Skip to main content

fdomain_fuchsia_component_sandbox/
fdomain_fuchsia_component_sandbox.rs

1// WARNING: This file is machine generated by fidlgen.
2
3#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fdomain_client::fidl::{ControlHandle as _, FDomainFlexibleIntoResult as _, Responder as _};
8use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
9pub use fidl_fuchsia_component_sandbox__common::*;
10use futures::future::{self, MaybeDone, TryFutureExt};
11use zx_status;
12
13/// A token represents a bedrock object. Tokens are reference counted, dropping
14/// all counts of the token removes the object.
15pub type Token = fdomain_client::EventPair;
16
17#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
18pub struct CapabilityStoreConnectorCreateRequest {
19    pub id: u64,
20    pub receiver: fdomain_client::fidl::ClientEnd<ReceiverMarker>,
21}
22
23impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
24    for CapabilityStoreConnectorCreateRequest
25{
26}
27
28#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
29pub struct CapabilityStoreConnectorOpenRequest {
30    pub id: u64,
31    pub server_end: fdomain_client::Channel,
32}
33
34impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
35    for CapabilityStoreConnectorOpenRequest
36{
37}
38
39#[derive(Debug, PartialEq)]
40pub struct CapabilityStoreCreateServiceAggregateRequest {
41    pub sources: Vec<AggregateSource>,
42}
43
44impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
45    for CapabilityStoreCreateServiceAggregateRequest
46{
47}
48
49#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
50pub struct CapabilityStoreDictionaryDrainRequest {
51    pub id: u64,
52    pub iterator: Option<fdomain_client::fidl::ServerEnd<DictionaryDrainIteratorMarker>>,
53}
54
55impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
56    for CapabilityStoreDictionaryDrainRequest
57{
58}
59
60#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
61pub struct CapabilityStoreDictionaryEnumerateRequest {
62    pub id: u64,
63    pub iterator: fdomain_client::fidl::ServerEnd<DictionaryEnumerateIteratorMarker>,
64}
65
66impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
67    for CapabilityStoreDictionaryEnumerateRequest
68{
69}
70
71#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
72pub struct CapabilityStoreDictionaryKeysRequest {
73    pub id: u64,
74    pub iterator: fdomain_client::fidl::ServerEnd<DictionaryKeysIteratorMarker>,
75}
76
77impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
78    for CapabilityStoreDictionaryKeysRequest
79{
80}
81
82#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
83pub struct CapabilityStoreDictionaryLegacyExportRequest {
84    pub id: u64,
85    pub server_end: fdomain_client::Channel,
86}
87
88impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
89    for CapabilityStoreDictionaryLegacyExportRequest
90{
91}
92
93#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
94pub struct CapabilityStoreDictionaryLegacyImportRequest {
95    pub id: u64,
96    pub client_end: fdomain_client::Channel,
97}
98
99impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
100    for CapabilityStoreDictionaryLegacyImportRequest
101{
102}
103
104#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
105pub struct CapabilityStoreDirConnectorCreateRequest {
106    pub id: u64,
107    pub receiver: fdomain_client::fidl::ClientEnd<DirReceiverMarker>,
108}
109
110impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
111    for CapabilityStoreDirConnectorCreateRequest
112{
113}
114
115#[derive(Debug, PartialEq)]
116pub struct CapabilityStoreImportRequest {
117    pub id: u64,
118    pub capability: Capability,
119}
120
121impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
122    for CapabilityStoreImportRequest
123{
124}
125
126#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
127pub struct CapabilityStoreCreateServiceAggregateResponse {
128    pub aggregate_dir_connector: DirConnector,
129}
130
131impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
132    for CapabilityStoreCreateServiceAggregateResponse
133{
134}
135
136#[derive(Debug, PartialEq)]
137pub struct CapabilityStoreExportResponse {
138    pub capability: Capability,
139}
140
141impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
142    for CapabilityStoreExportResponse
143{
144}
145
146#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
147pub struct Connector {
148    pub token: fdomain_client::EventPair,
149}
150
151impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for Connector {}
152
153#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
154pub struct DictionaryDrainIteratorGetNextResponse {
155    pub items: Vec<DictionaryItem>,
156    pub end_id: u64,
157}
158
159impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
160    for DictionaryDrainIteratorGetNextResponse
161{
162}
163
164#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
165pub struct DictionaryEnumerateIteratorGetNextResponse {
166    pub items: Vec<DictionaryOptionalItem>,
167    pub end_id: u64,
168}
169
170impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
171    for DictionaryEnumerateIteratorGetNextResponse
172{
173}
174
175#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
176pub struct DictionaryKeysIteratorGetNextResponse {
177    pub keys: Vec<String>,
178}
179
180impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
181    for DictionaryKeysIteratorGetNextResponse
182{
183}
184
185/// A key-value pair in a [`DictionaryRef`], where the value may be elided.
186/// This is useful for APIs that may wish to omit the value, for example if it could not be
187/// duplicated.
188#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
189pub struct DictionaryOptionalItem {
190    pub key: String,
191    pub value: Option<Box<WrappedCapabilityId>>,
192}
193
194impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for DictionaryOptionalItem {}
195
196#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
197pub struct DictionaryRef {
198    pub token: fdomain_client::EventPair,
199}
200
201impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for DictionaryRef {}
202
203#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
204pub struct DirConnector {
205    pub token: fdomain_client::EventPair,
206}
207
208impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for DirConnector {}
209
210#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
211pub struct DirEntry {
212    pub token: fdomain_client::EventPair,
213}
214
215impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for DirEntry {}
216
217/// Represents an instance in the component tree, either a component
218/// instance or component manager's instance.
219#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
220pub struct InstanceToken {
221    pub token: fdomain_client::EventPair,
222}
223
224impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for InstanceToken {}
225
226/// Contains a protocol open request.
227#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
228pub struct ProtocolPayload {
229    pub channel: fdomain_client::Channel,
230}
231
232impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for ProtocolPayload {}
233
234#[derive(Debug, Default, PartialEq)]
235pub struct AggregateSource {
236    pub dir_connector: Option<DirConnector>,
237    /// (Optional) The list of allowlisted instances to be offered. Instances
238    /// of the service not in this list will not be accessible by the target
239    /// component. If this is not set that means all instances from the source
240    /// service are offered.
241    pub source_instance_filter: Option<Vec<String>>,
242    /// (Optional) The list of allowlisted instances to be offered, with
243    /// renames.
244    ///
245    /// If this is set and nonempty, the set of instances in the target service
246    /// will be restricted to the instances in this list, renaming `source_name`
247    /// to `target_name`.
248    ///
249    /// If it is set and nonempty, `source_instance_filter` will further
250    /// restrict the set of instances to those whose `target_name` appears in
251    /// that list. There is generally no reason to set both, but we support it
252    /// for compatibility.
253    pub renamed_instances: Option<Vec<fdomain_fuchsia_component_decl::NameMapping>>,
254    #[doc(hidden)]
255    pub __source_breaking: fidl::marker::SourceBreaking,
256}
257
258impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for AggregateSource {}
259
260#[derive(Debug, Default, PartialEq)]
261pub struct CapabilityStoreDirConnectorOpenRequest {
262    pub id: Option<u64>,
263    pub server_end: Option<fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>>,
264    pub flags: Option<fdomain_fuchsia_io::Flags>,
265    pub path: Option<String>,
266    #[doc(hidden)]
267    pub __source_breaking: fidl::marker::SourceBreaking,
268}
269
270impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
271    for CapabilityStoreDirConnectorOpenRequest
272{
273}
274
275#[derive(Debug, Default, PartialEq)]
276pub struct DirReceiverReceiveRequest {
277    pub channel: Option<fdomain_client::Channel>,
278    pub flags: Option<fdomain_fuchsia_io::Flags>,
279    pub subdir: Option<String>,
280    #[doc(hidden)]
281    pub __source_breaking: fidl::marker::SourceBreaking,
282}
283
284impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for DirReceiverReceiveRequest {}
285
286/// A request for a route.
287#[derive(Debug, Default, PartialEq)]
288pub struct RouteRequest {
289    /// The component that is requesting the capability. May be omitted for a default request
290    /// (see `*Router.Route`).
291    pub requesting: Option<InstanceToken>,
292    #[doc(hidden)]
293    pub __source_breaking: fidl::marker::SourceBreaking,
294}
295
296impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for RouteRequest {}
297
298#[derive(Debug)]
299pub enum Capability {
300    Unit(Unit),
301    Handle(fdomain_client::NullableHandle),
302    Data(Data),
303    Dictionary(DictionaryRef),
304    Connector(Connector),
305    DirConnector(DirConnector),
306    Directory(fdomain_client::fidl::ClientEnd<fdomain_fuchsia_io::DirectoryMarker>),
307    DirEntry(DirEntry),
308    ConnectorRouter(fdomain_client::fidl::ClientEnd<ConnectorRouterMarker>),
309    DictionaryRouter(fdomain_client::fidl::ClientEnd<DictionaryRouterMarker>),
310    DirEntryRouter(fdomain_client::fidl::ClientEnd<DirEntryRouterMarker>),
311    DataRouter(fdomain_client::fidl::ClientEnd<DataRouterMarker>),
312    DirConnectorRouter(fdomain_client::fidl::ClientEnd<DirConnectorRouterMarker>),
313    #[doc(hidden)]
314    __SourceBreaking {
315        unknown_ordinal: u64,
316    },
317}
318
319/// Pattern that matches an unknown `Capability` member.
320#[macro_export]
321macro_rules! CapabilityUnknown {
322    () => {
323        _
324    };
325}
326
327// Custom PartialEq so that unknown variants are not equal to themselves.
328impl PartialEq for Capability {
329    fn eq(&self, other: &Self) -> bool {
330        match (self, other) {
331            (Self::Unit(x), Self::Unit(y)) => *x == *y,
332            (Self::Handle(x), Self::Handle(y)) => *x == *y,
333            (Self::Data(x), Self::Data(y)) => *x == *y,
334            (Self::Dictionary(x), Self::Dictionary(y)) => *x == *y,
335            (Self::Connector(x), Self::Connector(y)) => *x == *y,
336            (Self::DirConnector(x), Self::DirConnector(y)) => *x == *y,
337            (Self::Directory(x), Self::Directory(y)) => *x == *y,
338            (Self::DirEntry(x), Self::DirEntry(y)) => *x == *y,
339            (Self::ConnectorRouter(x), Self::ConnectorRouter(y)) => *x == *y,
340            (Self::DictionaryRouter(x), Self::DictionaryRouter(y)) => *x == *y,
341            (Self::DirEntryRouter(x), Self::DirEntryRouter(y)) => *x == *y,
342            (Self::DataRouter(x), Self::DataRouter(y)) => *x == *y,
343            (Self::DirConnectorRouter(x), Self::DirConnectorRouter(y)) => *x == *y,
344            _ => false,
345        }
346    }
347}
348
349impl Capability {
350    #[inline]
351    pub fn ordinal(&self) -> u64 {
352        match *self {
353            Self::Unit(_) => 1,
354            Self::Handle(_) => 2,
355            Self::Data(_) => 3,
356            Self::Dictionary(_) => 4,
357            Self::Connector(_) => 5,
358            Self::DirConnector(_) => 6,
359            Self::Directory(_) => 7,
360            Self::DirEntry(_) => 8,
361            Self::ConnectorRouter(_) => 9,
362            Self::DictionaryRouter(_) => 10,
363            Self::DirEntryRouter(_) => 11,
364            Self::DataRouter(_) => 12,
365            Self::DirConnectorRouter(_) => 13,
366            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
367        }
368    }
369
370    #[inline]
371    pub fn unknown_variant_for_testing() -> Self {
372        Self::__SourceBreaking { unknown_ordinal: 0 }
373    }
374
375    #[inline]
376    pub fn is_unknown(&self) -> bool {
377        match self {
378            Self::__SourceBreaking { .. } => true,
379            _ => false,
380        }
381    }
382}
383
384impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for Capability {}
385
386#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
387pub enum ConnectorRouterRouteResponse {
388    Connector(Connector),
389    Unavailable(Unit),
390}
391
392impl ConnectorRouterRouteResponse {
393    #[inline]
394    pub fn ordinal(&self) -> u64 {
395        match *self {
396            Self::Connector(_) => 1,
397            Self::Unavailable(_) => 2,
398        }
399    }
400}
401
402impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
403    for ConnectorRouterRouteResponse
404{
405}
406
407#[derive(Debug, PartialEq)]
408pub enum DataRouterRouteResponse {
409    Data(Data),
410    Unavailable(Unit),
411}
412
413impl DataRouterRouteResponse {
414    #[inline]
415    pub fn ordinal(&self) -> u64 {
416        match *self {
417            Self::Data(_) => 1,
418            Self::Unavailable(_) => 2,
419        }
420    }
421}
422
423impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for DataRouterRouteResponse {}
424
425#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
426pub enum DictionaryRouterRouteResponse {
427    Dictionary(DictionaryRef),
428    Unavailable(Unit),
429}
430
431impl DictionaryRouterRouteResponse {
432    #[inline]
433    pub fn ordinal(&self) -> u64 {
434        match *self {
435            Self::Dictionary(_) => 1,
436            Self::Unavailable(_) => 2,
437        }
438    }
439}
440
441impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
442    for DictionaryRouterRouteResponse
443{
444}
445
446#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
447pub enum DirConnectorRouterRouteResponse {
448    DirConnector(DirConnector),
449    Unavailable(Unit),
450}
451
452impl DirConnectorRouterRouteResponse {
453    #[inline]
454    pub fn ordinal(&self) -> u64 {
455        match *self {
456            Self::DirConnector(_) => 1,
457            Self::Unavailable(_) => 2,
458        }
459    }
460}
461
462impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
463    for DirConnectorRouterRouteResponse
464{
465}
466
467#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
468pub enum DirEntryRouterRouteResponse {
469    DirEntry(DirEntry),
470    Unavailable(Unit),
471}
472
473impl DirEntryRouterRouteResponse {
474    #[inline]
475    pub fn ordinal(&self) -> u64 {
476        match *self {
477            Self::DirEntry(_) => 1,
478            Self::Unavailable(_) => 2,
479        }
480    }
481}
482
483impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
484    for DirEntryRouterRouteResponse
485{
486}
487
488#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
489pub enum DirectoryRouterRouteResponse {
490    Directory(fdomain_client::fidl::ClientEnd<fdomain_fuchsia_io::DirectoryMarker>),
491    Unavailable(Unit),
492}
493
494impl DirectoryRouterRouteResponse {
495    #[inline]
496    pub fn ordinal(&self) -> u64 {
497        match *self {
498            Self::Directory(_) => 1,
499            Self::Unavailable(_) => 2,
500        }
501    }
502}
503
504impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
505    for DirectoryRouterRouteResponse
506{
507}
508
509#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
510pub struct CapabilityStoreMarker;
511
512impl fdomain_client::fidl::ProtocolMarker for CapabilityStoreMarker {
513    type Proxy = CapabilityStoreProxy;
514    type RequestStream = CapabilityStoreRequestStream;
515
516    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.CapabilityStore";
517}
518impl fdomain_client::fidl::DiscoverableProtocolMarker for CapabilityStoreMarker {}
519pub type CapabilityStoreDuplicateResult = Result<(), CapabilityStoreError>;
520pub type CapabilityStoreDropResult = Result<(), CapabilityStoreError>;
521pub type CapabilityStoreExportResult = Result<Capability, CapabilityStoreError>;
522pub type CapabilityStoreImportResult = Result<(), CapabilityStoreError>;
523pub type CapabilityStoreConnectorCreateResult = Result<(), CapabilityStoreError>;
524pub type CapabilityStoreConnectorOpenResult = Result<(), CapabilityStoreError>;
525pub type CapabilityStoreDirConnectorCreateResult = Result<(), CapabilityStoreError>;
526pub type CapabilityStoreDirConnectorOpenResult = Result<(), CapabilityStoreError>;
527pub type CapabilityStoreDictionaryCreateResult = Result<(), CapabilityStoreError>;
528pub type CapabilityStoreDictionaryLegacyImportResult = Result<(), CapabilityStoreError>;
529pub type CapabilityStoreDictionaryLegacyExportResult = Result<(), CapabilityStoreError>;
530pub type CapabilityStoreDictionaryInsertResult = Result<(), CapabilityStoreError>;
531pub type CapabilityStoreDictionaryGetResult = Result<(), CapabilityStoreError>;
532pub type CapabilityStoreDictionaryRemoveResult = Result<(), CapabilityStoreError>;
533pub type CapabilityStoreDictionaryCopyResult = Result<(), CapabilityStoreError>;
534pub type CapabilityStoreDictionaryKeysResult = Result<(), CapabilityStoreError>;
535pub type CapabilityStoreDictionaryEnumerateResult = Result<(), CapabilityStoreError>;
536pub type CapabilityStoreDictionaryDrainResult = Result<(), CapabilityStoreError>;
537pub type CapabilityStoreCreateServiceAggregateResult = Result<DirConnector, CapabilityStoreError>;
538
539pub trait CapabilityStoreProxyInterface: Send + Sync {
540    type DuplicateResponseFut: std::future::Future<Output = Result<CapabilityStoreDuplicateResult, fidl::Error>>
541        + Send;
542    fn r#duplicate(&self, id: u64, dest_id: u64) -> Self::DuplicateResponseFut;
543    type DropResponseFut: std::future::Future<Output = Result<CapabilityStoreDropResult, fidl::Error>>
544        + Send;
545    fn r#drop(&self, id: u64) -> Self::DropResponseFut;
546    type ExportResponseFut: std::future::Future<Output = Result<CapabilityStoreExportResult, fidl::Error>>
547        + Send;
548    fn r#export(&self, id: u64) -> Self::ExportResponseFut;
549    type ImportResponseFut: std::future::Future<Output = Result<CapabilityStoreImportResult, fidl::Error>>
550        + Send;
551    fn r#import(&self, id: u64, capability: Capability) -> Self::ImportResponseFut;
552    type ConnectorCreateResponseFut: std::future::Future<Output = Result<CapabilityStoreConnectorCreateResult, fidl::Error>>
553        + Send;
554    fn r#connector_create(
555        &self,
556        id: u64,
557        receiver: fdomain_client::fidl::ClientEnd<ReceiverMarker>,
558    ) -> Self::ConnectorCreateResponseFut;
559    type ConnectorOpenResponseFut: std::future::Future<Output = Result<CapabilityStoreConnectorOpenResult, fidl::Error>>
560        + Send;
561    fn r#connector_open(
562        &self,
563        id: u64,
564        server_end: fdomain_client::Channel,
565    ) -> Self::ConnectorOpenResponseFut;
566    type DirConnectorCreateResponseFut: std::future::Future<Output = Result<CapabilityStoreDirConnectorCreateResult, fidl::Error>>
567        + Send;
568    fn r#dir_connector_create(
569        &self,
570        id: u64,
571        receiver: fdomain_client::fidl::ClientEnd<DirReceiverMarker>,
572    ) -> Self::DirConnectorCreateResponseFut;
573    type DirConnectorOpenResponseFut: std::future::Future<Output = Result<CapabilityStoreDirConnectorOpenResult, fidl::Error>>
574        + Send;
575    fn r#dir_connector_open(
576        &self,
577        payload: CapabilityStoreDirConnectorOpenRequest,
578    ) -> Self::DirConnectorOpenResponseFut;
579    type DictionaryCreateResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryCreateResult, fidl::Error>>
580        + Send;
581    fn r#dictionary_create(&self, id: u64) -> Self::DictionaryCreateResponseFut;
582    type DictionaryLegacyImportResponseFut: std::future::Future<
583            Output = Result<CapabilityStoreDictionaryLegacyImportResult, fidl::Error>,
584        > + Send;
585    fn r#dictionary_legacy_import(
586        &self,
587        id: u64,
588        client_end: fdomain_client::Channel,
589    ) -> Self::DictionaryLegacyImportResponseFut;
590    type DictionaryLegacyExportResponseFut: std::future::Future<
591            Output = Result<CapabilityStoreDictionaryLegacyExportResult, fidl::Error>,
592        > + Send;
593    fn r#dictionary_legacy_export(
594        &self,
595        id: u64,
596        server_end: fdomain_client::Channel,
597    ) -> Self::DictionaryLegacyExportResponseFut;
598    type DictionaryInsertResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryInsertResult, fidl::Error>>
599        + Send;
600    fn r#dictionary_insert(
601        &self,
602        id: u64,
603        item: &DictionaryItem,
604    ) -> Self::DictionaryInsertResponseFut;
605    type DictionaryGetResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryGetResult, fidl::Error>>
606        + Send;
607    fn r#dictionary_get(&self, id: u64, key: &str, dest_id: u64) -> Self::DictionaryGetResponseFut;
608    type DictionaryRemoveResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryRemoveResult, fidl::Error>>
609        + Send;
610    fn r#dictionary_remove(
611        &self,
612        id: u64,
613        key: &str,
614        dest_id: Option<&WrappedCapabilityId>,
615    ) -> Self::DictionaryRemoveResponseFut;
616    type DictionaryCopyResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryCopyResult, fidl::Error>>
617        + Send;
618    fn r#dictionary_copy(&self, id: u64, dest_id: u64) -> Self::DictionaryCopyResponseFut;
619    type DictionaryKeysResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryKeysResult, fidl::Error>>
620        + Send;
621    fn r#dictionary_keys(
622        &self,
623        id: u64,
624        iterator: fdomain_client::fidl::ServerEnd<DictionaryKeysIteratorMarker>,
625    ) -> Self::DictionaryKeysResponseFut;
626    type DictionaryEnumerateResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryEnumerateResult, fidl::Error>>
627        + Send;
628    fn r#dictionary_enumerate(
629        &self,
630        id: u64,
631        iterator: fdomain_client::fidl::ServerEnd<DictionaryEnumerateIteratorMarker>,
632    ) -> Self::DictionaryEnumerateResponseFut;
633    type DictionaryDrainResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryDrainResult, fidl::Error>>
634        + Send;
635    fn r#dictionary_drain(
636        &self,
637        id: u64,
638        iterator: Option<fdomain_client::fidl::ServerEnd<DictionaryDrainIteratorMarker>>,
639    ) -> Self::DictionaryDrainResponseFut;
640    type CreateServiceAggregateResponseFut: std::future::Future<
641            Output = Result<CapabilityStoreCreateServiceAggregateResult, fidl::Error>,
642        > + Send;
643    fn r#create_service_aggregate(
644        &self,
645        sources: Vec<AggregateSource>,
646    ) -> Self::CreateServiceAggregateResponseFut;
647}
648
649#[derive(Debug, Clone)]
650pub struct CapabilityStoreProxy {
651    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
652}
653
654impl fdomain_client::fidl::Proxy for CapabilityStoreProxy {
655    type Protocol = CapabilityStoreMarker;
656
657    fn from_channel(inner: fdomain_client::Channel) -> Self {
658        Self::new(inner)
659    }
660
661    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
662        self.client.into_channel().map_err(|client| Self { client })
663    }
664
665    fn as_channel(&self) -> &fdomain_client::Channel {
666        self.client.as_channel()
667    }
668}
669
670impl CapabilityStoreProxy {
671    /// Create a new Proxy for fuchsia.component.sandbox/CapabilityStore.
672    pub fn new(channel: fdomain_client::Channel) -> Self {
673        let protocol_name =
674            <CapabilityStoreMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
675        Self { client: fidl::client::Client::new(channel, protocol_name) }
676    }
677
678    /// Get a Stream of events from the remote end of the protocol.
679    ///
680    /// # Panics
681    ///
682    /// Panics if the event stream was already taken.
683    pub fn take_event_stream(&self) -> CapabilityStoreEventStream {
684        CapabilityStoreEventStream { event_receiver: self.client.take_event_receiver() }
685    }
686
687    /// Duplicates the capability with `id` to `dest_id`.
688    ///
689    /// Errors:
690    ///
691    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
692    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
693    /// - `NOT_DUPLICATABLE` if `id` could not be duplicated.
694    pub fn r#duplicate(
695        &self,
696        mut id: u64,
697        mut dest_id: u64,
698    ) -> fidl::client::QueryResponseFut<
699        CapabilityStoreDuplicateResult,
700        fdomain_client::fidl::FDomainResourceDialect,
701    > {
702        CapabilityStoreProxyInterface::r#duplicate(self, id, dest_id)
703    }
704
705    /// Drops the capability with `id` from this [`CapabilityStore`].
706    ///
707    /// Errors:
708    ///
709    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
710    pub fn r#drop(
711        &self,
712        mut id: u64,
713    ) -> fidl::client::QueryResponseFut<
714        CapabilityStoreDropResult,
715        fdomain_client::fidl::FDomainResourceDialect,
716    > {
717        CapabilityStoreProxyInterface::r#drop(self, id)
718    }
719
720    /// Exports the capability with the client-assigned identifier `id` to
721    /// `capability`. This operation removes the capability from the store. If
722    /// this is not desired, [Duplicate] the capability first.
723    ///
724    /// Errors:
725    ///
726    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
727    pub fn r#export(
728        &self,
729        mut id: u64,
730    ) -> fidl::client::QueryResponseFut<
731        CapabilityStoreExportResult,
732        fdomain_client::fidl::FDomainResourceDialect,
733    > {
734        CapabilityStoreProxyInterface::r#export(self, id)
735    }
736
737    /// Imports `capability` into this store with the client-assigned `id`.
738    ///
739    /// Errors:
740    ///
741    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
742    /// - `BAD_CAPABILITY` if `capability` was not a valid [Capability].
743    pub fn r#import(
744        &self,
745        mut id: u64,
746        mut capability: Capability,
747    ) -> fidl::client::QueryResponseFut<
748        CapabilityStoreImportResult,
749        fdomain_client::fidl::FDomainResourceDialect,
750    > {
751        CapabilityStoreProxyInterface::r#import(self, id, capability)
752    }
753
754    /// Creates a [Connector] from a [Receiver]. Incoming connections to the [Connector] will be
755    /// dispatched to this [Receiver].
756    ///
757    /// Errors:
758    ///
759    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
760    pub fn r#connector_create(
761        &self,
762        mut id: u64,
763        mut receiver: fdomain_client::fidl::ClientEnd<ReceiverMarker>,
764    ) -> fidl::client::QueryResponseFut<
765        CapabilityStoreConnectorCreateResult,
766        fdomain_client::fidl::FDomainResourceDialect,
767    > {
768        CapabilityStoreProxyInterface::r#connector_create(self, id, receiver)
769    }
770
771    /// Open a connection from the provided [Connector] capability that will be dispatched to
772    /// the [Receiver] on the other end.
773    ///
774    /// If there is an error, it will be reported as a zx.Status epitaph on `server_end`.
775    ///
776    /// Errors:
777    ///
778    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
779    /// - `WRONG_TYPE` if `id` was not a connector capability.
780    pub fn r#connector_open(
781        &self,
782        mut id: u64,
783        mut server_end: fdomain_client::Channel,
784    ) -> fidl::client::QueryResponseFut<
785        CapabilityStoreConnectorOpenResult,
786        fdomain_client::fidl::FDomainResourceDialect,
787    > {
788        CapabilityStoreProxyInterface::r#connector_open(self, id, server_end)
789    }
790
791    /// Creates a [DirConnector] from a [DirReceiver]. Incoming connections to the [DirConnector]
792    /// will be dispatched to this [DirReceiver].
793    ///
794    /// Errors:
795    ///
796    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
797    pub fn r#dir_connector_create(
798        &self,
799        mut id: u64,
800        mut receiver: fdomain_client::fidl::ClientEnd<DirReceiverMarker>,
801    ) -> fidl::client::QueryResponseFut<
802        CapabilityStoreDirConnectorCreateResult,
803        fdomain_client::fidl::FDomainResourceDialect,
804    > {
805        CapabilityStoreProxyInterface::r#dir_connector_create(self, id, receiver)
806    }
807
808    /// Open a connection from the provided [DirConnector] capability that will
809    /// be dispatched to the [DirReceiver] on the other end. The `id` and
810    /// `server_end` arguments are required, and the `flags` and `path`
811    /// arguments are optional (a path of `.` will be used if one is not
812    /// otherwise set).
813    ///
814    /// If there was an error making the connection, it will be reported as a zx.Status
815    /// epitaph on `server_end`.
816    ///
817    /// Errors:
818    ///
819    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
820    /// - `WRONG_TYPE` if `id` was not a connector capability.
821    pub fn r#dir_connector_open(
822        &self,
823        mut payload: CapabilityStoreDirConnectorOpenRequest,
824    ) -> fidl::client::QueryResponseFut<
825        CapabilityStoreDirConnectorOpenResult,
826        fdomain_client::fidl::FDomainResourceDialect,
827    > {
828        CapabilityStoreProxyInterface::r#dir_connector_open(self, payload)
829    }
830
831    /// Creates a new empty dictionary in this [`CapabilityStore`] with client-assigned `id`.
832    ///
833    /// Errors:
834    ///
835    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
836    pub fn r#dictionary_create(
837        &self,
838        mut id: u64,
839    ) -> fidl::client::QueryResponseFut<
840        CapabilityStoreDictionaryCreateResult,
841        fdomain_client::fidl::FDomainResourceDialect,
842    > {
843        CapabilityStoreProxyInterface::r#dictionary_create(self, id)
844    }
845
846    /// Imports a dictionary in the form of a channel.
847    ///
848    /// This is a legacy API to support backward compatibility with APIs that take a [Dictionary]
849    /// channel.
850    ///
851    /// Errors:
852    ///
853    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
854    /// - `BAD_CAPABILITY` if `client_end` was not a valid dictionary channel.
855    pub fn r#dictionary_legacy_import(
856        &self,
857        mut id: u64,
858        mut client_end: fdomain_client::Channel,
859    ) -> fidl::client::QueryResponseFut<
860        CapabilityStoreDictionaryLegacyImportResult,
861        fdomain_client::fidl::FDomainResourceDialect,
862    > {
863        CapabilityStoreProxyInterface::r#dictionary_legacy_import(self, id, client_end)
864    }
865
866    /// Binds a channel to the dictionary with `id`. The channel can
867    /// be re-imported into a [CapabilityStore] with [DictionaryImportLegacy].
868    ///
869    /// This is a legacy API to support backward compatibility with APIs that take a [Dictionary]
870    /// channel.
871    ///
872    /// Errors:
873    ///
874    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
875    pub fn r#dictionary_legacy_export(
876        &self,
877        mut id: u64,
878        mut server_end: fdomain_client::Channel,
879    ) -> fidl::client::QueryResponseFut<
880        CapabilityStoreDictionaryLegacyExportResult,
881        fdomain_client::fidl::FDomainResourceDialect,
882    > {
883        CapabilityStoreProxyInterface::r#dictionary_legacy_export(self, id, server_end)
884    }
885
886    /// Inserts `item` into the dictionary with `id`. `item.value` is moved into the dictionary and
887    /// its id is released if this call succeeds.
888    ///
889    /// Errors:
890    ///
891    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
892    /// - `WRONG_TYPE` if `id` was not a dictionary.
893    /// - `INVALID_KEY` if `item.key` was invalid.
894    /// - `ITEM_ALREADY_EXISTS` if the dictionary already contains an item with `item.key`.
895    pub fn r#dictionary_insert(
896        &self,
897        mut id: u64,
898        mut item: &DictionaryItem,
899    ) -> fidl::client::QueryResponseFut<
900        CapabilityStoreDictionaryInsertResult,
901        fdomain_client::fidl::FDomainResourceDialect,
902    > {
903        CapabilityStoreProxyInterface::r#dictionary_insert(self, id, item)
904    }
905
906    /// Get a duplicate of a capability from the dictionary with `id`, which is
907    /// loaded into `dest_id`.
908    ///
909    /// Errors:
910    ///
911    /// - `ID_NOT_FOUND` if `id` was not a recognized capability id in this store.
912    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
913    /// - `WRONG_TYPE` if `id` was not a dictionary.
914    /// - `INVALID_KEY` if `item.key` was invalid.
915    /// - `ITEM_NOT_FOUND` if the dictionary does not contain `key`.
916    /// - `NOT_DUPLICATABLE` if the capability could not be duplicated.
917    pub fn r#dictionary_get(
918        &self,
919        mut id: u64,
920        mut key: &str,
921        mut dest_id: u64,
922    ) -> fidl::client::QueryResponseFut<
923        CapabilityStoreDictionaryGetResult,
924        fdomain_client::fidl::FDomainResourceDialect,
925    > {
926        CapabilityStoreProxyInterface::r#dictionary_get(self, id, key, dest_id)
927    }
928
929    /// Removes a key from the dictionary with `id`. If `dest_id` is present, loads the value
930    /// into it, otherwise discards the value.
931    ///
932    /// Errors:
933    ///
934    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
935    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
936    /// - `WRONG_TYPE` if `id` was not a dictionary.
937    /// - `INVALID_KEY` if `key` was invalid.
938    /// - `ITEM_NOT_FOUND` if the dictionary does not contain the key.
939    pub fn r#dictionary_remove(
940        &self,
941        mut id: u64,
942        mut key: &str,
943        mut dest_id: Option<&WrappedCapabilityId>,
944    ) -> fidl::client::QueryResponseFut<
945        CapabilityStoreDictionaryRemoveResult,
946        fdomain_client::fidl::FDomainResourceDialect,
947    > {
948        CapabilityStoreProxyInterface::r#dictionary_remove(self, id, key, dest_id)
949    }
950
951    /// Create a new dictionary that contains a duplicate of all the entries in
952    /// the dictionary with `id`, assigning `dest_id` to the new dictionary.
953    /// The runtime of this method is linear in the number of top-level entries
954    /// in the dictionary.
955    ///
956    /// For example, if the dictionary contains nested dictionaries, the newly
957    /// created dictionary will contain references to those same nested
958    /// dictionaries because the entries are duplicated rather than deep-copied.
959    ///
960    /// Errors:
961    ///
962    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
963    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
964    /// - `WRONG_TYPE` if `id` was not a dictionary.
965    /// - `NOT_DUPLICATABLE` if one of the capabilities in `id` could not be duplicated.
966    pub fn r#dictionary_copy(
967        &self,
968        mut id: u64,
969        mut dest_id: u64,
970    ) -> fidl::client::QueryResponseFut<
971        CapabilityStoreDictionaryCopyResult,
972        fdomain_client::fidl::FDomainResourceDialect,
973    > {
974        CapabilityStoreProxyInterface::r#dictionary_copy(self, id, dest_id)
975    }
976
977    /// Enumerates the keys in the dictionary with `id`.
978    ///
979    /// Errors:
980    ///
981    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
982    /// - `WRONG_TYPE` if `id` was not a dictionary.
983    pub fn r#dictionary_keys(
984        &self,
985        mut id: u64,
986        mut iterator: fdomain_client::fidl::ServerEnd<DictionaryKeysIteratorMarker>,
987    ) -> fidl::client::QueryResponseFut<
988        CapabilityStoreDictionaryKeysResult,
989        fdomain_client::fidl::FDomainResourceDialect,
990    > {
991        CapabilityStoreProxyInterface::r#dictionary_keys(self, id, iterator)
992    }
993
994    /// Enumerates the items (keys and values) in the dictionary with `id`.
995    ///
996    /// Creates a duplicate of each value (capability). If a value could not be duplicated,
997    /// the value will be null.
998    ///
999    /// Errors:
1000    ///
1001    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1002    /// - `WRONG_TYPE` if `id` was not a dictionary.
1003    pub fn r#dictionary_enumerate(
1004        &self,
1005        mut id: u64,
1006        mut iterator: fdomain_client::fidl::ServerEnd<DictionaryEnumerateIteratorMarker>,
1007    ) -> fidl::client::QueryResponseFut<
1008        CapabilityStoreDictionaryEnumerateResult,
1009        fdomain_client::fidl::FDomainResourceDialect,
1010    > {
1011        CapabilityStoreProxyInterface::r#dictionary_enumerate(self, id, iterator)
1012    }
1013
1014    /// Removes all the entries in this dictionary, returning them in `contents` if provided.
1015    /// If `contents` is not provided, all the items are discarded without enumerating them.
1016    ///
1017    /// Errors:
1018    ///
1019    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1020    /// - `WRONG_TYPE` if `id` was not a dictionary.
1021    pub fn r#dictionary_drain(
1022        &self,
1023        mut id: u64,
1024        mut iterator: Option<fdomain_client::fidl::ServerEnd<DictionaryDrainIteratorMarker>>,
1025    ) -> fidl::client::QueryResponseFut<
1026        CapabilityStoreDictionaryDrainResult,
1027        fdomain_client::fidl::FDomainResourceDialect,
1028    > {
1029        CapabilityStoreProxyInterface::r#dictionary_drain(self, id, iterator)
1030    }
1031
1032    /// Creates a new DirConnector that forwards open requests to a set of
1033    /// sources.
1034    pub fn r#create_service_aggregate(
1035        &self,
1036        mut sources: Vec<AggregateSource>,
1037    ) -> fidl::client::QueryResponseFut<
1038        CapabilityStoreCreateServiceAggregateResult,
1039        fdomain_client::fidl::FDomainResourceDialect,
1040    > {
1041        CapabilityStoreProxyInterface::r#create_service_aggregate(self, sources)
1042    }
1043}
1044
1045impl CapabilityStoreProxyInterface for CapabilityStoreProxy {
1046    type DuplicateResponseFut = fidl::client::QueryResponseFut<
1047        CapabilityStoreDuplicateResult,
1048        fdomain_client::fidl::FDomainResourceDialect,
1049    >;
1050    fn r#duplicate(&self, mut id: u64, mut dest_id: u64) -> Self::DuplicateResponseFut {
1051        fn _decode(
1052            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1053        ) -> Result<CapabilityStoreDuplicateResult, fidl::Error> {
1054            let _response = fidl::client::decode_transaction_body::<
1055                fidl::encoding::FlexibleResultType<
1056                    fidl::encoding::EmptyStruct,
1057                    CapabilityStoreError,
1058                >,
1059                fdomain_client::fidl::FDomainResourceDialect,
1060                0x5d5d35d9c20a2184,
1061            >(_buf?)?
1062            .into_result_fdomain::<CapabilityStoreMarker>("duplicate")?;
1063            Ok(_response.map(|x| x))
1064        }
1065        self.client.send_query_and_decode::<
1066            CapabilityStoreDuplicateRequest,
1067            CapabilityStoreDuplicateResult,
1068        >(
1069            (id, dest_id,),
1070            0x5d5d35d9c20a2184,
1071            fidl::encoding::DynamicFlags::FLEXIBLE,
1072            _decode,
1073        )
1074    }
1075
1076    type DropResponseFut = fidl::client::QueryResponseFut<
1077        CapabilityStoreDropResult,
1078        fdomain_client::fidl::FDomainResourceDialect,
1079    >;
1080    fn r#drop(&self, mut id: u64) -> Self::DropResponseFut {
1081        fn _decode(
1082            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1083        ) -> Result<CapabilityStoreDropResult, fidl::Error> {
1084            let _response = fidl::client::decode_transaction_body::<
1085                fidl::encoding::FlexibleResultType<
1086                    fidl::encoding::EmptyStruct,
1087                    CapabilityStoreError,
1088                >,
1089                fdomain_client::fidl::FDomainResourceDialect,
1090                0xa745c0990fc2559,
1091            >(_buf?)?
1092            .into_result_fdomain::<CapabilityStoreMarker>("drop")?;
1093            Ok(_response.map(|x| x))
1094        }
1095        self.client.send_query_and_decode::<CapabilityStoreDropRequest, CapabilityStoreDropResult>(
1096            (id,),
1097            0xa745c0990fc2559,
1098            fidl::encoding::DynamicFlags::FLEXIBLE,
1099            _decode,
1100        )
1101    }
1102
1103    type ExportResponseFut = fidl::client::QueryResponseFut<
1104        CapabilityStoreExportResult,
1105        fdomain_client::fidl::FDomainResourceDialect,
1106    >;
1107    fn r#export(&self, mut id: u64) -> Self::ExportResponseFut {
1108        fn _decode(
1109            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1110        ) -> Result<CapabilityStoreExportResult, fidl::Error> {
1111            let _response = fidl::client::decode_transaction_body::<
1112                fidl::encoding::FlexibleResultType<
1113                    CapabilityStoreExportResponse,
1114                    CapabilityStoreError,
1115                >,
1116                fdomain_client::fidl::FDomainResourceDialect,
1117                0x3237a8f4748faff,
1118            >(_buf?)?
1119            .into_result_fdomain::<CapabilityStoreMarker>("export")?;
1120            Ok(_response.map(|x| x.capability))
1121        }
1122        self.client
1123            .send_query_and_decode::<CapabilityStoreExportRequest, CapabilityStoreExportResult>(
1124                (id,),
1125                0x3237a8f4748faff,
1126                fidl::encoding::DynamicFlags::FLEXIBLE,
1127                _decode,
1128            )
1129    }
1130
1131    type ImportResponseFut = fidl::client::QueryResponseFut<
1132        CapabilityStoreImportResult,
1133        fdomain_client::fidl::FDomainResourceDialect,
1134    >;
1135    fn r#import(&self, mut id: u64, mut capability: Capability) -> Self::ImportResponseFut {
1136        fn _decode(
1137            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1138        ) -> Result<CapabilityStoreImportResult, fidl::Error> {
1139            let _response = fidl::client::decode_transaction_body::<
1140                fidl::encoding::FlexibleResultType<
1141                    fidl::encoding::EmptyStruct,
1142                    CapabilityStoreError,
1143                >,
1144                fdomain_client::fidl::FDomainResourceDialect,
1145                0x1f96157a29f4539b,
1146            >(_buf?)?
1147            .into_result_fdomain::<CapabilityStoreMarker>("import")?;
1148            Ok(_response.map(|x| x))
1149        }
1150        self.client
1151            .send_query_and_decode::<CapabilityStoreImportRequest, CapabilityStoreImportResult>(
1152                (id, &mut capability),
1153                0x1f96157a29f4539b,
1154                fidl::encoding::DynamicFlags::FLEXIBLE,
1155                _decode,
1156            )
1157    }
1158
1159    type ConnectorCreateResponseFut = fidl::client::QueryResponseFut<
1160        CapabilityStoreConnectorCreateResult,
1161        fdomain_client::fidl::FDomainResourceDialect,
1162    >;
1163    fn r#connector_create(
1164        &self,
1165        mut id: u64,
1166        mut receiver: fdomain_client::fidl::ClientEnd<ReceiverMarker>,
1167    ) -> Self::ConnectorCreateResponseFut {
1168        fn _decode(
1169            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1170        ) -> Result<CapabilityStoreConnectorCreateResult, fidl::Error> {
1171            let _response = fidl::client::decode_transaction_body::<
1172                fidl::encoding::FlexibleResultType<
1173                    fidl::encoding::EmptyStruct,
1174                    CapabilityStoreError,
1175                >,
1176                fdomain_client::fidl::FDomainResourceDialect,
1177                0x29592c5d63e91c25,
1178            >(_buf?)?
1179            .into_result_fdomain::<CapabilityStoreMarker>("connector_create")?;
1180            Ok(_response.map(|x| x))
1181        }
1182        self.client.send_query_and_decode::<
1183            CapabilityStoreConnectorCreateRequest,
1184            CapabilityStoreConnectorCreateResult,
1185        >(
1186            (id, receiver,),
1187            0x29592c5d63e91c25,
1188            fidl::encoding::DynamicFlags::FLEXIBLE,
1189            _decode,
1190        )
1191    }
1192
1193    type ConnectorOpenResponseFut = fidl::client::QueryResponseFut<
1194        CapabilityStoreConnectorOpenResult,
1195        fdomain_client::fidl::FDomainResourceDialect,
1196    >;
1197    fn r#connector_open(
1198        &self,
1199        mut id: u64,
1200        mut server_end: fdomain_client::Channel,
1201    ) -> Self::ConnectorOpenResponseFut {
1202        fn _decode(
1203            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1204        ) -> Result<CapabilityStoreConnectorOpenResult, fidl::Error> {
1205            let _response = fidl::client::decode_transaction_body::<
1206                fidl::encoding::FlexibleResultType<
1207                    fidl::encoding::EmptyStruct,
1208                    CapabilityStoreError,
1209                >,
1210                fdomain_client::fidl::FDomainResourceDialect,
1211                0x537e69ab40563b9f,
1212            >(_buf?)?
1213            .into_result_fdomain::<CapabilityStoreMarker>("connector_open")?;
1214            Ok(_response.map(|x| x))
1215        }
1216        self.client.send_query_and_decode::<
1217            CapabilityStoreConnectorOpenRequest,
1218            CapabilityStoreConnectorOpenResult,
1219        >(
1220            (id, server_end,),
1221            0x537e69ab40563b9f,
1222            fidl::encoding::DynamicFlags::FLEXIBLE,
1223            _decode,
1224        )
1225    }
1226
1227    type DirConnectorCreateResponseFut = fidl::client::QueryResponseFut<
1228        CapabilityStoreDirConnectorCreateResult,
1229        fdomain_client::fidl::FDomainResourceDialect,
1230    >;
1231    fn r#dir_connector_create(
1232        &self,
1233        mut id: u64,
1234        mut receiver: fdomain_client::fidl::ClientEnd<DirReceiverMarker>,
1235    ) -> Self::DirConnectorCreateResponseFut {
1236        fn _decode(
1237            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1238        ) -> Result<CapabilityStoreDirConnectorCreateResult, fidl::Error> {
1239            let _response = fidl::client::decode_transaction_body::<
1240                fidl::encoding::FlexibleResultType<
1241                    fidl::encoding::EmptyStruct,
1242                    CapabilityStoreError,
1243                >,
1244                fdomain_client::fidl::FDomainResourceDialect,
1245                0x186138a11ccf19bb,
1246            >(_buf?)?
1247            .into_result_fdomain::<CapabilityStoreMarker>("dir_connector_create")?;
1248            Ok(_response.map(|x| x))
1249        }
1250        self.client.send_query_and_decode::<
1251            CapabilityStoreDirConnectorCreateRequest,
1252            CapabilityStoreDirConnectorCreateResult,
1253        >(
1254            (id, receiver,),
1255            0x186138a11ccf19bb,
1256            fidl::encoding::DynamicFlags::FLEXIBLE,
1257            _decode,
1258        )
1259    }
1260
1261    type DirConnectorOpenResponseFut = fidl::client::QueryResponseFut<
1262        CapabilityStoreDirConnectorOpenResult,
1263        fdomain_client::fidl::FDomainResourceDialect,
1264    >;
1265    fn r#dir_connector_open(
1266        &self,
1267        mut payload: CapabilityStoreDirConnectorOpenRequest,
1268    ) -> Self::DirConnectorOpenResponseFut {
1269        fn _decode(
1270            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1271        ) -> Result<CapabilityStoreDirConnectorOpenResult, fidl::Error> {
1272            let _response = fidl::client::decode_transaction_body::<
1273                fidl::encoding::FlexibleResultType<
1274                    fidl::encoding::EmptyStruct,
1275                    CapabilityStoreError,
1276                >,
1277                fdomain_client::fidl::FDomainResourceDialect,
1278                0x5650d3d6a3a13901,
1279            >(_buf?)?
1280            .into_result_fdomain::<CapabilityStoreMarker>("dir_connector_open")?;
1281            Ok(_response.map(|x| x))
1282        }
1283        self.client.send_query_and_decode::<
1284            CapabilityStoreDirConnectorOpenRequest,
1285            CapabilityStoreDirConnectorOpenResult,
1286        >(
1287            &mut payload,
1288            0x5650d3d6a3a13901,
1289            fidl::encoding::DynamicFlags::FLEXIBLE,
1290            _decode,
1291        )
1292    }
1293
1294    type DictionaryCreateResponseFut = fidl::client::QueryResponseFut<
1295        CapabilityStoreDictionaryCreateResult,
1296        fdomain_client::fidl::FDomainResourceDialect,
1297    >;
1298    fn r#dictionary_create(&self, mut id: u64) -> Self::DictionaryCreateResponseFut {
1299        fn _decode(
1300            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1301        ) -> Result<CapabilityStoreDictionaryCreateResult, fidl::Error> {
1302            let _response = fidl::client::decode_transaction_body::<
1303                fidl::encoding::FlexibleResultType<
1304                    fidl::encoding::EmptyStruct,
1305                    CapabilityStoreError,
1306                >,
1307                fdomain_client::fidl::FDomainResourceDialect,
1308                0x6997c8dfc63de093,
1309            >(_buf?)?
1310            .into_result_fdomain::<CapabilityStoreMarker>("dictionary_create")?;
1311            Ok(_response.map(|x| x))
1312        }
1313        self.client.send_query_and_decode::<
1314            CapabilityStoreDictionaryCreateRequest,
1315            CapabilityStoreDictionaryCreateResult,
1316        >(
1317            (id,),
1318            0x6997c8dfc63de093,
1319            fidl::encoding::DynamicFlags::FLEXIBLE,
1320            _decode,
1321        )
1322    }
1323
1324    type DictionaryLegacyImportResponseFut = fidl::client::QueryResponseFut<
1325        CapabilityStoreDictionaryLegacyImportResult,
1326        fdomain_client::fidl::FDomainResourceDialect,
1327    >;
1328    fn r#dictionary_legacy_import(
1329        &self,
1330        mut id: u64,
1331        mut client_end: fdomain_client::Channel,
1332    ) -> Self::DictionaryLegacyImportResponseFut {
1333        fn _decode(
1334            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1335        ) -> Result<CapabilityStoreDictionaryLegacyImportResult, fidl::Error> {
1336            let _response = fidl::client::decode_transaction_body::<
1337                fidl::encoding::FlexibleResultType<
1338                    fidl::encoding::EmptyStruct,
1339                    CapabilityStoreError,
1340                >,
1341                fdomain_client::fidl::FDomainResourceDialect,
1342                0x72fd686c37b6025f,
1343            >(_buf?)?
1344            .into_result_fdomain::<CapabilityStoreMarker>("dictionary_legacy_import")?;
1345            Ok(_response.map(|x| x))
1346        }
1347        self.client.send_query_and_decode::<
1348            CapabilityStoreDictionaryLegacyImportRequest,
1349            CapabilityStoreDictionaryLegacyImportResult,
1350        >(
1351            (id, client_end,),
1352            0x72fd686c37b6025f,
1353            fidl::encoding::DynamicFlags::FLEXIBLE,
1354            _decode,
1355        )
1356    }
1357
1358    type DictionaryLegacyExportResponseFut = fidl::client::QueryResponseFut<
1359        CapabilityStoreDictionaryLegacyExportResult,
1360        fdomain_client::fidl::FDomainResourceDialect,
1361    >;
1362    fn r#dictionary_legacy_export(
1363        &self,
1364        mut id: u64,
1365        mut server_end: fdomain_client::Channel,
1366    ) -> Self::DictionaryLegacyExportResponseFut {
1367        fn _decode(
1368            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1369        ) -> Result<CapabilityStoreDictionaryLegacyExportResult, fidl::Error> {
1370            let _response = fidl::client::decode_transaction_body::<
1371                fidl::encoding::FlexibleResultType<
1372                    fidl::encoding::EmptyStruct,
1373                    CapabilityStoreError,
1374                >,
1375                fdomain_client::fidl::FDomainResourceDialect,
1376                0x407e15cc4bde5dcd,
1377            >(_buf?)?
1378            .into_result_fdomain::<CapabilityStoreMarker>("dictionary_legacy_export")?;
1379            Ok(_response.map(|x| x))
1380        }
1381        self.client.send_query_and_decode::<
1382            CapabilityStoreDictionaryLegacyExportRequest,
1383            CapabilityStoreDictionaryLegacyExportResult,
1384        >(
1385            (id, server_end,),
1386            0x407e15cc4bde5dcd,
1387            fidl::encoding::DynamicFlags::FLEXIBLE,
1388            _decode,
1389        )
1390    }
1391
1392    type DictionaryInsertResponseFut = fidl::client::QueryResponseFut<
1393        CapabilityStoreDictionaryInsertResult,
1394        fdomain_client::fidl::FDomainResourceDialect,
1395    >;
1396    fn r#dictionary_insert(
1397        &self,
1398        mut id: u64,
1399        mut item: &DictionaryItem,
1400    ) -> Self::DictionaryInsertResponseFut {
1401        fn _decode(
1402            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1403        ) -> Result<CapabilityStoreDictionaryInsertResult, fidl::Error> {
1404            let _response = fidl::client::decode_transaction_body::<
1405                fidl::encoding::FlexibleResultType<
1406                    fidl::encoding::EmptyStruct,
1407                    CapabilityStoreError,
1408                >,
1409                fdomain_client::fidl::FDomainResourceDialect,
1410                0x7702183689d44c27,
1411            >(_buf?)?
1412            .into_result_fdomain::<CapabilityStoreMarker>("dictionary_insert")?;
1413            Ok(_response.map(|x| x))
1414        }
1415        self.client.send_query_and_decode::<
1416            CapabilityStoreDictionaryInsertRequest,
1417            CapabilityStoreDictionaryInsertResult,
1418        >(
1419            (id, item,),
1420            0x7702183689d44c27,
1421            fidl::encoding::DynamicFlags::FLEXIBLE,
1422            _decode,
1423        )
1424    }
1425
1426    type DictionaryGetResponseFut = fidl::client::QueryResponseFut<
1427        CapabilityStoreDictionaryGetResult,
1428        fdomain_client::fidl::FDomainResourceDialect,
1429    >;
1430    fn r#dictionary_get(
1431        &self,
1432        mut id: u64,
1433        mut key: &str,
1434        mut dest_id: u64,
1435    ) -> Self::DictionaryGetResponseFut {
1436        fn _decode(
1437            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1438        ) -> Result<CapabilityStoreDictionaryGetResult, fidl::Error> {
1439            let _response = fidl::client::decode_transaction_body::<
1440                fidl::encoding::FlexibleResultType<
1441                    fidl::encoding::EmptyStruct,
1442                    CapabilityStoreError,
1443                >,
1444                fdomain_client::fidl::FDomainResourceDialect,
1445                0x4d9e27538284add2,
1446            >(_buf?)?
1447            .into_result_fdomain::<CapabilityStoreMarker>("dictionary_get")?;
1448            Ok(_response.map(|x| x))
1449        }
1450        self.client.send_query_and_decode::<
1451            CapabilityStoreDictionaryGetRequest,
1452            CapabilityStoreDictionaryGetResult,
1453        >(
1454            (id, key, dest_id,),
1455            0x4d9e27538284add2,
1456            fidl::encoding::DynamicFlags::FLEXIBLE,
1457            _decode,
1458        )
1459    }
1460
1461    type DictionaryRemoveResponseFut = fidl::client::QueryResponseFut<
1462        CapabilityStoreDictionaryRemoveResult,
1463        fdomain_client::fidl::FDomainResourceDialect,
1464    >;
1465    fn r#dictionary_remove(
1466        &self,
1467        mut id: u64,
1468        mut key: &str,
1469        mut dest_id: Option<&WrappedCapabilityId>,
1470    ) -> Self::DictionaryRemoveResponseFut {
1471        fn _decode(
1472            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1473        ) -> Result<CapabilityStoreDictionaryRemoveResult, fidl::Error> {
1474            let _response = fidl::client::decode_transaction_body::<
1475                fidl::encoding::FlexibleResultType<
1476                    fidl::encoding::EmptyStruct,
1477                    CapabilityStoreError,
1478                >,
1479                fdomain_client::fidl::FDomainResourceDialect,
1480                0x4c5c025ab05d4f3,
1481            >(_buf?)?
1482            .into_result_fdomain::<CapabilityStoreMarker>("dictionary_remove")?;
1483            Ok(_response.map(|x| x))
1484        }
1485        self.client.send_query_and_decode::<
1486            CapabilityStoreDictionaryRemoveRequest,
1487            CapabilityStoreDictionaryRemoveResult,
1488        >(
1489            (id, key, dest_id,),
1490            0x4c5c025ab05d4f3,
1491            fidl::encoding::DynamicFlags::FLEXIBLE,
1492            _decode,
1493        )
1494    }
1495
1496    type DictionaryCopyResponseFut = fidl::client::QueryResponseFut<
1497        CapabilityStoreDictionaryCopyResult,
1498        fdomain_client::fidl::FDomainResourceDialect,
1499    >;
1500    fn r#dictionary_copy(&self, mut id: u64, mut dest_id: u64) -> Self::DictionaryCopyResponseFut {
1501        fn _decode(
1502            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1503        ) -> Result<CapabilityStoreDictionaryCopyResult, fidl::Error> {
1504            let _response = fidl::client::decode_transaction_body::<
1505                fidl::encoding::FlexibleResultType<
1506                    fidl::encoding::EmptyStruct,
1507                    CapabilityStoreError,
1508                >,
1509                fdomain_client::fidl::FDomainResourceDialect,
1510                0x3733ecdf4ea1b44f,
1511            >(_buf?)?
1512            .into_result_fdomain::<CapabilityStoreMarker>("dictionary_copy")?;
1513            Ok(_response.map(|x| x))
1514        }
1515        self.client.send_query_and_decode::<
1516            CapabilityStoreDictionaryCopyRequest,
1517            CapabilityStoreDictionaryCopyResult,
1518        >(
1519            (id, dest_id,),
1520            0x3733ecdf4ea1b44f,
1521            fidl::encoding::DynamicFlags::FLEXIBLE,
1522            _decode,
1523        )
1524    }
1525
1526    type DictionaryKeysResponseFut = fidl::client::QueryResponseFut<
1527        CapabilityStoreDictionaryKeysResult,
1528        fdomain_client::fidl::FDomainResourceDialect,
1529    >;
1530    fn r#dictionary_keys(
1531        &self,
1532        mut id: u64,
1533        mut iterator: fdomain_client::fidl::ServerEnd<DictionaryKeysIteratorMarker>,
1534    ) -> Self::DictionaryKeysResponseFut {
1535        fn _decode(
1536            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1537        ) -> Result<CapabilityStoreDictionaryKeysResult, fidl::Error> {
1538            let _response = fidl::client::decode_transaction_body::<
1539                fidl::encoding::FlexibleResultType<
1540                    fidl::encoding::EmptyStruct,
1541                    CapabilityStoreError,
1542                >,
1543                fdomain_client::fidl::FDomainResourceDialect,
1544                0x84b05577ceaec9e,
1545            >(_buf?)?
1546            .into_result_fdomain::<CapabilityStoreMarker>("dictionary_keys")?;
1547            Ok(_response.map(|x| x))
1548        }
1549        self.client.send_query_and_decode::<
1550            CapabilityStoreDictionaryKeysRequest,
1551            CapabilityStoreDictionaryKeysResult,
1552        >(
1553            (id, iterator,),
1554            0x84b05577ceaec9e,
1555            fidl::encoding::DynamicFlags::FLEXIBLE,
1556            _decode,
1557        )
1558    }
1559
1560    type DictionaryEnumerateResponseFut = fidl::client::QueryResponseFut<
1561        CapabilityStoreDictionaryEnumerateResult,
1562        fdomain_client::fidl::FDomainResourceDialect,
1563    >;
1564    fn r#dictionary_enumerate(
1565        &self,
1566        mut id: u64,
1567        mut iterator: fdomain_client::fidl::ServerEnd<DictionaryEnumerateIteratorMarker>,
1568    ) -> Self::DictionaryEnumerateResponseFut {
1569        fn _decode(
1570            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1571        ) -> Result<CapabilityStoreDictionaryEnumerateResult, fidl::Error> {
1572            let _response = fidl::client::decode_transaction_body::<
1573                fidl::encoding::FlexibleResultType<
1574                    fidl::encoding::EmptyStruct,
1575                    CapabilityStoreError,
1576                >,
1577                fdomain_client::fidl::FDomainResourceDialect,
1578                0xd6279b6ced04641,
1579            >(_buf?)?
1580            .into_result_fdomain::<CapabilityStoreMarker>("dictionary_enumerate")?;
1581            Ok(_response.map(|x| x))
1582        }
1583        self.client.send_query_and_decode::<
1584            CapabilityStoreDictionaryEnumerateRequest,
1585            CapabilityStoreDictionaryEnumerateResult,
1586        >(
1587            (id, iterator,),
1588            0xd6279b6ced04641,
1589            fidl::encoding::DynamicFlags::FLEXIBLE,
1590            _decode,
1591        )
1592    }
1593
1594    type DictionaryDrainResponseFut = fidl::client::QueryResponseFut<
1595        CapabilityStoreDictionaryDrainResult,
1596        fdomain_client::fidl::FDomainResourceDialect,
1597    >;
1598    fn r#dictionary_drain(
1599        &self,
1600        mut id: u64,
1601        mut iterator: Option<fdomain_client::fidl::ServerEnd<DictionaryDrainIteratorMarker>>,
1602    ) -> Self::DictionaryDrainResponseFut {
1603        fn _decode(
1604            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1605        ) -> Result<CapabilityStoreDictionaryDrainResult, fidl::Error> {
1606            let _response = fidl::client::decode_transaction_body::<
1607                fidl::encoding::FlexibleResultType<
1608                    fidl::encoding::EmptyStruct,
1609                    CapabilityStoreError,
1610                >,
1611                fdomain_client::fidl::FDomainResourceDialect,
1612                0x28a3a3f84d928cd8,
1613            >(_buf?)?
1614            .into_result_fdomain::<CapabilityStoreMarker>("dictionary_drain")?;
1615            Ok(_response.map(|x| x))
1616        }
1617        self.client.send_query_and_decode::<
1618            CapabilityStoreDictionaryDrainRequest,
1619            CapabilityStoreDictionaryDrainResult,
1620        >(
1621            (id, iterator,),
1622            0x28a3a3f84d928cd8,
1623            fidl::encoding::DynamicFlags::FLEXIBLE,
1624            _decode,
1625        )
1626    }
1627
1628    type CreateServiceAggregateResponseFut = fidl::client::QueryResponseFut<
1629        CapabilityStoreCreateServiceAggregateResult,
1630        fdomain_client::fidl::FDomainResourceDialect,
1631    >;
1632    fn r#create_service_aggregate(
1633        &self,
1634        mut sources: Vec<AggregateSource>,
1635    ) -> Self::CreateServiceAggregateResponseFut {
1636        fn _decode(
1637            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1638        ) -> Result<CapabilityStoreCreateServiceAggregateResult, fidl::Error> {
1639            let _response = fidl::client::decode_transaction_body::<
1640                fidl::encoding::FlexibleResultType<
1641                    CapabilityStoreCreateServiceAggregateResponse,
1642                    CapabilityStoreError,
1643                >,
1644                fdomain_client::fidl::FDomainResourceDialect,
1645                0x4584116c8085885a,
1646            >(_buf?)?
1647            .into_result_fdomain::<CapabilityStoreMarker>("create_service_aggregate")?;
1648            Ok(_response.map(|x| x.aggregate_dir_connector))
1649        }
1650        self.client.send_query_and_decode::<
1651            CapabilityStoreCreateServiceAggregateRequest,
1652            CapabilityStoreCreateServiceAggregateResult,
1653        >(
1654            (sources.as_mut(),),
1655            0x4584116c8085885a,
1656            fidl::encoding::DynamicFlags::FLEXIBLE,
1657            _decode,
1658        )
1659    }
1660}
1661
1662pub struct CapabilityStoreEventStream {
1663    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
1664}
1665
1666impl std::marker::Unpin for CapabilityStoreEventStream {}
1667
1668impl futures::stream::FusedStream for CapabilityStoreEventStream {
1669    fn is_terminated(&self) -> bool {
1670        self.event_receiver.is_terminated()
1671    }
1672}
1673
1674impl futures::Stream for CapabilityStoreEventStream {
1675    type Item = Result<CapabilityStoreEvent, fidl::Error>;
1676
1677    fn poll_next(
1678        mut self: std::pin::Pin<&mut Self>,
1679        cx: &mut std::task::Context<'_>,
1680    ) -> std::task::Poll<Option<Self::Item>> {
1681        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1682            &mut self.event_receiver,
1683            cx
1684        )?) {
1685            Some(buf) => std::task::Poll::Ready(Some(CapabilityStoreEvent::decode(buf))),
1686            None => std::task::Poll::Ready(None),
1687        }
1688    }
1689}
1690
1691#[derive(Debug)]
1692pub enum CapabilityStoreEvent {
1693    #[non_exhaustive]
1694    _UnknownEvent {
1695        /// Ordinal of the event that was sent.
1696        ordinal: u64,
1697    },
1698}
1699
1700impl CapabilityStoreEvent {
1701    /// Decodes a message buffer as a [`CapabilityStoreEvent`].
1702    fn decode(
1703        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1704    ) -> Result<CapabilityStoreEvent, fidl::Error> {
1705        let (bytes, _handles) = buf.split_mut();
1706        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1707        debug_assert_eq!(tx_header.tx_id, 0);
1708        match tx_header.ordinal {
1709            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
1710                Ok(CapabilityStoreEvent::_UnknownEvent { ordinal: tx_header.ordinal })
1711            }
1712            _ => Err(fidl::Error::UnknownOrdinal {
1713                ordinal: tx_header.ordinal,
1714                protocol_name:
1715                    <CapabilityStoreMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
1716            }),
1717        }
1718    }
1719}
1720
1721/// A Stream of incoming requests for fuchsia.component.sandbox/CapabilityStore.
1722pub struct CapabilityStoreRequestStream {
1723    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
1724    is_terminated: bool,
1725}
1726
1727impl std::marker::Unpin for CapabilityStoreRequestStream {}
1728
1729impl futures::stream::FusedStream for CapabilityStoreRequestStream {
1730    fn is_terminated(&self) -> bool {
1731        self.is_terminated
1732    }
1733}
1734
1735impl fdomain_client::fidl::RequestStream for CapabilityStoreRequestStream {
1736    type Protocol = CapabilityStoreMarker;
1737    type ControlHandle = CapabilityStoreControlHandle;
1738
1739    fn from_channel(channel: fdomain_client::Channel) -> Self {
1740        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1741    }
1742
1743    fn control_handle(&self) -> Self::ControlHandle {
1744        CapabilityStoreControlHandle { inner: self.inner.clone() }
1745    }
1746
1747    fn into_inner(
1748        self,
1749    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
1750    {
1751        (self.inner, self.is_terminated)
1752    }
1753
1754    fn from_inner(
1755        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
1756        is_terminated: bool,
1757    ) -> Self {
1758        Self { inner, is_terminated }
1759    }
1760}
1761
1762impl futures::Stream for CapabilityStoreRequestStream {
1763    type Item = Result<CapabilityStoreRequest, fidl::Error>;
1764
1765    fn poll_next(
1766        mut self: std::pin::Pin<&mut Self>,
1767        cx: &mut std::task::Context<'_>,
1768    ) -> std::task::Poll<Option<Self::Item>> {
1769        let this = &mut *self;
1770        if this.inner.check_shutdown(cx) {
1771            this.is_terminated = true;
1772            return std::task::Poll::Ready(None);
1773        }
1774        if this.is_terminated {
1775            panic!("polled CapabilityStoreRequestStream after completion");
1776        }
1777        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
1778            |bytes, handles| {
1779                match this.inner.channel().read_etc(cx, bytes, handles) {
1780                    std::task::Poll::Ready(Ok(())) => {}
1781                    std::task::Poll::Pending => return std::task::Poll::Pending,
1782                    std::task::Poll::Ready(Err(None)) => {
1783                        this.is_terminated = true;
1784                        return std::task::Poll::Ready(None);
1785                    }
1786                    std::task::Poll::Ready(Err(Some(e))) => {
1787                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1788                            e.into(),
1789                        ))));
1790                    }
1791                }
1792
1793                // A message has been received from the channel
1794                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1795
1796                std::task::Poll::Ready(Some(match header.ordinal {
1797                0x5d5d35d9c20a2184 => {
1798                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1799                    let mut req = fidl::new_empty!(CapabilityStoreDuplicateRequest, fdomain_client::fidl::FDomainResourceDialect);
1800                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<CapabilityStoreDuplicateRequest>(&header, _body_bytes, handles, &mut req)?;
1801                    let control_handle = CapabilityStoreControlHandle {
1802                        inner: this.inner.clone(),
1803                    };
1804                    Ok(CapabilityStoreRequest::Duplicate {id: req.id,
1805dest_id: req.dest_id,
1806
1807                        responder: CapabilityStoreDuplicateResponder {
1808                            control_handle: std::mem::ManuallyDrop::new(control_handle),
1809                            tx_id: header.tx_id,
1810                        },
1811                    })
1812                }
1813                0xa745c0990fc2559 => {
1814                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1815                    let mut req = fidl::new_empty!(CapabilityStoreDropRequest, fdomain_client::fidl::FDomainResourceDialect);
1816                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<CapabilityStoreDropRequest>(&header, _body_bytes, handles, &mut req)?;
1817                    let control_handle = CapabilityStoreControlHandle {
1818                        inner: this.inner.clone(),
1819                    };
1820                    Ok(CapabilityStoreRequest::Drop {id: req.id,
1821
1822                        responder: CapabilityStoreDropResponder {
1823                            control_handle: std::mem::ManuallyDrop::new(control_handle),
1824                            tx_id: header.tx_id,
1825                        },
1826                    })
1827                }
1828                0x3237a8f4748faff => {
1829                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1830                    let mut req = fidl::new_empty!(CapabilityStoreExportRequest, fdomain_client::fidl::FDomainResourceDialect);
1831                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<CapabilityStoreExportRequest>(&header, _body_bytes, handles, &mut req)?;
1832                    let control_handle = CapabilityStoreControlHandle {
1833                        inner: this.inner.clone(),
1834                    };
1835                    Ok(CapabilityStoreRequest::Export {id: req.id,
1836
1837                        responder: CapabilityStoreExportResponder {
1838                            control_handle: std::mem::ManuallyDrop::new(control_handle),
1839                            tx_id: header.tx_id,
1840                        },
1841                    })
1842                }
1843                0x1f96157a29f4539b => {
1844                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1845                    let mut req = fidl::new_empty!(CapabilityStoreImportRequest, fdomain_client::fidl::FDomainResourceDialect);
1846                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<CapabilityStoreImportRequest>(&header, _body_bytes, handles, &mut req)?;
1847                    let control_handle = CapabilityStoreControlHandle {
1848                        inner: this.inner.clone(),
1849                    };
1850                    Ok(CapabilityStoreRequest::Import {id: req.id,
1851capability: req.capability,
1852
1853                        responder: CapabilityStoreImportResponder {
1854                            control_handle: std::mem::ManuallyDrop::new(control_handle),
1855                            tx_id: header.tx_id,
1856                        },
1857                    })
1858                }
1859                0x29592c5d63e91c25 => {
1860                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1861                    let mut req = fidl::new_empty!(CapabilityStoreConnectorCreateRequest, fdomain_client::fidl::FDomainResourceDialect);
1862                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<CapabilityStoreConnectorCreateRequest>(&header, _body_bytes, handles, &mut req)?;
1863                    let control_handle = CapabilityStoreControlHandle {
1864                        inner: this.inner.clone(),
1865                    };
1866                    Ok(CapabilityStoreRequest::ConnectorCreate {id: req.id,
1867receiver: req.receiver,
1868
1869                        responder: CapabilityStoreConnectorCreateResponder {
1870                            control_handle: std::mem::ManuallyDrop::new(control_handle),
1871                            tx_id: header.tx_id,
1872                        },
1873                    })
1874                }
1875                0x537e69ab40563b9f => {
1876                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1877                    let mut req = fidl::new_empty!(CapabilityStoreConnectorOpenRequest, fdomain_client::fidl::FDomainResourceDialect);
1878                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<CapabilityStoreConnectorOpenRequest>(&header, _body_bytes, handles, &mut req)?;
1879                    let control_handle = CapabilityStoreControlHandle {
1880                        inner: this.inner.clone(),
1881                    };
1882                    Ok(CapabilityStoreRequest::ConnectorOpen {id: req.id,
1883server_end: req.server_end,
1884
1885                        responder: CapabilityStoreConnectorOpenResponder {
1886                            control_handle: std::mem::ManuallyDrop::new(control_handle),
1887                            tx_id: header.tx_id,
1888                        },
1889                    })
1890                }
1891                0x186138a11ccf19bb => {
1892                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1893                    let mut req = fidl::new_empty!(CapabilityStoreDirConnectorCreateRequest, fdomain_client::fidl::FDomainResourceDialect);
1894                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<CapabilityStoreDirConnectorCreateRequest>(&header, _body_bytes, handles, &mut req)?;
1895                    let control_handle = CapabilityStoreControlHandle {
1896                        inner: this.inner.clone(),
1897                    };
1898                    Ok(CapabilityStoreRequest::DirConnectorCreate {id: req.id,
1899receiver: req.receiver,
1900
1901                        responder: CapabilityStoreDirConnectorCreateResponder {
1902                            control_handle: std::mem::ManuallyDrop::new(control_handle),
1903                            tx_id: header.tx_id,
1904                        },
1905                    })
1906                }
1907                0x5650d3d6a3a13901 => {
1908                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1909                    let mut req = fidl::new_empty!(CapabilityStoreDirConnectorOpenRequest, fdomain_client::fidl::FDomainResourceDialect);
1910                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<CapabilityStoreDirConnectorOpenRequest>(&header, _body_bytes, handles, &mut req)?;
1911                    let control_handle = CapabilityStoreControlHandle {
1912                        inner: this.inner.clone(),
1913                    };
1914                    Ok(CapabilityStoreRequest::DirConnectorOpen {payload: req,
1915                        responder: CapabilityStoreDirConnectorOpenResponder {
1916                            control_handle: std::mem::ManuallyDrop::new(control_handle),
1917                            tx_id: header.tx_id,
1918                        },
1919                    })
1920                }
1921                0x6997c8dfc63de093 => {
1922                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1923                    let mut req = fidl::new_empty!(CapabilityStoreDictionaryCreateRequest, fdomain_client::fidl::FDomainResourceDialect);
1924                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<CapabilityStoreDictionaryCreateRequest>(&header, _body_bytes, handles, &mut req)?;
1925                    let control_handle = CapabilityStoreControlHandle {
1926                        inner: this.inner.clone(),
1927                    };
1928                    Ok(CapabilityStoreRequest::DictionaryCreate {id: req.id,
1929
1930                        responder: CapabilityStoreDictionaryCreateResponder {
1931                            control_handle: std::mem::ManuallyDrop::new(control_handle),
1932                            tx_id: header.tx_id,
1933                        },
1934                    })
1935                }
1936                0x72fd686c37b6025f => {
1937                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1938                    let mut req = fidl::new_empty!(CapabilityStoreDictionaryLegacyImportRequest, fdomain_client::fidl::FDomainResourceDialect);
1939                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<CapabilityStoreDictionaryLegacyImportRequest>(&header, _body_bytes, handles, &mut req)?;
1940                    let control_handle = CapabilityStoreControlHandle {
1941                        inner: this.inner.clone(),
1942                    };
1943                    Ok(CapabilityStoreRequest::DictionaryLegacyImport {id: req.id,
1944client_end: req.client_end,
1945
1946                        responder: CapabilityStoreDictionaryLegacyImportResponder {
1947                            control_handle: std::mem::ManuallyDrop::new(control_handle),
1948                            tx_id: header.tx_id,
1949                        },
1950                    })
1951                }
1952                0x407e15cc4bde5dcd => {
1953                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1954                    let mut req = fidl::new_empty!(CapabilityStoreDictionaryLegacyExportRequest, fdomain_client::fidl::FDomainResourceDialect);
1955                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<CapabilityStoreDictionaryLegacyExportRequest>(&header, _body_bytes, handles, &mut req)?;
1956                    let control_handle = CapabilityStoreControlHandle {
1957                        inner: this.inner.clone(),
1958                    };
1959                    Ok(CapabilityStoreRequest::DictionaryLegacyExport {id: req.id,
1960server_end: req.server_end,
1961
1962                        responder: CapabilityStoreDictionaryLegacyExportResponder {
1963                            control_handle: std::mem::ManuallyDrop::new(control_handle),
1964                            tx_id: header.tx_id,
1965                        },
1966                    })
1967                }
1968                0x7702183689d44c27 => {
1969                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1970                    let mut req = fidl::new_empty!(CapabilityStoreDictionaryInsertRequest, fdomain_client::fidl::FDomainResourceDialect);
1971                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<CapabilityStoreDictionaryInsertRequest>(&header, _body_bytes, handles, &mut req)?;
1972                    let control_handle = CapabilityStoreControlHandle {
1973                        inner: this.inner.clone(),
1974                    };
1975                    Ok(CapabilityStoreRequest::DictionaryInsert {id: req.id,
1976item: req.item,
1977
1978                        responder: CapabilityStoreDictionaryInsertResponder {
1979                            control_handle: std::mem::ManuallyDrop::new(control_handle),
1980                            tx_id: header.tx_id,
1981                        },
1982                    })
1983                }
1984                0x4d9e27538284add2 => {
1985                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1986                    let mut req = fidl::new_empty!(CapabilityStoreDictionaryGetRequest, fdomain_client::fidl::FDomainResourceDialect);
1987                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<CapabilityStoreDictionaryGetRequest>(&header, _body_bytes, handles, &mut req)?;
1988                    let control_handle = CapabilityStoreControlHandle {
1989                        inner: this.inner.clone(),
1990                    };
1991                    Ok(CapabilityStoreRequest::DictionaryGet {id: req.id,
1992key: req.key,
1993dest_id: req.dest_id,
1994
1995                        responder: CapabilityStoreDictionaryGetResponder {
1996                            control_handle: std::mem::ManuallyDrop::new(control_handle),
1997                            tx_id: header.tx_id,
1998                        },
1999                    })
2000                }
2001                0x4c5c025ab05d4f3 => {
2002                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2003                    let mut req = fidl::new_empty!(CapabilityStoreDictionaryRemoveRequest, fdomain_client::fidl::FDomainResourceDialect);
2004                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<CapabilityStoreDictionaryRemoveRequest>(&header, _body_bytes, handles, &mut req)?;
2005                    let control_handle = CapabilityStoreControlHandle {
2006                        inner: this.inner.clone(),
2007                    };
2008                    Ok(CapabilityStoreRequest::DictionaryRemove {id: req.id,
2009key: req.key,
2010dest_id: req.dest_id,
2011
2012                        responder: CapabilityStoreDictionaryRemoveResponder {
2013                            control_handle: std::mem::ManuallyDrop::new(control_handle),
2014                            tx_id: header.tx_id,
2015                        },
2016                    })
2017                }
2018                0x3733ecdf4ea1b44f => {
2019                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2020                    let mut req = fidl::new_empty!(CapabilityStoreDictionaryCopyRequest, fdomain_client::fidl::FDomainResourceDialect);
2021                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<CapabilityStoreDictionaryCopyRequest>(&header, _body_bytes, handles, &mut req)?;
2022                    let control_handle = CapabilityStoreControlHandle {
2023                        inner: this.inner.clone(),
2024                    };
2025                    Ok(CapabilityStoreRequest::DictionaryCopy {id: req.id,
2026dest_id: req.dest_id,
2027
2028                        responder: CapabilityStoreDictionaryCopyResponder {
2029                            control_handle: std::mem::ManuallyDrop::new(control_handle),
2030                            tx_id: header.tx_id,
2031                        },
2032                    })
2033                }
2034                0x84b05577ceaec9e => {
2035                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2036                    let mut req = fidl::new_empty!(CapabilityStoreDictionaryKeysRequest, fdomain_client::fidl::FDomainResourceDialect);
2037                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<CapabilityStoreDictionaryKeysRequest>(&header, _body_bytes, handles, &mut req)?;
2038                    let control_handle = CapabilityStoreControlHandle {
2039                        inner: this.inner.clone(),
2040                    };
2041                    Ok(CapabilityStoreRequest::DictionaryKeys {id: req.id,
2042iterator: req.iterator,
2043
2044                        responder: CapabilityStoreDictionaryKeysResponder {
2045                            control_handle: std::mem::ManuallyDrop::new(control_handle),
2046                            tx_id: header.tx_id,
2047                        },
2048                    })
2049                }
2050                0xd6279b6ced04641 => {
2051                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2052                    let mut req = fidl::new_empty!(CapabilityStoreDictionaryEnumerateRequest, fdomain_client::fidl::FDomainResourceDialect);
2053                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<CapabilityStoreDictionaryEnumerateRequest>(&header, _body_bytes, handles, &mut req)?;
2054                    let control_handle = CapabilityStoreControlHandle {
2055                        inner: this.inner.clone(),
2056                    };
2057                    Ok(CapabilityStoreRequest::DictionaryEnumerate {id: req.id,
2058iterator: req.iterator,
2059
2060                        responder: CapabilityStoreDictionaryEnumerateResponder {
2061                            control_handle: std::mem::ManuallyDrop::new(control_handle),
2062                            tx_id: header.tx_id,
2063                        },
2064                    })
2065                }
2066                0x28a3a3f84d928cd8 => {
2067                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2068                    let mut req = fidl::new_empty!(CapabilityStoreDictionaryDrainRequest, fdomain_client::fidl::FDomainResourceDialect);
2069                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<CapabilityStoreDictionaryDrainRequest>(&header, _body_bytes, handles, &mut req)?;
2070                    let control_handle = CapabilityStoreControlHandle {
2071                        inner: this.inner.clone(),
2072                    };
2073                    Ok(CapabilityStoreRequest::DictionaryDrain {id: req.id,
2074iterator: req.iterator,
2075
2076                        responder: CapabilityStoreDictionaryDrainResponder {
2077                            control_handle: std::mem::ManuallyDrop::new(control_handle),
2078                            tx_id: header.tx_id,
2079                        },
2080                    })
2081                }
2082                0x4584116c8085885a => {
2083                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2084                    let mut req = fidl::new_empty!(CapabilityStoreCreateServiceAggregateRequest, fdomain_client::fidl::FDomainResourceDialect);
2085                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<CapabilityStoreCreateServiceAggregateRequest>(&header, _body_bytes, handles, &mut req)?;
2086                    let control_handle = CapabilityStoreControlHandle {
2087                        inner: this.inner.clone(),
2088                    };
2089                    Ok(CapabilityStoreRequest::CreateServiceAggregate {sources: req.sources,
2090
2091                        responder: CapabilityStoreCreateServiceAggregateResponder {
2092                            control_handle: std::mem::ManuallyDrop::new(control_handle),
2093                            tx_id: header.tx_id,
2094                        },
2095                    })
2096                }
2097                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2098                    Ok(CapabilityStoreRequest::_UnknownMethod {
2099                        ordinal: header.ordinal,
2100                        control_handle: CapabilityStoreControlHandle { inner: this.inner.clone() },
2101                        method_type: fidl::MethodType::OneWay,
2102                    })
2103                }
2104                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2105                    this.inner.send_framework_err(
2106                        fidl::encoding::FrameworkErr::UnknownMethod,
2107                        header.tx_id,
2108                        header.ordinal,
2109                        header.dynamic_flags(),
2110                        (bytes, handles),
2111                    )?;
2112                    Ok(CapabilityStoreRequest::_UnknownMethod {
2113                        ordinal: header.ordinal,
2114                        control_handle: CapabilityStoreControlHandle { inner: this.inner.clone() },
2115                        method_type: fidl::MethodType::TwoWay,
2116                    })
2117                }
2118                _ => Err(fidl::Error::UnknownOrdinal {
2119                    ordinal: header.ordinal,
2120                    protocol_name: <CapabilityStoreMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
2121                }),
2122            }))
2123            },
2124        )
2125    }
2126}
2127
2128/// Protocol that represents the concept of a "capability store", a repository
2129/// for [Capability]s that are held by the component framework runtime.
2130///
2131/// [CapabilityStore] serves as the main bridge between the component runtime and clients
2132/// that enables them to operate on and exchange [Capability]s. A [CapabilityStore] instance
2133/// contains a set of [Capability]s, each of which has a [CapabilityId] assigned by the client.
2134///
2135/// Normally, a program would not exchange a [CapabilityStore] or [CapabilityId] with other
2136/// programs -- a [CapabilityStore] connection and its enclosed capabilities are intended to
2137/// be "local" to a program. Instead, if a program wishes to exchange a [Capability] with other
2138/// programs, it should [Export] the [Capability] out of the store, send the [Capability] to the
2139/// target program, which can then [Import] the capability into its own store.
2140///
2141/// [CapabilityStore] is also used to manage capability lifetimes. The lifetime of a capability is
2142/// scoped to the [CapabilityStore] in which it resides; i.e. to drop the [CapabilityStore]
2143/// connections to release the capabilities instead it. In addition, [CapabilityStore] supports a
2144/// [Drop] API to drop an individual [Capability] reference. (Note that it is possible for a
2145/// some capabilities, like [DictionaryRef], to have multiple references, in which case all of
2146/// the references must be dropped for the underlying resource to be released.)
2147///
2148/// A note about semantics: the [CapabilityStore] APIs do not return [CapabilityId]s, because
2149/// [CapabilityId]s are assigned by the client. Instead, when a method would semantically return
2150/// a capability, this is expressed by taking the destination [CapabilityId] as an output parameter.
2151#[derive(Debug)]
2152pub enum CapabilityStoreRequest {
2153    /// Duplicates the capability with `id` to `dest_id`.
2154    ///
2155    /// Errors:
2156    ///
2157    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2158    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
2159    /// - `NOT_DUPLICATABLE` if `id` could not be duplicated.
2160    Duplicate { id: u64, dest_id: u64, responder: CapabilityStoreDuplicateResponder },
2161    /// Drops the capability with `id` from this [`CapabilityStore`].
2162    ///
2163    /// Errors:
2164    ///
2165    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2166    Drop { id: u64, responder: CapabilityStoreDropResponder },
2167    /// Exports the capability with the client-assigned identifier `id` to
2168    /// `capability`. This operation removes the capability from the store. If
2169    /// this is not desired, [Duplicate] the capability first.
2170    ///
2171    /// Errors:
2172    ///
2173    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2174    Export { id: u64, responder: CapabilityStoreExportResponder },
2175    /// Imports `capability` into this store with the client-assigned `id`.
2176    ///
2177    /// Errors:
2178    ///
2179    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
2180    /// - `BAD_CAPABILITY` if `capability` was not a valid [Capability].
2181    Import { id: u64, capability: Capability, responder: CapabilityStoreImportResponder },
2182    /// Creates a [Connector] from a [Receiver]. Incoming connections to the [Connector] will be
2183    /// dispatched to this [Receiver].
2184    ///
2185    /// Errors:
2186    ///
2187    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
2188    ConnectorCreate {
2189        id: u64,
2190        receiver: fdomain_client::fidl::ClientEnd<ReceiverMarker>,
2191        responder: CapabilityStoreConnectorCreateResponder,
2192    },
2193    /// Open a connection from the provided [Connector] capability that will be dispatched to
2194    /// the [Receiver] on the other end.
2195    ///
2196    /// If there is an error, it will be reported as a zx.Status epitaph on `server_end`.
2197    ///
2198    /// Errors:
2199    ///
2200    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2201    /// - `WRONG_TYPE` if `id` was not a connector capability.
2202    ConnectorOpen {
2203        id: u64,
2204        server_end: fdomain_client::Channel,
2205        responder: CapabilityStoreConnectorOpenResponder,
2206    },
2207    /// Creates a [DirConnector] from a [DirReceiver]. Incoming connections to the [DirConnector]
2208    /// will be dispatched to this [DirReceiver].
2209    ///
2210    /// Errors:
2211    ///
2212    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
2213    DirConnectorCreate {
2214        id: u64,
2215        receiver: fdomain_client::fidl::ClientEnd<DirReceiverMarker>,
2216        responder: CapabilityStoreDirConnectorCreateResponder,
2217    },
2218    /// Open a connection from the provided [DirConnector] capability that will
2219    /// be dispatched to the [DirReceiver] on the other end. The `id` and
2220    /// `server_end` arguments are required, and the `flags` and `path`
2221    /// arguments are optional (a path of `.` will be used if one is not
2222    /// otherwise set).
2223    ///
2224    /// If there was an error making the connection, it will be reported as a zx.Status
2225    /// epitaph on `server_end`.
2226    ///
2227    /// Errors:
2228    ///
2229    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2230    /// - `WRONG_TYPE` if `id` was not a connector capability.
2231    DirConnectorOpen {
2232        payload: CapabilityStoreDirConnectorOpenRequest,
2233        responder: CapabilityStoreDirConnectorOpenResponder,
2234    },
2235    /// Creates a new empty dictionary in this [`CapabilityStore`] with client-assigned `id`.
2236    ///
2237    /// Errors:
2238    ///
2239    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
2240    DictionaryCreate { id: u64, responder: CapabilityStoreDictionaryCreateResponder },
2241    /// Imports a dictionary in the form of a channel.
2242    ///
2243    /// This is a legacy API to support backward compatibility with APIs that take a [Dictionary]
2244    /// channel.
2245    ///
2246    /// Errors:
2247    ///
2248    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
2249    /// - `BAD_CAPABILITY` if `client_end` was not a valid dictionary channel.
2250    DictionaryLegacyImport {
2251        id: u64,
2252        client_end: fdomain_client::Channel,
2253        responder: CapabilityStoreDictionaryLegacyImportResponder,
2254    },
2255    /// Binds a channel to the dictionary with `id`. The channel can
2256    /// be re-imported into a [CapabilityStore] with [DictionaryImportLegacy].
2257    ///
2258    /// This is a legacy API to support backward compatibility with APIs that take a [Dictionary]
2259    /// channel.
2260    ///
2261    /// Errors:
2262    ///
2263    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2264    DictionaryLegacyExport {
2265        id: u64,
2266        server_end: fdomain_client::Channel,
2267        responder: CapabilityStoreDictionaryLegacyExportResponder,
2268    },
2269    /// Inserts `item` into the dictionary with `id`. `item.value` is moved into the dictionary and
2270    /// its id is released if this call succeeds.
2271    ///
2272    /// Errors:
2273    ///
2274    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2275    /// - `WRONG_TYPE` if `id` was not a dictionary.
2276    /// - `INVALID_KEY` if `item.key` was invalid.
2277    /// - `ITEM_ALREADY_EXISTS` if the dictionary already contains an item with `item.key`.
2278    DictionaryInsert {
2279        id: u64,
2280        item: DictionaryItem,
2281        responder: CapabilityStoreDictionaryInsertResponder,
2282    },
2283    /// Get a duplicate of a capability from the dictionary with `id`, which is
2284    /// loaded into `dest_id`.
2285    ///
2286    /// Errors:
2287    ///
2288    /// - `ID_NOT_FOUND` if `id` was not a recognized capability id in this store.
2289    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
2290    /// - `WRONG_TYPE` if `id` was not a dictionary.
2291    /// - `INVALID_KEY` if `item.key` was invalid.
2292    /// - `ITEM_NOT_FOUND` if the dictionary does not contain `key`.
2293    /// - `NOT_DUPLICATABLE` if the capability could not be duplicated.
2294    DictionaryGet {
2295        id: u64,
2296        key: String,
2297        dest_id: u64,
2298        responder: CapabilityStoreDictionaryGetResponder,
2299    },
2300    /// Removes a key from the dictionary with `id`. If `dest_id` is present, loads the value
2301    /// into it, otherwise discards the value.
2302    ///
2303    /// Errors:
2304    ///
2305    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2306    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
2307    /// - `WRONG_TYPE` if `id` was not a dictionary.
2308    /// - `INVALID_KEY` if `key` was invalid.
2309    /// - `ITEM_NOT_FOUND` if the dictionary does not contain the key.
2310    DictionaryRemove {
2311        id: u64,
2312        key: String,
2313        dest_id: Option<Box<WrappedCapabilityId>>,
2314        responder: CapabilityStoreDictionaryRemoveResponder,
2315    },
2316    /// Create a new dictionary that contains a duplicate of all the entries in
2317    /// the dictionary with `id`, assigning `dest_id` to the new dictionary.
2318    /// The runtime of this method is linear in the number of top-level entries
2319    /// in the dictionary.
2320    ///
2321    /// For example, if the dictionary contains nested dictionaries, the newly
2322    /// created dictionary will contain references to those same nested
2323    /// dictionaries because the entries are duplicated rather than deep-copied.
2324    ///
2325    /// Errors:
2326    ///
2327    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2328    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
2329    /// - `WRONG_TYPE` if `id` was not a dictionary.
2330    /// - `NOT_DUPLICATABLE` if one of the capabilities in `id` could not be duplicated.
2331    DictionaryCopy { id: u64, dest_id: u64, responder: CapabilityStoreDictionaryCopyResponder },
2332    /// Enumerates the keys in the dictionary with `id`.
2333    ///
2334    /// Errors:
2335    ///
2336    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2337    /// - `WRONG_TYPE` if `id` was not a dictionary.
2338    DictionaryKeys {
2339        id: u64,
2340        iterator: fdomain_client::fidl::ServerEnd<DictionaryKeysIteratorMarker>,
2341        responder: CapabilityStoreDictionaryKeysResponder,
2342    },
2343    /// Enumerates the items (keys and values) in the dictionary with `id`.
2344    ///
2345    /// Creates a duplicate of each value (capability). If a value could not be duplicated,
2346    /// the value will be null.
2347    ///
2348    /// Errors:
2349    ///
2350    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2351    /// - `WRONG_TYPE` if `id` was not a dictionary.
2352    DictionaryEnumerate {
2353        id: u64,
2354        iterator: fdomain_client::fidl::ServerEnd<DictionaryEnumerateIteratorMarker>,
2355        responder: CapabilityStoreDictionaryEnumerateResponder,
2356    },
2357    /// Removes all the entries in this dictionary, returning them in `contents` if provided.
2358    /// If `contents` is not provided, all the items are discarded without enumerating them.
2359    ///
2360    /// Errors:
2361    ///
2362    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2363    /// - `WRONG_TYPE` if `id` was not a dictionary.
2364    DictionaryDrain {
2365        id: u64,
2366        iterator: Option<fdomain_client::fidl::ServerEnd<DictionaryDrainIteratorMarker>>,
2367        responder: CapabilityStoreDictionaryDrainResponder,
2368    },
2369    /// Creates a new DirConnector that forwards open requests to a set of
2370    /// sources.
2371    CreateServiceAggregate {
2372        sources: Vec<AggregateSource>,
2373        responder: CapabilityStoreCreateServiceAggregateResponder,
2374    },
2375    /// An interaction was received which does not match any known method.
2376    #[non_exhaustive]
2377    _UnknownMethod {
2378        /// Ordinal of the method that was called.
2379        ordinal: u64,
2380        control_handle: CapabilityStoreControlHandle,
2381        method_type: fidl::MethodType,
2382    },
2383}
2384
2385impl CapabilityStoreRequest {
2386    #[allow(irrefutable_let_patterns)]
2387    pub fn into_duplicate(self) -> Option<(u64, u64, CapabilityStoreDuplicateResponder)> {
2388        if let CapabilityStoreRequest::Duplicate { id, dest_id, responder } = self {
2389            Some((id, dest_id, responder))
2390        } else {
2391            None
2392        }
2393    }
2394
2395    #[allow(irrefutable_let_patterns)]
2396    pub fn into_drop(self) -> Option<(u64, CapabilityStoreDropResponder)> {
2397        if let CapabilityStoreRequest::Drop { id, responder } = self {
2398            Some((id, responder))
2399        } else {
2400            None
2401        }
2402    }
2403
2404    #[allow(irrefutable_let_patterns)]
2405    pub fn into_export(self) -> Option<(u64, CapabilityStoreExportResponder)> {
2406        if let CapabilityStoreRequest::Export { id, responder } = self {
2407            Some((id, responder))
2408        } else {
2409            None
2410        }
2411    }
2412
2413    #[allow(irrefutable_let_patterns)]
2414    pub fn into_import(self) -> Option<(u64, Capability, CapabilityStoreImportResponder)> {
2415        if let CapabilityStoreRequest::Import { id, capability, responder } = self {
2416            Some((id, capability, responder))
2417        } else {
2418            None
2419        }
2420    }
2421
2422    #[allow(irrefutable_let_patterns)]
2423    pub fn into_connector_create(
2424        self,
2425    ) -> Option<(
2426        u64,
2427        fdomain_client::fidl::ClientEnd<ReceiverMarker>,
2428        CapabilityStoreConnectorCreateResponder,
2429    )> {
2430        if let CapabilityStoreRequest::ConnectorCreate { id, receiver, responder } = self {
2431            Some((id, receiver, responder))
2432        } else {
2433            None
2434        }
2435    }
2436
2437    #[allow(irrefutable_let_patterns)]
2438    pub fn into_connector_open(
2439        self,
2440    ) -> Option<(u64, fdomain_client::Channel, CapabilityStoreConnectorOpenResponder)> {
2441        if let CapabilityStoreRequest::ConnectorOpen { id, server_end, responder } = self {
2442            Some((id, server_end, responder))
2443        } else {
2444            None
2445        }
2446    }
2447
2448    #[allow(irrefutable_let_patterns)]
2449    pub fn into_dir_connector_create(
2450        self,
2451    ) -> Option<(
2452        u64,
2453        fdomain_client::fidl::ClientEnd<DirReceiverMarker>,
2454        CapabilityStoreDirConnectorCreateResponder,
2455    )> {
2456        if let CapabilityStoreRequest::DirConnectorCreate { id, receiver, responder } = self {
2457            Some((id, receiver, responder))
2458        } else {
2459            None
2460        }
2461    }
2462
2463    #[allow(irrefutable_let_patterns)]
2464    pub fn into_dir_connector_open(
2465        self,
2466    ) -> Option<(CapabilityStoreDirConnectorOpenRequest, CapabilityStoreDirConnectorOpenResponder)>
2467    {
2468        if let CapabilityStoreRequest::DirConnectorOpen { payload, responder } = self {
2469            Some((payload, responder))
2470        } else {
2471            None
2472        }
2473    }
2474
2475    #[allow(irrefutable_let_patterns)]
2476    pub fn into_dictionary_create(self) -> Option<(u64, CapabilityStoreDictionaryCreateResponder)> {
2477        if let CapabilityStoreRequest::DictionaryCreate { id, responder } = self {
2478            Some((id, responder))
2479        } else {
2480            None
2481        }
2482    }
2483
2484    #[allow(irrefutable_let_patterns)]
2485    pub fn into_dictionary_legacy_import(
2486        self,
2487    ) -> Option<(u64, fdomain_client::Channel, CapabilityStoreDictionaryLegacyImportResponder)>
2488    {
2489        if let CapabilityStoreRequest::DictionaryLegacyImport { id, client_end, responder } = self {
2490            Some((id, client_end, responder))
2491        } else {
2492            None
2493        }
2494    }
2495
2496    #[allow(irrefutable_let_patterns)]
2497    pub fn into_dictionary_legacy_export(
2498        self,
2499    ) -> Option<(u64, fdomain_client::Channel, CapabilityStoreDictionaryLegacyExportResponder)>
2500    {
2501        if let CapabilityStoreRequest::DictionaryLegacyExport { id, server_end, responder } = self {
2502            Some((id, server_end, responder))
2503        } else {
2504            None
2505        }
2506    }
2507
2508    #[allow(irrefutable_let_patterns)]
2509    pub fn into_dictionary_insert(
2510        self,
2511    ) -> Option<(u64, DictionaryItem, CapabilityStoreDictionaryInsertResponder)> {
2512        if let CapabilityStoreRequest::DictionaryInsert { id, item, responder } = self {
2513            Some((id, item, responder))
2514        } else {
2515            None
2516        }
2517    }
2518
2519    #[allow(irrefutable_let_patterns)]
2520    pub fn into_dictionary_get(
2521        self,
2522    ) -> Option<(u64, String, u64, CapabilityStoreDictionaryGetResponder)> {
2523        if let CapabilityStoreRequest::DictionaryGet { id, key, dest_id, responder } = self {
2524            Some((id, key, dest_id, responder))
2525        } else {
2526            None
2527        }
2528    }
2529
2530    #[allow(irrefutable_let_patterns)]
2531    pub fn into_dictionary_remove(
2532        self,
2533    ) -> Option<(
2534        u64,
2535        String,
2536        Option<Box<WrappedCapabilityId>>,
2537        CapabilityStoreDictionaryRemoveResponder,
2538    )> {
2539        if let CapabilityStoreRequest::DictionaryRemove { id, key, dest_id, responder } = self {
2540            Some((id, key, dest_id, responder))
2541        } else {
2542            None
2543        }
2544    }
2545
2546    #[allow(irrefutable_let_patterns)]
2547    pub fn into_dictionary_copy(
2548        self,
2549    ) -> Option<(u64, u64, CapabilityStoreDictionaryCopyResponder)> {
2550        if let CapabilityStoreRequest::DictionaryCopy { id, dest_id, responder } = self {
2551            Some((id, dest_id, responder))
2552        } else {
2553            None
2554        }
2555    }
2556
2557    #[allow(irrefutable_let_patterns)]
2558    pub fn into_dictionary_keys(
2559        self,
2560    ) -> Option<(
2561        u64,
2562        fdomain_client::fidl::ServerEnd<DictionaryKeysIteratorMarker>,
2563        CapabilityStoreDictionaryKeysResponder,
2564    )> {
2565        if let CapabilityStoreRequest::DictionaryKeys { id, iterator, responder } = self {
2566            Some((id, iterator, responder))
2567        } else {
2568            None
2569        }
2570    }
2571
2572    #[allow(irrefutable_let_patterns)]
2573    pub fn into_dictionary_enumerate(
2574        self,
2575    ) -> Option<(
2576        u64,
2577        fdomain_client::fidl::ServerEnd<DictionaryEnumerateIteratorMarker>,
2578        CapabilityStoreDictionaryEnumerateResponder,
2579    )> {
2580        if let CapabilityStoreRequest::DictionaryEnumerate { id, iterator, responder } = self {
2581            Some((id, iterator, responder))
2582        } else {
2583            None
2584        }
2585    }
2586
2587    #[allow(irrefutable_let_patterns)]
2588    pub fn into_dictionary_drain(
2589        self,
2590    ) -> Option<(
2591        u64,
2592        Option<fdomain_client::fidl::ServerEnd<DictionaryDrainIteratorMarker>>,
2593        CapabilityStoreDictionaryDrainResponder,
2594    )> {
2595        if let CapabilityStoreRequest::DictionaryDrain { id, iterator, responder } = self {
2596            Some((id, iterator, responder))
2597        } else {
2598            None
2599        }
2600    }
2601
2602    #[allow(irrefutable_let_patterns)]
2603    pub fn into_create_service_aggregate(
2604        self,
2605    ) -> Option<(Vec<AggregateSource>, CapabilityStoreCreateServiceAggregateResponder)> {
2606        if let CapabilityStoreRequest::CreateServiceAggregate { sources, responder } = self {
2607            Some((sources, responder))
2608        } else {
2609            None
2610        }
2611    }
2612
2613    /// Name of the method defined in FIDL
2614    pub fn method_name(&self) -> &'static str {
2615        match *self {
2616            CapabilityStoreRequest::Duplicate { .. } => "duplicate",
2617            CapabilityStoreRequest::Drop { .. } => "drop",
2618            CapabilityStoreRequest::Export { .. } => "export",
2619            CapabilityStoreRequest::Import { .. } => "import",
2620            CapabilityStoreRequest::ConnectorCreate { .. } => "connector_create",
2621            CapabilityStoreRequest::ConnectorOpen { .. } => "connector_open",
2622            CapabilityStoreRequest::DirConnectorCreate { .. } => "dir_connector_create",
2623            CapabilityStoreRequest::DirConnectorOpen { .. } => "dir_connector_open",
2624            CapabilityStoreRequest::DictionaryCreate { .. } => "dictionary_create",
2625            CapabilityStoreRequest::DictionaryLegacyImport { .. } => "dictionary_legacy_import",
2626            CapabilityStoreRequest::DictionaryLegacyExport { .. } => "dictionary_legacy_export",
2627            CapabilityStoreRequest::DictionaryInsert { .. } => "dictionary_insert",
2628            CapabilityStoreRequest::DictionaryGet { .. } => "dictionary_get",
2629            CapabilityStoreRequest::DictionaryRemove { .. } => "dictionary_remove",
2630            CapabilityStoreRequest::DictionaryCopy { .. } => "dictionary_copy",
2631            CapabilityStoreRequest::DictionaryKeys { .. } => "dictionary_keys",
2632            CapabilityStoreRequest::DictionaryEnumerate { .. } => "dictionary_enumerate",
2633            CapabilityStoreRequest::DictionaryDrain { .. } => "dictionary_drain",
2634            CapabilityStoreRequest::CreateServiceAggregate { .. } => "create_service_aggregate",
2635            CapabilityStoreRequest::_UnknownMethod {
2636                method_type: fidl::MethodType::OneWay,
2637                ..
2638            } => "unknown one-way method",
2639            CapabilityStoreRequest::_UnknownMethod {
2640                method_type: fidl::MethodType::TwoWay,
2641                ..
2642            } => "unknown two-way method",
2643        }
2644    }
2645}
2646
2647#[derive(Debug, Clone)]
2648pub struct CapabilityStoreControlHandle {
2649    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
2650}
2651
2652impl fdomain_client::fidl::ControlHandle for CapabilityStoreControlHandle {
2653    fn shutdown(&self) {
2654        self.inner.shutdown()
2655    }
2656
2657    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2658        self.inner.shutdown_with_epitaph(status)
2659    }
2660
2661    fn is_closed(&self) -> bool {
2662        self.inner.channel().is_closed()
2663    }
2664    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
2665        self.inner.channel().on_closed()
2666    }
2667}
2668
2669impl CapabilityStoreControlHandle {}
2670
2671#[must_use = "FIDL methods require a response to be sent"]
2672#[derive(Debug)]
2673pub struct CapabilityStoreDuplicateResponder {
2674    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
2675    tx_id: u32,
2676}
2677
2678/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
2679/// if the responder is dropped without sending a response, so that the client
2680/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2681impl std::ops::Drop for CapabilityStoreDuplicateResponder {
2682    fn drop(&mut self) {
2683        self.control_handle.shutdown();
2684        // Safety: drops once, never accessed again
2685        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2686    }
2687}
2688
2689impl fdomain_client::fidl::Responder for CapabilityStoreDuplicateResponder {
2690    type ControlHandle = CapabilityStoreControlHandle;
2691
2692    fn control_handle(&self) -> &CapabilityStoreControlHandle {
2693        &self.control_handle
2694    }
2695
2696    fn drop_without_shutdown(mut self) {
2697        // Safety: drops once, never accessed again due to mem::forget
2698        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2699        // Prevent Drop from running (which would shut down the channel)
2700        std::mem::forget(self);
2701    }
2702}
2703
2704impl CapabilityStoreDuplicateResponder {
2705    /// Sends a response to the FIDL transaction.
2706    ///
2707    /// Sets the channel to shutdown if an error occurs.
2708    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
2709        let _result = self.send_raw(result);
2710        if _result.is_err() {
2711            self.control_handle.shutdown();
2712        }
2713        self.drop_without_shutdown();
2714        _result
2715    }
2716
2717    /// Similar to "send" but does not shutdown the channel if an error occurs.
2718    pub fn send_no_shutdown_on_err(
2719        self,
2720        mut result: Result<(), CapabilityStoreError>,
2721    ) -> Result<(), fidl::Error> {
2722        let _result = self.send_raw(result);
2723        self.drop_without_shutdown();
2724        _result
2725    }
2726
2727    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
2728        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
2729            fidl::encoding::EmptyStruct,
2730            CapabilityStoreError,
2731        >>(
2732            fidl::encoding::FlexibleResult::new(result),
2733            self.tx_id,
2734            0x5d5d35d9c20a2184,
2735            fidl::encoding::DynamicFlags::FLEXIBLE,
2736        )
2737    }
2738}
2739
2740#[must_use = "FIDL methods require a response to be sent"]
2741#[derive(Debug)]
2742pub struct CapabilityStoreDropResponder {
2743    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
2744    tx_id: u32,
2745}
2746
2747/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
2748/// if the responder is dropped without sending a response, so that the client
2749/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2750impl std::ops::Drop for CapabilityStoreDropResponder {
2751    fn drop(&mut self) {
2752        self.control_handle.shutdown();
2753        // Safety: drops once, never accessed again
2754        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2755    }
2756}
2757
2758impl fdomain_client::fidl::Responder for CapabilityStoreDropResponder {
2759    type ControlHandle = CapabilityStoreControlHandle;
2760
2761    fn control_handle(&self) -> &CapabilityStoreControlHandle {
2762        &self.control_handle
2763    }
2764
2765    fn drop_without_shutdown(mut self) {
2766        // Safety: drops once, never accessed again due to mem::forget
2767        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2768        // Prevent Drop from running (which would shut down the channel)
2769        std::mem::forget(self);
2770    }
2771}
2772
2773impl CapabilityStoreDropResponder {
2774    /// Sends a response to the FIDL transaction.
2775    ///
2776    /// Sets the channel to shutdown if an error occurs.
2777    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
2778        let _result = self.send_raw(result);
2779        if _result.is_err() {
2780            self.control_handle.shutdown();
2781        }
2782        self.drop_without_shutdown();
2783        _result
2784    }
2785
2786    /// Similar to "send" but does not shutdown the channel if an error occurs.
2787    pub fn send_no_shutdown_on_err(
2788        self,
2789        mut result: Result<(), CapabilityStoreError>,
2790    ) -> Result<(), fidl::Error> {
2791        let _result = self.send_raw(result);
2792        self.drop_without_shutdown();
2793        _result
2794    }
2795
2796    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
2797        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
2798            fidl::encoding::EmptyStruct,
2799            CapabilityStoreError,
2800        >>(
2801            fidl::encoding::FlexibleResult::new(result),
2802            self.tx_id,
2803            0xa745c0990fc2559,
2804            fidl::encoding::DynamicFlags::FLEXIBLE,
2805        )
2806    }
2807}
2808
2809#[must_use = "FIDL methods require a response to be sent"]
2810#[derive(Debug)]
2811pub struct CapabilityStoreExportResponder {
2812    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
2813    tx_id: u32,
2814}
2815
2816/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
2817/// if the responder is dropped without sending a response, so that the client
2818/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2819impl std::ops::Drop for CapabilityStoreExportResponder {
2820    fn drop(&mut self) {
2821        self.control_handle.shutdown();
2822        // Safety: drops once, never accessed again
2823        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2824    }
2825}
2826
2827impl fdomain_client::fidl::Responder for CapabilityStoreExportResponder {
2828    type ControlHandle = CapabilityStoreControlHandle;
2829
2830    fn control_handle(&self) -> &CapabilityStoreControlHandle {
2831        &self.control_handle
2832    }
2833
2834    fn drop_without_shutdown(mut self) {
2835        // Safety: drops once, never accessed again due to mem::forget
2836        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2837        // Prevent Drop from running (which would shut down the channel)
2838        std::mem::forget(self);
2839    }
2840}
2841
2842impl CapabilityStoreExportResponder {
2843    /// Sends a response to the FIDL transaction.
2844    ///
2845    /// Sets the channel to shutdown if an error occurs.
2846    pub fn send(
2847        self,
2848        mut result: Result<Capability, CapabilityStoreError>,
2849    ) -> Result<(), fidl::Error> {
2850        let _result = self.send_raw(result);
2851        if _result.is_err() {
2852            self.control_handle.shutdown();
2853        }
2854        self.drop_without_shutdown();
2855        _result
2856    }
2857
2858    /// Similar to "send" but does not shutdown the channel if an error occurs.
2859    pub fn send_no_shutdown_on_err(
2860        self,
2861        mut result: Result<Capability, CapabilityStoreError>,
2862    ) -> Result<(), fidl::Error> {
2863        let _result = self.send_raw(result);
2864        self.drop_without_shutdown();
2865        _result
2866    }
2867
2868    fn send_raw(
2869        &self,
2870        mut result: Result<Capability, CapabilityStoreError>,
2871    ) -> Result<(), fidl::Error> {
2872        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
2873            CapabilityStoreExportResponse,
2874            CapabilityStoreError,
2875        >>(
2876            fidl::encoding::FlexibleResult::new(
2877                result.as_mut().map_err(|e| *e).map(|capability| (capability,)),
2878            ),
2879            self.tx_id,
2880            0x3237a8f4748faff,
2881            fidl::encoding::DynamicFlags::FLEXIBLE,
2882        )
2883    }
2884}
2885
2886#[must_use = "FIDL methods require a response to be sent"]
2887#[derive(Debug)]
2888pub struct CapabilityStoreImportResponder {
2889    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
2890    tx_id: u32,
2891}
2892
2893/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
2894/// if the responder is dropped without sending a response, so that the client
2895/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2896impl std::ops::Drop for CapabilityStoreImportResponder {
2897    fn drop(&mut self) {
2898        self.control_handle.shutdown();
2899        // Safety: drops once, never accessed again
2900        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2901    }
2902}
2903
2904impl fdomain_client::fidl::Responder for CapabilityStoreImportResponder {
2905    type ControlHandle = CapabilityStoreControlHandle;
2906
2907    fn control_handle(&self) -> &CapabilityStoreControlHandle {
2908        &self.control_handle
2909    }
2910
2911    fn drop_without_shutdown(mut self) {
2912        // Safety: drops once, never accessed again due to mem::forget
2913        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2914        // Prevent Drop from running (which would shut down the channel)
2915        std::mem::forget(self);
2916    }
2917}
2918
2919impl CapabilityStoreImportResponder {
2920    /// Sends a response to the FIDL transaction.
2921    ///
2922    /// Sets the channel to shutdown if an error occurs.
2923    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
2924        let _result = self.send_raw(result);
2925        if _result.is_err() {
2926            self.control_handle.shutdown();
2927        }
2928        self.drop_without_shutdown();
2929        _result
2930    }
2931
2932    /// Similar to "send" but does not shutdown the channel if an error occurs.
2933    pub fn send_no_shutdown_on_err(
2934        self,
2935        mut result: Result<(), CapabilityStoreError>,
2936    ) -> Result<(), fidl::Error> {
2937        let _result = self.send_raw(result);
2938        self.drop_without_shutdown();
2939        _result
2940    }
2941
2942    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
2943        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
2944            fidl::encoding::EmptyStruct,
2945            CapabilityStoreError,
2946        >>(
2947            fidl::encoding::FlexibleResult::new(result),
2948            self.tx_id,
2949            0x1f96157a29f4539b,
2950            fidl::encoding::DynamicFlags::FLEXIBLE,
2951        )
2952    }
2953}
2954
2955#[must_use = "FIDL methods require a response to be sent"]
2956#[derive(Debug)]
2957pub struct CapabilityStoreConnectorCreateResponder {
2958    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
2959    tx_id: u32,
2960}
2961
2962/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
2963/// if the responder is dropped without sending a response, so that the client
2964/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2965impl std::ops::Drop for CapabilityStoreConnectorCreateResponder {
2966    fn drop(&mut self) {
2967        self.control_handle.shutdown();
2968        // Safety: drops once, never accessed again
2969        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2970    }
2971}
2972
2973impl fdomain_client::fidl::Responder for CapabilityStoreConnectorCreateResponder {
2974    type ControlHandle = CapabilityStoreControlHandle;
2975
2976    fn control_handle(&self) -> &CapabilityStoreControlHandle {
2977        &self.control_handle
2978    }
2979
2980    fn drop_without_shutdown(mut self) {
2981        // Safety: drops once, never accessed again due to mem::forget
2982        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2983        // Prevent Drop from running (which would shut down the channel)
2984        std::mem::forget(self);
2985    }
2986}
2987
2988impl CapabilityStoreConnectorCreateResponder {
2989    /// Sends a response to the FIDL transaction.
2990    ///
2991    /// Sets the channel to shutdown if an error occurs.
2992    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
2993        let _result = self.send_raw(result);
2994        if _result.is_err() {
2995            self.control_handle.shutdown();
2996        }
2997        self.drop_without_shutdown();
2998        _result
2999    }
3000
3001    /// Similar to "send" but does not shutdown the channel if an error occurs.
3002    pub fn send_no_shutdown_on_err(
3003        self,
3004        mut result: Result<(), CapabilityStoreError>,
3005    ) -> Result<(), fidl::Error> {
3006        let _result = self.send_raw(result);
3007        self.drop_without_shutdown();
3008        _result
3009    }
3010
3011    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3012        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3013            fidl::encoding::EmptyStruct,
3014            CapabilityStoreError,
3015        >>(
3016            fidl::encoding::FlexibleResult::new(result),
3017            self.tx_id,
3018            0x29592c5d63e91c25,
3019            fidl::encoding::DynamicFlags::FLEXIBLE,
3020        )
3021    }
3022}
3023
3024#[must_use = "FIDL methods require a response to be sent"]
3025#[derive(Debug)]
3026pub struct CapabilityStoreConnectorOpenResponder {
3027    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3028    tx_id: u32,
3029}
3030
3031/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3032/// if the responder is dropped without sending a response, so that the client
3033/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3034impl std::ops::Drop for CapabilityStoreConnectorOpenResponder {
3035    fn drop(&mut self) {
3036        self.control_handle.shutdown();
3037        // Safety: drops once, never accessed again
3038        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3039    }
3040}
3041
3042impl fdomain_client::fidl::Responder for CapabilityStoreConnectorOpenResponder {
3043    type ControlHandle = CapabilityStoreControlHandle;
3044
3045    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3046        &self.control_handle
3047    }
3048
3049    fn drop_without_shutdown(mut self) {
3050        // Safety: drops once, never accessed again due to mem::forget
3051        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3052        // Prevent Drop from running (which would shut down the channel)
3053        std::mem::forget(self);
3054    }
3055}
3056
3057impl CapabilityStoreConnectorOpenResponder {
3058    /// Sends a response to the FIDL transaction.
3059    ///
3060    /// Sets the channel to shutdown if an error occurs.
3061    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3062        let _result = self.send_raw(result);
3063        if _result.is_err() {
3064            self.control_handle.shutdown();
3065        }
3066        self.drop_without_shutdown();
3067        _result
3068    }
3069
3070    /// Similar to "send" but does not shutdown the channel if an error occurs.
3071    pub fn send_no_shutdown_on_err(
3072        self,
3073        mut result: Result<(), CapabilityStoreError>,
3074    ) -> Result<(), fidl::Error> {
3075        let _result = self.send_raw(result);
3076        self.drop_without_shutdown();
3077        _result
3078    }
3079
3080    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3081        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3082            fidl::encoding::EmptyStruct,
3083            CapabilityStoreError,
3084        >>(
3085            fidl::encoding::FlexibleResult::new(result),
3086            self.tx_id,
3087            0x537e69ab40563b9f,
3088            fidl::encoding::DynamicFlags::FLEXIBLE,
3089        )
3090    }
3091}
3092
3093#[must_use = "FIDL methods require a response to be sent"]
3094#[derive(Debug)]
3095pub struct CapabilityStoreDirConnectorCreateResponder {
3096    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3097    tx_id: u32,
3098}
3099
3100/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3101/// if the responder is dropped without sending a response, so that the client
3102/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3103impl std::ops::Drop for CapabilityStoreDirConnectorCreateResponder {
3104    fn drop(&mut self) {
3105        self.control_handle.shutdown();
3106        // Safety: drops once, never accessed again
3107        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3108    }
3109}
3110
3111impl fdomain_client::fidl::Responder for CapabilityStoreDirConnectorCreateResponder {
3112    type ControlHandle = CapabilityStoreControlHandle;
3113
3114    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3115        &self.control_handle
3116    }
3117
3118    fn drop_without_shutdown(mut self) {
3119        // Safety: drops once, never accessed again due to mem::forget
3120        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3121        // Prevent Drop from running (which would shut down the channel)
3122        std::mem::forget(self);
3123    }
3124}
3125
3126impl CapabilityStoreDirConnectorCreateResponder {
3127    /// Sends a response to the FIDL transaction.
3128    ///
3129    /// Sets the channel to shutdown if an error occurs.
3130    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3131        let _result = self.send_raw(result);
3132        if _result.is_err() {
3133            self.control_handle.shutdown();
3134        }
3135        self.drop_without_shutdown();
3136        _result
3137    }
3138
3139    /// Similar to "send" but does not shutdown the channel if an error occurs.
3140    pub fn send_no_shutdown_on_err(
3141        self,
3142        mut result: Result<(), CapabilityStoreError>,
3143    ) -> Result<(), fidl::Error> {
3144        let _result = self.send_raw(result);
3145        self.drop_without_shutdown();
3146        _result
3147    }
3148
3149    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3150        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3151            fidl::encoding::EmptyStruct,
3152            CapabilityStoreError,
3153        >>(
3154            fidl::encoding::FlexibleResult::new(result),
3155            self.tx_id,
3156            0x186138a11ccf19bb,
3157            fidl::encoding::DynamicFlags::FLEXIBLE,
3158        )
3159    }
3160}
3161
3162#[must_use = "FIDL methods require a response to be sent"]
3163#[derive(Debug)]
3164pub struct CapabilityStoreDirConnectorOpenResponder {
3165    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3166    tx_id: u32,
3167}
3168
3169/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3170/// if the responder is dropped without sending a response, so that the client
3171/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3172impl std::ops::Drop for CapabilityStoreDirConnectorOpenResponder {
3173    fn drop(&mut self) {
3174        self.control_handle.shutdown();
3175        // Safety: drops once, never accessed again
3176        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3177    }
3178}
3179
3180impl fdomain_client::fidl::Responder for CapabilityStoreDirConnectorOpenResponder {
3181    type ControlHandle = CapabilityStoreControlHandle;
3182
3183    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3184        &self.control_handle
3185    }
3186
3187    fn drop_without_shutdown(mut self) {
3188        // Safety: drops once, never accessed again due to mem::forget
3189        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3190        // Prevent Drop from running (which would shut down the channel)
3191        std::mem::forget(self);
3192    }
3193}
3194
3195impl CapabilityStoreDirConnectorOpenResponder {
3196    /// Sends a response to the FIDL transaction.
3197    ///
3198    /// Sets the channel to shutdown if an error occurs.
3199    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3200        let _result = self.send_raw(result);
3201        if _result.is_err() {
3202            self.control_handle.shutdown();
3203        }
3204        self.drop_without_shutdown();
3205        _result
3206    }
3207
3208    /// Similar to "send" but does not shutdown the channel if an error occurs.
3209    pub fn send_no_shutdown_on_err(
3210        self,
3211        mut result: Result<(), CapabilityStoreError>,
3212    ) -> Result<(), fidl::Error> {
3213        let _result = self.send_raw(result);
3214        self.drop_without_shutdown();
3215        _result
3216    }
3217
3218    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3219        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3220            fidl::encoding::EmptyStruct,
3221            CapabilityStoreError,
3222        >>(
3223            fidl::encoding::FlexibleResult::new(result),
3224            self.tx_id,
3225            0x5650d3d6a3a13901,
3226            fidl::encoding::DynamicFlags::FLEXIBLE,
3227        )
3228    }
3229}
3230
3231#[must_use = "FIDL methods require a response to be sent"]
3232#[derive(Debug)]
3233pub struct CapabilityStoreDictionaryCreateResponder {
3234    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3235    tx_id: u32,
3236}
3237
3238/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3239/// if the responder is dropped without sending a response, so that the client
3240/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3241impl std::ops::Drop for CapabilityStoreDictionaryCreateResponder {
3242    fn drop(&mut self) {
3243        self.control_handle.shutdown();
3244        // Safety: drops once, never accessed again
3245        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3246    }
3247}
3248
3249impl fdomain_client::fidl::Responder for CapabilityStoreDictionaryCreateResponder {
3250    type ControlHandle = CapabilityStoreControlHandle;
3251
3252    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3253        &self.control_handle
3254    }
3255
3256    fn drop_without_shutdown(mut self) {
3257        // Safety: drops once, never accessed again due to mem::forget
3258        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3259        // Prevent Drop from running (which would shut down the channel)
3260        std::mem::forget(self);
3261    }
3262}
3263
3264impl CapabilityStoreDictionaryCreateResponder {
3265    /// Sends a response to the FIDL transaction.
3266    ///
3267    /// Sets the channel to shutdown if an error occurs.
3268    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3269        let _result = self.send_raw(result);
3270        if _result.is_err() {
3271            self.control_handle.shutdown();
3272        }
3273        self.drop_without_shutdown();
3274        _result
3275    }
3276
3277    /// Similar to "send" but does not shutdown the channel if an error occurs.
3278    pub fn send_no_shutdown_on_err(
3279        self,
3280        mut result: Result<(), CapabilityStoreError>,
3281    ) -> Result<(), fidl::Error> {
3282        let _result = self.send_raw(result);
3283        self.drop_without_shutdown();
3284        _result
3285    }
3286
3287    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3288        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3289            fidl::encoding::EmptyStruct,
3290            CapabilityStoreError,
3291        >>(
3292            fidl::encoding::FlexibleResult::new(result),
3293            self.tx_id,
3294            0x6997c8dfc63de093,
3295            fidl::encoding::DynamicFlags::FLEXIBLE,
3296        )
3297    }
3298}
3299
3300#[must_use = "FIDL methods require a response to be sent"]
3301#[derive(Debug)]
3302pub struct CapabilityStoreDictionaryLegacyImportResponder {
3303    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3304    tx_id: u32,
3305}
3306
3307/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3308/// if the responder is dropped without sending a response, so that the client
3309/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3310impl std::ops::Drop for CapabilityStoreDictionaryLegacyImportResponder {
3311    fn drop(&mut self) {
3312        self.control_handle.shutdown();
3313        // Safety: drops once, never accessed again
3314        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3315    }
3316}
3317
3318impl fdomain_client::fidl::Responder for CapabilityStoreDictionaryLegacyImportResponder {
3319    type ControlHandle = CapabilityStoreControlHandle;
3320
3321    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3322        &self.control_handle
3323    }
3324
3325    fn drop_without_shutdown(mut self) {
3326        // Safety: drops once, never accessed again due to mem::forget
3327        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3328        // Prevent Drop from running (which would shut down the channel)
3329        std::mem::forget(self);
3330    }
3331}
3332
3333impl CapabilityStoreDictionaryLegacyImportResponder {
3334    /// Sends a response to the FIDL transaction.
3335    ///
3336    /// Sets the channel to shutdown if an error occurs.
3337    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3338        let _result = self.send_raw(result);
3339        if _result.is_err() {
3340            self.control_handle.shutdown();
3341        }
3342        self.drop_without_shutdown();
3343        _result
3344    }
3345
3346    /// Similar to "send" but does not shutdown the channel if an error occurs.
3347    pub fn send_no_shutdown_on_err(
3348        self,
3349        mut result: Result<(), CapabilityStoreError>,
3350    ) -> Result<(), fidl::Error> {
3351        let _result = self.send_raw(result);
3352        self.drop_without_shutdown();
3353        _result
3354    }
3355
3356    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3357        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3358            fidl::encoding::EmptyStruct,
3359            CapabilityStoreError,
3360        >>(
3361            fidl::encoding::FlexibleResult::new(result),
3362            self.tx_id,
3363            0x72fd686c37b6025f,
3364            fidl::encoding::DynamicFlags::FLEXIBLE,
3365        )
3366    }
3367}
3368
3369#[must_use = "FIDL methods require a response to be sent"]
3370#[derive(Debug)]
3371pub struct CapabilityStoreDictionaryLegacyExportResponder {
3372    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3373    tx_id: u32,
3374}
3375
3376/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3377/// if the responder is dropped without sending a response, so that the client
3378/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3379impl std::ops::Drop for CapabilityStoreDictionaryLegacyExportResponder {
3380    fn drop(&mut self) {
3381        self.control_handle.shutdown();
3382        // Safety: drops once, never accessed again
3383        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3384    }
3385}
3386
3387impl fdomain_client::fidl::Responder for CapabilityStoreDictionaryLegacyExportResponder {
3388    type ControlHandle = CapabilityStoreControlHandle;
3389
3390    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3391        &self.control_handle
3392    }
3393
3394    fn drop_without_shutdown(mut self) {
3395        // Safety: drops once, never accessed again due to mem::forget
3396        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3397        // Prevent Drop from running (which would shut down the channel)
3398        std::mem::forget(self);
3399    }
3400}
3401
3402impl CapabilityStoreDictionaryLegacyExportResponder {
3403    /// Sends a response to the FIDL transaction.
3404    ///
3405    /// Sets the channel to shutdown if an error occurs.
3406    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3407        let _result = self.send_raw(result);
3408        if _result.is_err() {
3409            self.control_handle.shutdown();
3410        }
3411        self.drop_without_shutdown();
3412        _result
3413    }
3414
3415    /// Similar to "send" but does not shutdown the channel if an error occurs.
3416    pub fn send_no_shutdown_on_err(
3417        self,
3418        mut result: Result<(), CapabilityStoreError>,
3419    ) -> Result<(), fidl::Error> {
3420        let _result = self.send_raw(result);
3421        self.drop_without_shutdown();
3422        _result
3423    }
3424
3425    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3426        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3427            fidl::encoding::EmptyStruct,
3428            CapabilityStoreError,
3429        >>(
3430            fidl::encoding::FlexibleResult::new(result),
3431            self.tx_id,
3432            0x407e15cc4bde5dcd,
3433            fidl::encoding::DynamicFlags::FLEXIBLE,
3434        )
3435    }
3436}
3437
3438#[must_use = "FIDL methods require a response to be sent"]
3439#[derive(Debug)]
3440pub struct CapabilityStoreDictionaryInsertResponder {
3441    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3442    tx_id: u32,
3443}
3444
3445/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3446/// if the responder is dropped without sending a response, so that the client
3447/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3448impl std::ops::Drop for CapabilityStoreDictionaryInsertResponder {
3449    fn drop(&mut self) {
3450        self.control_handle.shutdown();
3451        // Safety: drops once, never accessed again
3452        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3453    }
3454}
3455
3456impl fdomain_client::fidl::Responder for CapabilityStoreDictionaryInsertResponder {
3457    type ControlHandle = CapabilityStoreControlHandle;
3458
3459    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3460        &self.control_handle
3461    }
3462
3463    fn drop_without_shutdown(mut self) {
3464        // Safety: drops once, never accessed again due to mem::forget
3465        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3466        // Prevent Drop from running (which would shut down the channel)
3467        std::mem::forget(self);
3468    }
3469}
3470
3471impl CapabilityStoreDictionaryInsertResponder {
3472    /// Sends a response to the FIDL transaction.
3473    ///
3474    /// Sets the channel to shutdown if an error occurs.
3475    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3476        let _result = self.send_raw(result);
3477        if _result.is_err() {
3478            self.control_handle.shutdown();
3479        }
3480        self.drop_without_shutdown();
3481        _result
3482    }
3483
3484    /// Similar to "send" but does not shutdown the channel if an error occurs.
3485    pub fn send_no_shutdown_on_err(
3486        self,
3487        mut result: Result<(), CapabilityStoreError>,
3488    ) -> Result<(), fidl::Error> {
3489        let _result = self.send_raw(result);
3490        self.drop_without_shutdown();
3491        _result
3492    }
3493
3494    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3495        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3496            fidl::encoding::EmptyStruct,
3497            CapabilityStoreError,
3498        >>(
3499            fidl::encoding::FlexibleResult::new(result),
3500            self.tx_id,
3501            0x7702183689d44c27,
3502            fidl::encoding::DynamicFlags::FLEXIBLE,
3503        )
3504    }
3505}
3506
3507#[must_use = "FIDL methods require a response to be sent"]
3508#[derive(Debug)]
3509pub struct CapabilityStoreDictionaryGetResponder {
3510    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3511    tx_id: u32,
3512}
3513
3514/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3515/// if the responder is dropped without sending a response, so that the client
3516/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3517impl std::ops::Drop for CapabilityStoreDictionaryGetResponder {
3518    fn drop(&mut self) {
3519        self.control_handle.shutdown();
3520        // Safety: drops once, never accessed again
3521        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3522    }
3523}
3524
3525impl fdomain_client::fidl::Responder for CapabilityStoreDictionaryGetResponder {
3526    type ControlHandle = CapabilityStoreControlHandle;
3527
3528    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3529        &self.control_handle
3530    }
3531
3532    fn drop_without_shutdown(mut self) {
3533        // Safety: drops once, never accessed again due to mem::forget
3534        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3535        // Prevent Drop from running (which would shut down the channel)
3536        std::mem::forget(self);
3537    }
3538}
3539
3540impl CapabilityStoreDictionaryGetResponder {
3541    /// Sends a response to the FIDL transaction.
3542    ///
3543    /// Sets the channel to shutdown if an error occurs.
3544    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3545        let _result = self.send_raw(result);
3546        if _result.is_err() {
3547            self.control_handle.shutdown();
3548        }
3549        self.drop_without_shutdown();
3550        _result
3551    }
3552
3553    /// Similar to "send" but does not shutdown the channel if an error occurs.
3554    pub fn send_no_shutdown_on_err(
3555        self,
3556        mut result: Result<(), CapabilityStoreError>,
3557    ) -> Result<(), fidl::Error> {
3558        let _result = self.send_raw(result);
3559        self.drop_without_shutdown();
3560        _result
3561    }
3562
3563    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3564        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3565            fidl::encoding::EmptyStruct,
3566            CapabilityStoreError,
3567        >>(
3568            fidl::encoding::FlexibleResult::new(result),
3569            self.tx_id,
3570            0x4d9e27538284add2,
3571            fidl::encoding::DynamicFlags::FLEXIBLE,
3572        )
3573    }
3574}
3575
3576#[must_use = "FIDL methods require a response to be sent"]
3577#[derive(Debug)]
3578pub struct CapabilityStoreDictionaryRemoveResponder {
3579    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3580    tx_id: u32,
3581}
3582
3583/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3584/// if the responder is dropped without sending a response, so that the client
3585/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3586impl std::ops::Drop for CapabilityStoreDictionaryRemoveResponder {
3587    fn drop(&mut self) {
3588        self.control_handle.shutdown();
3589        // Safety: drops once, never accessed again
3590        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3591    }
3592}
3593
3594impl fdomain_client::fidl::Responder for CapabilityStoreDictionaryRemoveResponder {
3595    type ControlHandle = CapabilityStoreControlHandle;
3596
3597    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3598        &self.control_handle
3599    }
3600
3601    fn drop_without_shutdown(mut self) {
3602        // Safety: drops once, never accessed again due to mem::forget
3603        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3604        // Prevent Drop from running (which would shut down the channel)
3605        std::mem::forget(self);
3606    }
3607}
3608
3609impl CapabilityStoreDictionaryRemoveResponder {
3610    /// Sends a response to the FIDL transaction.
3611    ///
3612    /// Sets the channel to shutdown if an error occurs.
3613    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3614        let _result = self.send_raw(result);
3615        if _result.is_err() {
3616            self.control_handle.shutdown();
3617        }
3618        self.drop_without_shutdown();
3619        _result
3620    }
3621
3622    /// Similar to "send" but does not shutdown the channel if an error occurs.
3623    pub fn send_no_shutdown_on_err(
3624        self,
3625        mut result: Result<(), CapabilityStoreError>,
3626    ) -> Result<(), fidl::Error> {
3627        let _result = self.send_raw(result);
3628        self.drop_without_shutdown();
3629        _result
3630    }
3631
3632    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3633        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3634            fidl::encoding::EmptyStruct,
3635            CapabilityStoreError,
3636        >>(
3637            fidl::encoding::FlexibleResult::new(result),
3638            self.tx_id,
3639            0x4c5c025ab05d4f3,
3640            fidl::encoding::DynamicFlags::FLEXIBLE,
3641        )
3642    }
3643}
3644
3645#[must_use = "FIDL methods require a response to be sent"]
3646#[derive(Debug)]
3647pub struct CapabilityStoreDictionaryCopyResponder {
3648    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3649    tx_id: u32,
3650}
3651
3652/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3653/// if the responder is dropped without sending a response, so that the client
3654/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3655impl std::ops::Drop for CapabilityStoreDictionaryCopyResponder {
3656    fn drop(&mut self) {
3657        self.control_handle.shutdown();
3658        // Safety: drops once, never accessed again
3659        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3660    }
3661}
3662
3663impl fdomain_client::fidl::Responder for CapabilityStoreDictionaryCopyResponder {
3664    type ControlHandle = CapabilityStoreControlHandle;
3665
3666    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3667        &self.control_handle
3668    }
3669
3670    fn drop_without_shutdown(mut self) {
3671        // Safety: drops once, never accessed again due to mem::forget
3672        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3673        // Prevent Drop from running (which would shut down the channel)
3674        std::mem::forget(self);
3675    }
3676}
3677
3678impl CapabilityStoreDictionaryCopyResponder {
3679    /// Sends a response to the FIDL transaction.
3680    ///
3681    /// Sets the channel to shutdown if an error occurs.
3682    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3683        let _result = self.send_raw(result);
3684        if _result.is_err() {
3685            self.control_handle.shutdown();
3686        }
3687        self.drop_without_shutdown();
3688        _result
3689    }
3690
3691    /// Similar to "send" but does not shutdown the channel if an error occurs.
3692    pub fn send_no_shutdown_on_err(
3693        self,
3694        mut result: Result<(), CapabilityStoreError>,
3695    ) -> Result<(), fidl::Error> {
3696        let _result = self.send_raw(result);
3697        self.drop_without_shutdown();
3698        _result
3699    }
3700
3701    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3702        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3703            fidl::encoding::EmptyStruct,
3704            CapabilityStoreError,
3705        >>(
3706            fidl::encoding::FlexibleResult::new(result),
3707            self.tx_id,
3708            0x3733ecdf4ea1b44f,
3709            fidl::encoding::DynamicFlags::FLEXIBLE,
3710        )
3711    }
3712}
3713
3714#[must_use = "FIDL methods require a response to be sent"]
3715#[derive(Debug)]
3716pub struct CapabilityStoreDictionaryKeysResponder {
3717    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3718    tx_id: u32,
3719}
3720
3721/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3722/// if the responder is dropped without sending a response, so that the client
3723/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3724impl std::ops::Drop for CapabilityStoreDictionaryKeysResponder {
3725    fn drop(&mut self) {
3726        self.control_handle.shutdown();
3727        // Safety: drops once, never accessed again
3728        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3729    }
3730}
3731
3732impl fdomain_client::fidl::Responder for CapabilityStoreDictionaryKeysResponder {
3733    type ControlHandle = CapabilityStoreControlHandle;
3734
3735    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3736        &self.control_handle
3737    }
3738
3739    fn drop_without_shutdown(mut self) {
3740        // Safety: drops once, never accessed again due to mem::forget
3741        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3742        // Prevent Drop from running (which would shut down the channel)
3743        std::mem::forget(self);
3744    }
3745}
3746
3747impl CapabilityStoreDictionaryKeysResponder {
3748    /// Sends a response to the FIDL transaction.
3749    ///
3750    /// Sets the channel to shutdown if an error occurs.
3751    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3752        let _result = self.send_raw(result);
3753        if _result.is_err() {
3754            self.control_handle.shutdown();
3755        }
3756        self.drop_without_shutdown();
3757        _result
3758    }
3759
3760    /// Similar to "send" but does not shutdown the channel if an error occurs.
3761    pub fn send_no_shutdown_on_err(
3762        self,
3763        mut result: Result<(), CapabilityStoreError>,
3764    ) -> Result<(), fidl::Error> {
3765        let _result = self.send_raw(result);
3766        self.drop_without_shutdown();
3767        _result
3768    }
3769
3770    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3771        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3772            fidl::encoding::EmptyStruct,
3773            CapabilityStoreError,
3774        >>(
3775            fidl::encoding::FlexibleResult::new(result),
3776            self.tx_id,
3777            0x84b05577ceaec9e,
3778            fidl::encoding::DynamicFlags::FLEXIBLE,
3779        )
3780    }
3781}
3782
3783#[must_use = "FIDL methods require a response to be sent"]
3784#[derive(Debug)]
3785pub struct CapabilityStoreDictionaryEnumerateResponder {
3786    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3787    tx_id: u32,
3788}
3789
3790/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3791/// if the responder is dropped without sending a response, so that the client
3792/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3793impl std::ops::Drop for CapabilityStoreDictionaryEnumerateResponder {
3794    fn drop(&mut self) {
3795        self.control_handle.shutdown();
3796        // Safety: drops once, never accessed again
3797        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3798    }
3799}
3800
3801impl fdomain_client::fidl::Responder for CapabilityStoreDictionaryEnumerateResponder {
3802    type ControlHandle = CapabilityStoreControlHandle;
3803
3804    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3805        &self.control_handle
3806    }
3807
3808    fn drop_without_shutdown(mut self) {
3809        // Safety: drops once, never accessed again due to mem::forget
3810        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3811        // Prevent Drop from running (which would shut down the channel)
3812        std::mem::forget(self);
3813    }
3814}
3815
3816impl CapabilityStoreDictionaryEnumerateResponder {
3817    /// Sends a response to the FIDL transaction.
3818    ///
3819    /// Sets the channel to shutdown if an error occurs.
3820    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3821        let _result = self.send_raw(result);
3822        if _result.is_err() {
3823            self.control_handle.shutdown();
3824        }
3825        self.drop_without_shutdown();
3826        _result
3827    }
3828
3829    /// Similar to "send" but does not shutdown the channel if an error occurs.
3830    pub fn send_no_shutdown_on_err(
3831        self,
3832        mut result: Result<(), CapabilityStoreError>,
3833    ) -> Result<(), fidl::Error> {
3834        let _result = self.send_raw(result);
3835        self.drop_without_shutdown();
3836        _result
3837    }
3838
3839    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3840        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3841            fidl::encoding::EmptyStruct,
3842            CapabilityStoreError,
3843        >>(
3844            fidl::encoding::FlexibleResult::new(result),
3845            self.tx_id,
3846            0xd6279b6ced04641,
3847            fidl::encoding::DynamicFlags::FLEXIBLE,
3848        )
3849    }
3850}
3851
3852#[must_use = "FIDL methods require a response to be sent"]
3853#[derive(Debug)]
3854pub struct CapabilityStoreDictionaryDrainResponder {
3855    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3856    tx_id: u32,
3857}
3858
3859/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3860/// if the responder is dropped without sending a response, so that the client
3861/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3862impl std::ops::Drop for CapabilityStoreDictionaryDrainResponder {
3863    fn drop(&mut self) {
3864        self.control_handle.shutdown();
3865        // Safety: drops once, never accessed again
3866        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3867    }
3868}
3869
3870impl fdomain_client::fidl::Responder for CapabilityStoreDictionaryDrainResponder {
3871    type ControlHandle = CapabilityStoreControlHandle;
3872
3873    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3874        &self.control_handle
3875    }
3876
3877    fn drop_without_shutdown(mut self) {
3878        // Safety: drops once, never accessed again due to mem::forget
3879        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3880        // Prevent Drop from running (which would shut down the channel)
3881        std::mem::forget(self);
3882    }
3883}
3884
3885impl CapabilityStoreDictionaryDrainResponder {
3886    /// Sends a response to the FIDL transaction.
3887    ///
3888    /// Sets the channel to shutdown if an error occurs.
3889    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3890        let _result = self.send_raw(result);
3891        if _result.is_err() {
3892            self.control_handle.shutdown();
3893        }
3894        self.drop_without_shutdown();
3895        _result
3896    }
3897
3898    /// Similar to "send" but does not shutdown the channel if an error occurs.
3899    pub fn send_no_shutdown_on_err(
3900        self,
3901        mut result: Result<(), CapabilityStoreError>,
3902    ) -> Result<(), fidl::Error> {
3903        let _result = self.send_raw(result);
3904        self.drop_without_shutdown();
3905        _result
3906    }
3907
3908    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3909        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3910            fidl::encoding::EmptyStruct,
3911            CapabilityStoreError,
3912        >>(
3913            fidl::encoding::FlexibleResult::new(result),
3914            self.tx_id,
3915            0x28a3a3f84d928cd8,
3916            fidl::encoding::DynamicFlags::FLEXIBLE,
3917        )
3918    }
3919}
3920
3921#[must_use = "FIDL methods require a response to be sent"]
3922#[derive(Debug)]
3923pub struct CapabilityStoreCreateServiceAggregateResponder {
3924    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3925    tx_id: u32,
3926}
3927
3928/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3929/// if the responder is dropped without sending a response, so that the client
3930/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3931impl std::ops::Drop for CapabilityStoreCreateServiceAggregateResponder {
3932    fn drop(&mut self) {
3933        self.control_handle.shutdown();
3934        // Safety: drops once, never accessed again
3935        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3936    }
3937}
3938
3939impl fdomain_client::fidl::Responder for CapabilityStoreCreateServiceAggregateResponder {
3940    type ControlHandle = CapabilityStoreControlHandle;
3941
3942    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3943        &self.control_handle
3944    }
3945
3946    fn drop_without_shutdown(mut self) {
3947        // Safety: drops once, never accessed again due to mem::forget
3948        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3949        // Prevent Drop from running (which would shut down the channel)
3950        std::mem::forget(self);
3951    }
3952}
3953
3954impl CapabilityStoreCreateServiceAggregateResponder {
3955    /// Sends a response to the FIDL transaction.
3956    ///
3957    /// Sets the channel to shutdown if an error occurs.
3958    pub fn send(
3959        self,
3960        mut result: Result<DirConnector, CapabilityStoreError>,
3961    ) -> Result<(), fidl::Error> {
3962        let _result = self.send_raw(result);
3963        if _result.is_err() {
3964            self.control_handle.shutdown();
3965        }
3966        self.drop_without_shutdown();
3967        _result
3968    }
3969
3970    /// Similar to "send" but does not shutdown the channel if an error occurs.
3971    pub fn send_no_shutdown_on_err(
3972        self,
3973        mut result: Result<DirConnector, CapabilityStoreError>,
3974    ) -> Result<(), fidl::Error> {
3975        let _result = self.send_raw(result);
3976        self.drop_without_shutdown();
3977        _result
3978    }
3979
3980    fn send_raw(
3981        &self,
3982        mut result: Result<DirConnector, CapabilityStoreError>,
3983    ) -> Result<(), fidl::Error> {
3984        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3985            CapabilityStoreCreateServiceAggregateResponse,
3986            CapabilityStoreError,
3987        >>(
3988            fidl::encoding::FlexibleResult::new(
3989                result
3990                    .as_mut()
3991                    .map_err(|e| *e)
3992                    .map(|aggregate_dir_connector| (aggregate_dir_connector,)),
3993            ),
3994            self.tx_id,
3995            0x4584116c8085885a,
3996            fidl::encoding::DynamicFlags::FLEXIBLE,
3997        )
3998    }
3999}
4000
4001#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4002pub struct ConnectorRouterMarker;
4003
4004impl fdomain_client::fidl::ProtocolMarker for ConnectorRouterMarker {
4005    type Proxy = ConnectorRouterProxy;
4006    type RequestStream = ConnectorRouterRequestStream;
4007
4008    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.ConnectorRouter";
4009}
4010impl fdomain_client::fidl::DiscoverableProtocolMarker for ConnectorRouterMarker {}
4011pub type ConnectorRouterRouteResult = Result<ConnectorRouterRouteResponse, RouterError>;
4012
4013pub trait ConnectorRouterProxyInterface: Send + Sync {
4014    type RouteResponseFut: std::future::Future<Output = Result<ConnectorRouterRouteResult, fidl::Error>>
4015        + Send;
4016    fn r#route(&self, payload: RouteRequest) -> Self::RouteResponseFut;
4017}
4018
4019#[derive(Debug, Clone)]
4020pub struct ConnectorRouterProxy {
4021    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
4022}
4023
4024impl fdomain_client::fidl::Proxy for ConnectorRouterProxy {
4025    type Protocol = ConnectorRouterMarker;
4026
4027    fn from_channel(inner: fdomain_client::Channel) -> Self {
4028        Self::new(inner)
4029    }
4030
4031    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
4032        self.client.into_channel().map_err(|client| Self { client })
4033    }
4034
4035    fn as_channel(&self) -> &fdomain_client::Channel {
4036        self.client.as_channel()
4037    }
4038}
4039
4040impl ConnectorRouterProxy {
4041    /// Create a new Proxy for fuchsia.component.sandbox/ConnectorRouter.
4042    pub fn new(channel: fdomain_client::Channel) -> Self {
4043        let protocol_name =
4044            <ConnectorRouterMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
4045        Self { client: fidl::client::Client::new(channel, protocol_name) }
4046    }
4047
4048    /// Get a Stream of events from the remote end of the protocol.
4049    ///
4050    /// # Panics
4051    ///
4052    /// Panics if the event stream was already taken.
4053    pub fn take_event_stream(&self) -> ConnectorRouterEventStream {
4054        ConnectorRouterEventStream { event_receiver: self.client.take_event_receiver() }
4055    }
4056
4057    pub fn r#route(
4058        &self,
4059        mut payload: RouteRequest,
4060    ) -> fidl::client::QueryResponseFut<
4061        ConnectorRouterRouteResult,
4062        fdomain_client::fidl::FDomainResourceDialect,
4063    > {
4064        ConnectorRouterProxyInterface::r#route(self, payload)
4065    }
4066}
4067
4068impl ConnectorRouterProxyInterface for ConnectorRouterProxy {
4069    type RouteResponseFut = fidl::client::QueryResponseFut<
4070        ConnectorRouterRouteResult,
4071        fdomain_client::fidl::FDomainResourceDialect,
4072    >;
4073    fn r#route(&self, mut payload: RouteRequest) -> Self::RouteResponseFut {
4074        fn _decode(
4075            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4076        ) -> Result<ConnectorRouterRouteResult, fidl::Error> {
4077            let _response = fidl::client::decode_transaction_body::<
4078                fidl::encoding::FlexibleResultType<ConnectorRouterRouteResponse, RouterError>,
4079                fdomain_client::fidl::FDomainResourceDialect,
4080                0x74dbb8bc13730766,
4081            >(_buf?)?
4082            .into_result_fdomain::<ConnectorRouterMarker>("route")?;
4083            Ok(_response.map(|x| x))
4084        }
4085        self.client.send_query_and_decode::<RouteRequest, ConnectorRouterRouteResult>(
4086            &mut payload,
4087            0x74dbb8bc13730766,
4088            fidl::encoding::DynamicFlags::FLEXIBLE,
4089            _decode,
4090        )
4091    }
4092}
4093
4094pub struct ConnectorRouterEventStream {
4095    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
4096}
4097
4098impl std::marker::Unpin for ConnectorRouterEventStream {}
4099
4100impl futures::stream::FusedStream for ConnectorRouterEventStream {
4101    fn is_terminated(&self) -> bool {
4102        self.event_receiver.is_terminated()
4103    }
4104}
4105
4106impl futures::Stream for ConnectorRouterEventStream {
4107    type Item = Result<ConnectorRouterEvent, fidl::Error>;
4108
4109    fn poll_next(
4110        mut self: std::pin::Pin<&mut Self>,
4111        cx: &mut std::task::Context<'_>,
4112    ) -> std::task::Poll<Option<Self::Item>> {
4113        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4114            &mut self.event_receiver,
4115            cx
4116        )?) {
4117            Some(buf) => std::task::Poll::Ready(Some(ConnectorRouterEvent::decode(buf))),
4118            None => std::task::Poll::Ready(None),
4119        }
4120    }
4121}
4122
4123#[derive(Debug)]
4124pub enum ConnectorRouterEvent {
4125    #[non_exhaustive]
4126    _UnknownEvent {
4127        /// Ordinal of the event that was sent.
4128        ordinal: u64,
4129    },
4130}
4131
4132impl ConnectorRouterEvent {
4133    /// Decodes a message buffer as a [`ConnectorRouterEvent`].
4134    fn decode(
4135        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4136    ) -> Result<ConnectorRouterEvent, fidl::Error> {
4137        let (bytes, _handles) = buf.split_mut();
4138        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4139        debug_assert_eq!(tx_header.tx_id, 0);
4140        match tx_header.ordinal {
4141            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4142                Ok(ConnectorRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
4143            }
4144            _ => Err(fidl::Error::UnknownOrdinal {
4145                ordinal: tx_header.ordinal,
4146                protocol_name:
4147                    <ConnectorRouterMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
4148            }),
4149        }
4150    }
4151}
4152
4153/// A Stream of incoming requests for fuchsia.component.sandbox/ConnectorRouter.
4154pub struct ConnectorRouterRequestStream {
4155    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
4156    is_terminated: bool,
4157}
4158
4159impl std::marker::Unpin for ConnectorRouterRequestStream {}
4160
4161impl futures::stream::FusedStream for ConnectorRouterRequestStream {
4162    fn is_terminated(&self) -> bool {
4163        self.is_terminated
4164    }
4165}
4166
4167impl fdomain_client::fidl::RequestStream for ConnectorRouterRequestStream {
4168    type Protocol = ConnectorRouterMarker;
4169    type ControlHandle = ConnectorRouterControlHandle;
4170
4171    fn from_channel(channel: fdomain_client::Channel) -> Self {
4172        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4173    }
4174
4175    fn control_handle(&self) -> Self::ControlHandle {
4176        ConnectorRouterControlHandle { inner: self.inner.clone() }
4177    }
4178
4179    fn into_inner(
4180        self,
4181    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
4182    {
4183        (self.inner, self.is_terminated)
4184    }
4185
4186    fn from_inner(
4187        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
4188        is_terminated: bool,
4189    ) -> Self {
4190        Self { inner, is_terminated }
4191    }
4192}
4193
4194impl futures::Stream for ConnectorRouterRequestStream {
4195    type Item = Result<ConnectorRouterRequest, fidl::Error>;
4196
4197    fn poll_next(
4198        mut self: std::pin::Pin<&mut Self>,
4199        cx: &mut std::task::Context<'_>,
4200    ) -> std::task::Poll<Option<Self::Item>> {
4201        let this = &mut *self;
4202        if this.inner.check_shutdown(cx) {
4203            this.is_terminated = true;
4204            return std::task::Poll::Ready(None);
4205        }
4206        if this.is_terminated {
4207            panic!("polled ConnectorRouterRequestStream after completion");
4208        }
4209        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
4210            |bytes, handles| {
4211                match this.inner.channel().read_etc(cx, bytes, handles) {
4212                    std::task::Poll::Ready(Ok(())) => {}
4213                    std::task::Poll::Pending => return std::task::Poll::Pending,
4214                    std::task::Poll::Ready(Err(None)) => {
4215                        this.is_terminated = true;
4216                        return std::task::Poll::Ready(None);
4217                    }
4218                    std::task::Poll::Ready(Err(Some(e))) => {
4219                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4220                            e.into(),
4221                        ))));
4222                    }
4223                }
4224
4225                // A message has been received from the channel
4226                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4227
4228                std::task::Poll::Ready(Some(match header.ordinal {
4229                0x74dbb8bc13730766 => {
4230                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4231                    let mut req = fidl::new_empty!(RouteRequest, fdomain_client::fidl::FDomainResourceDialect);
4232                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<RouteRequest>(&header, _body_bytes, handles, &mut req)?;
4233                    let control_handle = ConnectorRouterControlHandle {
4234                        inner: this.inner.clone(),
4235                    };
4236                    Ok(ConnectorRouterRequest::Route {payload: req,
4237                        responder: ConnectorRouterRouteResponder {
4238                            control_handle: std::mem::ManuallyDrop::new(control_handle),
4239                            tx_id: header.tx_id,
4240                        },
4241                    })
4242                }
4243                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4244                    Ok(ConnectorRouterRequest::_UnknownMethod {
4245                        ordinal: header.ordinal,
4246                        control_handle: ConnectorRouterControlHandle { inner: this.inner.clone() },
4247                        method_type: fidl::MethodType::OneWay,
4248                    })
4249                }
4250                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4251                    this.inner.send_framework_err(
4252                        fidl::encoding::FrameworkErr::UnknownMethod,
4253                        header.tx_id,
4254                        header.ordinal,
4255                        header.dynamic_flags(),
4256                        (bytes, handles),
4257                    )?;
4258                    Ok(ConnectorRouterRequest::_UnknownMethod {
4259                        ordinal: header.ordinal,
4260                        control_handle: ConnectorRouterControlHandle { inner: this.inner.clone() },
4261                        method_type: fidl::MethodType::TwoWay,
4262                    })
4263                }
4264                _ => Err(fidl::Error::UnknownOrdinal {
4265                    ordinal: header.ordinal,
4266                    protocol_name: <ConnectorRouterMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
4267                }),
4268            }))
4269            },
4270        )
4271    }
4272}
4273
4274#[derive(Debug)]
4275pub enum ConnectorRouterRequest {
4276    Route {
4277        payload: RouteRequest,
4278        responder: ConnectorRouterRouteResponder,
4279    },
4280    /// An interaction was received which does not match any known method.
4281    #[non_exhaustive]
4282    _UnknownMethod {
4283        /// Ordinal of the method that was called.
4284        ordinal: u64,
4285        control_handle: ConnectorRouterControlHandle,
4286        method_type: fidl::MethodType,
4287    },
4288}
4289
4290impl ConnectorRouterRequest {
4291    #[allow(irrefutable_let_patterns)]
4292    pub fn into_route(self) -> Option<(RouteRequest, ConnectorRouterRouteResponder)> {
4293        if let ConnectorRouterRequest::Route { payload, responder } = self {
4294            Some((payload, responder))
4295        } else {
4296            None
4297        }
4298    }
4299
4300    /// Name of the method defined in FIDL
4301    pub fn method_name(&self) -> &'static str {
4302        match *self {
4303            ConnectorRouterRequest::Route { .. } => "route",
4304            ConnectorRouterRequest::_UnknownMethod {
4305                method_type: fidl::MethodType::OneWay,
4306                ..
4307            } => "unknown one-way method",
4308            ConnectorRouterRequest::_UnknownMethod {
4309                method_type: fidl::MethodType::TwoWay,
4310                ..
4311            } => "unknown two-way method",
4312        }
4313    }
4314}
4315
4316#[derive(Debug, Clone)]
4317pub struct ConnectorRouterControlHandle {
4318    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
4319}
4320
4321impl fdomain_client::fidl::ControlHandle for ConnectorRouterControlHandle {
4322    fn shutdown(&self) {
4323        self.inner.shutdown()
4324    }
4325
4326    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
4327        self.inner.shutdown_with_epitaph(status)
4328    }
4329
4330    fn is_closed(&self) -> bool {
4331        self.inner.channel().is_closed()
4332    }
4333    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
4334        self.inner.channel().on_closed()
4335    }
4336}
4337
4338impl ConnectorRouterControlHandle {}
4339
4340#[must_use = "FIDL methods require a response to be sent"]
4341#[derive(Debug)]
4342pub struct ConnectorRouterRouteResponder {
4343    control_handle: std::mem::ManuallyDrop<ConnectorRouterControlHandle>,
4344    tx_id: u32,
4345}
4346
4347/// Set the the channel to be shutdown (see [`ConnectorRouterControlHandle::shutdown`])
4348/// if the responder is dropped without sending a response, so that the client
4349/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4350impl std::ops::Drop for ConnectorRouterRouteResponder {
4351    fn drop(&mut self) {
4352        self.control_handle.shutdown();
4353        // Safety: drops once, never accessed again
4354        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4355    }
4356}
4357
4358impl fdomain_client::fidl::Responder for ConnectorRouterRouteResponder {
4359    type ControlHandle = ConnectorRouterControlHandle;
4360
4361    fn control_handle(&self) -> &ConnectorRouterControlHandle {
4362        &self.control_handle
4363    }
4364
4365    fn drop_without_shutdown(mut self) {
4366        // Safety: drops once, never accessed again due to mem::forget
4367        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4368        // Prevent Drop from running (which would shut down the channel)
4369        std::mem::forget(self);
4370    }
4371}
4372
4373impl ConnectorRouterRouteResponder {
4374    /// Sends a response to the FIDL transaction.
4375    ///
4376    /// Sets the channel to shutdown if an error occurs.
4377    pub fn send(
4378        self,
4379        mut result: Result<ConnectorRouterRouteResponse, RouterError>,
4380    ) -> Result<(), fidl::Error> {
4381        let _result = self.send_raw(result);
4382        if _result.is_err() {
4383            self.control_handle.shutdown();
4384        }
4385        self.drop_without_shutdown();
4386        _result
4387    }
4388
4389    /// Similar to "send" but does not shutdown the channel if an error occurs.
4390    pub fn send_no_shutdown_on_err(
4391        self,
4392        mut result: Result<ConnectorRouterRouteResponse, RouterError>,
4393    ) -> Result<(), fidl::Error> {
4394        let _result = self.send_raw(result);
4395        self.drop_without_shutdown();
4396        _result
4397    }
4398
4399    fn send_raw(
4400        &self,
4401        mut result: Result<ConnectorRouterRouteResponse, RouterError>,
4402    ) -> Result<(), fidl::Error> {
4403        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4404            ConnectorRouterRouteResponse,
4405            RouterError,
4406        >>(
4407            fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
4408            self.tx_id,
4409            0x74dbb8bc13730766,
4410            fidl::encoding::DynamicFlags::FLEXIBLE,
4411        )
4412    }
4413}
4414
4415#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4416pub struct DataRouterMarker;
4417
4418impl fdomain_client::fidl::ProtocolMarker for DataRouterMarker {
4419    type Proxy = DataRouterProxy;
4420    type RequestStream = DataRouterRequestStream;
4421
4422    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.DataRouter";
4423}
4424impl fdomain_client::fidl::DiscoverableProtocolMarker for DataRouterMarker {}
4425pub type DataRouterRouteResult = Result<DataRouterRouteResponse, RouterError>;
4426
4427pub trait DataRouterProxyInterface: Send + Sync {
4428    type RouteResponseFut: std::future::Future<Output = Result<DataRouterRouteResult, fidl::Error>>
4429        + Send;
4430    fn r#route(&self, payload: RouteRequest) -> Self::RouteResponseFut;
4431}
4432
4433#[derive(Debug, Clone)]
4434pub struct DataRouterProxy {
4435    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
4436}
4437
4438impl fdomain_client::fidl::Proxy for DataRouterProxy {
4439    type Protocol = DataRouterMarker;
4440
4441    fn from_channel(inner: fdomain_client::Channel) -> Self {
4442        Self::new(inner)
4443    }
4444
4445    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
4446        self.client.into_channel().map_err(|client| Self { client })
4447    }
4448
4449    fn as_channel(&self) -> &fdomain_client::Channel {
4450        self.client.as_channel()
4451    }
4452}
4453
4454impl DataRouterProxy {
4455    /// Create a new Proxy for fuchsia.component.sandbox/DataRouter.
4456    pub fn new(channel: fdomain_client::Channel) -> Self {
4457        let protocol_name = <DataRouterMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
4458        Self { client: fidl::client::Client::new(channel, protocol_name) }
4459    }
4460
4461    /// Get a Stream of events from the remote end of the protocol.
4462    ///
4463    /// # Panics
4464    ///
4465    /// Panics if the event stream was already taken.
4466    pub fn take_event_stream(&self) -> DataRouterEventStream {
4467        DataRouterEventStream { event_receiver: self.client.take_event_receiver() }
4468    }
4469
4470    pub fn r#route(
4471        &self,
4472        mut payload: RouteRequest,
4473    ) -> fidl::client::QueryResponseFut<
4474        DataRouterRouteResult,
4475        fdomain_client::fidl::FDomainResourceDialect,
4476    > {
4477        DataRouterProxyInterface::r#route(self, payload)
4478    }
4479}
4480
4481impl DataRouterProxyInterface for DataRouterProxy {
4482    type RouteResponseFut = fidl::client::QueryResponseFut<
4483        DataRouterRouteResult,
4484        fdomain_client::fidl::FDomainResourceDialect,
4485    >;
4486    fn r#route(&self, mut payload: RouteRequest) -> Self::RouteResponseFut {
4487        fn _decode(
4488            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4489        ) -> Result<DataRouterRouteResult, fidl::Error> {
4490            let _response = fidl::client::decode_transaction_body::<
4491                fidl::encoding::FlexibleResultType<DataRouterRouteResponse, RouterError>,
4492                fdomain_client::fidl::FDomainResourceDialect,
4493                0x2e87dc44dfc53804,
4494            >(_buf?)?
4495            .into_result_fdomain::<DataRouterMarker>("route")?;
4496            Ok(_response.map(|x| x))
4497        }
4498        self.client.send_query_and_decode::<RouteRequest, DataRouterRouteResult>(
4499            &mut payload,
4500            0x2e87dc44dfc53804,
4501            fidl::encoding::DynamicFlags::FLEXIBLE,
4502            _decode,
4503        )
4504    }
4505}
4506
4507pub struct DataRouterEventStream {
4508    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
4509}
4510
4511impl std::marker::Unpin for DataRouterEventStream {}
4512
4513impl futures::stream::FusedStream for DataRouterEventStream {
4514    fn is_terminated(&self) -> bool {
4515        self.event_receiver.is_terminated()
4516    }
4517}
4518
4519impl futures::Stream for DataRouterEventStream {
4520    type Item = Result<DataRouterEvent, fidl::Error>;
4521
4522    fn poll_next(
4523        mut self: std::pin::Pin<&mut Self>,
4524        cx: &mut std::task::Context<'_>,
4525    ) -> std::task::Poll<Option<Self::Item>> {
4526        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4527            &mut self.event_receiver,
4528            cx
4529        )?) {
4530            Some(buf) => std::task::Poll::Ready(Some(DataRouterEvent::decode(buf))),
4531            None => std::task::Poll::Ready(None),
4532        }
4533    }
4534}
4535
4536#[derive(Debug)]
4537pub enum DataRouterEvent {
4538    #[non_exhaustive]
4539    _UnknownEvent {
4540        /// Ordinal of the event that was sent.
4541        ordinal: u64,
4542    },
4543}
4544
4545impl DataRouterEvent {
4546    /// Decodes a message buffer as a [`DataRouterEvent`].
4547    fn decode(
4548        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4549    ) -> Result<DataRouterEvent, fidl::Error> {
4550        let (bytes, _handles) = buf.split_mut();
4551        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4552        debug_assert_eq!(tx_header.tx_id, 0);
4553        match tx_header.ordinal {
4554            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4555                Ok(DataRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
4556            }
4557            _ => Err(fidl::Error::UnknownOrdinal {
4558                ordinal: tx_header.ordinal,
4559                protocol_name:
4560                    <DataRouterMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
4561            }),
4562        }
4563    }
4564}
4565
4566/// A Stream of incoming requests for fuchsia.component.sandbox/DataRouter.
4567pub struct DataRouterRequestStream {
4568    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
4569    is_terminated: bool,
4570}
4571
4572impl std::marker::Unpin for DataRouterRequestStream {}
4573
4574impl futures::stream::FusedStream for DataRouterRequestStream {
4575    fn is_terminated(&self) -> bool {
4576        self.is_terminated
4577    }
4578}
4579
4580impl fdomain_client::fidl::RequestStream for DataRouterRequestStream {
4581    type Protocol = DataRouterMarker;
4582    type ControlHandle = DataRouterControlHandle;
4583
4584    fn from_channel(channel: fdomain_client::Channel) -> Self {
4585        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4586    }
4587
4588    fn control_handle(&self) -> Self::ControlHandle {
4589        DataRouterControlHandle { inner: self.inner.clone() }
4590    }
4591
4592    fn into_inner(
4593        self,
4594    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
4595    {
4596        (self.inner, self.is_terminated)
4597    }
4598
4599    fn from_inner(
4600        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
4601        is_terminated: bool,
4602    ) -> Self {
4603        Self { inner, is_terminated }
4604    }
4605}
4606
4607impl futures::Stream for DataRouterRequestStream {
4608    type Item = Result<DataRouterRequest, fidl::Error>;
4609
4610    fn poll_next(
4611        mut self: std::pin::Pin<&mut Self>,
4612        cx: &mut std::task::Context<'_>,
4613    ) -> std::task::Poll<Option<Self::Item>> {
4614        let this = &mut *self;
4615        if this.inner.check_shutdown(cx) {
4616            this.is_terminated = true;
4617            return std::task::Poll::Ready(None);
4618        }
4619        if this.is_terminated {
4620            panic!("polled DataRouterRequestStream after completion");
4621        }
4622        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
4623            |bytes, handles| {
4624                match this.inner.channel().read_etc(cx, bytes, handles) {
4625                    std::task::Poll::Ready(Ok(())) => {}
4626                    std::task::Poll::Pending => return std::task::Poll::Pending,
4627                    std::task::Poll::Ready(Err(None)) => {
4628                        this.is_terminated = true;
4629                        return std::task::Poll::Ready(None);
4630                    }
4631                    std::task::Poll::Ready(Err(Some(e))) => {
4632                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4633                            e.into(),
4634                        ))));
4635                    }
4636                }
4637
4638                // A message has been received from the channel
4639                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4640
4641                std::task::Poll::Ready(Some(match header.ordinal {
4642                    0x2e87dc44dfc53804 => {
4643                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4644                        let mut req = fidl::new_empty!(
4645                            RouteRequest,
4646                            fdomain_client::fidl::FDomainResourceDialect
4647                        );
4648                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<RouteRequest>(&header, _body_bytes, handles, &mut req)?;
4649                        let control_handle = DataRouterControlHandle { inner: this.inner.clone() };
4650                        Ok(DataRouterRequest::Route {
4651                            payload: req,
4652                            responder: DataRouterRouteResponder {
4653                                control_handle: std::mem::ManuallyDrop::new(control_handle),
4654                                tx_id: header.tx_id,
4655                            },
4656                        })
4657                    }
4658                    _ if header.tx_id == 0
4659                        && header
4660                            .dynamic_flags()
4661                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
4662                    {
4663                        Ok(DataRouterRequest::_UnknownMethod {
4664                            ordinal: header.ordinal,
4665                            control_handle: DataRouterControlHandle { inner: this.inner.clone() },
4666                            method_type: fidl::MethodType::OneWay,
4667                        })
4668                    }
4669                    _ if header
4670                        .dynamic_flags()
4671                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
4672                    {
4673                        this.inner.send_framework_err(
4674                            fidl::encoding::FrameworkErr::UnknownMethod,
4675                            header.tx_id,
4676                            header.ordinal,
4677                            header.dynamic_flags(),
4678                            (bytes, handles),
4679                        )?;
4680                        Ok(DataRouterRequest::_UnknownMethod {
4681                            ordinal: header.ordinal,
4682                            control_handle: DataRouterControlHandle { inner: this.inner.clone() },
4683                            method_type: fidl::MethodType::TwoWay,
4684                        })
4685                    }
4686                    _ => Err(fidl::Error::UnknownOrdinal {
4687                        ordinal: header.ordinal,
4688                        protocol_name:
4689                            <DataRouterMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
4690                    }),
4691                }))
4692            },
4693        )
4694    }
4695}
4696
4697#[derive(Debug)]
4698pub enum DataRouterRequest {
4699    Route {
4700        payload: RouteRequest,
4701        responder: DataRouterRouteResponder,
4702    },
4703    /// An interaction was received which does not match any known method.
4704    #[non_exhaustive]
4705    _UnknownMethod {
4706        /// Ordinal of the method that was called.
4707        ordinal: u64,
4708        control_handle: DataRouterControlHandle,
4709        method_type: fidl::MethodType,
4710    },
4711}
4712
4713impl DataRouterRequest {
4714    #[allow(irrefutable_let_patterns)]
4715    pub fn into_route(self) -> Option<(RouteRequest, DataRouterRouteResponder)> {
4716        if let DataRouterRequest::Route { payload, responder } = self {
4717            Some((payload, responder))
4718        } else {
4719            None
4720        }
4721    }
4722
4723    /// Name of the method defined in FIDL
4724    pub fn method_name(&self) -> &'static str {
4725        match *self {
4726            DataRouterRequest::Route { .. } => "route",
4727            DataRouterRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
4728                "unknown one-way method"
4729            }
4730            DataRouterRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
4731                "unknown two-way method"
4732            }
4733        }
4734    }
4735}
4736
4737#[derive(Debug, Clone)]
4738pub struct DataRouterControlHandle {
4739    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
4740}
4741
4742impl fdomain_client::fidl::ControlHandle for DataRouterControlHandle {
4743    fn shutdown(&self) {
4744        self.inner.shutdown()
4745    }
4746
4747    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
4748        self.inner.shutdown_with_epitaph(status)
4749    }
4750
4751    fn is_closed(&self) -> bool {
4752        self.inner.channel().is_closed()
4753    }
4754    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
4755        self.inner.channel().on_closed()
4756    }
4757}
4758
4759impl DataRouterControlHandle {}
4760
4761#[must_use = "FIDL methods require a response to be sent"]
4762#[derive(Debug)]
4763pub struct DataRouterRouteResponder {
4764    control_handle: std::mem::ManuallyDrop<DataRouterControlHandle>,
4765    tx_id: u32,
4766}
4767
4768/// Set the the channel to be shutdown (see [`DataRouterControlHandle::shutdown`])
4769/// if the responder is dropped without sending a response, so that the client
4770/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4771impl std::ops::Drop for DataRouterRouteResponder {
4772    fn drop(&mut self) {
4773        self.control_handle.shutdown();
4774        // Safety: drops once, never accessed again
4775        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4776    }
4777}
4778
4779impl fdomain_client::fidl::Responder for DataRouterRouteResponder {
4780    type ControlHandle = DataRouterControlHandle;
4781
4782    fn control_handle(&self) -> &DataRouterControlHandle {
4783        &self.control_handle
4784    }
4785
4786    fn drop_without_shutdown(mut self) {
4787        // Safety: drops once, never accessed again due to mem::forget
4788        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4789        // Prevent Drop from running (which would shut down the channel)
4790        std::mem::forget(self);
4791    }
4792}
4793
4794impl DataRouterRouteResponder {
4795    /// Sends a response to the FIDL transaction.
4796    ///
4797    /// Sets the channel to shutdown if an error occurs.
4798    pub fn send(
4799        self,
4800        mut result: Result<DataRouterRouteResponse, RouterError>,
4801    ) -> Result<(), fidl::Error> {
4802        let _result = self.send_raw(result);
4803        if _result.is_err() {
4804            self.control_handle.shutdown();
4805        }
4806        self.drop_without_shutdown();
4807        _result
4808    }
4809
4810    /// Similar to "send" but does not shutdown the channel if an error occurs.
4811    pub fn send_no_shutdown_on_err(
4812        self,
4813        mut result: Result<DataRouterRouteResponse, RouterError>,
4814    ) -> Result<(), fidl::Error> {
4815        let _result = self.send_raw(result);
4816        self.drop_without_shutdown();
4817        _result
4818    }
4819
4820    fn send_raw(
4821        &self,
4822        mut result: Result<DataRouterRouteResponse, RouterError>,
4823    ) -> Result<(), fidl::Error> {
4824        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4825            DataRouterRouteResponse,
4826            RouterError,
4827        >>(
4828            fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
4829            self.tx_id,
4830            0x2e87dc44dfc53804,
4831            fidl::encoding::DynamicFlags::FLEXIBLE,
4832        )
4833    }
4834}
4835
4836#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4837pub struct DictionaryMarker;
4838
4839impl fdomain_client::fidl::ProtocolMarker for DictionaryMarker {
4840    type Proxy = DictionaryProxy;
4841    type RequestStream = DictionaryRequestStream;
4842
4843    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.Dictionary";
4844}
4845impl fdomain_client::fidl::DiscoverableProtocolMarker for DictionaryMarker {}
4846
4847pub trait DictionaryProxyInterface: Send + Sync {}
4848
4849#[derive(Debug, Clone)]
4850pub struct DictionaryProxy {
4851    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
4852}
4853
4854impl fdomain_client::fidl::Proxy for DictionaryProxy {
4855    type Protocol = DictionaryMarker;
4856
4857    fn from_channel(inner: fdomain_client::Channel) -> Self {
4858        Self::new(inner)
4859    }
4860
4861    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
4862        self.client.into_channel().map_err(|client| Self { client })
4863    }
4864
4865    fn as_channel(&self) -> &fdomain_client::Channel {
4866        self.client.as_channel()
4867    }
4868}
4869
4870impl DictionaryProxy {
4871    /// Create a new Proxy for fuchsia.component.sandbox/Dictionary.
4872    pub fn new(channel: fdomain_client::Channel) -> Self {
4873        let protocol_name = <DictionaryMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
4874        Self { client: fidl::client::Client::new(channel, protocol_name) }
4875    }
4876
4877    /// Get a Stream of events from the remote end of the protocol.
4878    ///
4879    /// # Panics
4880    ///
4881    /// Panics if the event stream was already taken.
4882    pub fn take_event_stream(&self) -> DictionaryEventStream {
4883        DictionaryEventStream { event_receiver: self.client.take_event_receiver() }
4884    }
4885}
4886
4887impl DictionaryProxyInterface for DictionaryProxy {}
4888
4889pub struct DictionaryEventStream {
4890    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
4891}
4892
4893impl std::marker::Unpin for DictionaryEventStream {}
4894
4895impl futures::stream::FusedStream for DictionaryEventStream {
4896    fn is_terminated(&self) -> bool {
4897        self.event_receiver.is_terminated()
4898    }
4899}
4900
4901impl futures::Stream for DictionaryEventStream {
4902    type Item = Result<DictionaryEvent, fidl::Error>;
4903
4904    fn poll_next(
4905        mut self: std::pin::Pin<&mut Self>,
4906        cx: &mut std::task::Context<'_>,
4907    ) -> std::task::Poll<Option<Self::Item>> {
4908        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4909            &mut self.event_receiver,
4910            cx
4911        )?) {
4912            Some(buf) => std::task::Poll::Ready(Some(DictionaryEvent::decode(buf))),
4913            None => std::task::Poll::Ready(None),
4914        }
4915    }
4916}
4917
4918#[derive(Debug)]
4919pub enum DictionaryEvent {
4920    #[non_exhaustive]
4921    _UnknownEvent {
4922        /// Ordinal of the event that was sent.
4923        ordinal: u64,
4924    },
4925}
4926
4927impl DictionaryEvent {
4928    /// Decodes a message buffer as a [`DictionaryEvent`].
4929    fn decode(
4930        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4931    ) -> Result<DictionaryEvent, fidl::Error> {
4932        let (bytes, _handles) = buf.split_mut();
4933        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4934        debug_assert_eq!(tx_header.tx_id, 0);
4935        match tx_header.ordinal {
4936            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4937                Ok(DictionaryEvent::_UnknownEvent { ordinal: tx_header.ordinal })
4938            }
4939            _ => Err(fidl::Error::UnknownOrdinal {
4940                ordinal: tx_header.ordinal,
4941                protocol_name:
4942                    <DictionaryMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
4943            }),
4944        }
4945    }
4946}
4947
4948/// A Stream of incoming requests for fuchsia.component.sandbox/Dictionary.
4949pub struct DictionaryRequestStream {
4950    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
4951    is_terminated: bool,
4952}
4953
4954impl std::marker::Unpin for DictionaryRequestStream {}
4955
4956impl futures::stream::FusedStream for DictionaryRequestStream {
4957    fn is_terminated(&self) -> bool {
4958        self.is_terminated
4959    }
4960}
4961
4962impl fdomain_client::fidl::RequestStream for DictionaryRequestStream {
4963    type Protocol = DictionaryMarker;
4964    type ControlHandle = DictionaryControlHandle;
4965
4966    fn from_channel(channel: fdomain_client::Channel) -> Self {
4967        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4968    }
4969
4970    fn control_handle(&self) -> Self::ControlHandle {
4971        DictionaryControlHandle { inner: self.inner.clone() }
4972    }
4973
4974    fn into_inner(
4975        self,
4976    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
4977    {
4978        (self.inner, self.is_terminated)
4979    }
4980
4981    fn from_inner(
4982        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
4983        is_terminated: bool,
4984    ) -> Self {
4985        Self { inner, is_terminated }
4986    }
4987}
4988
4989impl futures::Stream for DictionaryRequestStream {
4990    type Item = Result<DictionaryRequest, fidl::Error>;
4991
4992    fn poll_next(
4993        mut self: std::pin::Pin<&mut Self>,
4994        cx: &mut std::task::Context<'_>,
4995    ) -> std::task::Poll<Option<Self::Item>> {
4996        let this = &mut *self;
4997        if this.inner.check_shutdown(cx) {
4998            this.is_terminated = true;
4999            return std::task::Poll::Ready(None);
5000        }
5001        if this.is_terminated {
5002            panic!("polled DictionaryRequestStream after completion");
5003        }
5004        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
5005            |bytes, handles| {
5006                match this.inner.channel().read_etc(cx, bytes, handles) {
5007                    std::task::Poll::Ready(Ok(())) => {}
5008                    std::task::Poll::Pending => return std::task::Poll::Pending,
5009                    std::task::Poll::Ready(Err(None)) => {
5010                        this.is_terminated = true;
5011                        return std::task::Poll::Ready(None);
5012                    }
5013                    std::task::Poll::Ready(Err(Some(e))) => {
5014                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5015                            e.into(),
5016                        ))));
5017                    }
5018                }
5019
5020                // A message has been received from the channel
5021                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5022
5023                std::task::Poll::Ready(Some(match header.ordinal {
5024                    _ if header.tx_id == 0
5025                        && header
5026                            .dynamic_flags()
5027                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5028                    {
5029                        Ok(DictionaryRequest::_UnknownMethod {
5030                            ordinal: header.ordinal,
5031                            control_handle: DictionaryControlHandle { inner: this.inner.clone() },
5032                            method_type: fidl::MethodType::OneWay,
5033                        })
5034                    }
5035                    _ if header
5036                        .dynamic_flags()
5037                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5038                    {
5039                        this.inner.send_framework_err(
5040                            fidl::encoding::FrameworkErr::UnknownMethod,
5041                            header.tx_id,
5042                            header.ordinal,
5043                            header.dynamic_flags(),
5044                            (bytes, handles),
5045                        )?;
5046                        Ok(DictionaryRequest::_UnknownMethod {
5047                            ordinal: header.ordinal,
5048                            control_handle: DictionaryControlHandle { inner: this.inner.clone() },
5049                            method_type: fidl::MethodType::TwoWay,
5050                        })
5051                    }
5052                    _ => Err(fidl::Error::UnknownOrdinal {
5053                        ordinal: header.ordinal,
5054                        protocol_name:
5055                            <DictionaryMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
5056                    }),
5057                }))
5058            },
5059        )
5060    }
5061}
5062
5063#[derive(Debug)]
5064pub enum DictionaryRequest {
5065    /// An interaction was received which does not match any known method.
5066    #[non_exhaustive]
5067    _UnknownMethod {
5068        /// Ordinal of the method that was called.
5069        ordinal: u64,
5070        control_handle: DictionaryControlHandle,
5071        method_type: fidl::MethodType,
5072    },
5073}
5074
5075impl DictionaryRequest {
5076    /// Name of the method defined in FIDL
5077    pub fn method_name(&self) -> &'static str {
5078        match *self {
5079            DictionaryRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
5080                "unknown one-way method"
5081            }
5082            DictionaryRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
5083                "unknown two-way method"
5084            }
5085        }
5086    }
5087}
5088
5089#[derive(Debug, Clone)]
5090pub struct DictionaryControlHandle {
5091    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
5092}
5093
5094impl fdomain_client::fidl::ControlHandle for DictionaryControlHandle {
5095    fn shutdown(&self) {
5096        self.inner.shutdown()
5097    }
5098
5099    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
5100        self.inner.shutdown_with_epitaph(status)
5101    }
5102
5103    fn is_closed(&self) -> bool {
5104        self.inner.channel().is_closed()
5105    }
5106    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
5107        self.inner.channel().on_closed()
5108    }
5109}
5110
5111impl DictionaryControlHandle {}
5112
5113#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5114pub struct DictionaryDrainIteratorMarker;
5115
5116impl fdomain_client::fidl::ProtocolMarker for DictionaryDrainIteratorMarker {
5117    type Proxy = DictionaryDrainIteratorProxy;
5118    type RequestStream = DictionaryDrainIteratorRequestStream;
5119
5120    const DEBUG_NAME: &'static str = "(anonymous) DictionaryDrainIterator";
5121}
5122pub type DictionaryDrainIteratorGetNextResult =
5123    Result<(Vec<DictionaryItem>, u64), CapabilityStoreError>;
5124
5125pub trait DictionaryDrainIteratorProxyInterface: Send + Sync {
5126    type GetNextResponseFut: std::future::Future<Output = Result<DictionaryDrainIteratorGetNextResult, fidl::Error>>
5127        + Send;
5128    fn r#get_next(&self, start_id: u64, limit: u32) -> Self::GetNextResponseFut;
5129}
5130
5131#[derive(Debug, Clone)]
5132pub struct DictionaryDrainIteratorProxy {
5133    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
5134}
5135
5136impl fdomain_client::fidl::Proxy for DictionaryDrainIteratorProxy {
5137    type Protocol = DictionaryDrainIteratorMarker;
5138
5139    fn from_channel(inner: fdomain_client::Channel) -> Self {
5140        Self::new(inner)
5141    }
5142
5143    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
5144        self.client.into_channel().map_err(|client| Self { client })
5145    }
5146
5147    fn as_channel(&self) -> &fdomain_client::Channel {
5148        self.client.as_channel()
5149    }
5150}
5151
5152impl DictionaryDrainIteratorProxy {
5153    /// Create a new Proxy for fuchsia.component.sandbox/DictionaryDrainIterator.
5154    pub fn new(channel: fdomain_client::Channel) -> Self {
5155        let protocol_name =
5156            <DictionaryDrainIteratorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
5157        Self { client: fidl::client::Client::new(channel, protocol_name) }
5158    }
5159
5160    /// Get a Stream of events from the remote end of the protocol.
5161    ///
5162    /// # Panics
5163    ///
5164    /// Panics if the event stream was already taken.
5165    pub fn take_event_stream(&self) -> DictionaryDrainIteratorEventStream {
5166        DictionaryDrainIteratorEventStream { event_receiver: self.client.take_event_receiver() }
5167    }
5168
5169    /// Returns the next batch of results for a [Dictionary.Drain] call, returning up to
5170    /// `limit` results. `limit` can be at most [MAX_DICTIONARY_ITERATOR_CHUNK].
5171    ///
5172    /// Each returned capability will be assigned a monotonically increasing [CapabilityId] starting
5173    /// from `start_id`.
5174    ///
5175    /// In addition to the `items`, returns `end_id`, which is one more than the highest id reserved
5176    /// by [GetNext]. `end_id` can be used as the `start_id` for the next call to [GetNext].
5177    ///
5178    /// If [GetNext] returns an error, the server will also close the channel.
5179    ///
5180    /// Errors:
5181    ///
5182    /// - `ID_ALREADY_EXISTS` if some id in the range `[start_id, limit)` already exists in this
5183    ///   store.
5184    /// - `INVALID_ARGS` if `limit` was `0` or greater than `MAX_DICTIONARY_ITERATOR_CHUNK`.
5185    pub fn r#get_next(
5186        &self,
5187        mut start_id: u64,
5188        mut limit: u32,
5189    ) -> fidl::client::QueryResponseFut<
5190        DictionaryDrainIteratorGetNextResult,
5191        fdomain_client::fidl::FDomainResourceDialect,
5192    > {
5193        DictionaryDrainIteratorProxyInterface::r#get_next(self, start_id, limit)
5194    }
5195}
5196
5197impl DictionaryDrainIteratorProxyInterface for DictionaryDrainIteratorProxy {
5198    type GetNextResponseFut = fidl::client::QueryResponseFut<
5199        DictionaryDrainIteratorGetNextResult,
5200        fdomain_client::fidl::FDomainResourceDialect,
5201    >;
5202    fn r#get_next(&self, mut start_id: u64, mut limit: u32) -> Self::GetNextResponseFut {
5203        fn _decode(
5204            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5205        ) -> Result<DictionaryDrainIteratorGetNextResult, fidl::Error> {
5206            let _response = fidl::client::decode_transaction_body::<
5207                fidl::encoding::FlexibleResultType<
5208                    DictionaryDrainIteratorGetNextResponse,
5209                    CapabilityStoreError,
5210                >,
5211                fdomain_client::fidl::FDomainResourceDialect,
5212                0x4f8082ca1ee26061,
5213            >(_buf?)?
5214            .into_result_fdomain::<DictionaryDrainIteratorMarker>("get_next")?;
5215            Ok(_response.map(|x| (x.items, x.end_id)))
5216        }
5217        self.client.send_query_and_decode::<
5218            DictionaryDrainIteratorGetNextRequest,
5219            DictionaryDrainIteratorGetNextResult,
5220        >(
5221            (start_id, limit,),
5222            0x4f8082ca1ee26061,
5223            fidl::encoding::DynamicFlags::FLEXIBLE,
5224            _decode,
5225        )
5226    }
5227}
5228
5229pub struct DictionaryDrainIteratorEventStream {
5230    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
5231}
5232
5233impl std::marker::Unpin for DictionaryDrainIteratorEventStream {}
5234
5235impl futures::stream::FusedStream for DictionaryDrainIteratorEventStream {
5236    fn is_terminated(&self) -> bool {
5237        self.event_receiver.is_terminated()
5238    }
5239}
5240
5241impl futures::Stream for DictionaryDrainIteratorEventStream {
5242    type Item = Result<DictionaryDrainIteratorEvent, fidl::Error>;
5243
5244    fn poll_next(
5245        mut self: std::pin::Pin<&mut Self>,
5246        cx: &mut std::task::Context<'_>,
5247    ) -> std::task::Poll<Option<Self::Item>> {
5248        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5249            &mut self.event_receiver,
5250            cx
5251        )?) {
5252            Some(buf) => std::task::Poll::Ready(Some(DictionaryDrainIteratorEvent::decode(buf))),
5253            None => std::task::Poll::Ready(None),
5254        }
5255    }
5256}
5257
5258#[derive(Debug)]
5259pub enum DictionaryDrainIteratorEvent {
5260    #[non_exhaustive]
5261    _UnknownEvent {
5262        /// Ordinal of the event that was sent.
5263        ordinal: u64,
5264    },
5265}
5266
5267impl DictionaryDrainIteratorEvent {
5268    /// Decodes a message buffer as a [`DictionaryDrainIteratorEvent`].
5269    fn decode(
5270        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5271    ) -> Result<DictionaryDrainIteratorEvent, fidl::Error> {
5272        let (bytes, _handles) = buf.split_mut();
5273        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5274        debug_assert_eq!(tx_header.tx_id, 0);
5275        match tx_header.ordinal {
5276            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
5277                Ok(DictionaryDrainIteratorEvent::_UnknownEvent {
5278                    ordinal: tx_header.ordinal,
5279                })
5280            }
5281            _ => Err(fidl::Error::UnknownOrdinal {
5282                ordinal: tx_header.ordinal,
5283                protocol_name: <DictionaryDrainIteratorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
5284            })
5285        }
5286    }
5287}
5288
5289/// A Stream of incoming requests for fuchsia.component.sandbox/DictionaryDrainIterator.
5290pub struct DictionaryDrainIteratorRequestStream {
5291    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
5292    is_terminated: bool,
5293}
5294
5295impl std::marker::Unpin for DictionaryDrainIteratorRequestStream {}
5296
5297impl futures::stream::FusedStream for DictionaryDrainIteratorRequestStream {
5298    fn is_terminated(&self) -> bool {
5299        self.is_terminated
5300    }
5301}
5302
5303impl fdomain_client::fidl::RequestStream for DictionaryDrainIteratorRequestStream {
5304    type Protocol = DictionaryDrainIteratorMarker;
5305    type ControlHandle = DictionaryDrainIteratorControlHandle;
5306
5307    fn from_channel(channel: fdomain_client::Channel) -> Self {
5308        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5309    }
5310
5311    fn control_handle(&self) -> Self::ControlHandle {
5312        DictionaryDrainIteratorControlHandle { inner: self.inner.clone() }
5313    }
5314
5315    fn into_inner(
5316        self,
5317    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
5318    {
5319        (self.inner, self.is_terminated)
5320    }
5321
5322    fn from_inner(
5323        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
5324        is_terminated: bool,
5325    ) -> Self {
5326        Self { inner, is_terminated }
5327    }
5328}
5329
5330impl futures::Stream for DictionaryDrainIteratorRequestStream {
5331    type Item = Result<DictionaryDrainIteratorRequest, fidl::Error>;
5332
5333    fn poll_next(
5334        mut self: std::pin::Pin<&mut Self>,
5335        cx: &mut std::task::Context<'_>,
5336    ) -> std::task::Poll<Option<Self::Item>> {
5337        let this = &mut *self;
5338        if this.inner.check_shutdown(cx) {
5339            this.is_terminated = true;
5340            return std::task::Poll::Ready(None);
5341        }
5342        if this.is_terminated {
5343            panic!("polled DictionaryDrainIteratorRequestStream after completion");
5344        }
5345        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
5346            |bytes, handles| {
5347                match this.inner.channel().read_etc(cx, bytes, handles) {
5348                    std::task::Poll::Ready(Ok(())) => {}
5349                    std::task::Poll::Pending => return std::task::Poll::Pending,
5350                    std::task::Poll::Ready(Err(None)) => {
5351                        this.is_terminated = true;
5352                        return std::task::Poll::Ready(None);
5353                    }
5354                    std::task::Poll::Ready(Err(Some(e))) => {
5355                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5356                            e.into(),
5357                        ))));
5358                    }
5359                }
5360
5361                // A message has been received from the channel
5362                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5363
5364                std::task::Poll::Ready(Some(match header.ordinal {
5365                0x4f8082ca1ee26061 => {
5366                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5367                    let mut req = fidl::new_empty!(DictionaryDrainIteratorGetNextRequest, fdomain_client::fidl::FDomainResourceDialect);
5368                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<DictionaryDrainIteratorGetNextRequest>(&header, _body_bytes, handles, &mut req)?;
5369                    let control_handle = DictionaryDrainIteratorControlHandle {
5370                        inner: this.inner.clone(),
5371                    };
5372                    Ok(DictionaryDrainIteratorRequest::GetNext {start_id: req.start_id,
5373limit: req.limit,
5374
5375                        responder: DictionaryDrainIteratorGetNextResponder {
5376                            control_handle: std::mem::ManuallyDrop::new(control_handle),
5377                            tx_id: header.tx_id,
5378                        },
5379                    })
5380                }
5381                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
5382                    Ok(DictionaryDrainIteratorRequest::_UnknownMethod {
5383                        ordinal: header.ordinal,
5384                        control_handle: DictionaryDrainIteratorControlHandle { inner: this.inner.clone() },
5385                        method_type: fidl::MethodType::OneWay,
5386                    })
5387                }
5388                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
5389                    this.inner.send_framework_err(
5390                        fidl::encoding::FrameworkErr::UnknownMethod,
5391                        header.tx_id,
5392                        header.ordinal,
5393                        header.dynamic_flags(),
5394                        (bytes, handles),
5395                    )?;
5396                    Ok(DictionaryDrainIteratorRequest::_UnknownMethod {
5397                        ordinal: header.ordinal,
5398                        control_handle: DictionaryDrainIteratorControlHandle { inner: this.inner.clone() },
5399                        method_type: fidl::MethodType::TwoWay,
5400                    })
5401                }
5402                _ => Err(fidl::Error::UnknownOrdinal {
5403                    ordinal: header.ordinal,
5404                    protocol_name: <DictionaryDrainIteratorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
5405                }),
5406            }))
5407            },
5408        )
5409    }
5410}
5411
5412#[derive(Debug)]
5413pub enum DictionaryDrainIteratorRequest {
5414    /// Returns the next batch of results for a [Dictionary.Drain] call, returning up to
5415    /// `limit` results. `limit` can be at most [MAX_DICTIONARY_ITERATOR_CHUNK].
5416    ///
5417    /// Each returned capability will be assigned a monotonically increasing [CapabilityId] starting
5418    /// from `start_id`.
5419    ///
5420    /// In addition to the `items`, returns `end_id`, which is one more than the highest id reserved
5421    /// by [GetNext]. `end_id` can be used as the `start_id` for the next call to [GetNext].
5422    ///
5423    /// If [GetNext] returns an error, the server will also close the channel.
5424    ///
5425    /// Errors:
5426    ///
5427    /// - `ID_ALREADY_EXISTS` if some id in the range `[start_id, limit)` already exists in this
5428    ///   store.
5429    /// - `INVALID_ARGS` if `limit` was `0` or greater than `MAX_DICTIONARY_ITERATOR_CHUNK`.
5430    GetNext { start_id: u64, limit: u32, responder: DictionaryDrainIteratorGetNextResponder },
5431    /// An interaction was received which does not match any known method.
5432    #[non_exhaustive]
5433    _UnknownMethod {
5434        /// Ordinal of the method that was called.
5435        ordinal: u64,
5436        control_handle: DictionaryDrainIteratorControlHandle,
5437        method_type: fidl::MethodType,
5438    },
5439}
5440
5441impl DictionaryDrainIteratorRequest {
5442    #[allow(irrefutable_let_patterns)]
5443    pub fn into_get_next(self) -> Option<(u64, u32, DictionaryDrainIteratorGetNextResponder)> {
5444        if let DictionaryDrainIteratorRequest::GetNext { start_id, limit, responder } = self {
5445            Some((start_id, limit, responder))
5446        } else {
5447            None
5448        }
5449    }
5450
5451    /// Name of the method defined in FIDL
5452    pub fn method_name(&self) -> &'static str {
5453        match *self {
5454            DictionaryDrainIteratorRequest::GetNext { .. } => "get_next",
5455            DictionaryDrainIteratorRequest::_UnknownMethod {
5456                method_type: fidl::MethodType::OneWay,
5457                ..
5458            } => "unknown one-way method",
5459            DictionaryDrainIteratorRequest::_UnknownMethod {
5460                method_type: fidl::MethodType::TwoWay,
5461                ..
5462            } => "unknown two-way method",
5463        }
5464    }
5465}
5466
5467#[derive(Debug, Clone)]
5468pub struct DictionaryDrainIteratorControlHandle {
5469    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
5470}
5471
5472impl fdomain_client::fidl::ControlHandle for DictionaryDrainIteratorControlHandle {
5473    fn shutdown(&self) {
5474        self.inner.shutdown()
5475    }
5476
5477    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
5478        self.inner.shutdown_with_epitaph(status)
5479    }
5480
5481    fn is_closed(&self) -> bool {
5482        self.inner.channel().is_closed()
5483    }
5484    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
5485        self.inner.channel().on_closed()
5486    }
5487}
5488
5489impl DictionaryDrainIteratorControlHandle {}
5490
5491#[must_use = "FIDL methods require a response to be sent"]
5492#[derive(Debug)]
5493pub struct DictionaryDrainIteratorGetNextResponder {
5494    control_handle: std::mem::ManuallyDrop<DictionaryDrainIteratorControlHandle>,
5495    tx_id: u32,
5496}
5497
5498/// Set the the channel to be shutdown (see [`DictionaryDrainIteratorControlHandle::shutdown`])
5499/// if the responder is dropped without sending a response, so that the client
5500/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5501impl std::ops::Drop for DictionaryDrainIteratorGetNextResponder {
5502    fn drop(&mut self) {
5503        self.control_handle.shutdown();
5504        // Safety: drops once, never accessed again
5505        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5506    }
5507}
5508
5509impl fdomain_client::fidl::Responder for DictionaryDrainIteratorGetNextResponder {
5510    type ControlHandle = DictionaryDrainIteratorControlHandle;
5511
5512    fn control_handle(&self) -> &DictionaryDrainIteratorControlHandle {
5513        &self.control_handle
5514    }
5515
5516    fn drop_without_shutdown(mut self) {
5517        // Safety: drops once, never accessed again due to mem::forget
5518        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5519        // Prevent Drop from running (which would shut down the channel)
5520        std::mem::forget(self);
5521    }
5522}
5523
5524impl DictionaryDrainIteratorGetNextResponder {
5525    /// Sends a response to the FIDL transaction.
5526    ///
5527    /// Sets the channel to shutdown if an error occurs.
5528    pub fn send(
5529        self,
5530        mut result: Result<(&[DictionaryItem], u64), CapabilityStoreError>,
5531    ) -> Result<(), fidl::Error> {
5532        let _result = self.send_raw(result);
5533        if _result.is_err() {
5534            self.control_handle.shutdown();
5535        }
5536        self.drop_without_shutdown();
5537        _result
5538    }
5539
5540    /// Similar to "send" but does not shutdown the channel if an error occurs.
5541    pub fn send_no_shutdown_on_err(
5542        self,
5543        mut result: Result<(&[DictionaryItem], u64), CapabilityStoreError>,
5544    ) -> Result<(), fidl::Error> {
5545        let _result = self.send_raw(result);
5546        self.drop_without_shutdown();
5547        _result
5548    }
5549
5550    fn send_raw(
5551        &self,
5552        mut result: Result<(&[DictionaryItem], u64), CapabilityStoreError>,
5553    ) -> Result<(), fidl::Error> {
5554        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
5555            DictionaryDrainIteratorGetNextResponse,
5556            CapabilityStoreError,
5557        >>(
5558            fidl::encoding::FlexibleResult::new(result),
5559            self.tx_id,
5560            0x4f8082ca1ee26061,
5561            fidl::encoding::DynamicFlags::FLEXIBLE,
5562        )
5563    }
5564}
5565
5566#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5567pub struct DictionaryEnumerateIteratorMarker;
5568
5569impl fdomain_client::fidl::ProtocolMarker for DictionaryEnumerateIteratorMarker {
5570    type Proxy = DictionaryEnumerateIteratorProxy;
5571    type RequestStream = DictionaryEnumerateIteratorRequestStream;
5572
5573    const DEBUG_NAME: &'static str = "(anonymous) DictionaryEnumerateIterator";
5574}
5575pub type DictionaryEnumerateIteratorGetNextResult =
5576    Result<(Vec<DictionaryOptionalItem>, u64), CapabilityStoreError>;
5577
5578pub trait DictionaryEnumerateIteratorProxyInterface: Send + Sync {
5579    type GetNextResponseFut: std::future::Future<Output = Result<DictionaryEnumerateIteratorGetNextResult, fidl::Error>>
5580        + Send;
5581    fn r#get_next(&self, start_id: u64, limit: u32) -> Self::GetNextResponseFut;
5582}
5583
5584#[derive(Debug, Clone)]
5585pub struct DictionaryEnumerateIteratorProxy {
5586    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
5587}
5588
5589impl fdomain_client::fidl::Proxy for DictionaryEnumerateIteratorProxy {
5590    type Protocol = DictionaryEnumerateIteratorMarker;
5591
5592    fn from_channel(inner: fdomain_client::Channel) -> Self {
5593        Self::new(inner)
5594    }
5595
5596    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
5597        self.client.into_channel().map_err(|client| Self { client })
5598    }
5599
5600    fn as_channel(&self) -> &fdomain_client::Channel {
5601        self.client.as_channel()
5602    }
5603}
5604
5605impl DictionaryEnumerateIteratorProxy {
5606    /// Create a new Proxy for fuchsia.component.sandbox/DictionaryEnumerateIterator.
5607    pub fn new(channel: fdomain_client::Channel) -> Self {
5608        let protocol_name =
5609            <DictionaryEnumerateIteratorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
5610        Self { client: fidl::client::Client::new(channel, protocol_name) }
5611    }
5612
5613    /// Get a Stream of events from the remote end of the protocol.
5614    ///
5615    /// # Panics
5616    ///
5617    /// Panics if the event stream was already taken.
5618    pub fn take_event_stream(&self) -> DictionaryEnumerateIteratorEventStream {
5619        DictionaryEnumerateIteratorEventStream { event_receiver: self.client.take_event_receiver() }
5620    }
5621
5622    /// Returns the next batch of results for a [Dictionary.Enumerate] call, returning up to
5623    /// `limit` results. `limit` can be at most [MAX_DICTIONARY_ITERATOR_CHUNK].
5624    ///
5625    /// The value of each of `items` is a duplicate of the original capability
5626    /// ([CapabilityStore.Duplicate]), unless it could not be duplicated, it which case it will
5627    /// be null.
5628    ///
5629    /// Each returned capability will be assigned a monotonically increasing [CapabilityId] starting
5630    /// from `start_id`.
5631    ///
5632    /// In addition to the `items`, returns `end_id`, which is one more than the highest id reserved
5633    /// by [GetNext]. `end_id` can be used as the `start_id` for the next call to [GetNext].
5634    ///
5635    /// If [GetNext] returns an error, the server will also close the channel.
5636    ///
5637    /// Errors:
5638    ///
5639    /// - `ID_ALREADY_EXISTS` if some id in the range `[start_id, limit)` already exists in this
5640    ///   store.
5641    /// - `INVALID_ARGS` if `limit` was `0` or greater than `MAX_DICTIONARY_ITERATOR_CHUNK`.
5642    pub fn r#get_next(
5643        &self,
5644        mut start_id: u64,
5645        mut limit: u32,
5646    ) -> fidl::client::QueryResponseFut<
5647        DictionaryEnumerateIteratorGetNextResult,
5648        fdomain_client::fidl::FDomainResourceDialect,
5649    > {
5650        DictionaryEnumerateIteratorProxyInterface::r#get_next(self, start_id, limit)
5651    }
5652}
5653
5654impl DictionaryEnumerateIteratorProxyInterface for DictionaryEnumerateIteratorProxy {
5655    type GetNextResponseFut = fidl::client::QueryResponseFut<
5656        DictionaryEnumerateIteratorGetNextResult,
5657        fdomain_client::fidl::FDomainResourceDialect,
5658    >;
5659    fn r#get_next(&self, mut start_id: u64, mut limit: u32) -> Self::GetNextResponseFut {
5660        fn _decode(
5661            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5662        ) -> Result<DictionaryEnumerateIteratorGetNextResult, fidl::Error> {
5663            let _response = fidl::client::decode_transaction_body::<
5664                fidl::encoding::FlexibleResultType<
5665                    DictionaryEnumerateIteratorGetNextResponse,
5666                    CapabilityStoreError,
5667                >,
5668                fdomain_client::fidl::FDomainResourceDialect,
5669                0x14f8bc286512f5cf,
5670            >(_buf?)?
5671            .into_result_fdomain::<DictionaryEnumerateIteratorMarker>("get_next")?;
5672            Ok(_response.map(|x| (x.items, x.end_id)))
5673        }
5674        self.client.send_query_and_decode::<
5675            DictionaryEnumerateIteratorGetNextRequest,
5676            DictionaryEnumerateIteratorGetNextResult,
5677        >(
5678            (start_id, limit,),
5679            0x14f8bc286512f5cf,
5680            fidl::encoding::DynamicFlags::FLEXIBLE,
5681            _decode,
5682        )
5683    }
5684}
5685
5686pub struct DictionaryEnumerateIteratorEventStream {
5687    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
5688}
5689
5690impl std::marker::Unpin for DictionaryEnumerateIteratorEventStream {}
5691
5692impl futures::stream::FusedStream for DictionaryEnumerateIteratorEventStream {
5693    fn is_terminated(&self) -> bool {
5694        self.event_receiver.is_terminated()
5695    }
5696}
5697
5698impl futures::Stream for DictionaryEnumerateIteratorEventStream {
5699    type Item = Result<DictionaryEnumerateIteratorEvent, fidl::Error>;
5700
5701    fn poll_next(
5702        mut self: std::pin::Pin<&mut Self>,
5703        cx: &mut std::task::Context<'_>,
5704    ) -> std::task::Poll<Option<Self::Item>> {
5705        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5706            &mut self.event_receiver,
5707            cx
5708        )?) {
5709            Some(buf) => {
5710                std::task::Poll::Ready(Some(DictionaryEnumerateIteratorEvent::decode(buf)))
5711            }
5712            None => std::task::Poll::Ready(None),
5713        }
5714    }
5715}
5716
5717#[derive(Debug)]
5718pub enum DictionaryEnumerateIteratorEvent {
5719    #[non_exhaustive]
5720    _UnknownEvent {
5721        /// Ordinal of the event that was sent.
5722        ordinal: u64,
5723    },
5724}
5725
5726impl DictionaryEnumerateIteratorEvent {
5727    /// Decodes a message buffer as a [`DictionaryEnumerateIteratorEvent`].
5728    fn decode(
5729        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5730    ) -> Result<DictionaryEnumerateIteratorEvent, fidl::Error> {
5731        let (bytes, _handles) = buf.split_mut();
5732        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5733        debug_assert_eq!(tx_header.tx_id, 0);
5734        match tx_header.ordinal {
5735            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
5736                Ok(DictionaryEnumerateIteratorEvent::_UnknownEvent {
5737                    ordinal: tx_header.ordinal,
5738                })
5739            }
5740            _ => Err(fidl::Error::UnknownOrdinal {
5741                ordinal: tx_header.ordinal,
5742                protocol_name: <DictionaryEnumerateIteratorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
5743            })
5744        }
5745    }
5746}
5747
5748/// A Stream of incoming requests for fuchsia.component.sandbox/DictionaryEnumerateIterator.
5749pub struct DictionaryEnumerateIteratorRequestStream {
5750    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
5751    is_terminated: bool,
5752}
5753
5754impl std::marker::Unpin for DictionaryEnumerateIteratorRequestStream {}
5755
5756impl futures::stream::FusedStream for DictionaryEnumerateIteratorRequestStream {
5757    fn is_terminated(&self) -> bool {
5758        self.is_terminated
5759    }
5760}
5761
5762impl fdomain_client::fidl::RequestStream for DictionaryEnumerateIteratorRequestStream {
5763    type Protocol = DictionaryEnumerateIteratorMarker;
5764    type ControlHandle = DictionaryEnumerateIteratorControlHandle;
5765
5766    fn from_channel(channel: fdomain_client::Channel) -> Self {
5767        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5768    }
5769
5770    fn control_handle(&self) -> Self::ControlHandle {
5771        DictionaryEnumerateIteratorControlHandle { inner: self.inner.clone() }
5772    }
5773
5774    fn into_inner(
5775        self,
5776    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
5777    {
5778        (self.inner, self.is_terminated)
5779    }
5780
5781    fn from_inner(
5782        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
5783        is_terminated: bool,
5784    ) -> Self {
5785        Self { inner, is_terminated }
5786    }
5787}
5788
5789impl futures::Stream for DictionaryEnumerateIteratorRequestStream {
5790    type Item = Result<DictionaryEnumerateIteratorRequest, fidl::Error>;
5791
5792    fn poll_next(
5793        mut self: std::pin::Pin<&mut Self>,
5794        cx: &mut std::task::Context<'_>,
5795    ) -> std::task::Poll<Option<Self::Item>> {
5796        let this = &mut *self;
5797        if this.inner.check_shutdown(cx) {
5798            this.is_terminated = true;
5799            return std::task::Poll::Ready(None);
5800        }
5801        if this.is_terminated {
5802            panic!("polled DictionaryEnumerateIteratorRequestStream after completion");
5803        }
5804        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
5805            |bytes, handles| {
5806                match this.inner.channel().read_etc(cx, bytes, handles) {
5807                    std::task::Poll::Ready(Ok(())) => {}
5808                    std::task::Poll::Pending => return std::task::Poll::Pending,
5809                    std::task::Poll::Ready(Err(None)) => {
5810                        this.is_terminated = true;
5811                        return std::task::Poll::Ready(None);
5812                    }
5813                    std::task::Poll::Ready(Err(Some(e))) => {
5814                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5815                            e.into(),
5816                        ))));
5817                    }
5818                }
5819
5820                // A message has been received from the channel
5821                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5822
5823                std::task::Poll::Ready(Some(match header.ordinal {
5824                0x14f8bc286512f5cf => {
5825                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5826                    let mut req = fidl::new_empty!(DictionaryEnumerateIteratorGetNextRequest, fdomain_client::fidl::FDomainResourceDialect);
5827                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<DictionaryEnumerateIteratorGetNextRequest>(&header, _body_bytes, handles, &mut req)?;
5828                    let control_handle = DictionaryEnumerateIteratorControlHandle {
5829                        inner: this.inner.clone(),
5830                    };
5831                    Ok(DictionaryEnumerateIteratorRequest::GetNext {start_id: req.start_id,
5832limit: req.limit,
5833
5834                        responder: DictionaryEnumerateIteratorGetNextResponder {
5835                            control_handle: std::mem::ManuallyDrop::new(control_handle),
5836                            tx_id: header.tx_id,
5837                        },
5838                    })
5839                }
5840                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
5841                    Ok(DictionaryEnumerateIteratorRequest::_UnknownMethod {
5842                        ordinal: header.ordinal,
5843                        control_handle: DictionaryEnumerateIteratorControlHandle { inner: this.inner.clone() },
5844                        method_type: fidl::MethodType::OneWay,
5845                    })
5846                }
5847                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
5848                    this.inner.send_framework_err(
5849                        fidl::encoding::FrameworkErr::UnknownMethod,
5850                        header.tx_id,
5851                        header.ordinal,
5852                        header.dynamic_flags(),
5853                        (bytes, handles),
5854                    )?;
5855                    Ok(DictionaryEnumerateIteratorRequest::_UnknownMethod {
5856                        ordinal: header.ordinal,
5857                        control_handle: DictionaryEnumerateIteratorControlHandle { inner: this.inner.clone() },
5858                        method_type: fidl::MethodType::TwoWay,
5859                    })
5860                }
5861                _ => Err(fidl::Error::UnknownOrdinal {
5862                    ordinal: header.ordinal,
5863                    protocol_name: <DictionaryEnumerateIteratorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
5864                }),
5865            }))
5866            },
5867        )
5868    }
5869}
5870
5871#[derive(Debug)]
5872pub enum DictionaryEnumerateIteratorRequest {
5873    /// Returns the next batch of results for a [Dictionary.Enumerate] call, returning up to
5874    /// `limit` results. `limit` can be at most [MAX_DICTIONARY_ITERATOR_CHUNK].
5875    ///
5876    /// The value of each of `items` is a duplicate of the original capability
5877    /// ([CapabilityStore.Duplicate]), unless it could not be duplicated, it which case it will
5878    /// be null.
5879    ///
5880    /// Each returned capability will be assigned a monotonically increasing [CapabilityId] starting
5881    /// from `start_id`.
5882    ///
5883    /// In addition to the `items`, returns `end_id`, which is one more than the highest id reserved
5884    /// by [GetNext]. `end_id` can be used as the `start_id` for the next call to [GetNext].
5885    ///
5886    /// If [GetNext] returns an error, the server will also close the channel.
5887    ///
5888    /// Errors:
5889    ///
5890    /// - `ID_ALREADY_EXISTS` if some id in the range `[start_id, limit)` already exists in this
5891    ///   store.
5892    /// - `INVALID_ARGS` if `limit` was `0` or greater than `MAX_DICTIONARY_ITERATOR_CHUNK`.
5893    GetNext { start_id: u64, limit: u32, responder: DictionaryEnumerateIteratorGetNextResponder },
5894    /// An interaction was received which does not match any known method.
5895    #[non_exhaustive]
5896    _UnknownMethod {
5897        /// Ordinal of the method that was called.
5898        ordinal: u64,
5899        control_handle: DictionaryEnumerateIteratorControlHandle,
5900        method_type: fidl::MethodType,
5901    },
5902}
5903
5904impl DictionaryEnumerateIteratorRequest {
5905    #[allow(irrefutable_let_patterns)]
5906    pub fn into_get_next(self) -> Option<(u64, u32, DictionaryEnumerateIteratorGetNextResponder)> {
5907        if let DictionaryEnumerateIteratorRequest::GetNext { start_id, limit, responder } = self {
5908            Some((start_id, limit, responder))
5909        } else {
5910            None
5911        }
5912    }
5913
5914    /// Name of the method defined in FIDL
5915    pub fn method_name(&self) -> &'static str {
5916        match *self {
5917            DictionaryEnumerateIteratorRequest::GetNext { .. } => "get_next",
5918            DictionaryEnumerateIteratorRequest::_UnknownMethod {
5919                method_type: fidl::MethodType::OneWay,
5920                ..
5921            } => "unknown one-way method",
5922            DictionaryEnumerateIteratorRequest::_UnknownMethod {
5923                method_type: fidl::MethodType::TwoWay,
5924                ..
5925            } => "unknown two-way method",
5926        }
5927    }
5928}
5929
5930#[derive(Debug, Clone)]
5931pub struct DictionaryEnumerateIteratorControlHandle {
5932    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
5933}
5934
5935impl fdomain_client::fidl::ControlHandle for DictionaryEnumerateIteratorControlHandle {
5936    fn shutdown(&self) {
5937        self.inner.shutdown()
5938    }
5939
5940    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
5941        self.inner.shutdown_with_epitaph(status)
5942    }
5943
5944    fn is_closed(&self) -> bool {
5945        self.inner.channel().is_closed()
5946    }
5947    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
5948        self.inner.channel().on_closed()
5949    }
5950}
5951
5952impl DictionaryEnumerateIteratorControlHandle {}
5953
5954#[must_use = "FIDL methods require a response to be sent"]
5955#[derive(Debug)]
5956pub struct DictionaryEnumerateIteratorGetNextResponder {
5957    control_handle: std::mem::ManuallyDrop<DictionaryEnumerateIteratorControlHandle>,
5958    tx_id: u32,
5959}
5960
5961/// Set the the channel to be shutdown (see [`DictionaryEnumerateIteratorControlHandle::shutdown`])
5962/// if the responder is dropped without sending a response, so that the client
5963/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5964impl std::ops::Drop for DictionaryEnumerateIteratorGetNextResponder {
5965    fn drop(&mut self) {
5966        self.control_handle.shutdown();
5967        // Safety: drops once, never accessed again
5968        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5969    }
5970}
5971
5972impl fdomain_client::fidl::Responder for DictionaryEnumerateIteratorGetNextResponder {
5973    type ControlHandle = DictionaryEnumerateIteratorControlHandle;
5974
5975    fn control_handle(&self) -> &DictionaryEnumerateIteratorControlHandle {
5976        &self.control_handle
5977    }
5978
5979    fn drop_without_shutdown(mut self) {
5980        // Safety: drops once, never accessed again due to mem::forget
5981        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5982        // Prevent Drop from running (which would shut down the channel)
5983        std::mem::forget(self);
5984    }
5985}
5986
5987impl DictionaryEnumerateIteratorGetNextResponder {
5988    /// Sends a response to the FIDL transaction.
5989    ///
5990    /// Sets the channel to shutdown if an error occurs.
5991    pub fn send(
5992        self,
5993        mut result: Result<(Vec<DictionaryOptionalItem>, u64), CapabilityStoreError>,
5994    ) -> Result<(), fidl::Error> {
5995        let _result = self.send_raw(result);
5996        if _result.is_err() {
5997            self.control_handle.shutdown();
5998        }
5999        self.drop_without_shutdown();
6000        _result
6001    }
6002
6003    /// Similar to "send" but does not shutdown the channel if an error occurs.
6004    pub fn send_no_shutdown_on_err(
6005        self,
6006        mut result: Result<(Vec<DictionaryOptionalItem>, u64), CapabilityStoreError>,
6007    ) -> Result<(), fidl::Error> {
6008        let _result = self.send_raw(result);
6009        self.drop_without_shutdown();
6010        _result
6011    }
6012
6013    fn send_raw(
6014        &self,
6015        mut result: Result<(Vec<DictionaryOptionalItem>, u64), CapabilityStoreError>,
6016    ) -> Result<(), fidl::Error> {
6017        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
6018            DictionaryEnumerateIteratorGetNextResponse,
6019            CapabilityStoreError,
6020        >>(
6021            fidl::encoding::FlexibleResult::new(
6022                result
6023                    .as_mut()
6024                    .map_err(|e| *e)
6025                    .map(|(items, end_id)| (items.as_mut_slice(), *end_id)),
6026            ),
6027            self.tx_id,
6028            0x14f8bc286512f5cf,
6029            fidl::encoding::DynamicFlags::FLEXIBLE,
6030        )
6031    }
6032}
6033
6034#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6035pub struct DictionaryKeysIteratorMarker;
6036
6037impl fdomain_client::fidl::ProtocolMarker for DictionaryKeysIteratorMarker {
6038    type Proxy = DictionaryKeysIteratorProxy;
6039    type RequestStream = DictionaryKeysIteratorRequestStream;
6040
6041    const DEBUG_NAME: &'static str = "(anonymous) DictionaryKeysIterator";
6042}
6043
6044pub trait DictionaryKeysIteratorProxyInterface: Send + Sync {
6045    type GetNextResponseFut: std::future::Future<Output = Result<Vec<String>, fidl::Error>> + Send;
6046    fn r#get_next(&self) -> Self::GetNextResponseFut;
6047}
6048
6049#[derive(Debug, Clone)]
6050pub struct DictionaryKeysIteratorProxy {
6051    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
6052}
6053
6054impl fdomain_client::fidl::Proxy for DictionaryKeysIteratorProxy {
6055    type Protocol = DictionaryKeysIteratorMarker;
6056
6057    fn from_channel(inner: fdomain_client::Channel) -> Self {
6058        Self::new(inner)
6059    }
6060
6061    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
6062        self.client.into_channel().map_err(|client| Self { client })
6063    }
6064
6065    fn as_channel(&self) -> &fdomain_client::Channel {
6066        self.client.as_channel()
6067    }
6068}
6069
6070impl DictionaryKeysIteratorProxy {
6071    /// Create a new Proxy for fuchsia.component.sandbox/DictionaryKeysIterator.
6072    pub fn new(channel: fdomain_client::Channel) -> Self {
6073        let protocol_name =
6074            <DictionaryKeysIteratorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
6075        Self { client: fidl::client::Client::new(channel, protocol_name) }
6076    }
6077
6078    /// Get a Stream of events from the remote end of the protocol.
6079    ///
6080    /// # Panics
6081    ///
6082    /// Panics if the event stream was already taken.
6083    pub fn take_event_stream(&self) -> DictionaryKeysIteratorEventStream {
6084        DictionaryKeysIteratorEventStream { event_receiver: self.client.take_event_receiver() }
6085    }
6086
6087    pub fn r#get_next(
6088        &self,
6089    ) -> fidl::client::QueryResponseFut<Vec<String>, fdomain_client::fidl::FDomainResourceDialect>
6090    {
6091        DictionaryKeysIteratorProxyInterface::r#get_next(self)
6092    }
6093}
6094
6095impl DictionaryKeysIteratorProxyInterface for DictionaryKeysIteratorProxy {
6096    type GetNextResponseFut =
6097        fidl::client::QueryResponseFut<Vec<String>, fdomain_client::fidl::FDomainResourceDialect>;
6098    fn r#get_next(&self) -> Self::GetNextResponseFut {
6099        fn _decode(
6100            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6101        ) -> Result<Vec<String>, fidl::Error> {
6102            let _response = fidl::client::decode_transaction_body::<
6103                fidl::encoding::FlexibleType<DictionaryKeysIteratorGetNextResponse>,
6104                fdomain_client::fidl::FDomainResourceDialect,
6105                0x453828cbacca7d53,
6106            >(_buf?)?
6107            .into_result_fdomain::<DictionaryKeysIteratorMarker>("get_next")?;
6108            Ok(_response.keys)
6109        }
6110        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<String>>(
6111            (),
6112            0x453828cbacca7d53,
6113            fidl::encoding::DynamicFlags::FLEXIBLE,
6114            _decode,
6115        )
6116    }
6117}
6118
6119pub struct DictionaryKeysIteratorEventStream {
6120    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
6121}
6122
6123impl std::marker::Unpin for DictionaryKeysIteratorEventStream {}
6124
6125impl futures::stream::FusedStream for DictionaryKeysIteratorEventStream {
6126    fn is_terminated(&self) -> bool {
6127        self.event_receiver.is_terminated()
6128    }
6129}
6130
6131impl futures::Stream for DictionaryKeysIteratorEventStream {
6132    type Item = Result<DictionaryKeysIteratorEvent, fidl::Error>;
6133
6134    fn poll_next(
6135        mut self: std::pin::Pin<&mut Self>,
6136        cx: &mut std::task::Context<'_>,
6137    ) -> std::task::Poll<Option<Self::Item>> {
6138        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6139            &mut self.event_receiver,
6140            cx
6141        )?) {
6142            Some(buf) => std::task::Poll::Ready(Some(DictionaryKeysIteratorEvent::decode(buf))),
6143            None => std::task::Poll::Ready(None),
6144        }
6145    }
6146}
6147
6148#[derive(Debug)]
6149pub enum DictionaryKeysIteratorEvent {
6150    #[non_exhaustive]
6151    _UnknownEvent {
6152        /// Ordinal of the event that was sent.
6153        ordinal: u64,
6154    },
6155}
6156
6157impl DictionaryKeysIteratorEvent {
6158    /// Decodes a message buffer as a [`DictionaryKeysIteratorEvent`].
6159    fn decode(
6160        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6161    ) -> Result<DictionaryKeysIteratorEvent, fidl::Error> {
6162        let (bytes, _handles) = buf.split_mut();
6163        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6164        debug_assert_eq!(tx_header.tx_id, 0);
6165        match tx_header.ordinal {
6166            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6167                Ok(DictionaryKeysIteratorEvent::_UnknownEvent {
6168                    ordinal: tx_header.ordinal,
6169                })
6170            }
6171            _ => Err(fidl::Error::UnknownOrdinal {
6172                ordinal: tx_header.ordinal,
6173                protocol_name: <DictionaryKeysIteratorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
6174            })
6175        }
6176    }
6177}
6178
6179/// A Stream of incoming requests for fuchsia.component.sandbox/DictionaryKeysIterator.
6180pub struct DictionaryKeysIteratorRequestStream {
6181    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
6182    is_terminated: bool,
6183}
6184
6185impl std::marker::Unpin for DictionaryKeysIteratorRequestStream {}
6186
6187impl futures::stream::FusedStream for DictionaryKeysIteratorRequestStream {
6188    fn is_terminated(&self) -> bool {
6189        self.is_terminated
6190    }
6191}
6192
6193impl fdomain_client::fidl::RequestStream for DictionaryKeysIteratorRequestStream {
6194    type Protocol = DictionaryKeysIteratorMarker;
6195    type ControlHandle = DictionaryKeysIteratorControlHandle;
6196
6197    fn from_channel(channel: fdomain_client::Channel) -> Self {
6198        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6199    }
6200
6201    fn control_handle(&self) -> Self::ControlHandle {
6202        DictionaryKeysIteratorControlHandle { inner: self.inner.clone() }
6203    }
6204
6205    fn into_inner(
6206        self,
6207    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
6208    {
6209        (self.inner, self.is_terminated)
6210    }
6211
6212    fn from_inner(
6213        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
6214        is_terminated: bool,
6215    ) -> Self {
6216        Self { inner, is_terminated }
6217    }
6218}
6219
6220impl futures::Stream for DictionaryKeysIteratorRequestStream {
6221    type Item = Result<DictionaryKeysIteratorRequest, fidl::Error>;
6222
6223    fn poll_next(
6224        mut self: std::pin::Pin<&mut Self>,
6225        cx: &mut std::task::Context<'_>,
6226    ) -> std::task::Poll<Option<Self::Item>> {
6227        let this = &mut *self;
6228        if this.inner.check_shutdown(cx) {
6229            this.is_terminated = true;
6230            return std::task::Poll::Ready(None);
6231        }
6232        if this.is_terminated {
6233            panic!("polled DictionaryKeysIteratorRequestStream after completion");
6234        }
6235        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
6236            |bytes, handles| {
6237                match this.inner.channel().read_etc(cx, bytes, handles) {
6238                    std::task::Poll::Ready(Ok(())) => {}
6239                    std::task::Poll::Pending => return std::task::Poll::Pending,
6240                    std::task::Poll::Ready(Err(None)) => {
6241                        this.is_terminated = true;
6242                        return std::task::Poll::Ready(None);
6243                    }
6244                    std::task::Poll::Ready(Err(Some(e))) => {
6245                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6246                            e.into(),
6247                        ))));
6248                    }
6249                }
6250
6251                // A message has been received from the channel
6252                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6253
6254                std::task::Poll::Ready(Some(match header.ordinal {
6255                0x453828cbacca7d53 => {
6256                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6257                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fdomain_client::fidl::FDomainResourceDialect);
6258                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6259                    let control_handle = DictionaryKeysIteratorControlHandle {
6260                        inner: this.inner.clone(),
6261                    };
6262                    Ok(DictionaryKeysIteratorRequest::GetNext {
6263                        responder: DictionaryKeysIteratorGetNextResponder {
6264                            control_handle: std::mem::ManuallyDrop::new(control_handle),
6265                            tx_id: header.tx_id,
6266                        },
6267                    })
6268                }
6269                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6270                    Ok(DictionaryKeysIteratorRequest::_UnknownMethod {
6271                        ordinal: header.ordinal,
6272                        control_handle: DictionaryKeysIteratorControlHandle { inner: this.inner.clone() },
6273                        method_type: fidl::MethodType::OneWay,
6274                    })
6275                }
6276                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6277                    this.inner.send_framework_err(
6278                        fidl::encoding::FrameworkErr::UnknownMethod,
6279                        header.tx_id,
6280                        header.ordinal,
6281                        header.dynamic_flags(),
6282                        (bytes, handles),
6283                    )?;
6284                    Ok(DictionaryKeysIteratorRequest::_UnknownMethod {
6285                        ordinal: header.ordinal,
6286                        control_handle: DictionaryKeysIteratorControlHandle { inner: this.inner.clone() },
6287                        method_type: fidl::MethodType::TwoWay,
6288                    })
6289                }
6290                _ => Err(fidl::Error::UnknownOrdinal {
6291                    ordinal: header.ordinal,
6292                    protocol_name: <DictionaryKeysIteratorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
6293                }),
6294            }))
6295            },
6296        )
6297    }
6298}
6299
6300#[derive(Debug)]
6301pub enum DictionaryKeysIteratorRequest {
6302    GetNext {
6303        responder: DictionaryKeysIteratorGetNextResponder,
6304    },
6305    /// An interaction was received which does not match any known method.
6306    #[non_exhaustive]
6307    _UnknownMethod {
6308        /// Ordinal of the method that was called.
6309        ordinal: u64,
6310        control_handle: DictionaryKeysIteratorControlHandle,
6311        method_type: fidl::MethodType,
6312    },
6313}
6314
6315impl DictionaryKeysIteratorRequest {
6316    #[allow(irrefutable_let_patterns)]
6317    pub fn into_get_next(self) -> Option<(DictionaryKeysIteratorGetNextResponder)> {
6318        if let DictionaryKeysIteratorRequest::GetNext { responder } = self {
6319            Some((responder))
6320        } else {
6321            None
6322        }
6323    }
6324
6325    /// Name of the method defined in FIDL
6326    pub fn method_name(&self) -> &'static str {
6327        match *self {
6328            DictionaryKeysIteratorRequest::GetNext { .. } => "get_next",
6329            DictionaryKeysIteratorRequest::_UnknownMethod {
6330                method_type: fidl::MethodType::OneWay,
6331                ..
6332            } => "unknown one-way method",
6333            DictionaryKeysIteratorRequest::_UnknownMethod {
6334                method_type: fidl::MethodType::TwoWay,
6335                ..
6336            } => "unknown two-way method",
6337        }
6338    }
6339}
6340
6341#[derive(Debug, Clone)]
6342pub struct DictionaryKeysIteratorControlHandle {
6343    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
6344}
6345
6346impl fdomain_client::fidl::ControlHandle for DictionaryKeysIteratorControlHandle {
6347    fn shutdown(&self) {
6348        self.inner.shutdown()
6349    }
6350
6351    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
6352        self.inner.shutdown_with_epitaph(status)
6353    }
6354
6355    fn is_closed(&self) -> bool {
6356        self.inner.channel().is_closed()
6357    }
6358    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
6359        self.inner.channel().on_closed()
6360    }
6361}
6362
6363impl DictionaryKeysIteratorControlHandle {}
6364
6365#[must_use = "FIDL methods require a response to be sent"]
6366#[derive(Debug)]
6367pub struct DictionaryKeysIteratorGetNextResponder {
6368    control_handle: std::mem::ManuallyDrop<DictionaryKeysIteratorControlHandle>,
6369    tx_id: u32,
6370}
6371
6372/// Set the the channel to be shutdown (see [`DictionaryKeysIteratorControlHandle::shutdown`])
6373/// if the responder is dropped without sending a response, so that the client
6374/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6375impl std::ops::Drop for DictionaryKeysIteratorGetNextResponder {
6376    fn drop(&mut self) {
6377        self.control_handle.shutdown();
6378        // Safety: drops once, never accessed again
6379        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6380    }
6381}
6382
6383impl fdomain_client::fidl::Responder for DictionaryKeysIteratorGetNextResponder {
6384    type ControlHandle = DictionaryKeysIteratorControlHandle;
6385
6386    fn control_handle(&self) -> &DictionaryKeysIteratorControlHandle {
6387        &self.control_handle
6388    }
6389
6390    fn drop_without_shutdown(mut self) {
6391        // Safety: drops once, never accessed again due to mem::forget
6392        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6393        // Prevent Drop from running (which would shut down the channel)
6394        std::mem::forget(self);
6395    }
6396}
6397
6398impl DictionaryKeysIteratorGetNextResponder {
6399    /// Sends a response to the FIDL transaction.
6400    ///
6401    /// Sets the channel to shutdown if an error occurs.
6402    pub fn send(self, mut keys: &[String]) -> Result<(), fidl::Error> {
6403        let _result = self.send_raw(keys);
6404        if _result.is_err() {
6405            self.control_handle.shutdown();
6406        }
6407        self.drop_without_shutdown();
6408        _result
6409    }
6410
6411    /// Similar to "send" but does not shutdown the channel if an error occurs.
6412    pub fn send_no_shutdown_on_err(self, mut keys: &[String]) -> Result<(), fidl::Error> {
6413        let _result = self.send_raw(keys);
6414        self.drop_without_shutdown();
6415        _result
6416    }
6417
6418    fn send_raw(&self, mut keys: &[String]) -> Result<(), fidl::Error> {
6419        self.control_handle
6420            .inner
6421            .send::<fidl::encoding::FlexibleType<DictionaryKeysIteratorGetNextResponse>>(
6422                fidl::encoding::Flexible::new((keys,)),
6423                self.tx_id,
6424                0x453828cbacca7d53,
6425                fidl::encoding::DynamicFlags::FLEXIBLE,
6426            )
6427    }
6428}
6429
6430#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6431pub struct DictionaryRouterMarker;
6432
6433impl fdomain_client::fidl::ProtocolMarker for DictionaryRouterMarker {
6434    type Proxy = DictionaryRouterProxy;
6435    type RequestStream = DictionaryRouterRequestStream;
6436
6437    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.DictionaryRouter";
6438}
6439impl fdomain_client::fidl::DiscoverableProtocolMarker for DictionaryRouterMarker {}
6440pub type DictionaryRouterRouteResult = Result<DictionaryRouterRouteResponse, RouterError>;
6441
6442pub trait DictionaryRouterProxyInterface: Send + Sync {
6443    type RouteResponseFut: std::future::Future<Output = Result<DictionaryRouterRouteResult, fidl::Error>>
6444        + Send;
6445    fn r#route(&self, payload: RouteRequest) -> Self::RouteResponseFut;
6446}
6447
6448#[derive(Debug, Clone)]
6449pub struct DictionaryRouterProxy {
6450    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
6451}
6452
6453impl fdomain_client::fidl::Proxy for DictionaryRouterProxy {
6454    type Protocol = DictionaryRouterMarker;
6455
6456    fn from_channel(inner: fdomain_client::Channel) -> Self {
6457        Self::new(inner)
6458    }
6459
6460    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
6461        self.client.into_channel().map_err(|client| Self { client })
6462    }
6463
6464    fn as_channel(&self) -> &fdomain_client::Channel {
6465        self.client.as_channel()
6466    }
6467}
6468
6469impl DictionaryRouterProxy {
6470    /// Create a new Proxy for fuchsia.component.sandbox/DictionaryRouter.
6471    pub fn new(channel: fdomain_client::Channel) -> Self {
6472        let protocol_name =
6473            <DictionaryRouterMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
6474        Self { client: fidl::client::Client::new(channel, protocol_name) }
6475    }
6476
6477    /// Get a Stream of events from the remote end of the protocol.
6478    ///
6479    /// # Panics
6480    ///
6481    /// Panics if the event stream was already taken.
6482    pub fn take_event_stream(&self) -> DictionaryRouterEventStream {
6483        DictionaryRouterEventStream { event_receiver: self.client.take_event_receiver() }
6484    }
6485
6486    pub fn r#route(
6487        &self,
6488        mut payload: RouteRequest,
6489    ) -> fidl::client::QueryResponseFut<
6490        DictionaryRouterRouteResult,
6491        fdomain_client::fidl::FDomainResourceDialect,
6492    > {
6493        DictionaryRouterProxyInterface::r#route(self, payload)
6494    }
6495}
6496
6497impl DictionaryRouterProxyInterface for DictionaryRouterProxy {
6498    type RouteResponseFut = fidl::client::QueryResponseFut<
6499        DictionaryRouterRouteResult,
6500        fdomain_client::fidl::FDomainResourceDialect,
6501    >;
6502    fn r#route(&self, mut payload: RouteRequest) -> Self::RouteResponseFut {
6503        fn _decode(
6504            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6505        ) -> Result<DictionaryRouterRouteResult, fidl::Error> {
6506            let _response = fidl::client::decode_transaction_body::<
6507                fidl::encoding::FlexibleResultType<DictionaryRouterRouteResponse, RouterError>,
6508                fdomain_client::fidl::FDomainResourceDialect,
6509                0x714c65bfe54bd79f,
6510            >(_buf?)?
6511            .into_result_fdomain::<DictionaryRouterMarker>("route")?;
6512            Ok(_response.map(|x| x))
6513        }
6514        self.client.send_query_and_decode::<RouteRequest, DictionaryRouterRouteResult>(
6515            &mut payload,
6516            0x714c65bfe54bd79f,
6517            fidl::encoding::DynamicFlags::FLEXIBLE,
6518            _decode,
6519        )
6520    }
6521}
6522
6523pub struct DictionaryRouterEventStream {
6524    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
6525}
6526
6527impl std::marker::Unpin for DictionaryRouterEventStream {}
6528
6529impl futures::stream::FusedStream for DictionaryRouterEventStream {
6530    fn is_terminated(&self) -> bool {
6531        self.event_receiver.is_terminated()
6532    }
6533}
6534
6535impl futures::Stream for DictionaryRouterEventStream {
6536    type Item = Result<DictionaryRouterEvent, fidl::Error>;
6537
6538    fn poll_next(
6539        mut self: std::pin::Pin<&mut Self>,
6540        cx: &mut std::task::Context<'_>,
6541    ) -> std::task::Poll<Option<Self::Item>> {
6542        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6543            &mut self.event_receiver,
6544            cx
6545        )?) {
6546            Some(buf) => std::task::Poll::Ready(Some(DictionaryRouterEvent::decode(buf))),
6547            None => std::task::Poll::Ready(None),
6548        }
6549    }
6550}
6551
6552#[derive(Debug)]
6553pub enum DictionaryRouterEvent {
6554    #[non_exhaustive]
6555    _UnknownEvent {
6556        /// Ordinal of the event that was sent.
6557        ordinal: u64,
6558    },
6559}
6560
6561impl DictionaryRouterEvent {
6562    /// Decodes a message buffer as a [`DictionaryRouterEvent`].
6563    fn decode(
6564        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6565    ) -> Result<DictionaryRouterEvent, fidl::Error> {
6566        let (bytes, _handles) = buf.split_mut();
6567        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6568        debug_assert_eq!(tx_header.tx_id, 0);
6569        match tx_header.ordinal {
6570            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6571                Ok(DictionaryRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
6572            }
6573            _ => Err(fidl::Error::UnknownOrdinal {
6574                ordinal: tx_header.ordinal,
6575                protocol_name:
6576                    <DictionaryRouterMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
6577            }),
6578        }
6579    }
6580}
6581
6582/// A Stream of incoming requests for fuchsia.component.sandbox/DictionaryRouter.
6583pub struct DictionaryRouterRequestStream {
6584    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
6585    is_terminated: bool,
6586}
6587
6588impl std::marker::Unpin for DictionaryRouterRequestStream {}
6589
6590impl futures::stream::FusedStream for DictionaryRouterRequestStream {
6591    fn is_terminated(&self) -> bool {
6592        self.is_terminated
6593    }
6594}
6595
6596impl fdomain_client::fidl::RequestStream for DictionaryRouterRequestStream {
6597    type Protocol = DictionaryRouterMarker;
6598    type ControlHandle = DictionaryRouterControlHandle;
6599
6600    fn from_channel(channel: fdomain_client::Channel) -> Self {
6601        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6602    }
6603
6604    fn control_handle(&self) -> Self::ControlHandle {
6605        DictionaryRouterControlHandle { inner: self.inner.clone() }
6606    }
6607
6608    fn into_inner(
6609        self,
6610    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
6611    {
6612        (self.inner, self.is_terminated)
6613    }
6614
6615    fn from_inner(
6616        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
6617        is_terminated: bool,
6618    ) -> Self {
6619        Self { inner, is_terminated }
6620    }
6621}
6622
6623impl futures::Stream for DictionaryRouterRequestStream {
6624    type Item = Result<DictionaryRouterRequest, fidl::Error>;
6625
6626    fn poll_next(
6627        mut self: std::pin::Pin<&mut Self>,
6628        cx: &mut std::task::Context<'_>,
6629    ) -> std::task::Poll<Option<Self::Item>> {
6630        let this = &mut *self;
6631        if this.inner.check_shutdown(cx) {
6632            this.is_terminated = true;
6633            return std::task::Poll::Ready(None);
6634        }
6635        if this.is_terminated {
6636            panic!("polled DictionaryRouterRequestStream after completion");
6637        }
6638        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
6639            |bytes, handles| {
6640                match this.inner.channel().read_etc(cx, bytes, handles) {
6641                    std::task::Poll::Ready(Ok(())) => {}
6642                    std::task::Poll::Pending => return std::task::Poll::Pending,
6643                    std::task::Poll::Ready(Err(None)) => {
6644                        this.is_terminated = true;
6645                        return std::task::Poll::Ready(None);
6646                    }
6647                    std::task::Poll::Ready(Err(Some(e))) => {
6648                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6649                            e.into(),
6650                        ))));
6651                    }
6652                }
6653
6654                // A message has been received from the channel
6655                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6656
6657                std::task::Poll::Ready(Some(match header.ordinal {
6658                0x714c65bfe54bd79f => {
6659                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6660                    let mut req = fidl::new_empty!(RouteRequest, fdomain_client::fidl::FDomainResourceDialect);
6661                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<RouteRequest>(&header, _body_bytes, handles, &mut req)?;
6662                    let control_handle = DictionaryRouterControlHandle {
6663                        inner: this.inner.clone(),
6664                    };
6665                    Ok(DictionaryRouterRequest::Route {payload: req,
6666                        responder: DictionaryRouterRouteResponder {
6667                            control_handle: std::mem::ManuallyDrop::new(control_handle),
6668                            tx_id: header.tx_id,
6669                        },
6670                    })
6671                }
6672                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6673                    Ok(DictionaryRouterRequest::_UnknownMethod {
6674                        ordinal: header.ordinal,
6675                        control_handle: DictionaryRouterControlHandle { inner: this.inner.clone() },
6676                        method_type: fidl::MethodType::OneWay,
6677                    })
6678                }
6679                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6680                    this.inner.send_framework_err(
6681                        fidl::encoding::FrameworkErr::UnknownMethod,
6682                        header.tx_id,
6683                        header.ordinal,
6684                        header.dynamic_flags(),
6685                        (bytes, handles),
6686                    )?;
6687                    Ok(DictionaryRouterRequest::_UnknownMethod {
6688                        ordinal: header.ordinal,
6689                        control_handle: DictionaryRouterControlHandle { inner: this.inner.clone() },
6690                        method_type: fidl::MethodType::TwoWay,
6691                    })
6692                }
6693                _ => Err(fidl::Error::UnknownOrdinal {
6694                    ordinal: header.ordinal,
6695                    protocol_name: <DictionaryRouterMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
6696                }),
6697            }))
6698            },
6699        )
6700    }
6701}
6702
6703#[derive(Debug)]
6704pub enum DictionaryRouterRequest {
6705    Route {
6706        payload: RouteRequest,
6707        responder: DictionaryRouterRouteResponder,
6708    },
6709    /// An interaction was received which does not match any known method.
6710    #[non_exhaustive]
6711    _UnknownMethod {
6712        /// Ordinal of the method that was called.
6713        ordinal: u64,
6714        control_handle: DictionaryRouterControlHandle,
6715        method_type: fidl::MethodType,
6716    },
6717}
6718
6719impl DictionaryRouterRequest {
6720    #[allow(irrefutable_let_patterns)]
6721    pub fn into_route(self) -> Option<(RouteRequest, DictionaryRouterRouteResponder)> {
6722        if let DictionaryRouterRequest::Route { payload, responder } = self {
6723            Some((payload, responder))
6724        } else {
6725            None
6726        }
6727    }
6728
6729    /// Name of the method defined in FIDL
6730    pub fn method_name(&self) -> &'static str {
6731        match *self {
6732            DictionaryRouterRequest::Route { .. } => "route",
6733            DictionaryRouterRequest::_UnknownMethod {
6734                method_type: fidl::MethodType::OneWay,
6735                ..
6736            } => "unknown one-way method",
6737            DictionaryRouterRequest::_UnknownMethod {
6738                method_type: fidl::MethodType::TwoWay,
6739                ..
6740            } => "unknown two-way method",
6741        }
6742    }
6743}
6744
6745#[derive(Debug, Clone)]
6746pub struct DictionaryRouterControlHandle {
6747    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
6748}
6749
6750impl fdomain_client::fidl::ControlHandle for DictionaryRouterControlHandle {
6751    fn shutdown(&self) {
6752        self.inner.shutdown()
6753    }
6754
6755    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
6756        self.inner.shutdown_with_epitaph(status)
6757    }
6758
6759    fn is_closed(&self) -> bool {
6760        self.inner.channel().is_closed()
6761    }
6762    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
6763        self.inner.channel().on_closed()
6764    }
6765}
6766
6767impl DictionaryRouterControlHandle {}
6768
6769#[must_use = "FIDL methods require a response to be sent"]
6770#[derive(Debug)]
6771pub struct DictionaryRouterRouteResponder {
6772    control_handle: std::mem::ManuallyDrop<DictionaryRouterControlHandle>,
6773    tx_id: u32,
6774}
6775
6776/// Set the the channel to be shutdown (see [`DictionaryRouterControlHandle::shutdown`])
6777/// if the responder is dropped without sending a response, so that the client
6778/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6779impl std::ops::Drop for DictionaryRouterRouteResponder {
6780    fn drop(&mut self) {
6781        self.control_handle.shutdown();
6782        // Safety: drops once, never accessed again
6783        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6784    }
6785}
6786
6787impl fdomain_client::fidl::Responder for DictionaryRouterRouteResponder {
6788    type ControlHandle = DictionaryRouterControlHandle;
6789
6790    fn control_handle(&self) -> &DictionaryRouterControlHandle {
6791        &self.control_handle
6792    }
6793
6794    fn drop_without_shutdown(mut self) {
6795        // Safety: drops once, never accessed again due to mem::forget
6796        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6797        // Prevent Drop from running (which would shut down the channel)
6798        std::mem::forget(self);
6799    }
6800}
6801
6802impl DictionaryRouterRouteResponder {
6803    /// Sends a response to the FIDL transaction.
6804    ///
6805    /// Sets the channel to shutdown if an error occurs.
6806    pub fn send(
6807        self,
6808        mut result: Result<DictionaryRouterRouteResponse, RouterError>,
6809    ) -> Result<(), fidl::Error> {
6810        let _result = self.send_raw(result);
6811        if _result.is_err() {
6812            self.control_handle.shutdown();
6813        }
6814        self.drop_without_shutdown();
6815        _result
6816    }
6817
6818    /// Similar to "send" but does not shutdown the channel if an error occurs.
6819    pub fn send_no_shutdown_on_err(
6820        self,
6821        mut result: Result<DictionaryRouterRouteResponse, RouterError>,
6822    ) -> Result<(), fidl::Error> {
6823        let _result = self.send_raw(result);
6824        self.drop_without_shutdown();
6825        _result
6826    }
6827
6828    fn send_raw(
6829        &self,
6830        mut result: Result<DictionaryRouterRouteResponse, RouterError>,
6831    ) -> Result<(), fidl::Error> {
6832        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
6833            DictionaryRouterRouteResponse,
6834            RouterError,
6835        >>(
6836            fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
6837            self.tx_id,
6838            0x714c65bfe54bd79f,
6839            fidl::encoding::DynamicFlags::FLEXIBLE,
6840        )
6841    }
6842}
6843
6844#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6845pub struct DirConnectorRouterMarker;
6846
6847impl fdomain_client::fidl::ProtocolMarker for DirConnectorRouterMarker {
6848    type Proxy = DirConnectorRouterProxy;
6849    type RequestStream = DirConnectorRouterRequestStream;
6850
6851    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.DirConnectorRouter";
6852}
6853impl fdomain_client::fidl::DiscoverableProtocolMarker for DirConnectorRouterMarker {}
6854pub type DirConnectorRouterRouteResult = Result<DirConnectorRouterRouteResponse, RouterError>;
6855
6856pub trait DirConnectorRouterProxyInterface: Send + Sync {
6857    type RouteResponseFut: std::future::Future<Output = Result<DirConnectorRouterRouteResult, fidl::Error>>
6858        + Send;
6859    fn r#route(&self, payload: RouteRequest) -> Self::RouteResponseFut;
6860}
6861
6862#[derive(Debug, Clone)]
6863pub struct DirConnectorRouterProxy {
6864    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
6865}
6866
6867impl fdomain_client::fidl::Proxy for DirConnectorRouterProxy {
6868    type Protocol = DirConnectorRouterMarker;
6869
6870    fn from_channel(inner: fdomain_client::Channel) -> Self {
6871        Self::new(inner)
6872    }
6873
6874    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
6875        self.client.into_channel().map_err(|client| Self { client })
6876    }
6877
6878    fn as_channel(&self) -> &fdomain_client::Channel {
6879        self.client.as_channel()
6880    }
6881}
6882
6883impl DirConnectorRouterProxy {
6884    /// Create a new Proxy for fuchsia.component.sandbox/DirConnectorRouter.
6885    pub fn new(channel: fdomain_client::Channel) -> Self {
6886        let protocol_name =
6887            <DirConnectorRouterMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
6888        Self { client: fidl::client::Client::new(channel, protocol_name) }
6889    }
6890
6891    /// Get a Stream of events from the remote end of the protocol.
6892    ///
6893    /// # Panics
6894    ///
6895    /// Panics if the event stream was already taken.
6896    pub fn take_event_stream(&self) -> DirConnectorRouterEventStream {
6897        DirConnectorRouterEventStream { event_receiver: self.client.take_event_receiver() }
6898    }
6899
6900    pub fn r#route(
6901        &self,
6902        mut payload: RouteRequest,
6903    ) -> fidl::client::QueryResponseFut<
6904        DirConnectorRouterRouteResult,
6905        fdomain_client::fidl::FDomainResourceDialect,
6906    > {
6907        DirConnectorRouterProxyInterface::r#route(self, payload)
6908    }
6909}
6910
6911impl DirConnectorRouterProxyInterface for DirConnectorRouterProxy {
6912    type RouteResponseFut = fidl::client::QueryResponseFut<
6913        DirConnectorRouterRouteResult,
6914        fdomain_client::fidl::FDomainResourceDialect,
6915    >;
6916    fn r#route(&self, mut payload: RouteRequest) -> Self::RouteResponseFut {
6917        fn _decode(
6918            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6919        ) -> Result<DirConnectorRouterRouteResult, fidl::Error> {
6920            let _response = fidl::client::decode_transaction_body::<
6921                fidl::encoding::FlexibleResultType<DirConnectorRouterRouteResponse, RouterError>,
6922                fdomain_client::fidl::FDomainResourceDialect,
6923                0xd7e0f01da2c8e40,
6924            >(_buf?)?
6925            .into_result_fdomain::<DirConnectorRouterMarker>("route")?;
6926            Ok(_response.map(|x| x))
6927        }
6928        self.client.send_query_and_decode::<RouteRequest, DirConnectorRouterRouteResult>(
6929            &mut payload,
6930            0xd7e0f01da2c8e40,
6931            fidl::encoding::DynamicFlags::FLEXIBLE,
6932            _decode,
6933        )
6934    }
6935}
6936
6937pub struct DirConnectorRouterEventStream {
6938    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
6939}
6940
6941impl std::marker::Unpin for DirConnectorRouterEventStream {}
6942
6943impl futures::stream::FusedStream for DirConnectorRouterEventStream {
6944    fn is_terminated(&self) -> bool {
6945        self.event_receiver.is_terminated()
6946    }
6947}
6948
6949impl futures::Stream for DirConnectorRouterEventStream {
6950    type Item = Result<DirConnectorRouterEvent, fidl::Error>;
6951
6952    fn poll_next(
6953        mut self: std::pin::Pin<&mut Self>,
6954        cx: &mut std::task::Context<'_>,
6955    ) -> std::task::Poll<Option<Self::Item>> {
6956        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6957            &mut self.event_receiver,
6958            cx
6959        )?) {
6960            Some(buf) => std::task::Poll::Ready(Some(DirConnectorRouterEvent::decode(buf))),
6961            None => std::task::Poll::Ready(None),
6962        }
6963    }
6964}
6965
6966#[derive(Debug)]
6967pub enum DirConnectorRouterEvent {
6968    #[non_exhaustive]
6969    _UnknownEvent {
6970        /// Ordinal of the event that was sent.
6971        ordinal: u64,
6972    },
6973}
6974
6975impl DirConnectorRouterEvent {
6976    /// Decodes a message buffer as a [`DirConnectorRouterEvent`].
6977    fn decode(
6978        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6979    ) -> Result<DirConnectorRouterEvent, fidl::Error> {
6980        let (bytes, _handles) = buf.split_mut();
6981        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6982        debug_assert_eq!(tx_header.tx_id, 0);
6983        match tx_header.ordinal {
6984            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6985                Ok(DirConnectorRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
6986            }
6987            _ => Err(fidl::Error::UnknownOrdinal {
6988                ordinal: tx_header.ordinal,
6989                protocol_name:
6990                    <DirConnectorRouterMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
6991            }),
6992        }
6993    }
6994}
6995
6996/// A Stream of incoming requests for fuchsia.component.sandbox/DirConnectorRouter.
6997pub struct DirConnectorRouterRequestStream {
6998    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
6999    is_terminated: bool,
7000}
7001
7002impl std::marker::Unpin for DirConnectorRouterRequestStream {}
7003
7004impl futures::stream::FusedStream for DirConnectorRouterRequestStream {
7005    fn is_terminated(&self) -> bool {
7006        self.is_terminated
7007    }
7008}
7009
7010impl fdomain_client::fidl::RequestStream for DirConnectorRouterRequestStream {
7011    type Protocol = DirConnectorRouterMarker;
7012    type ControlHandle = DirConnectorRouterControlHandle;
7013
7014    fn from_channel(channel: fdomain_client::Channel) -> Self {
7015        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7016    }
7017
7018    fn control_handle(&self) -> Self::ControlHandle {
7019        DirConnectorRouterControlHandle { inner: self.inner.clone() }
7020    }
7021
7022    fn into_inner(
7023        self,
7024    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
7025    {
7026        (self.inner, self.is_terminated)
7027    }
7028
7029    fn from_inner(
7030        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
7031        is_terminated: bool,
7032    ) -> Self {
7033        Self { inner, is_terminated }
7034    }
7035}
7036
7037impl futures::Stream for DirConnectorRouterRequestStream {
7038    type Item = Result<DirConnectorRouterRequest, fidl::Error>;
7039
7040    fn poll_next(
7041        mut self: std::pin::Pin<&mut Self>,
7042        cx: &mut std::task::Context<'_>,
7043    ) -> std::task::Poll<Option<Self::Item>> {
7044        let this = &mut *self;
7045        if this.inner.check_shutdown(cx) {
7046            this.is_terminated = true;
7047            return std::task::Poll::Ready(None);
7048        }
7049        if this.is_terminated {
7050            panic!("polled DirConnectorRouterRequestStream after completion");
7051        }
7052        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
7053            |bytes, handles| {
7054                match this.inner.channel().read_etc(cx, bytes, handles) {
7055                    std::task::Poll::Ready(Ok(())) => {}
7056                    std::task::Poll::Pending => return std::task::Poll::Pending,
7057                    std::task::Poll::Ready(Err(None)) => {
7058                        this.is_terminated = true;
7059                        return std::task::Poll::Ready(None);
7060                    }
7061                    std::task::Poll::Ready(Err(Some(e))) => {
7062                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7063                            e.into(),
7064                        ))));
7065                    }
7066                }
7067
7068                // A message has been received from the channel
7069                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7070
7071                std::task::Poll::Ready(Some(match header.ordinal {
7072                0xd7e0f01da2c8e40 => {
7073                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7074                    let mut req = fidl::new_empty!(RouteRequest, fdomain_client::fidl::FDomainResourceDialect);
7075                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<RouteRequest>(&header, _body_bytes, handles, &mut req)?;
7076                    let control_handle = DirConnectorRouterControlHandle {
7077                        inner: this.inner.clone(),
7078                    };
7079                    Ok(DirConnectorRouterRequest::Route {payload: req,
7080                        responder: DirConnectorRouterRouteResponder {
7081                            control_handle: std::mem::ManuallyDrop::new(control_handle),
7082                            tx_id: header.tx_id,
7083                        },
7084                    })
7085                }
7086                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7087                    Ok(DirConnectorRouterRequest::_UnknownMethod {
7088                        ordinal: header.ordinal,
7089                        control_handle: DirConnectorRouterControlHandle { inner: this.inner.clone() },
7090                        method_type: fidl::MethodType::OneWay,
7091                    })
7092                }
7093                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7094                    this.inner.send_framework_err(
7095                        fidl::encoding::FrameworkErr::UnknownMethod,
7096                        header.tx_id,
7097                        header.ordinal,
7098                        header.dynamic_flags(),
7099                        (bytes, handles),
7100                    )?;
7101                    Ok(DirConnectorRouterRequest::_UnknownMethod {
7102                        ordinal: header.ordinal,
7103                        control_handle: DirConnectorRouterControlHandle { inner: this.inner.clone() },
7104                        method_type: fidl::MethodType::TwoWay,
7105                    })
7106                }
7107                _ => Err(fidl::Error::UnknownOrdinal {
7108                    ordinal: header.ordinal,
7109                    protocol_name: <DirConnectorRouterMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
7110                }),
7111            }))
7112            },
7113        )
7114    }
7115}
7116
7117#[derive(Debug)]
7118pub enum DirConnectorRouterRequest {
7119    Route {
7120        payload: RouteRequest,
7121        responder: DirConnectorRouterRouteResponder,
7122    },
7123    /// An interaction was received which does not match any known method.
7124    #[non_exhaustive]
7125    _UnknownMethod {
7126        /// Ordinal of the method that was called.
7127        ordinal: u64,
7128        control_handle: DirConnectorRouterControlHandle,
7129        method_type: fidl::MethodType,
7130    },
7131}
7132
7133impl DirConnectorRouterRequest {
7134    #[allow(irrefutable_let_patterns)]
7135    pub fn into_route(self) -> Option<(RouteRequest, DirConnectorRouterRouteResponder)> {
7136        if let DirConnectorRouterRequest::Route { payload, responder } = self {
7137            Some((payload, responder))
7138        } else {
7139            None
7140        }
7141    }
7142
7143    /// Name of the method defined in FIDL
7144    pub fn method_name(&self) -> &'static str {
7145        match *self {
7146            DirConnectorRouterRequest::Route { .. } => "route",
7147            DirConnectorRouterRequest::_UnknownMethod {
7148                method_type: fidl::MethodType::OneWay,
7149                ..
7150            } => "unknown one-way method",
7151            DirConnectorRouterRequest::_UnknownMethod {
7152                method_type: fidl::MethodType::TwoWay,
7153                ..
7154            } => "unknown two-way method",
7155        }
7156    }
7157}
7158
7159#[derive(Debug, Clone)]
7160pub struct DirConnectorRouterControlHandle {
7161    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
7162}
7163
7164impl fdomain_client::fidl::ControlHandle for DirConnectorRouterControlHandle {
7165    fn shutdown(&self) {
7166        self.inner.shutdown()
7167    }
7168
7169    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
7170        self.inner.shutdown_with_epitaph(status)
7171    }
7172
7173    fn is_closed(&self) -> bool {
7174        self.inner.channel().is_closed()
7175    }
7176    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
7177        self.inner.channel().on_closed()
7178    }
7179}
7180
7181impl DirConnectorRouterControlHandle {}
7182
7183#[must_use = "FIDL methods require a response to be sent"]
7184#[derive(Debug)]
7185pub struct DirConnectorRouterRouteResponder {
7186    control_handle: std::mem::ManuallyDrop<DirConnectorRouterControlHandle>,
7187    tx_id: u32,
7188}
7189
7190/// Set the the channel to be shutdown (see [`DirConnectorRouterControlHandle::shutdown`])
7191/// if the responder is dropped without sending a response, so that the client
7192/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7193impl std::ops::Drop for DirConnectorRouterRouteResponder {
7194    fn drop(&mut self) {
7195        self.control_handle.shutdown();
7196        // Safety: drops once, never accessed again
7197        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7198    }
7199}
7200
7201impl fdomain_client::fidl::Responder for DirConnectorRouterRouteResponder {
7202    type ControlHandle = DirConnectorRouterControlHandle;
7203
7204    fn control_handle(&self) -> &DirConnectorRouterControlHandle {
7205        &self.control_handle
7206    }
7207
7208    fn drop_without_shutdown(mut self) {
7209        // Safety: drops once, never accessed again due to mem::forget
7210        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7211        // Prevent Drop from running (which would shut down the channel)
7212        std::mem::forget(self);
7213    }
7214}
7215
7216impl DirConnectorRouterRouteResponder {
7217    /// Sends a response to the FIDL transaction.
7218    ///
7219    /// Sets the channel to shutdown if an error occurs.
7220    pub fn send(
7221        self,
7222        mut result: Result<DirConnectorRouterRouteResponse, RouterError>,
7223    ) -> Result<(), fidl::Error> {
7224        let _result = self.send_raw(result);
7225        if _result.is_err() {
7226            self.control_handle.shutdown();
7227        }
7228        self.drop_without_shutdown();
7229        _result
7230    }
7231
7232    /// Similar to "send" but does not shutdown the channel if an error occurs.
7233    pub fn send_no_shutdown_on_err(
7234        self,
7235        mut result: Result<DirConnectorRouterRouteResponse, RouterError>,
7236    ) -> Result<(), fidl::Error> {
7237        let _result = self.send_raw(result);
7238        self.drop_without_shutdown();
7239        _result
7240    }
7241
7242    fn send_raw(
7243        &self,
7244        mut result: Result<DirConnectorRouterRouteResponse, RouterError>,
7245    ) -> Result<(), fidl::Error> {
7246        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
7247            DirConnectorRouterRouteResponse,
7248            RouterError,
7249        >>(
7250            fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
7251            self.tx_id,
7252            0xd7e0f01da2c8e40,
7253            fidl::encoding::DynamicFlags::FLEXIBLE,
7254        )
7255    }
7256}
7257
7258#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
7259pub struct DirEntryRouterMarker;
7260
7261impl fdomain_client::fidl::ProtocolMarker for DirEntryRouterMarker {
7262    type Proxy = DirEntryRouterProxy;
7263    type RequestStream = DirEntryRouterRequestStream;
7264
7265    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.DirEntryRouter";
7266}
7267impl fdomain_client::fidl::DiscoverableProtocolMarker for DirEntryRouterMarker {}
7268pub type DirEntryRouterRouteResult = Result<DirEntryRouterRouteResponse, RouterError>;
7269
7270pub trait DirEntryRouterProxyInterface: Send + Sync {
7271    type RouteResponseFut: std::future::Future<Output = Result<DirEntryRouterRouteResult, fidl::Error>>
7272        + Send;
7273    fn r#route(&self, payload: RouteRequest) -> Self::RouteResponseFut;
7274}
7275
7276#[derive(Debug, Clone)]
7277pub struct DirEntryRouterProxy {
7278    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
7279}
7280
7281impl fdomain_client::fidl::Proxy for DirEntryRouterProxy {
7282    type Protocol = DirEntryRouterMarker;
7283
7284    fn from_channel(inner: fdomain_client::Channel) -> Self {
7285        Self::new(inner)
7286    }
7287
7288    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
7289        self.client.into_channel().map_err(|client| Self { client })
7290    }
7291
7292    fn as_channel(&self) -> &fdomain_client::Channel {
7293        self.client.as_channel()
7294    }
7295}
7296
7297impl DirEntryRouterProxy {
7298    /// Create a new Proxy for fuchsia.component.sandbox/DirEntryRouter.
7299    pub fn new(channel: fdomain_client::Channel) -> Self {
7300        let protocol_name =
7301            <DirEntryRouterMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
7302        Self { client: fidl::client::Client::new(channel, protocol_name) }
7303    }
7304
7305    /// Get a Stream of events from the remote end of the protocol.
7306    ///
7307    /// # Panics
7308    ///
7309    /// Panics if the event stream was already taken.
7310    pub fn take_event_stream(&self) -> DirEntryRouterEventStream {
7311        DirEntryRouterEventStream { event_receiver: self.client.take_event_receiver() }
7312    }
7313
7314    pub fn r#route(
7315        &self,
7316        mut payload: RouteRequest,
7317    ) -> fidl::client::QueryResponseFut<
7318        DirEntryRouterRouteResult,
7319        fdomain_client::fidl::FDomainResourceDialect,
7320    > {
7321        DirEntryRouterProxyInterface::r#route(self, payload)
7322    }
7323}
7324
7325impl DirEntryRouterProxyInterface for DirEntryRouterProxy {
7326    type RouteResponseFut = fidl::client::QueryResponseFut<
7327        DirEntryRouterRouteResult,
7328        fdomain_client::fidl::FDomainResourceDialect,
7329    >;
7330    fn r#route(&self, mut payload: RouteRequest) -> Self::RouteResponseFut {
7331        fn _decode(
7332            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7333        ) -> Result<DirEntryRouterRouteResult, fidl::Error> {
7334            let _response = fidl::client::decode_transaction_body::<
7335                fidl::encoding::FlexibleResultType<DirEntryRouterRouteResponse, RouterError>,
7336                fdomain_client::fidl::FDomainResourceDialect,
7337                0x1ac694001c208bd2,
7338            >(_buf?)?
7339            .into_result_fdomain::<DirEntryRouterMarker>("route")?;
7340            Ok(_response.map(|x| x))
7341        }
7342        self.client.send_query_and_decode::<RouteRequest, DirEntryRouterRouteResult>(
7343            &mut payload,
7344            0x1ac694001c208bd2,
7345            fidl::encoding::DynamicFlags::FLEXIBLE,
7346            _decode,
7347        )
7348    }
7349}
7350
7351pub struct DirEntryRouterEventStream {
7352    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
7353}
7354
7355impl std::marker::Unpin for DirEntryRouterEventStream {}
7356
7357impl futures::stream::FusedStream for DirEntryRouterEventStream {
7358    fn is_terminated(&self) -> bool {
7359        self.event_receiver.is_terminated()
7360    }
7361}
7362
7363impl futures::Stream for DirEntryRouterEventStream {
7364    type Item = Result<DirEntryRouterEvent, fidl::Error>;
7365
7366    fn poll_next(
7367        mut self: std::pin::Pin<&mut Self>,
7368        cx: &mut std::task::Context<'_>,
7369    ) -> std::task::Poll<Option<Self::Item>> {
7370        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7371            &mut self.event_receiver,
7372            cx
7373        )?) {
7374            Some(buf) => std::task::Poll::Ready(Some(DirEntryRouterEvent::decode(buf))),
7375            None => std::task::Poll::Ready(None),
7376        }
7377    }
7378}
7379
7380#[derive(Debug)]
7381pub enum DirEntryRouterEvent {
7382    #[non_exhaustive]
7383    _UnknownEvent {
7384        /// Ordinal of the event that was sent.
7385        ordinal: u64,
7386    },
7387}
7388
7389impl DirEntryRouterEvent {
7390    /// Decodes a message buffer as a [`DirEntryRouterEvent`].
7391    fn decode(
7392        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7393    ) -> Result<DirEntryRouterEvent, fidl::Error> {
7394        let (bytes, _handles) = buf.split_mut();
7395        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7396        debug_assert_eq!(tx_header.tx_id, 0);
7397        match tx_header.ordinal {
7398            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7399                Ok(DirEntryRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
7400            }
7401            _ => Err(fidl::Error::UnknownOrdinal {
7402                ordinal: tx_header.ordinal,
7403                protocol_name:
7404                    <DirEntryRouterMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
7405            }),
7406        }
7407    }
7408}
7409
7410/// A Stream of incoming requests for fuchsia.component.sandbox/DirEntryRouter.
7411pub struct DirEntryRouterRequestStream {
7412    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
7413    is_terminated: bool,
7414}
7415
7416impl std::marker::Unpin for DirEntryRouterRequestStream {}
7417
7418impl futures::stream::FusedStream for DirEntryRouterRequestStream {
7419    fn is_terminated(&self) -> bool {
7420        self.is_terminated
7421    }
7422}
7423
7424impl fdomain_client::fidl::RequestStream for DirEntryRouterRequestStream {
7425    type Protocol = DirEntryRouterMarker;
7426    type ControlHandle = DirEntryRouterControlHandle;
7427
7428    fn from_channel(channel: fdomain_client::Channel) -> Self {
7429        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7430    }
7431
7432    fn control_handle(&self) -> Self::ControlHandle {
7433        DirEntryRouterControlHandle { inner: self.inner.clone() }
7434    }
7435
7436    fn into_inner(
7437        self,
7438    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
7439    {
7440        (self.inner, self.is_terminated)
7441    }
7442
7443    fn from_inner(
7444        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
7445        is_terminated: bool,
7446    ) -> Self {
7447        Self { inner, is_terminated }
7448    }
7449}
7450
7451impl futures::Stream for DirEntryRouterRequestStream {
7452    type Item = Result<DirEntryRouterRequest, fidl::Error>;
7453
7454    fn poll_next(
7455        mut self: std::pin::Pin<&mut Self>,
7456        cx: &mut std::task::Context<'_>,
7457    ) -> std::task::Poll<Option<Self::Item>> {
7458        let this = &mut *self;
7459        if this.inner.check_shutdown(cx) {
7460            this.is_terminated = true;
7461            return std::task::Poll::Ready(None);
7462        }
7463        if this.is_terminated {
7464            panic!("polled DirEntryRouterRequestStream after completion");
7465        }
7466        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
7467            |bytes, handles| {
7468                match this.inner.channel().read_etc(cx, bytes, handles) {
7469                    std::task::Poll::Ready(Ok(())) => {}
7470                    std::task::Poll::Pending => return std::task::Poll::Pending,
7471                    std::task::Poll::Ready(Err(None)) => {
7472                        this.is_terminated = true;
7473                        return std::task::Poll::Ready(None);
7474                    }
7475                    std::task::Poll::Ready(Err(Some(e))) => {
7476                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7477                            e.into(),
7478                        ))));
7479                    }
7480                }
7481
7482                // A message has been received from the channel
7483                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7484
7485                std::task::Poll::Ready(Some(match header.ordinal {
7486                0x1ac694001c208bd2 => {
7487                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7488                    let mut req = fidl::new_empty!(RouteRequest, fdomain_client::fidl::FDomainResourceDialect);
7489                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<RouteRequest>(&header, _body_bytes, handles, &mut req)?;
7490                    let control_handle = DirEntryRouterControlHandle {
7491                        inner: this.inner.clone(),
7492                    };
7493                    Ok(DirEntryRouterRequest::Route {payload: req,
7494                        responder: DirEntryRouterRouteResponder {
7495                            control_handle: std::mem::ManuallyDrop::new(control_handle),
7496                            tx_id: header.tx_id,
7497                        },
7498                    })
7499                }
7500                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7501                    Ok(DirEntryRouterRequest::_UnknownMethod {
7502                        ordinal: header.ordinal,
7503                        control_handle: DirEntryRouterControlHandle { inner: this.inner.clone() },
7504                        method_type: fidl::MethodType::OneWay,
7505                    })
7506                }
7507                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7508                    this.inner.send_framework_err(
7509                        fidl::encoding::FrameworkErr::UnknownMethod,
7510                        header.tx_id,
7511                        header.ordinal,
7512                        header.dynamic_flags(),
7513                        (bytes, handles),
7514                    )?;
7515                    Ok(DirEntryRouterRequest::_UnknownMethod {
7516                        ordinal: header.ordinal,
7517                        control_handle: DirEntryRouterControlHandle { inner: this.inner.clone() },
7518                        method_type: fidl::MethodType::TwoWay,
7519                    })
7520                }
7521                _ => Err(fidl::Error::UnknownOrdinal {
7522                    ordinal: header.ordinal,
7523                    protocol_name: <DirEntryRouterMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
7524                }),
7525            }))
7526            },
7527        )
7528    }
7529}
7530
7531#[derive(Debug)]
7532pub enum DirEntryRouterRequest {
7533    Route {
7534        payload: RouteRequest,
7535        responder: DirEntryRouterRouteResponder,
7536    },
7537    /// An interaction was received which does not match any known method.
7538    #[non_exhaustive]
7539    _UnknownMethod {
7540        /// Ordinal of the method that was called.
7541        ordinal: u64,
7542        control_handle: DirEntryRouterControlHandle,
7543        method_type: fidl::MethodType,
7544    },
7545}
7546
7547impl DirEntryRouterRequest {
7548    #[allow(irrefutable_let_patterns)]
7549    pub fn into_route(self) -> Option<(RouteRequest, DirEntryRouterRouteResponder)> {
7550        if let DirEntryRouterRequest::Route { payload, responder } = self {
7551            Some((payload, responder))
7552        } else {
7553            None
7554        }
7555    }
7556
7557    /// Name of the method defined in FIDL
7558    pub fn method_name(&self) -> &'static str {
7559        match *self {
7560            DirEntryRouterRequest::Route { .. } => "route",
7561            DirEntryRouterRequest::_UnknownMethod {
7562                method_type: fidl::MethodType::OneWay, ..
7563            } => "unknown one-way method",
7564            DirEntryRouterRequest::_UnknownMethod {
7565                method_type: fidl::MethodType::TwoWay, ..
7566            } => "unknown two-way method",
7567        }
7568    }
7569}
7570
7571#[derive(Debug, Clone)]
7572pub struct DirEntryRouterControlHandle {
7573    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
7574}
7575
7576impl fdomain_client::fidl::ControlHandle for DirEntryRouterControlHandle {
7577    fn shutdown(&self) {
7578        self.inner.shutdown()
7579    }
7580
7581    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
7582        self.inner.shutdown_with_epitaph(status)
7583    }
7584
7585    fn is_closed(&self) -> bool {
7586        self.inner.channel().is_closed()
7587    }
7588    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
7589        self.inner.channel().on_closed()
7590    }
7591}
7592
7593impl DirEntryRouterControlHandle {}
7594
7595#[must_use = "FIDL methods require a response to be sent"]
7596#[derive(Debug)]
7597pub struct DirEntryRouterRouteResponder {
7598    control_handle: std::mem::ManuallyDrop<DirEntryRouterControlHandle>,
7599    tx_id: u32,
7600}
7601
7602/// Set the the channel to be shutdown (see [`DirEntryRouterControlHandle::shutdown`])
7603/// if the responder is dropped without sending a response, so that the client
7604/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7605impl std::ops::Drop for DirEntryRouterRouteResponder {
7606    fn drop(&mut self) {
7607        self.control_handle.shutdown();
7608        // Safety: drops once, never accessed again
7609        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7610    }
7611}
7612
7613impl fdomain_client::fidl::Responder for DirEntryRouterRouteResponder {
7614    type ControlHandle = DirEntryRouterControlHandle;
7615
7616    fn control_handle(&self) -> &DirEntryRouterControlHandle {
7617        &self.control_handle
7618    }
7619
7620    fn drop_without_shutdown(mut self) {
7621        // Safety: drops once, never accessed again due to mem::forget
7622        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7623        // Prevent Drop from running (which would shut down the channel)
7624        std::mem::forget(self);
7625    }
7626}
7627
7628impl DirEntryRouterRouteResponder {
7629    /// Sends a response to the FIDL transaction.
7630    ///
7631    /// Sets the channel to shutdown if an error occurs.
7632    pub fn send(
7633        self,
7634        mut result: Result<DirEntryRouterRouteResponse, RouterError>,
7635    ) -> Result<(), fidl::Error> {
7636        let _result = self.send_raw(result);
7637        if _result.is_err() {
7638            self.control_handle.shutdown();
7639        }
7640        self.drop_without_shutdown();
7641        _result
7642    }
7643
7644    /// Similar to "send" but does not shutdown the channel if an error occurs.
7645    pub fn send_no_shutdown_on_err(
7646        self,
7647        mut result: Result<DirEntryRouterRouteResponse, RouterError>,
7648    ) -> Result<(), fidl::Error> {
7649        let _result = self.send_raw(result);
7650        self.drop_without_shutdown();
7651        _result
7652    }
7653
7654    fn send_raw(
7655        &self,
7656        mut result: Result<DirEntryRouterRouteResponse, RouterError>,
7657    ) -> Result<(), fidl::Error> {
7658        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
7659            DirEntryRouterRouteResponse,
7660            RouterError,
7661        >>(
7662            fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
7663            self.tx_id,
7664            0x1ac694001c208bd2,
7665            fidl::encoding::DynamicFlags::FLEXIBLE,
7666        )
7667    }
7668}
7669
7670#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
7671pub struct DirReceiverMarker;
7672
7673impl fdomain_client::fidl::ProtocolMarker for DirReceiverMarker {
7674    type Proxy = DirReceiverProxy;
7675    type RequestStream = DirReceiverRequestStream;
7676
7677    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.DirReceiver";
7678}
7679impl fdomain_client::fidl::DiscoverableProtocolMarker for DirReceiverMarker {}
7680
7681pub trait DirReceiverProxyInterface: Send + Sync {
7682    fn r#receive(&self, payload: DirReceiverReceiveRequest) -> Result<(), fidl::Error>;
7683}
7684
7685#[derive(Debug, Clone)]
7686pub struct DirReceiverProxy {
7687    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
7688}
7689
7690impl fdomain_client::fidl::Proxy for DirReceiverProxy {
7691    type Protocol = DirReceiverMarker;
7692
7693    fn from_channel(inner: fdomain_client::Channel) -> Self {
7694        Self::new(inner)
7695    }
7696
7697    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
7698        self.client.into_channel().map_err(|client| Self { client })
7699    }
7700
7701    fn as_channel(&self) -> &fdomain_client::Channel {
7702        self.client.as_channel()
7703    }
7704}
7705
7706impl DirReceiverProxy {
7707    /// Create a new Proxy for fuchsia.component.sandbox/DirReceiver.
7708    pub fn new(channel: fdomain_client::Channel) -> Self {
7709        let protocol_name = <DirReceiverMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
7710        Self { client: fidl::client::Client::new(channel, protocol_name) }
7711    }
7712
7713    /// Get a Stream of events from the remote end of the protocol.
7714    ///
7715    /// # Panics
7716    ///
7717    /// Panics if the event stream was already taken.
7718    pub fn take_event_stream(&self) -> DirReceiverEventStream {
7719        DirReceiverEventStream { event_receiver: self.client.take_event_receiver() }
7720    }
7721
7722    /// Sends a directory channel to this receiver.
7723    ///
7724    /// The server should implement this method by forwarding `channel` to a vfs instance
7725    /// of the language appropriate `vfs` library.
7726    pub fn r#receive(&self, mut payload: DirReceiverReceiveRequest) -> Result<(), fidl::Error> {
7727        DirReceiverProxyInterface::r#receive(self, payload)
7728    }
7729}
7730
7731impl DirReceiverProxyInterface for DirReceiverProxy {
7732    fn r#receive(&self, mut payload: DirReceiverReceiveRequest) -> Result<(), fidl::Error> {
7733        self.client.send::<DirReceiverReceiveRequest>(
7734            &mut payload,
7735            0xcdc3e9b89fe7bb4,
7736            fidl::encoding::DynamicFlags::FLEXIBLE,
7737        )
7738    }
7739}
7740
7741pub struct DirReceiverEventStream {
7742    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
7743}
7744
7745impl std::marker::Unpin for DirReceiverEventStream {}
7746
7747impl futures::stream::FusedStream for DirReceiverEventStream {
7748    fn is_terminated(&self) -> bool {
7749        self.event_receiver.is_terminated()
7750    }
7751}
7752
7753impl futures::Stream for DirReceiverEventStream {
7754    type Item = Result<DirReceiverEvent, fidl::Error>;
7755
7756    fn poll_next(
7757        mut self: std::pin::Pin<&mut Self>,
7758        cx: &mut std::task::Context<'_>,
7759    ) -> std::task::Poll<Option<Self::Item>> {
7760        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7761            &mut self.event_receiver,
7762            cx
7763        )?) {
7764            Some(buf) => std::task::Poll::Ready(Some(DirReceiverEvent::decode(buf))),
7765            None => std::task::Poll::Ready(None),
7766        }
7767    }
7768}
7769
7770#[derive(Debug)]
7771pub enum DirReceiverEvent {
7772    #[non_exhaustive]
7773    _UnknownEvent {
7774        /// Ordinal of the event that was sent.
7775        ordinal: u64,
7776    },
7777}
7778
7779impl DirReceiverEvent {
7780    /// Decodes a message buffer as a [`DirReceiverEvent`].
7781    fn decode(
7782        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7783    ) -> Result<DirReceiverEvent, fidl::Error> {
7784        let (bytes, _handles) = buf.split_mut();
7785        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7786        debug_assert_eq!(tx_header.tx_id, 0);
7787        match tx_header.ordinal {
7788            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7789                Ok(DirReceiverEvent::_UnknownEvent { ordinal: tx_header.ordinal })
7790            }
7791            _ => Err(fidl::Error::UnknownOrdinal {
7792                ordinal: tx_header.ordinal,
7793                protocol_name:
7794                    <DirReceiverMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
7795            }),
7796        }
7797    }
7798}
7799
7800/// A Stream of incoming requests for fuchsia.component.sandbox/DirReceiver.
7801pub struct DirReceiverRequestStream {
7802    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
7803    is_terminated: bool,
7804}
7805
7806impl std::marker::Unpin for DirReceiverRequestStream {}
7807
7808impl futures::stream::FusedStream for DirReceiverRequestStream {
7809    fn is_terminated(&self) -> bool {
7810        self.is_terminated
7811    }
7812}
7813
7814impl fdomain_client::fidl::RequestStream for DirReceiverRequestStream {
7815    type Protocol = DirReceiverMarker;
7816    type ControlHandle = DirReceiverControlHandle;
7817
7818    fn from_channel(channel: fdomain_client::Channel) -> Self {
7819        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7820    }
7821
7822    fn control_handle(&self) -> Self::ControlHandle {
7823        DirReceiverControlHandle { inner: self.inner.clone() }
7824    }
7825
7826    fn into_inner(
7827        self,
7828    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
7829    {
7830        (self.inner, self.is_terminated)
7831    }
7832
7833    fn from_inner(
7834        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
7835        is_terminated: bool,
7836    ) -> Self {
7837        Self { inner, is_terminated }
7838    }
7839}
7840
7841impl futures::Stream for DirReceiverRequestStream {
7842    type Item = Result<DirReceiverRequest, fidl::Error>;
7843
7844    fn poll_next(
7845        mut self: std::pin::Pin<&mut Self>,
7846        cx: &mut std::task::Context<'_>,
7847    ) -> std::task::Poll<Option<Self::Item>> {
7848        let this = &mut *self;
7849        if this.inner.check_shutdown(cx) {
7850            this.is_terminated = true;
7851            return std::task::Poll::Ready(None);
7852        }
7853        if this.is_terminated {
7854            panic!("polled DirReceiverRequestStream after completion");
7855        }
7856        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
7857            |bytes, handles| {
7858                match this.inner.channel().read_etc(cx, bytes, handles) {
7859                    std::task::Poll::Ready(Ok(())) => {}
7860                    std::task::Poll::Pending => return std::task::Poll::Pending,
7861                    std::task::Poll::Ready(Err(None)) => {
7862                        this.is_terminated = true;
7863                        return std::task::Poll::Ready(None);
7864                    }
7865                    std::task::Poll::Ready(Err(Some(e))) => {
7866                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7867                            e.into(),
7868                        ))));
7869                    }
7870                }
7871
7872                // A message has been received from the channel
7873                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7874
7875                std::task::Poll::Ready(Some(match header.ordinal {
7876                    0xcdc3e9b89fe7bb4 => {
7877                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
7878                        let mut req = fidl::new_empty!(
7879                            DirReceiverReceiveRequest,
7880                            fdomain_client::fidl::FDomainResourceDialect
7881                        );
7882                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<DirReceiverReceiveRequest>(&header, _body_bytes, handles, &mut req)?;
7883                        let control_handle = DirReceiverControlHandle { inner: this.inner.clone() };
7884                        Ok(DirReceiverRequest::Receive { payload: req, control_handle })
7885                    }
7886                    _ if header.tx_id == 0
7887                        && header
7888                            .dynamic_flags()
7889                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
7890                    {
7891                        Ok(DirReceiverRequest::_UnknownMethod {
7892                            ordinal: header.ordinal,
7893                            control_handle: DirReceiverControlHandle { inner: this.inner.clone() },
7894                            method_type: fidl::MethodType::OneWay,
7895                        })
7896                    }
7897                    _ if header
7898                        .dynamic_flags()
7899                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
7900                    {
7901                        this.inner.send_framework_err(
7902                            fidl::encoding::FrameworkErr::UnknownMethod,
7903                            header.tx_id,
7904                            header.ordinal,
7905                            header.dynamic_flags(),
7906                            (bytes, handles),
7907                        )?;
7908                        Ok(DirReceiverRequest::_UnknownMethod {
7909                            ordinal: header.ordinal,
7910                            control_handle: DirReceiverControlHandle { inner: this.inner.clone() },
7911                            method_type: fidl::MethodType::TwoWay,
7912                        })
7913                    }
7914                    _ => Err(fidl::Error::UnknownOrdinal {
7915                        ordinal: header.ordinal,
7916                        protocol_name:
7917                            <DirReceiverMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
7918                    }),
7919                }))
7920            },
7921        )
7922    }
7923}
7924
7925/// A receiver is served by components and allows them to receive directory channels
7926/// framework.
7927#[derive(Debug)]
7928pub enum DirReceiverRequest {
7929    /// Sends a directory channel to this receiver.
7930    ///
7931    /// The server should implement this method by forwarding `channel` to a vfs instance
7932    /// of the language appropriate `vfs` library.
7933    Receive { payload: DirReceiverReceiveRequest, control_handle: DirReceiverControlHandle },
7934    /// An interaction was received which does not match any known method.
7935    #[non_exhaustive]
7936    _UnknownMethod {
7937        /// Ordinal of the method that was called.
7938        ordinal: u64,
7939        control_handle: DirReceiverControlHandle,
7940        method_type: fidl::MethodType,
7941    },
7942}
7943
7944impl DirReceiverRequest {
7945    #[allow(irrefutable_let_patterns)]
7946    pub fn into_receive(self) -> Option<(DirReceiverReceiveRequest, DirReceiverControlHandle)> {
7947        if let DirReceiverRequest::Receive { payload, control_handle } = self {
7948            Some((payload, control_handle))
7949        } else {
7950            None
7951        }
7952    }
7953
7954    /// Name of the method defined in FIDL
7955    pub fn method_name(&self) -> &'static str {
7956        match *self {
7957            DirReceiverRequest::Receive { .. } => "receive",
7958            DirReceiverRequest::_UnknownMethod {
7959                method_type: fidl::MethodType::OneWay, ..
7960            } => "unknown one-way method",
7961            DirReceiverRequest::_UnknownMethod {
7962                method_type: fidl::MethodType::TwoWay, ..
7963            } => "unknown two-way method",
7964        }
7965    }
7966}
7967
7968#[derive(Debug, Clone)]
7969pub struct DirReceiverControlHandle {
7970    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
7971}
7972
7973impl fdomain_client::fidl::ControlHandle for DirReceiverControlHandle {
7974    fn shutdown(&self) {
7975        self.inner.shutdown()
7976    }
7977
7978    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
7979        self.inner.shutdown_with_epitaph(status)
7980    }
7981
7982    fn is_closed(&self) -> bool {
7983        self.inner.channel().is_closed()
7984    }
7985    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
7986        self.inner.channel().on_closed()
7987    }
7988}
7989
7990impl DirReceiverControlHandle {}
7991
7992#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
7993pub struct DirectoryRouterMarker;
7994
7995impl fdomain_client::fidl::ProtocolMarker for DirectoryRouterMarker {
7996    type Proxy = DirectoryRouterProxy;
7997    type RequestStream = DirectoryRouterRequestStream;
7998
7999    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.DirectoryRouter";
8000}
8001impl fdomain_client::fidl::DiscoverableProtocolMarker for DirectoryRouterMarker {}
8002pub type DirectoryRouterRouteResult = Result<DirectoryRouterRouteResponse, RouterError>;
8003
8004pub trait DirectoryRouterProxyInterface: Send + Sync {
8005    type RouteResponseFut: std::future::Future<Output = Result<DirectoryRouterRouteResult, fidl::Error>>
8006        + Send;
8007    fn r#route(&self, payload: RouteRequest) -> Self::RouteResponseFut;
8008}
8009
8010#[derive(Debug, Clone)]
8011pub struct DirectoryRouterProxy {
8012    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
8013}
8014
8015impl fdomain_client::fidl::Proxy for DirectoryRouterProxy {
8016    type Protocol = DirectoryRouterMarker;
8017
8018    fn from_channel(inner: fdomain_client::Channel) -> Self {
8019        Self::new(inner)
8020    }
8021
8022    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
8023        self.client.into_channel().map_err(|client| Self { client })
8024    }
8025
8026    fn as_channel(&self) -> &fdomain_client::Channel {
8027        self.client.as_channel()
8028    }
8029}
8030
8031impl DirectoryRouterProxy {
8032    /// Create a new Proxy for fuchsia.component.sandbox/DirectoryRouter.
8033    pub fn new(channel: fdomain_client::Channel) -> Self {
8034        let protocol_name =
8035            <DirectoryRouterMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
8036        Self { client: fidl::client::Client::new(channel, protocol_name) }
8037    }
8038
8039    /// Get a Stream of events from the remote end of the protocol.
8040    ///
8041    /// # Panics
8042    ///
8043    /// Panics if the event stream was already taken.
8044    pub fn take_event_stream(&self) -> DirectoryRouterEventStream {
8045        DirectoryRouterEventStream { event_receiver: self.client.take_event_receiver() }
8046    }
8047
8048    pub fn r#route(
8049        &self,
8050        mut payload: RouteRequest,
8051    ) -> fidl::client::QueryResponseFut<
8052        DirectoryRouterRouteResult,
8053        fdomain_client::fidl::FDomainResourceDialect,
8054    > {
8055        DirectoryRouterProxyInterface::r#route(self, payload)
8056    }
8057}
8058
8059impl DirectoryRouterProxyInterface for DirectoryRouterProxy {
8060    type RouteResponseFut = fidl::client::QueryResponseFut<
8061        DirectoryRouterRouteResult,
8062        fdomain_client::fidl::FDomainResourceDialect,
8063    >;
8064    fn r#route(&self, mut payload: RouteRequest) -> Self::RouteResponseFut {
8065        fn _decode(
8066            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8067        ) -> Result<DirectoryRouterRouteResult, fidl::Error> {
8068            let _response = fidl::client::decode_transaction_body::<
8069                fidl::encoding::FlexibleResultType<DirectoryRouterRouteResponse, RouterError>,
8070                fdomain_client::fidl::FDomainResourceDialect,
8071                0x683b6c6be21b0f21,
8072            >(_buf?)?
8073            .into_result_fdomain::<DirectoryRouterMarker>("route")?;
8074            Ok(_response.map(|x| x))
8075        }
8076        self.client.send_query_and_decode::<RouteRequest, DirectoryRouterRouteResult>(
8077            &mut payload,
8078            0x683b6c6be21b0f21,
8079            fidl::encoding::DynamicFlags::FLEXIBLE,
8080            _decode,
8081        )
8082    }
8083}
8084
8085pub struct DirectoryRouterEventStream {
8086    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
8087}
8088
8089impl std::marker::Unpin for DirectoryRouterEventStream {}
8090
8091impl futures::stream::FusedStream for DirectoryRouterEventStream {
8092    fn is_terminated(&self) -> bool {
8093        self.event_receiver.is_terminated()
8094    }
8095}
8096
8097impl futures::Stream for DirectoryRouterEventStream {
8098    type Item = Result<DirectoryRouterEvent, fidl::Error>;
8099
8100    fn poll_next(
8101        mut self: std::pin::Pin<&mut Self>,
8102        cx: &mut std::task::Context<'_>,
8103    ) -> std::task::Poll<Option<Self::Item>> {
8104        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
8105            &mut self.event_receiver,
8106            cx
8107        )?) {
8108            Some(buf) => std::task::Poll::Ready(Some(DirectoryRouterEvent::decode(buf))),
8109            None => std::task::Poll::Ready(None),
8110        }
8111    }
8112}
8113
8114#[derive(Debug)]
8115pub enum DirectoryRouterEvent {
8116    #[non_exhaustive]
8117    _UnknownEvent {
8118        /// Ordinal of the event that was sent.
8119        ordinal: u64,
8120    },
8121}
8122
8123impl DirectoryRouterEvent {
8124    /// Decodes a message buffer as a [`DirectoryRouterEvent`].
8125    fn decode(
8126        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
8127    ) -> Result<DirectoryRouterEvent, fidl::Error> {
8128        let (bytes, _handles) = buf.split_mut();
8129        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8130        debug_assert_eq!(tx_header.tx_id, 0);
8131        match tx_header.ordinal {
8132            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
8133                Ok(DirectoryRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
8134            }
8135            _ => Err(fidl::Error::UnknownOrdinal {
8136                ordinal: tx_header.ordinal,
8137                protocol_name:
8138                    <DirectoryRouterMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
8139            }),
8140        }
8141    }
8142}
8143
8144/// A Stream of incoming requests for fuchsia.component.sandbox/DirectoryRouter.
8145pub struct DirectoryRouterRequestStream {
8146    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
8147    is_terminated: bool,
8148}
8149
8150impl std::marker::Unpin for DirectoryRouterRequestStream {}
8151
8152impl futures::stream::FusedStream for DirectoryRouterRequestStream {
8153    fn is_terminated(&self) -> bool {
8154        self.is_terminated
8155    }
8156}
8157
8158impl fdomain_client::fidl::RequestStream for DirectoryRouterRequestStream {
8159    type Protocol = DirectoryRouterMarker;
8160    type ControlHandle = DirectoryRouterControlHandle;
8161
8162    fn from_channel(channel: fdomain_client::Channel) -> Self {
8163        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
8164    }
8165
8166    fn control_handle(&self) -> Self::ControlHandle {
8167        DirectoryRouterControlHandle { inner: self.inner.clone() }
8168    }
8169
8170    fn into_inner(
8171        self,
8172    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
8173    {
8174        (self.inner, self.is_terminated)
8175    }
8176
8177    fn from_inner(
8178        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
8179        is_terminated: bool,
8180    ) -> Self {
8181        Self { inner, is_terminated }
8182    }
8183}
8184
8185impl futures::Stream for DirectoryRouterRequestStream {
8186    type Item = Result<DirectoryRouterRequest, fidl::Error>;
8187
8188    fn poll_next(
8189        mut self: std::pin::Pin<&mut Self>,
8190        cx: &mut std::task::Context<'_>,
8191    ) -> std::task::Poll<Option<Self::Item>> {
8192        let this = &mut *self;
8193        if this.inner.check_shutdown(cx) {
8194            this.is_terminated = true;
8195            return std::task::Poll::Ready(None);
8196        }
8197        if this.is_terminated {
8198            panic!("polled DirectoryRouterRequestStream after completion");
8199        }
8200        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
8201            |bytes, handles| {
8202                match this.inner.channel().read_etc(cx, bytes, handles) {
8203                    std::task::Poll::Ready(Ok(())) => {}
8204                    std::task::Poll::Pending => return std::task::Poll::Pending,
8205                    std::task::Poll::Ready(Err(None)) => {
8206                        this.is_terminated = true;
8207                        return std::task::Poll::Ready(None);
8208                    }
8209                    std::task::Poll::Ready(Err(Some(e))) => {
8210                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
8211                            e.into(),
8212                        ))));
8213                    }
8214                }
8215
8216                // A message has been received from the channel
8217                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8218
8219                std::task::Poll::Ready(Some(match header.ordinal {
8220                0x683b6c6be21b0f21 => {
8221                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
8222                    let mut req = fidl::new_empty!(RouteRequest, fdomain_client::fidl::FDomainResourceDialect);
8223                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<RouteRequest>(&header, _body_bytes, handles, &mut req)?;
8224                    let control_handle = DirectoryRouterControlHandle {
8225                        inner: this.inner.clone(),
8226                    };
8227                    Ok(DirectoryRouterRequest::Route {payload: req,
8228                        responder: DirectoryRouterRouteResponder {
8229                            control_handle: std::mem::ManuallyDrop::new(control_handle),
8230                            tx_id: header.tx_id,
8231                        },
8232                    })
8233                }
8234                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
8235                    Ok(DirectoryRouterRequest::_UnknownMethod {
8236                        ordinal: header.ordinal,
8237                        control_handle: DirectoryRouterControlHandle { inner: this.inner.clone() },
8238                        method_type: fidl::MethodType::OneWay,
8239                    })
8240                }
8241                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
8242                    this.inner.send_framework_err(
8243                        fidl::encoding::FrameworkErr::UnknownMethod,
8244                        header.tx_id,
8245                        header.ordinal,
8246                        header.dynamic_flags(),
8247                        (bytes, handles),
8248                    )?;
8249                    Ok(DirectoryRouterRequest::_UnknownMethod {
8250                        ordinal: header.ordinal,
8251                        control_handle: DirectoryRouterControlHandle { inner: this.inner.clone() },
8252                        method_type: fidl::MethodType::TwoWay,
8253                    })
8254                }
8255                _ => Err(fidl::Error::UnknownOrdinal {
8256                    ordinal: header.ordinal,
8257                    protocol_name: <DirectoryRouterMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
8258                }),
8259            }))
8260            },
8261        )
8262    }
8263}
8264
8265#[derive(Debug)]
8266pub enum DirectoryRouterRequest {
8267    Route {
8268        payload: RouteRequest,
8269        responder: DirectoryRouterRouteResponder,
8270    },
8271    /// An interaction was received which does not match any known method.
8272    #[non_exhaustive]
8273    _UnknownMethod {
8274        /// Ordinal of the method that was called.
8275        ordinal: u64,
8276        control_handle: DirectoryRouterControlHandle,
8277        method_type: fidl::MethodType,
8278    },
8279}
8280
8281impl DirectoryRouterRequest {
8282    #[allow(irrefutable_let_patterns)]
8283    pub fn into_route(self) -> Option<(RouteRequest, DirectoryRouterRouteResponder)> {
8284        if let DirectoryRouterRequest::Route { payload, responder } = self {
8285            Some((payload, responder))
8286        } else {
8287            None
8288        }
8289    }
8290
8291    /// Name of the method defined in FIDL
8292    pub fn method_name(&self) -> &'static str {
8293        match *self {
8294            DirectoryRouterRequest::Route { .. } => "route",
8295            DirectoryRouterRequest::_UnknownMethod {
8296                method_type: fidl::MethodType::OneWay,
8297                ..
8298            } => "unknown one-way method",
8299            DirectoryRouterRequest::_UnknownMethod {
8300                method_type: fidl::MethodType::TwoWay,
8301                ..
8302            } => "unknown two-way method",
8303        }
8304    }
8305}
8306
8307#[derive(Debug, Clone)]
8308pub struct DirectoryRouterControlHandle {
8309    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
8310}
8311
8312impl fdomain_client::fidl::ControlHandle for DirectoryRouterControlHandle {
8313    fn shutdown(&self) {
8314        self.inner.shutdown()
8315    }
8316
8317    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
8318        self.inner.shutdown_with_epitaph(status)
8319    }
8320
8321    fn is_closed(&self) -> bool {
8322        self.inner.channel().is_closed()
8323    }
8324    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
8325        self.inner.channel().on_closed()
8326    }
8327}
8328
8329impl DirectoryRouterControlHandle {}
8330
8331#[must_use = "FIDL methods require a response to be sent"]
8332#[derive(Debug)]
8333pub struct DirectoryRouterRouteResponder {
8334    control_handle: std::mem::ManuallyDrop<DirectoryRouterControlHandle>,
8335    tx_id: u32,
8336}
8337
8338/// Set the the channel to be shutdown (see [`DirectoryRouterControlHandle::shutdown`])
8339/// if the responder is dropped without sending a response, so that the client
8340/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8341impl std::ops::Drop for DirectoryRouterRouteResponder {
8342    fn drop(&mut self) {
8343        self.control_handle.shutdown();
8344        // Safety: drops once, never accessed again
8345        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8346    }
8347}
8348
8349impl fdomain_client::fidl::Responder for DirectoryRouterRouteResponder {
8350    type ControlHandle = DirectoryRouterControlHandle;
8351
8352    fn control_handle(&self) -> &DirectoryRouterControlHandle {
8353        &self.control_handle
8354    }
8355
8356    fn drop_without_shutdown(mut self) {
8357        // Safety: drops once, never accessed again due to mem::forget
8358        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8359        // Prevent Drop from running (which would shut down the channel)
8360        std::mem::forget(self);
8361    }
8362}
8363
8364impl DirectoryRouterRouteResponder {
8365    /// Sends a response to the FIDL transaction.
8366    ///
8367    /// Sets the channel to shutdown if an error occurs.
8368    pub fn send(
8369        self,
8370        mut result: Result<DirectoryRouterRouteResponse, RouterError>,
8371    ) -> Result<(), fidl::Error> {
8372        let _result = self.send_raw(result);
8373        if _result.is_err() {
8374            self.control_handle.shutdown();
8375        }
8376        self.drop_without_shutdown();
8377        _result
8378    }
8379
8380    /// Similar to "send" but does not shutdown the channel if an error occurs.
8381    pub fn send_no_shutdown_on_err(
8382        self,
8383        mut result: Result<DirectoryRouterRouteResponse, RouterError>,
8384    ) -> Result<(), fidl::Error> {
8385        let _result = self.send_raw(result);
8386        self.drop_without_shutdown();
8387        _result
8388    }
8389
8390    fn send_raw(
8391        &self,
8392        mut result: Result<DirectoryRouterRouteResponse, RouterError>,
8393    ) -> Result<(), fidl::Error> {
8394        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
8395            DirectoryRouterRouteResponse,
8396            RouterError,
8397        >>(
8398            fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
8399            self.tx_id,
8400            0x683b6c6be21b0f21,
8401            fidl::encoding::DynamicFlags::FLEXIBLE,
8402        )
8403    }
8404}
8405
8406#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
8407pub struct ReceiverMarker;
8408
8409impl fdomain_client::fidl::ProtocolMarker for ReceiverMarker {
8410    type Proxy = ReceiverProxy;
8411    type RequestStream = ReceiverRequestStream;
8412
8413    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.Receiver";
8414}
8415impl fdomain_client::fidl::DiscoverableProtocolMarker for ReceiverMarker {}
8416
8417pub trait ReceiverProxyInterface: Send + Sync {
8418    fn r#receive(&self, channel: fdomain_client::Channel) -> Result<(), fidl::Error>;
8419}
8420
8421#[derive(Debug, Clone)]
8422pub struct ReceiverProxy {
8423    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
8424}
8425
8426impl fdomain_client::fidl::Proxy for ReceiverProxy {
8427    type Protocol = ReceiverMarker;
8428
8429    fn from_channel(inner: fdomain_client::Channel) -> Self {
8430        Self::new(inner)
8431    }
8432
8433    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
8434        self.client.into_channel().map_err(|client| Self { client })
8435    }
8436
8437    fn as_channel(&self) -> &fdomain_client::Channel {
8438        self.client.as_channel()
8439    }
8440}
8441
8442impl ReceiverProxy {
8443    /// Create a new Proxy for fuchsia.component.sandbox/Receiver.
8444    pub fn new(channel: fdomain_client::Channel) -> Self {
8445        let protocol_name = <ReceiverMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
8446        Self { client: fidl::client::Client::new(channel, protocol_name) }
8447    }
8448
8449    /// Get a Stream of events from the remote end of the protocol.
8450    ///
8451    /// # Panics
8452    ///
8453    /// Panics if the event stream was already taken.
8454    pub fn take_event_stream(&self) -> ReceiverEventStream {
8455        ReceiverEventStream { event_receiver: self.client.take_event_receiver() }
8456    }
8457
8458    /// Sends a channel to this receiver.
8459    pub fn r#receive(&self, mut channel: fdomain_client::Channel) -> Result<(), fidl::Error> {
8460        ReceiverProxyInterface::r#receive(self, channel)
8461    }
8462}
8463
8464impl ReceiverProxyInterface for ReceiverProxy {
8465    fn r#receive(&self, mut channel: fdomain_client::Channel) -> Result<(), fidl::Error> {
8466        self.client.send::<ProtocolPayload>(
8467            (channel,),
8468            0x4bae18ab7aa1a94,
8469            fidl::encoding::DynamicFlags::FLEXIBLE,
8470        )
8471    }
8472}
8473
8474pub struct ReceiverEventStream {
8475    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
8476}
8477
8478impl std::marker::Unpin for ReceiverEventStream {}
8479
8480impl futures::stream::FusedStream for ReceiverEventStream {
8481    fn is_terminated(&self) -> bool {
8482        self.event_receiver.is_terminated()
8483    }
8484}
8485
8486impl futures::Stream for ReceiverEventStream {
8487    type Item = Result<ReceiverEvent, fidl::Error>;
8488
8489    fn poll_next(
8490        mut self: std::pin::Pin<&mut Self>,
8491        cx: &mut std::task::Context<'_>,
8492    ) -> std::task::Poll<Option<Self::Item>> {
8493        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
8494            &mut self.event_receiver,
8495            cx
8496        )?) {
8497            Some(buf) => std::task::Poll::Ready(Some(ReceiverEvent::decode(buf))),
8498            None => std::task::Poll::Ready(None),
8499        }
8500    }
8501}
8502
8503#[derive(Debug)]
8504pub enum ReceiverEvent {
8505    #[non_exhaustive]
8506    _UnknownEvent {
8507        /// Ordinal of the event that was sent.
8508        ordinal: u64,
8509    },
8510}
8511
8512impl ReceiverEvent {
8513    /// Decodes a message buffer as a [`ReceiverEvent`].
8514    fn decode(
8515        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
8516    ) -> Result<ReceiverEvent, fidl::Error> {
8517        let (bytes, _handles) = buf.split_mut();
8518        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8519        debug_assert_eq!(tx_header.tx_id, 0);
8520        match tx_header.ordinal {
8521            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
8522                Ok(ReceiverEvent::_UnknownEvent { ordinal: tx_header.ordinal })
8523            }
8524            _ => Err(fidl::Error::UnknownOrdinal {
8525                ordinal: tx_header.ordinal,
8526                protocol_name: <ReceiverMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
8527            }),
8528        }
8529    }
8530}
8531
8532/// A Stream of incoming requests for fuchsia.component.sandbox/Receiver.
8533pub struct ReceiverRequestStream {
8534    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
8535    is_terminated: bool,
8536}
8537
8538impl std::marker::Unpin for ReceiverRequestStream {}
8539
8540impl futures::stream::FusedStream for ReceiverRequestStream {
8541    fn is_terminated(&self) -> bool {
8542        self.is_terminated
8543    }
8544}
8545
8546impl fdomain_client::fidl::RequestStream for ReceiverRequestStream {
8547    type Protocol = ReceiverMarker;
8548    type ControlHandle = ReceiverControlHandle;
8549
8550    fn from_channel(channel: fdomain_client::Channel) -> Self {
8551        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
8552    }
8553
8554    fn control_handle(&self) -> Self::ControlHandle {
8555        ReceiverControlHandle { inner: self.inner.clone() }
8556    }
8557
8558    fn into_inner(
8559        self,
8560    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
8561    {
8562        (self.inner, self.is_terminated)
8563    }
8564
8565    fn from_inner(
8566        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
8567        is_terminated: bool,
8568    ) -> Self {
8569        Self { inner, is_terminated }
8570    }
8571}
8572
8573impl futures::Stream for ReceiverRequestStream {
8574    type Item = Result<ReceiverRequest, fidl::Error>;
8575
8576    fn poll_next(
8577        mut self: std::pin::Pin<&mut Self>,
8578        cx: &mut std::task::Context<'_>,
8579    ) -> std::task::Poll<Option<Self::Item>> {
8580        let this = &mut *self;
8581        if this.inner.check_shutdown(cx) {
8582            this.is_terminated = true;
8583            return std::task::Poll::Ready(None);
8584        }
8585        if this.is_terminated {
8586            panic!("polled ReceiverRequestStream after completion");
8587        }
8588        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
8589            |bytes, handles| {
8590                match this.inner.channel().read_etc(cx, bytes, handles) {
8591                    std::task::Poll::Ready(Ok(())) => {}
8592                    std::task::Poll::Pending => return std::task::Poll::Pending,
8593                    std::task::Poll::Ready(Err(None)) => {
8594                        this.is_terminated = true;
8595                        return std::task::Poll::Ready(None);
8596                    }
8597                    std::task::Poll::Ready(Err(Some(e))) => {
8598                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
8599                            e.into(),
8600                        ))));
8601                    }
8602                }
8603
8604                // A message has been received from the channel
8605                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8606
8607                std::task::Poll::Ready(Some(match header.ordinal {
8608                    0x4bae18ab7aa1a94 => {
8609                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
8610                        let mut req = fidl::new_empty!(
8611                            ProtocolPayload,
8612                            fdomain_client::fidl::FDomainResourceDialect
8613                        );
8614                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<ProtocolPayload>(&header, _body_bytes, handles, &mut req)?;
8615                        let control_handle = ReceiverControlHandle { inner: this.inner.clone() };
8616                        Ok(ReceiverRequest::Receive { channel: req.channel, control_handle })
8617                    }
8618                    _ if header.tx_id == 0
8619                        && header
8620                            .dynamic_flags()
8621                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
8622                    {
8623                        Ok(ReceiverRequest::_UnknownMethod {
8624                            ordinal: header.ordinal,
8625                            control_handle: ReceiverControlHandle { inner: this.inner.clone() },
8626                            method_type: fidl::MethodType::OneWay,
8627                        })
8628                    }
8629                    _ if header
8630                        .dynamic_flags()
8631                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
8632                    {
8633                        this.inner.send_framework_err(
8634                            fidl::encoding::FrameworkErr::UnknownMethod,
8635                            header.tx_id,
8636                            header.ordinal,
8637                            header.dynamic_flags(),
8638                            (bytes, handles),
8639                        )?;
8640                        Ok(ReceiverRequest::_UnknownMethod {
8641                            ordinal: header.ordinal,
8642                            control_handle: ReceiverControlHandle { inner: this.inner.clone() },
8643                            method_type: fidl::MethodType::TwoWay,
8644                        })
8645                    }
8646                    _ => Err(fidl::Error::UnknownOrdinal {
8647                        ordinal: header.ordinal,
8648                        protocol_name:
8649                            <ReceiverMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
8650                    }),
8651                }))
8652            },
8653        )
8654    }
8655}
8656
8657/// A receiver is served by components and allows them to receive channels
8658/// from the framework.
8659#[derive(Debug)]
8660pub enum ReceiverRequest {
8661    /// Sends a channel to this receiver.
8662    Receive { channel: fdomain_client::Channel, control_handle: ReceiverControlHandle },
8663    /// An interaction was received which does not match any known method.
8664    #[non_exhaustive]
8665    _UnknownMethod {
8666        /// Ordinal of the method that was called.
8667        ordinal: u64,
8668        control_handle: ReceiverControlHandle,
8669        method_type: fidl::MethodType,
8670    },
8671}
8672
8673impl ReceiverRequest {
8674    #[allow(irrefutable_let_patterns)]
8675    pub fn into_receive(self) -> Option<(fdomain_client::Channel, ReceiverControlHandle)> {
8676        if let ReceiverRequest::Receive { channel, control_handle } = self {
8677            Some((channel, control_handle))
8678        } else {
8679            None
8680        }
8681    }
8682
8683    /// Name of the method defined in FIDL
8684    pub fn method_name(&self) -> &'static str {
8685        match *self {
8686            ReceiverRequest::Receive { .. } => "receive",
8687            ReceiverRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
8688                "unknown one-way method"
8689            }
8690            ReceiverRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
8691                "unknown two-way method"
8692            }
8693        }
8694    }
8695}
8696
8697#[derive(Debug, Clone)]
8698pub struct ReceiverControlHandle {
8699    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
8700}
8701
8702impl fdomain_client::fidl::ControlHandle for ReceiverControlHandle {
8703    fn shutdown(&self) {
8704        self.inner.shutdown()
8705    }
8706
8707    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
8708        self.inner.shutdown_with_epitaph(status)
8709    }
8710
8711    fn is_closed(&self) -> bool {
8712        self.inner.channel().is_closed()
8713    }
8714    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
8715        self.inner.channel().on_closed()
8716    }
8717}
8718
8719impl ReceiverControlHandle {}
8720
8721mod internal {
8722    use super::*;
8723
8724    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreConnectorCreateRequest {
8725        type Borrowed<'a> = &'a mut Self;
8726        fn take_or_borrow<'a>(
8727            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8728        ) -> Self::Borrowed<'a> {
8729            value
8730        }
8731    }
8732
8733    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreConnectorCreateRequest {
8734        type Owned = Self;
8735
8736        #[inline(always)]
8737        fn inline_align(_context: fidl::encoding::Context) -> usize {
8738            8
8739        }
8740
8741        #[inline(always)]
8742        fn inline_size(_context: fidl::encoding::Context) -> usize {
8743            16
8744        }
8745    }
8746
8747    unsafe impl
8748        fidl::encoding::Encode<
8749            CapabilityStoreConnectorCreateRequest,
8750            fdomain_client::fidl::FDomainResourceDialect,
8751        > for &mut CapabilityStoreConnectorCreateRequest
8752    {
8753        #[inline]
8754        unsafe fn encode(
8755            self,
8756            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8757            offset: usize,
8758            _depth: fidl::encoding::Depth,
8759        ) -> fidl::Result<()> {
8760            encoder.debug_check_bounds::<CapabilityStoreConnectorCreateRequest>(offset);
8761            // Delegate to tuple encoding.
8762            fidl::encoding::Encode::<CapabilityStoreConnectorCreateRequest, fdomain_client::fidl::FDomainResourceDialect>::encode(
8763                (
8764                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
8765                    <fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<ReceiverMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.receiver),
8766                ),
8767                encoder, offset, _depth
8768            )
8769        }
8770    }
8771    unsafe impl<
8772        T0: fidl::encoding::Encode<u64, fdomain_client::fidl::FDomainResourceDialect>,
8773        T1: fidl::encoding::Encode<
8774                fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<ReceiverMarker>>,
8775                fdomain_client::fidl::FDomainResourceDialect,
8776            >,
8777    >
8778        fidl::encoding::Encode<
8779            CapabilityStoreConnectorCreateRequest,
8780            fdomain_client::fidl::FDomainResourceDialect,
8781        > for (T0, T1)
8782    {
8783        #[inline]
8784        unsafe fn encode(
8785            self,
8786            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8787            offset: usize,
8788            depth: fidl::encoding::Depth,
8789        ) -> fidl::Result<()> {
8790            encoder.debug_check_bounds::<CapabilityStoreConnectorCreateRequest>(offset);
8791            // Zero out padding regions. There's no need to apply masks
8792            // because the unmasked parts will be overwritten by fields.
8793            unsafe {
8794                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
8795                (ptr as *mut u64).write_unaligned(0);
8796            }
8797            // Write the fields.
8798            self.0.encode(encoder, offset + 0, depth)?;
8799            self.1.encode(encoder, offset + 8, depth)?;
8800            Ok(())
8801        }
8802    }
8803
8804    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
8805        for CapabilityStoreConnectorCreateRequest
8806    {
8807        #[inline(always)]
8808        fn new_empty() -> Self {
8809            Self {
8810                id: fidl::new_empty!(u64, fdomain_client::fidl::FDomainResourceDialect),
8811                receiver: fidl::new_empty!(
8812                    fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<ReceiverMarker>>,
8813                    fdomain_client::fidl::FDomainResourceDialect
8814                ),
8815            }
8816        }
8817
8818        #[inline]
8819        unsafe fn decode(
8820            &mut self,
8821            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8822            offset: usize,
8823            _depth: fidl::encoding::Depth,
8824        ) -> fidl::Result<()> {
8825            decoder.debug_check_bounds::<Self>(offset);
8826            // Verify that padding bytes are zero.
8827            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
8828            let padval = unsafe { (ptr as *const u64).read_unaligned() };
8829            let mask = 0xffffffff00000000u64;
8830            let maskedval = padval & mask;
8831            if maskedval != 0 {
8832                return Err(fidl::Error::NonZeroPadding {
8833                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
8834                });
8835            }
8836            fidl::decode!(
8837                u64,
8838                fdomain_client::fidl::FDomainResourceDialect,
8839                &mut self.id,
8840                decoder,
8841                offset + 0,
8842                _depth
8843            )?;
8844            fidl::decode!(
8845                fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<ReceiverMarker>>,
8846                fdomain_client::fidl::FDomainResourceDialect,
8847                &mut self.receiver,
8848                decoder,
8849                offset + 8,
8850                _depth
8851            )?;
8852            Ok(())
8853        }
8854    }
8855
8856    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreConnectorOpenRequest {
8857        type Borrowed<'a> = &'a mut Self;
8858        fn take_or_borrow<'a>(
8859            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8860        ) -> Self::Borrowed<'a> {
8861            value
8862        }
8863    }
8864
8865    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreConnectorOpenRequest {
8866        type Owned = Self;
8867
8868        #[inline(always)]
8869        fn inline_align(_context: fidl::encoding::Context) -> usize {
8870            8
8871        }
8872
8873        #[inline(always)]
8874        fn inline_size(_context: fidl::encoding::Context) -> usize {
8875            16
8876        }
8877    }
8878
8879    unsafe impl
8880        fidl::encoding::Encode<
8881            CapabilityStoreConnectorOpenRequest,
8882            fdomain_client::fidl::FDomainResourceDialect,
8883        > for &mut CapabilityStoreConnectorOpenRequest
8884    {
8885        #[inline]
8886        unsafe fn encode(
8887            self,
8888            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8889            offset: usize,
8890            _depth: fidl::encoding::Depth,
8891        ) -> fidl::Result<()> {
8892            encoder.debug_check_bounds::<CapabilityStoreConnectorOpenRequest>(offset);
8893            // Delegate to tuple encoding.
8894            fidl::encoding::Encode::<
8895                CapabilityStoreConnectorOpenRequest,
8896                fdomain_client::fidl::FDomainResourceDialect,
8897            >::encode(
8898                (
8899                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
8900                    <fidl::encoding::HandleType<
8901                        fdomain_client::Channel,
8902                        { fidl::ObjectType::CHANNEL.into_raw() },
8903                        2147483648,
8904                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
8905                        &mut self.server_end
8906                    ),
8907                ),
8908                encoder,
8909                offset,
8910                _depth,
8911            )
8912        }
8913    }
8914    unsafe impl<
8915        T0: fidl::encoding::Encode<u64, fdomain_client::fidl::FDomainResourceDialect>,
8916        T1: fidl::encoding::Encode<
8917                fidl::encoding::HandleType<
8918                    fdomain_client::Channel,
8919                    { fidl::ObjectType::CHANNEL.into_raw() },
8920                    2147483648,
8921                >,
8922                fdomain_client::fidl::FDomainResourceDialect,
8923            >,
8924    >
8925        fidl::encoding::Encode<
8926            CapabilityStoreConnectorOpenRequest,
8927            fdomain_client::fidl::FDomainResourceDialect,
8928        > for (T0, T1)
8929    {
8930        #[inline]
8931        unsafe fn encode(
8932            self,
8933            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8934            offset: usize,
8935            depth: fidl::encoding::Depth,
8936        ) -> fidl::Result<()> {
8937            encoder.debug_check_bounds::<CapabilityStoreConnectorOpenRequest>(offset);
8938            // Zero out padding regions. There's no need to apply masks
8939            // because the unmasked parts will be overwritten by fields.
8940            unsafe {
8941                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
8942                (ptr as *mut u64).write_unaligned(0);
8943            }
8944            // Write the fields.
8945            self.0.encode(encoder, offset + 0, depth)?;
8946            self.1.encode(encoder, offset + 8, depth)?;
8947            Ok(())
8948        }
8949    }
8950
8951    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
8952        for CapabilityStoreConnectorOpenRequest
8953    {
8954        #[inline(always)]
8955        fn new_empty() -> Self {
8956            Self {
8957                id: fidl::new_empty!(u64, fdomain_client::fidl::FDomainResourceDialect),
8958                server_end: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
8959            }
8960        }
8961
8962        #[inline]
8963        unsafe fn decode(
8964            &mut self,
8965            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8966            offset: usize,
8967            _depth: fidl::encoding::Depth,
8968        ) -> fidl::Result<()> {
8969            decoder.debug_check_bounds::<Self>(offset);
8970            // Verify that padding bytes are zero.
8971            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
8972            let padval = unsafe { (ptr as *const u64).read_unaligned() };
8973            let mask = 0xffffffff00000000u64;
8974            let maskedval = padval & mask;
8975            if maskedval != 0 {
8976                return Err(fidl::Error::NonZeroPadding {
8977                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
8978                });
8979            }
8980            fidl::decode!(
8981                u64,
8982                fdomain_client::fidl::FDomainResourceDialect,
8983                &mut self.id,
8984                decoder,
8985                offset + 0,
8986                _depth
8987            )?;
8988            fidl::decode!(fidl::encoding::HandleType<fdomain_client::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect, &mut self.server_end, decoder, offset + 8, _depth)?;
8989            Ok(())
8990        }
8991    }
8992
8993    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreCreateServiceAggregateRequest {
8994        type Borrowed<'a> = &'a mut Self;
8995        fn take_or_borrow<'a>(
8996            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8997        ) -> Self::Borrowed<'a> {
8998            value
8999        }
9000    }
9001
9002    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreCreateServiceAggregateRequest {
9003        type Owned = Self;
9004
9005        #[inline(always)]
9006        fn inline_align(_context: fidl::encoding::Context) -> usize {
9007            8
9008        }
9009
9010        #[inline(always)]
9011        fn inline_size(_context: fidl::encoding::Context) -> usize {
9012            16
9013        }
9014    }
9015
9016    unsafe impl
9017        fidl::encoding::Encode<
9018            CapabilityStoreCreateServiceAggregateRequest,
9019            fdomain_client::fidl::FDomainResourceDialect,
9020        > for &mut CapabilityStoreCreateServiceAggregateRequest
9021    {
9022        #[inline]
9023        unsafe fn encode(
9024            self,
9025            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9026            offset: usize,
9027            _depth: fidl::encoding::Depth,
9028        ) -> fidl::Result<()> {
9029            encoder.debug_check_bounds::<CapabilityStoreCreateServiceAggregateRequest>(offset);
9030            // Delegate to tuple encoding.
9031            fidl::encoding::Encode::<CapabilityStoreCreateServiceAggregateRequest, fdomain_client::fidl::FDomainResourceDialect>::encode(
9032                (
9033                    <fidl::encoding::UnboundedVector<AggregateSource> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.sources),
9034                ),
9035                encoder, offset, _depth
9036            )
9037        }
9038    }
9039    unsafe impl<
9040        T0: fidl::encoding::Encode<
9041                fidl::encoding::UnboundedVector<AggregateSource>,
9042                fdomain_client::fidl::FDomainResourceDialect,
9043            >,
9044    >
9045        fidl::encoding::Encode<
9046            CapabilityStoreCreateServiceAggregateRequest,
9047            fdomain_client::fidl::FDomainResourceDialect,
9048        > for (T0,)
9049    {
9050        #[inline]
9051        unsafe fn encode(
9052            self,
9053            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9054            offset: usize,
9055            depth: fidl::encoding::Depth,
9056        ) -> fidl::Result<()> {
9057            encoder.debug_check_bounds::<CapabilityStoreCreateServiceAggregateRequest>(offset);
9058            // Zero out padding regions. There's no need to apply masks
9059            // because the unmasked parts will be overwritten by fields.
9060            // Write the fields.
9061            self.0.encode(encoder, offset + 0, depth)?;
9062            Ok(())
9063        }
9064    }
9065
9066    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
9067        for CapabilityStoreCreateServiceAggregateRequest
9068    {
9069        #[inline(always)]
9070        fn new_empty() -> Self {
9071            Self {
9072                sources: fidl::new_empty!(
9073                    fidl::encoding::UnboundedVector<AggregateSource>,
9074                    fdomain_client::fidl::FDomainResourceDialect
9075                ),
9076            }
9077        }
9078
9079        #[inline]
9080        unsafe fn decode(
9081            &mut self,
9082            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9083            offset: usize,
9084            _depth: fidl::encoding::Depth,
9085        ) -> fidl::Result<()> {
9086            decoder.debug_check_bounds::<Self>(offset);
9087            // Verify that padding bytes are zero.
9088            fidl::decode!(
9089                fidl::encoding::UnboundedVector<AggregateSource>,
9090                fdomain_client::fidl::FDomainResourceDialect,
9091                &mut self.sources,
9092                decoder,
9093                offset + 0,
9094                _depth
9095            )?;
9096            Ok(())
9097        }
9098    }
9099
9100    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDictionaryDrainRequest {
9101        type Borrowed<'a> = &'a mut Self;
9102        fn take_or_borrow<'a>(
9103            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9104        ) -> Self::Borrowed<'a> {
9105            value
9106        }
9107    }
9108
9109    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDictionaryDrainRequest {
9110        type Owned = Self;
9111
9112        #[inline(always)]
9113        fn inline_align(_context: fidl::encoding::Context) -> usize {
9114            8
9115        }
9116
9117        #[inline(always)]
9118        fn inline_size(_context: fidl::encoding::Context) -> usize {
9119            16
9120        }
9121    }
9122
9123    unsafe impl
9124        fidl::encoding::Encode<
9125            CapabilityStoreDictionaryDrainRequest,
9126            fdomain_client::fidl::FDomainResourceDialect,
9127        > for &mut CapabilityStoreDictionaryDrainRequest
9128    {
9129        #[inline]
9130        unsafe fn encode(
9131            self,
9132            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9133            offset: usize,
9134            _depth: fidl::encoding::Depth,
9135        ) -> fidl::Result<()> {
9136            encoder.debug_check_bounds::<CapabilityStoreDictionaryDrainRequest>(offset);
9137            // Delegate to tuple encoding.
9138            fidl::encoding::Encode::<
9139                CapabilityStoreDictionaryDrainRequest,
9140                fdomain_client::fidl::FDomainResourceDialect,
9141            >::encode(
9142                (
9143                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
9144                    <fidl::encoding::Optional<
9145                        fidl::encoding::Endpoint<
9146                            fdomain_client::fidl::ServerEnd<DictionaryDrainIteratorMarker>,
9147                        >,
9148                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9149                        &mut self.iterator
9150                    ),
9151                ),
9152                encoder,
9153                offset,
9154                _depth,
9155            )
9156        }
9157    }
9158    unsafe impl<
9159        T0: fidl::encoding::Encode<u64, fdomain_client::fidl::FDomainResourceDialect>,
9160        T1: fidl::encoding::Encode<
9161                fidl::encoding::Optional<
9162                    fidl::encoding::Endpoint<
9163                        fdomain_client::fidl::ServerEnd<DictionaryDrainIteratorMarker>,
9164                    >,
9165                >,
9166                fdomain_client::fidl::FDomainResourceDialect,
9167            >,
9168    >
9169        fidl::encoding::Encode<
9170            CapabilityStoreDictionaryDrainRequest,
9171            fdomain_client::fidl::FDomainResourceDialect,
9172        > for (T0, T1)
9173    {
9174        #[inline]
9175        unsafe fn encode(
9176            self,
9177            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9178            offset: usize,
9179            depth: fidl::encoding::Depth,
9180        ) -> fidl::Result<()> {
9181            encoder.debug_check_bounds::<CapabilityStoreDictionaryDrainRequest>(offset);
9182            // Zero out padding regions. There's no need to apply masks
9183            // because the unmasked parts will be overwritten by fields.
9184            unsafe {
9185                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
9186                (ptr as *mut u64).write_unaligned(0);
9187            }
9188            // Write the fields.
9189            self.0.encode(encoder, offset + 0, depth)?;
9190            self.1.encode(encoder, offset + 8, depth)?;
9191            Ok(())
9192        }
9193    }
9194
9195    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
9196        for CapabilityStoreDictionaryDrainRequest
9197    {
9198        #[inline(always)]
9199        fn new_empty() -> Self {
9200            Self {
9201                id: fidl::new_empty!(u64, fdomain_client::fidl::FDomainResourceDialect),
9202                iterator: fidl::new_empty!(
9203                    fidl::encoding::Optional<
9204                        fidl::encoding::Endpoint<
9205                            fdomain_client::fidl::ServerEnd<DictionaryDrainIteratorMarker>,
9206                        >,
9207                    >,
9208                    fdomain_client::fidl::FDomainResourceDialect
9209                ),
9210            }
9211        }
9212
9213        #[inline]
9214        unsafe fn decode(
9215            &mut self,
9216            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9217            offset: usize,
9218            _depth: fidl::encoding::Depth,
9219        ) -> fidl::Result<()> {
9220            decoder.debug_check_bounds::<Self>(offset);
9221            // Verify that padding bytes are zero.
9222            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
9223            let padval = unsafe { (ptr as *const u64).read_unaligned() };
9224            let mask = 0xffffffff00000000u64;
9225            let maskedval = padval & mask;
9226            if maskedval != 0 {
9227                return Err(fidl::Error::NonZeroPadding {
9228                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
9229                });
9230            }
9231            fidl::decode!(
9232                u64,
9233                fdomain_client::fidl::FDomainResourceDialect,
9234                &mut self.id,
9235                decoder,
9236                offset + 0,
9237                _depth
9238            )?;
9239            fidl::decode!(
9240                fidl::encoding::Optional<
9241                    fidl::encoding::Endpoint<
9242                        fdomain_client::fidl::ServerEnd<DictionaryDrainIteratorMarker>,
9243                    >,
9244                >,
9245                fdomain_client::fidl::FDomainResourceDialect,
9246                &mut self.iterator,
9247                decoder,
9248                offset + 8,
9249                _depth
9250            )?;
9251            Ok(())
9252        }
9253    }
9254
9255    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDictionaryEnumerateRequest {
9256        type Borrowed<'a> = &'a mut Self;
9257        fn take_or_borrow<'a>(
9258            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9259        ) -> Self::Borrowed<'a> {
9260            value
9261        }
9262    }
9263
9264    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDictionaryEnumerateRequest {
9265        type Owned = Self;
9266
9267        #[inline(always)]
9268        fn inline_align(_context: fidl::encoding::Context) -> usize {
9269            8
9270        }
9271
9272        #[inline(always)]
9273        fn inline_size(_context: fidl::encoding::Context) -> usize {
9274            16
9275        }
9276    }
9277
9278    unsafe impl
9279        fidl::encoding::Encode<
9280            CapabilityStoreDictionaryEnumerateRequest,
9281            fdomain_client::fidl::FDomainResourceDialect,
9282        > for &mut CapabilityStoreDictionaryEnumerateRequest
9283    {
9284        #[inline]
9285        unsafe fn encode(
9286            self,
9287            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9288            offset: usize,
9289            _depth: fidl::encoding::Depth,
9290        ) -> fidl::Result<()> {
9291            encoder.debug_check_bounds::<CapabilityStoreDictionaryEnumerateRequest>(offset);
9292            // Delegate to tuple encoding.
9293            fidl::encoding::Encode::<
9294                CapabilityStoreDictionaryEnumerateRequest,
9295                fdomain_client::fidl::FDomainResourceDialect,
9296            >::encode(
9297                (
9298                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
9299                    <fidl::encoding::Endpoint<
9300                        fdomain_client::fidl::ServerEnd<DictionaryEnumerateIteratorMarker>,
9301                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9302                        &mut self.iterator
9303                    ),
9304                ),
9305                encoder,
9306                offset,
9307                _depth,
9308            )
9309        }
9310    }
9311    unsafe impl<
9312        T0: fidl::encoding::Encode<u64, fdomain_client::fidl::FDomainResourceDialect>,
9313        T1: fidl::encoding::Encode<
9314                fidl::encoding::Endpoint<
9315                    fdomain_client::fidl::ServerEnd<DictionaryEnumerateIteratorMarker>,
9316                >,
9317                fdomain_client::fidl::FDomainResourceDialect,
9318            >,
9319    >
9320        fidl::encoding::Encode<
9321            CapabilityStoreDictionaryEnumerateRequest,
9322            fdomain_client::fidl::FDomainResourceDialect,
9323        > for (T0, T1)
9324    {
9325        #[inline]
9326        unsafe fn encode(
9327            self,
9328            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9329            offset: usize,
9330            depth: fidl::encoding::Depth,
9331        ) -> fidl::Result<()> {
9332            encoder.debug_check_bounds::<CapabilityStoreDictionaryEnumerateRequest>(offset);
9333            // Zero out padding regions. There's no need to apply masks
9334            // because the unmasked parts will be overwritten by fields.
9335            unsafe {
9336                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
9337                (ptr as *mut u64).write_unaligned(0);
9338            }
9339            // Write the fields.
9340            self.0.encode(encoder, offset + 0, depth)?;
9341            self.1.encode(encoder, offset + 8, depth)?;
9342            Ok(())
9343        }
9344    }
9345
9346    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
9347        for CapabilityStoreDictionaryEnumerateRequest
9348    {
9349        #[inline(always)]
9350        fn new_empty() -> Self {
9351            Self {
9352                id: fidl::new_empty!(u64, fdomain_client::fidl::FDomainResourceDialect),
9353                iterator: fidl::new_empty!(
9354                    fidl::encoding::Endpoint<
9355                        fdomain_client::fidl::ServerEnd<DictionaryEnumerateIteratorMarker>,
9356                    >,
9357                    fdomain_client::fidl::FDomainResourceDialect
9358                ),
9359            }
9360        }
9361
9362        #[inline]
9363        unsafe fn decode(
9364            &mut self,
9365            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9366            offset: usize,
9367            _depth: fidl::encoding::Depth,
9368        ) -> fidl::Result<()> {
9369            decoder.debug_check_bounds::<Self>(offset);
9370            // Verify that padding bytes are zero.
9371            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
9372            let padval = unsafe { (ptr as *const u64).read_unaligned() };
9373            let mask = 0xffffffff00000000u64;
9374            let maskedval = padval & mask;
9375            if maskedval != 0 {
9376                return Err(fidl::Error::NonZeroPadding {
9377                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
9378                });
9379            }
9380            fidl::decode!(
9381                u64,
9382                fdomain_client::fidl::FDomainResourceDialect,
9383                &mut self.id,
9384                decoder,
9385                offset + 0,
9386                _depth
9387            )?;
9388            fidl::decode!(
9389                fidl::encoding::Endpoint<
9390                    fdomain_client::fidl::ServerEnd<DictionaryEnumerateIteratorMarker>,
9391                >,
9392                fdomain_client::fidl::FDomainResourceDialect,
9393                &mut self.iterator,
9394                decoder,
9395                offset + 8,
9396                _depth
9397            )?;
9398            Ok(())
9399        }
9400    }
9401
9402    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDictionaryKeysRequest {
9403        type Borrowed<'a> = &'a mut Self;
9404        fn take_or_borrow<'a>(
9405            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9406        ) -> Self::Borrowed<'a> {
9407            value
9408        }
9409    }
9410
9411    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDictionaryKeysRequest {
9412        type Owned = Self;
9413
9414        #[inline(always)]
9415        fn inline_align(_context: fidl::encoding::Context) -> usize {
9416            8
9417        }
9418
9419        #[inline(always)]
9420        fn inline_size(_context: fidl::encoding::Context) -> usize {
9421            16
9422        }
9423    }
9424
9425    unsafe impl
9426        fidl::encoding::Encode<
9427            CapabilityStoreDictionaryKeysRequest,
9428            fdomain_client::fidl::FDomainResourceDialect,
9429        > for &mut CapabilityStoreDictionaryKeysRequest
9430    {
9431        #[inline]
9432        unsafe fn encode(
9433            self,
9434            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9435            offset: usize,
9436            _depth: fidl::encoding::Depth,
9437        ) -> fidl::Result<()> {
9438            encoder.debug_check_bounds::<CapabilityStoreDictionaryKeysRequest>(offset);
9439            // Delegate to tuple encoding.
9440            fidl::encoding::Encode::<
9441                CapabilityStoreDictionaryKeysRequest,
9442                fdomain_client::fidl::FDomainResourceDialect,
9443            >::encode(
9444                (
9445                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
9446                    <fidl::encoding::Endpoint<
9447                        fdomain_client::fidl::ServerEnd<DictionaryKeysIteratorMarker>,
9448                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9449                        &mut self.iterator
9450                    ),
9451                ),
9452                encoder,
9453                offset,
9454                _depth,
9455            )
9456        }
9457    }
9458    unsafe impl<
9459        T0: fidl::encoding::Encode<u64, fdomain_client::fidl::FDomainResourceDialect>,
9460        T1: fidl::encoding::Encode<
9461                fidl::encoding::Endpoint<
9462                    fdomain_client::fidl::ServerEnd<DictionaryKeysIteratorMarker>,
9463                >,
9464                fdomain_client::fidl::FDomainResourceDialect,
9465            >,
9466    >
9467        fidl::encoding::Encode<
9468            CapabilityStoreDictionaryKeysRequest,
9469            fdomain_client::fidl::FDomainResourceDialect,
9470        > for (T0, T1)
9471    {
9472        #[inline]
9473        unsafe fn encode(
9474            self,
9475            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9476            offset: usize,
9477            depth: fidl::encoding::Depth,
9478        ) -> fidl::Result<()> {
9479            encoder.debug_check_bounds::<CapabilityStoreDictionaryKeysRequest>(offset);
9480            // Zero out padding regions. There's no need to apply masks
9481            // because the unmasked parts will be overwritten by fields.
9482            unsafe {
9483                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
9484                (ptr as *mut u64).write_unaligned(0);
9485            }
9486            // Write the fields.
9487            self.0.encode(encoder, offset + 0, depth)?;
9488            self.1.encode(encoder, offset + 8, depth)?;
9489            Ok(())
9490        }
9491    }
9492
9493    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
9494        for CapabilityStoreDictionaryKeysRequest
9495    {
9496        #[inline(always)]
9497        fn new_empty() -> Self {
9498            Self {
9499                id: fidl::new_empty!(u64, fdomain_client::fidl::FDomainResourceDialect),
9500                iterator: fidl::new_empty!(
9501                    fidl::encoding::Endpoint<
9502                        fdomain_client::fidl::ServerEnd<DictionaryKeysIteratorMarker>,
9503                    >,
9504                    fdomain_client::fidl::FDomainResourceDialect
9505                ),
9506            }
9507        }
9508
9509        #[inline]
9510        unsafe fn decode(
9511            &mut self,
9512            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9513            offset: usize,
9514            _depth: fidl::encoding::Depth,
9515        ) -> fidl::Result<()> {
9516            decoder.debug_check_bounds::<Self>(offset);
9517            // Verify that padding bytes are zero.
9518            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
9519            let padval = unsafe { (ptr as *const u64).read_unaligned() };
9520            let mask = 0xffffffff00000000u64;
9521            let maskedval = padval & mask;
9522            if maskedval != 0 {
9523                return Err(fidl::Error::NonZeroPadding {
9524                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
9525                });
9526            }
9527            fidl::decode!(
9528                u64,
9529                fdomain_client::fidl::FDomainResourceDialect,
9530                &mut self.id,
9531                decoder,
9532                offset + 0,
9533                _depth
9534            )?;
9535            fidl::decode!(
9536                fidl::encoding::Endpoint<
9537                    fdomain_client::fidl::ServerEnd<DictionaryKeysIteratorMarker>,
9538                >,
9539                fdomain_client::fidl::FDomainResourceDialect,
9540                &mut self.iterator,
9541                decoder,
9542                offset + 8,
9543                _depth
9544            )?;
9545            Ok(())
9546        }
9547    }
9548
9549    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDictionaryLegacyExportRequest {
9550        type Borrowed<'a> = &'a mut Self;
9551        fn take_or_borrow<'a>(
9552            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9553        ) -> Self::Borrowed<'a> {
9554            value
9555        }
9556    }
9557
9558    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDictionaryLegacyExportRequest {
9559        type Owned = Self;
9560
9561        #[inline(always)]
9562        fn inline_align(_context: fidl::encoding::Context) -> usize {
9563            8
9564        }
9565
9566        #[inline(always)]
9567        fn inline_size(_context: fidl::encoding::Context) -> usize {
9568            16
9569        }
9570    }
9571
9572    unsafe impl
9573        fidl::encoding::Encode<
9574            CapabilityStoreDictionaryLegacyExportRequest,
9575            fdomain_client::fidl::FDomainResourceDialect,
9576        > for &mut CapabilityStoreDictionaryLegacyExportRequest
9577    {
9578        #[inline]
9579        unsafe fn encode(
9580            self,
9581            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9582            offset: usize,
9583            _depth: fidl::encoding::Depth,
9584        ) -> fidl::Result<()> {
9585            encoder.debug_check_bounds::<CapabilityStoreDictionaryLegacyExportRequest>(offset);
9586            // Delegate to tuple encoding.
9587            fidl::encoding::Encode::<
9588                CapabilityStoreDictionaryLegacyExportRequest,
9589                fdomain_client::fidl::FDomainResourceDialect,
9590            >::encode(
9591                (
9592                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
9593                    <fidl::encoding::HandleType<
9594                        fdomain_client::Channel,
9595                        { fidl::ObjectType::CHANNEL.into_raw() },
9596                        2147483648,
9597                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9598                        &mut self.server_end
9599                    ),
9600                ),
9601                encoder,
9602                offset,
9603                _depth,
9604            )
9605        }
9606    }
9607    unsafe impl<
9608        T0: fidl::encoding::Encode<u64, fdomain_client::fidl::FDomainResourceDialect>,
9609        T1: fidl::encoding::Encode<
9610                fidl::encoding::HandleType<
9611                    fdomain_client::Channel,
9612                    { fidl::ObjectType::CHANNEL.into_raw() },
9613                    2147483648,
9614                >,
9615                fdomain_client::fidl::FDomainResourceDialect,
9616            >,
9617    >
9618        fidl::encoding::Encode<
9619            CapabilityStoreDictionaryLegacyExportRequest,
9620            fdomain_client::fidl::FDomainResourceDialect,
9621        > for (T0, T1)
9622    {
9623        #[inline]
9624        unsafe fn encode(
9625            self,
9626            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9627            offset: usize,
9628            depth: fidl::encoding::Depth,
9629        ) -> fidl::Result<()> {
9630            encoder.debug_check_bounds::<CapabilityStoreDictionaryLegacyExportRequest>(offset);
9631            // Zero out padding regions. There's no need to apply masks
9632            // because the unmasked parts will be overwritten by fields.
9633            unsafe {
9634                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
9635                (ptr as *mut u64).write_unaligned(0);
9636            }
9637            // Write the fields.
9638            self.0.encode(encoder, offset + 0, depth)?;
9639            self.1.encode(encoder, offset + 8, depth)?;
9640            Ok(())
9641        }
9642    }
9643
9644    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
9645        for CapabilityStoreDictionaryLegacyExportRequest
9646    {
9647        #[inline(always)]
9648        fn new_empty() -> Self {
9649            Self {
9650                id: fidl::new_empty!(u64, fdomain_client::fidl::FDomainResourceDialect),
9651                server_end: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
9652            }
9653        }
9654
9655        #[inline]
9656        unsafe fn decode(
9657            &mut self,
9658            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9659            offset: usize,
9660            _depth: fidl::encoding::Depth,
9661        ) -> fidl::Result<()> {
9662            decoder.debug_check_bounds::<Self>(offset);
9663            // Verify that padding bytes are zero.
9664            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
9665            let padval = unsafe { (ptr as *const u64).read_unaligned() };
9666            let mask = 0xffffffff00000000u64;
9667            let maskedval = padval & mask;
9668            if maskedval != 0 {
9669                return Err(fidl::Error::NonZeroPadding {
9670                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
9671                });
9672            }
9673            fidl::decode!(
9674                u64,
9675                fdomain_client::fidl::FDomainResourceDialect,
9676                &mut self.id,
9677                decoder,
9678                offset + 0,
9679                _depth
9680            )?;
9681            fidl::decode!(fidl::encoding::HandleType<fdomain_client::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect, &mut self.server_end, decoder, offset + 8, _depth)?;
9682            Ok(())
9683        }
9684    }
9685
9686    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDictionaryLegacyImportRequest {
9687        type Borrowed<'a> = &'a mut Self;
9688        fn take_or_borrow<'a>(
9689            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9690        ) -> Self::Borrowed<'a> {
9691            value
9692        }
9693    }
9694
9695    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDictionaryLegacyImportRequest {
9696        type Owned = Self;
9697
9698        #[inline(always)]
9699        fn inline_align(_context: fidl::encoding::Context) -> usize {
9700            8
9701        }
9702
9703        #[inline(always)]
9704        fn inline_size(_context: fidl::encoding::Context) -> usize {
9705            16
9706        }
9707    }
9708
9709    unsafe impl
9710        fidl::encoding::Encode<
9711            CapabilityStoreDictionaryLegacyImportRequest,
9712            fdomain_client::fidl::FDomainResourceDialect,
9713        > for &mut CapabilityStoreDictionaryLegacyImportRequest
9714    {
9715        #[inline]
9716        unsafe fn encode(
9717            self,
9718            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9719            offset: usize,
9720            _depth: fidl::encoding::Depth,
9721        ) -> fidl::Result<()> {
9722            encoder.debug_check_bounds::<CapabilityStoreDictionaryLegacyImportRequest>(offset);
9723            // Delegate to tuple encoding.
9724            fidl::encoding::Encode::<
9725                CapabilityStoreDictionaryLegacyImportRequest,
9726                fdomain_client::fidl::FDomainResourceDialect,
9727            >::encode(
9728                (
9729                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
9730                    <fidl::encoding::HandleType<
9731                        fdomain_client::Channel,
9732                        { fidl::ObjectType::CHANNEL.into_raw() },
9733                        2147483648,
9734                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9735                        &mut self.client_end
9736                    ),
9737                ),
9738                encoder,
9739                offset,
9740                _depth,
9741            )
9742        }
9743    }
9744    unsafe impl<
9745        T0: fidl::encoding::Encode<u64, fdomain_client::fidl::FDomainResourceDialect>,
9746        T1: fidl::encoding::Encode<
9747                fidl::encoding::HandleType<
9748                    fdomain_client::Channel,
9749                    { fidl::ObjectType::CHANNEL.into_raw() },
9750                    2147483648,
9751                >,
9752                fdomain_client::fidl::FDomainResourceDialect,
9753            >,
9754    >
9755        fidl::encoding::Encode<
9756            CapabilityStoreDictionaryLegacyImportRequest,
9757            fdomain_client::fidl::FDomainResourceDialect,
9758        > for (T0, T1)
9759    {
9760        #[inline]
9761        unsafe fn encode(
9762            self,
9763            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9764            offset: usize,
9765            depth: fidl::encoding::Depth,
9766        ) -> fidl::Result<()> {
9767            encoder.debug_check_bounds::<CapabilityStoreDictionaryLegacyImportRequest>(offset);
9768            // Zero out padding regions. There's no need to apply masks
9769            // because the unmasked parts will be overwritten by fields.
9770            unsafe {
9771                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
9772                (ptr as *mut u64).write_unaligned(0);
9773            }
9774            // Write the fields.
9775            self.0.encode(encoder, offset + 0, depth)?;
9776            self.1.encode(encoder, offset + 8, depth)?;
9777            Ok(())
9778        }
9779    }
9780
9781    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
9782        for CapabilityStoreDictionaryLegacyImportRequest
9783    {
9784        #[inline(always)]
9785        fn new_empty() -> Self {
9786            Self {
9787                id: fidl::new_empty!(u64, fdomain_client::fidl::FDomainResourceDialect),
9788                client_end: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
9789            }
9790        }
9791
9792        #[inline]
9793        unsafe fn decode(
9794            &mut self,
9795            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9796            offset: usize,
9797            _depth: fidl::encoding::Depth,
9798        ) -> fidl::Result<()> {
9799            decoder.debug_check_bounds::<Self>(offset);
9800            // Verify that padding bytes are zero.
9801            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
9802            let padval = unsafe { (ptr as *const u64).read_unaligned() };
9803            let mask = 0xffffffff00000000u64;
9804            let maskedval = padval & mask;
9805            if maskedval != 0 {
9806                return Err(fidl::Error::NonZeroPadding {
9807                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
9808                });
9809            }
9810            fidl::decode!(
9811                u64,
9812                fdomain_client::fidl::FDomainResourceDialect,
9813                &mut self.id,
9814                decoder,
9815                offset + 0,
9816                _depth
9817            )?;
9818            fidl::decode!(fidl::encoding::HandleType<fdomain_client::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect, &mut self.client_end, decoder, offset + 8, _depth)?;
9819            Ok(())
9820        }
9821    }
9822
9823    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDirConnectorCreateRequest {
9824        type Borrowed<'a> = &'a mut Self;
9825        fn take_or_borrow<'a>(
9826            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9827        ) -> Self::Borrowed<'a> {
9828            value
9829        }
9830    }
9831
9832    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDirConnectorCreateRequest {
9833        type Owned = Self;
9834
9835        #[inline(always)]
9836        fn inline_align(_context: fidl::encoding::Context) -> usize {
9837            8
9838        }
9839
9840        #[inline(always)]
9841        fn inline_size(_context: fidl::encoding::Context) -> usize {
9842            16
9843        }
9844    }
9845
9846    unsafe impl
9847        fidl::encoding::Encode<
9848            CapabilityStoreDirConnectorCreateRequest,
9849            fdomain_client::fidl::FDomainResourceDialect,
9850        > for &mut CapabilityStoreDirConnectorCreateRequest
9851    {
9852        #[inline]
9853        unsafe fn encode(
9854            self,
9855            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9856            offset: usize,
9857            _depth: fidl::encoding::Depth,
9858        ) -> fidl::Result<()> {
9859            encoder.debug_check_bounds::<CapabilityStoreDirConnectorCreateRequest>(offset);
9860            // Delegate to tuple encoding.
9861            fidl::encoding::Encode::<CapabilityStoreDirConnectorCreateRequest, fdomain_client::fidl::FDomainResourceDialect>::encode(
9862                (
9863                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
9864                    <fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<DirReceiverMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.receiver),
9865                ),
9866                encoder, offset, _depth
9867            )
9868        }
9869    }
9870    unsafe impl<
9871        T0: fidl::encoding::Encode<u64, fdomain_client::fidl::FDomainResourceDialect>,
9872        T1: fidl::encoding::Encode<
9873                fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<DirReceiverMarker>>,
9874                fdomain_client::fidl::FDomainResourceDialect,
9875            >,
9876    >
9877        fidl::encoding::Encode<
9878            CapabilityStoreDirConnectorCreateRequest,
9879            fdomain_client::fidl::FDomainResourceDialect,
9880        > for (T0, T1)
9881    {
9882        #[inline]
9883        unsafe fn encode(
9884            self,
9885            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9886            offset: usize,
9887            depth: fidl::encoding::Depth,
9888        ) -> fidl::Result<()> {
9889            encoder.debug_check_bounds::<CapabilityStoreDirConnectorCreateRequest>(offset);
9890            // Zero out padding regions. There's no need to apply masks
9891            // because the unmasked parts will be overwritten by fields.
9892            unsafe {
9893                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
9894                (ptr as *mut u64).write_unaligned(0);
9895            }
9896            // Write the fields.
9897            self.0.encode(encoder, offset + 0, depth)?;
9898            self.1.encode(encoder, offset + 8, depth)?;
9899            Ok(())
9900        }
9901    }
9902
9903    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
9904        for CapabilityStoreDirConnectorCreateRequest
9905    {
9906        #[inline(always)]
9907        fn new_empty() -> Self {
9908            Self {
9909                id: fidl::new_empty!(u64, fdomain_client::fidl::FDomainResourceDialect),
9910                receiver: fidl::new_empty!(
9911                    fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<DirReceiverMarker>>,
9912                    fdomain_client::fidl::FDomainResourceDialect
9913                ),
9914            }
9915        }
9916
9917        #[inline]
9918        unsafe fn decode(
9919            &mut self,
9920            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9921            offset: usize,
9922            _depth: fidl::encoding::Depth,
9923        ) -> fidl::Result<()> {
9924            decoder.debug_check_bounds::<Self>(offset);
9925            // Verify that padding bytes are zero.
9926            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
9927            let padval = unsafe { (ptr as *const u64).read_unaligned() };
9928            let mask = 0xffffffff00000000u64;
9929            let maskedval = padval & mask;
9930            if maskedval != 0 {
9931                return Err(fidl::Error::NonZeroPadding {
9932                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
9933                });
9934            }
9935            fidl::decode!(
9936                u64,
9937                fdomain_client::fidl::FDomainResourceDialect,
9938                &mut self.id,
9939                decoder,
9940                offset + 0,
9941                _depth
9942            )?;
9943            fidl::decode!(
9944                fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<DirReceiverMarker>>,
9945                fdomain_client::fidl::FDomainResourceDialect,
9946                &mut self.receiver,
9947                decoder,
9948                offset + 8,
9949                _depth
9950            )?;
9951            Ok(())
9952        }
9953    }
9954
9955    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreImportRequest {
9956        type Borrowed<'a> = &'a mut Self;
9957        fn take_or_borrow<'a>(
9958            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9959        ) -> Self::Borrowed<'a> {
9960            value
9961        }
9962    }
9963
9964    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreImportRequest {
9965        type Owned = Self;
9966
9967        #[inline(always)]
9968        fn inline_align(_context: fidl::encoding::Context) -> usize {
9969            8
9970        }
9971
9972        #[inline(always)]
9973        fn inline_size(_context: fidl::encoding::Context) -> usize {
9974            24
9975        }
9976    }
9977
9978    unsafe impl
9979        fidl::encoding::Encode<
9980            CapabilityStoreImportRequest,
9981            fdomain_client::fidl::FDomainResourceDialect,
9982        > for &mut CapabilityStoreImportRequest
9983    {
9984        #[inline]
9985        unsafe fn encode(
9986            self,
9987            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9988            offset: usize,
9989            _depth: fidl::encoding::Depth,
9990        ) -> fidl::Result<()> {
9991            encoder.debug_check_bounds::<CapabilityStoreImportRequest>(offset);
9992            // Delegate to tuple encoding.
9993            fidl::encoding::Encode::<
9994                CapabilityStoreImportRequest,
9995                fdomain_client::fidl::FDomainResourceDialect,
9996            >::encode(
9997                (
9998                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
9999                    <Capability as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10000                        &mut self.capability,
10001                    ),
10002                ),
10003                encoder,
10004                offset,
10005                _depth,
10006            )
10007        }
10008    }
10009    unsafe impl<
10010        T0: fidl::encoding::Encode<u64, fdomain_client::fidl::FDomainResourceDialect>,
10011        T1: fidl::encoding::Encode<Capability, fdomain_client::fidl::FDomainResourceDialect>,
10012    >
10013        fidl::encoding::Encode<
10014            CapabilityStoreImportRequest,
10015            fdomain_client::fidl::FDomainResourceDialect,
10016        > for (T0, T1)
10017    {
10018        #[inline]
10019        unsafe fn encode(
10020            self,
10021            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10022            offset: usize,
10023            depth: fidl::encoding::Depth,
10024        ) -> fidl::Result<()> {
10025            encoder.debug_check_bounds::<CapabilityStoreImportRequest>(offset);
10026            // Zero out padding regions. There's no need to apply masks
10027            // because the unmasked parts will be overwritten by fields.
10028            // Write the fields.
10029            self.0.encode(encoder, offset + 0, depth)?;
10030            self.1.encode(encoder, offset + 8, depth)?;
10031            Ok(())
10032        }
10033    }
10034
10035    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
10036        for CapabilityStoreImportRequest
10037    {
10038        #[inline(always)]
10039        fn new_empty() -> Self {
10040            Self {
10041                id: fidl::new_empty!(u64, fdomain_client::fidl::FDomainResourceDialect),
10042                capability: fidl::new_empty!(
10043                    Capability,
10044                    fdomain_client::fidl::FDomainResourceDialect
10045                ),
10046            }
10047        }
10048
10049        #[inline]
10050        unsafe fn decode(
10051            &mut self,
10052            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10053            offset: usize,
10054            _depth: fidl::encoding::Depth,
10055        ) -> fidl::Result<()> {
10056            decoder.debug_check_bounds::<Self>(offset);
10057            // Verify that padding bytes are zero.
10058            fidl::decode!(
10059                u64,
10060                fdomain_client::fidl::FDomainResourceDialect,
10061                &mut self.id,
10062                decoder,
10063                offset + 0,
10064                _depth
10065            )?;
10066            fidl::decode!(
10067                Capability,
10068                fdomain_client::fidl::FDomainResourceDialect,
10069                &mut self.capability,
10070                decoder,
10071                offset + 8,
10072                _depth
10073            )?;
10074            Ok(())
10075        }
10076    }
10077
10078    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreCreateServiceAggregateResponse {
10079        type Borrowed<'a> = &'a mut Self;
10080        fn take_or_borrow<'a>(
10081            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10082        ) -> Self::Borrowed<'a> {
10083            value
10084        }
10085    }
10086
10087    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreCreateServiceAggregateResponse {
10088        type Owned = Self;
10089
10090        #[inline(always)]
10091        fn inline_align(_context: fidl::encoding::Context) -> usize {
10092            4
10093        }
10094
10095        #[inline(always)]
10096        fn inline_size(_context: fidl::encoding::Context) -> usize {
10097            4
10098        }
10099    }
10100
10101    unsafe impl
10102        fidl::encoding::Encode<
10103            CapabilityStoreCreateServiceAggregateResponse,
10104            fdomain_client::fidl::FDomainResourceDialect,
10105        > for &mut CapabilityStoreCreateServiceAggregateResponse
10106    {
10107        #[inline]
10108        unsafe fn encode(
10109            self,
10110            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10111            offset: usize,
10112            _depth: fidl::encoding::Depth,
10113        ) -> fidl::Result<()> {
10114            encoder.debug_check_bounds::<CapabilityStoreCreateServiceAggregateResponse>(offset);
10115            // Delegate to tuple encoding.
10116            fidl::encoding::Encode::<
10117                CapabilityStoreCreateServiceAggregateResponse,
10118                fdomain_client::fidl::FDomainResourceDialect,
10119            >::encode(
10120                (<DirConnector as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10121                    &mut self.aggregate_dir_connector,
10122                ),),
10123                encoder,
10124                offset,
10125                _depth,
10126            )
10127        }
10128    }
10129    unsafe impl<
10130        T0: fidl::encoding::Encode<DirConnector, fdomain_client::fidl::FDomainResourceDialect>,
10131    >
10132        fidl::encoding::Encode<
10133            CapabilityStoreCreateServiceAggregateResponse,
10134            fdomain_client::fidl::FDomainResourceDialect,
10135        > for (T0,)
10136    {
10137        #[inline]
10138        unsafe fn encode(
10139            self,
10140            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10141            offset: usize,
10142            depth: fidl::encoding::Depth,
10143        ) -> fidl::Result<()> {
10144            encoder.debug_check_bounds::<CapabilityStoreCreateServiceAggregateResponse>(offset);
10145            // Zero out padding regions. There's no need to apply masks
10146            // because the unmasked parts will be overwritten by fields.
10147            // Write the fields.
10148            self.0.encode(encoder, offset + 0, depth)?;
10149            Ok(())
10150        }
10151    }
10152
10153    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
10154        for CapabilityStoreCreateServiceAggregateResponse
10155    {
10156        #[inline(always)]
10157        fn new_empty() -> Self {
10158            Self {
10159                aggregate_dir_connector: fidl::new_empty!(
10160                    DirConnector,
10161                    fdomain_client::fidl::FDomainResourceDialect
10162                ),
10163            }
10164        }
10165
10166        #[inline]
10167        unsafe fn decode(
10168            &mut self,
10169            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10170            offset: usize,
10171            _depth: fidl::encoding::Depth,
10172        ) -> fidl::Result<()> {
10173            decoder.debug_check_bounds::<Self>(offset);
10174            // Verify that padding bytes are zero.
10175            fidl::decode!(
10176                DirConnector,
10177                fdomain_client::fidl::FDomainResourceDialect,
10178                &mut self.aggregate_dir_connector,
10179                decoder,
10180                offset + 0,
10181                _depth
10182            )?;
10183            Ok(())
10184        }
10185    }
10186
10187    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreExportResponse {
10188        type Borrowed<'a> = &'a mut Self;
10189        fn take_or_borrow<'a>(
10190            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10191        ) -> Self::Borrowed<'a> {
10192            value
10193        }
10194    }
10195
10196    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreExportResponse {
10197        type Owned = Self;
10198
10199        #[inline(always)]
10200        fn inline_align(_context: fidl::encoding::Context) -> usize {
10201            8
10202        }
10203
10204        #[inline(always)]
10205        fn inline_size(_context: fidl::encoding::Context) -> usize {
10206            16
10207        }
10208    }
10209
10210    unsafe impl
10211        fidl::encoding::Encode<
10212            CapabilityStoreExportResponse,
10213            fdomain_client::fidl::FDomainResourceDialect,
10214        > for &mut CapabilityStoreExportResponse
10215    {
10216        #[inline]
10217        unsafe fn encode(
10218            self,
10219            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10220            offset: usize,
10221            _depth: fidl::encoding::Depth,
10222        ) -> fidl::Result<()> {
10223            encoder.debug_check_bounds::<CapabilityStoreExportResponse>(offset);
10224            // Delegate to tuple encoding.
10225            fidl::encoding::Encode::<
10226                CapabilityStoreExportResponse,
10227                fdomain_client::fidl::FDomainResourceDialect,
10228            >::encode(
10229                (<Capability as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10230                    &mut self.capability,
10231                ),),
10232                encoder,
10233                offset,
10234                _depth,
10235            )
10236        }
10237    }
10238    unsafe impl<
10239        T0: fidl::encoding::Encode<Capability, fdomain_client::fidl::FDomainResourceDialect>,
10240    >
10241        fidl::encoding::Encode<
10242            CapabilityStoreExportResponse,
10243            fdomain_client::fidl::FDomainResourceDialect,
10244        > for (T0,)
10245    {
10246        #[inline]
10247        unsafe fn encode(
10248            self,
10249            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10250            offset: usize,
10251            depth: fidl::encoding::Depth,
10252        ) -> fidl::Result<()> {
10253            encoder.debug_check_bounds::<CapabilityStoreExportResponse>(offset);
10254            // Zero out padding regions. There's no need to apply masks
10255            // because the unmasked parts will be overwritten by fields.
10256            // Write the fields.
10257            self.0.encode(encoder, offset + 0, depth)?;
10258            Ok(())
10259        }
10260    }
10261
10262    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
10263        for CapabilityStoreExportResponse
10264    {
10265        #[inline(always)]
10266        fn new_empty() -> Self {
10267            Self {
10268                capability: fidl::new_empty!(
10269                    Capability,
10270                    fdomain_client::fidl::FDomainResourceDialect
10271                ),
10272            }
10273        }
10274
10275        #[inline]
10276        unsafe fn decode(
10277            &mut self,
10278            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10279            offset: usize,
10280            _depth: fidl::encoding::Depth,
10281        ) -> fidl::Result<()> {
10282            decoder.debug_check_bounds::<Self>(offset);
10283            // Verify that padding bytes are zero.
10284            fidl::decode!(
10285                Capability,
10286                fdomain_client::fidl::FDomainResourceDialect,
10287                &mut self.capability,
10288                decoder,
10289                offset + 0,
10290                _depth
10291            )?;
10292            Ok(())
10293        }
10294    }
10295
10296    impl fidl::encoding::ResourceTypeMarker for Connector {
10297        type Borrowed<'a> = &'a mut Self;
10298        fn take_or_borrow<'a>(
10299            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10300        ) -> Self::Borrowed<'a> {
10301            value
10302        }
10303    }
10304
10305    unsafe impl fidl::encoding::TypeMarker for Connector {
10306        type Owned = Self;
10307
10308        #[inline(always)]
10309        fn inline_align(_context: fidl::encoding::Context) -> usize {
10310            4
10311        }
10312
10313        #[inline(always)]
10314        fn inline_size(_context: fidl::encoding::Context) -> usize {
10315            4
10316        }
10317    }
10318
10319    unsafe impl fidl::encoding::Encode<Connector, fdomain_client::fidl::FDomainResourceDialect>
10320        for &mut Connector
10321    {
10322        #[inline]
10323        unsafe fn encode(
10324            self,
10325            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10326            offset: usize,
10327            _depth: fidl::encoding::Depth,
10328        ) -> fidl::Result<()> {
10329            encoder.debug_check_bounds::<Connector>(offset);
10330            // Delegate to tuple encoding.
10331            fidl::encoding::Encode::<Connector, fdomain_client::fidl::FDomainResourceDialect>::encode(
10332                (
10333                    <fidl::encoding::HandleType<fdomain_client::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.token),
10334                ),
10335                encoder, offset, _depth
10336            )
10337        }
10338    }
10339    unsafe impl<
10340        T0: fidl::encoding::Encode<
10341                fidl::encoding::HandleType<
10342                    fdomain_client::EventPair,
10343                    { fidl::ObjectType::EVENTPAIR.into_raw() },
10344                    2147483648,
10345                >,
10346                fdomain_client::fidl::FDomainResourceDialect,
10347            >,
10348    > fidl::encoding::Encode<Connector, fdomain_client::fidl::FDomainResourceDialect> for (T0,)
10349    {
10350        #[inline]
10351        unsafe fn encode(
10352            self,
10353            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10354            offset: usize,
10355            depth: fidl::encoding::Depth,
10356        ) -> fidl::Result<()> {
10357            encoder.debug_check_bounds::<Connector>(offset);
10358            // Zero out padding regions. There's no need to apply masks
10359            // because the unmasked parts will be overwritten by fields.
10360            // Write the fields.
10361            self.0.encode(encoder, offset + 0, depth)?;
10362            Ok(())
10363        }
10364    }
10365
10366    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect> for Connector {
10367        #[inline(always)]
10368        fn new_empty() -> Self {
10369            Self {
10370                token: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
10371            }
10372        }
10373
10374        #[inline]
10375        unsafe fn decode(
10376            &mut self,
10377            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10378            offset: usize,
10379            _depth: fidl::encoding::Depth,
10380        ) -> fidl::Result<()> {
10381            decoder.debug_check_bounds::<Self>(offset);
10382            // Verify that padding bytes are zero.
10383            fidl::decode!(fidl::encoding::HandleType<fdomain_client::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect, &mut self.token, decoder, offset + 0, _depth)?;
10384            Ok(())
10385        }
10386    }
10387
10388    impl fidl::encoding::ResourceTypeMarker for DictionaryDrainIteratorGetNextResponse {
10389        type Borrowed<'a> = &'a mut Self;
10390        fn take_or_borrow<'a>(
10391            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10392        ) -> Self::Borrowed<'a> {
10393            value
10394        }
10395    }
10396
10397    unsafe impl fidl::encoding::TypeMarker for DictionaryDrainIteratorGetNextResponse {
10398        type Owned = Self;
10399
10400        #[inline(always)]
10401        fn inline_align(_context: fidl::encoding::Context) -> usize {
10402            8
10403        }
10404
10405        #[inline(always)]
10406        fn inline_size(_context: fidl::encoding::Context) -> usize {
10407            24
10408        }
10409    }
10410
10411    unsafe impl
10412        fidl::encoding::Encode<
10413            DictionaryDrainIteratorGetNextResponse,
10414            fdomain_client::fidl::FDomainResourceDialect,
10415        > for &mut DictionaryDrainIteratorGetNextResponse
10416    {
10417        #[inline]
10418        unsafe fn encode(
10419            self,
10420            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10421            offset: usize,
10422            _depth: fidl::encoding::Depth,
10423        ) -> fidl::Result<()> {
10424            encoder.debug_check_bounds::<DictionaryDrainIteratorGetNextResponse>(offset);
10425            // Delegate to tuple encoding.
10426            fidl::encoding::Encode::<DictionaryDrainIteratorGetNextResponse, fdomain_client::fidl::FDomainResourceDialect>::encode(
10427                (
10428                    <fidl::encoding::Vector<DictionaryItem, 128> as fidl::encoding::ValueTypeMarker>::borrow(&self.items),
10429                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.end_id),
10430                ),
10431                encoder, offset, _depth
10432            )
10433        }
10434    }
10435    unsafe impl<
10436        T0: fidl::encoding::Encode<
10437                fidl::encoding::Vector<DictionaryItem, 128>,
10438                fdomain_client::fidl::FDomainResourceDialect,
10439            >,
10440        T1: fidl::encoding::Encode<u64, fdomain_client::fidl::FDomainResourceDialect>,
10441    >
10442        fidl::encoding::Encode<
10443            DictionaryDrainIteratorGetNextResponse,
10444            fdomain_client::fidl::FDomainResourceDialect,
10445        > for (T0, T1)
10446    {
10447        #[inline]
10448        unsafe fn encode(
10449            self,
10450            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10451            offset: usize,
10452            depth: fidl::encoding::Depth,
10453        ) -> fidl::Result<()> {
10454            encoder.debug_check_bounds::<DictionaryDrainIteratorGetNextResponse>(offset);
10455            // Zero out padding regions. There's no need to apply masks
10456            // because the unmasked parts will be overwritten by fields.
10457            // Write the fields.
10458            self.0.encode(encoder, offset + 0, depth)?;
10459            self.1.encode(encoder, offset + 16, depth)?;
10460            Ok(())
10461        }
10462    }
10463
10464    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
10465        for DictionaryDrainIteratorGetNextResponse
10466    {
10467        #[inline(always)]
10468        fn new_empty() -> Self {
10469            Self {
10470                items: fidl::new_empty!(fidl::encoding::Vector<DictionaryItem, 128>, fdomain_client::fidl::FDomainResourceDialect),
10471                end_id: fidl::new_empty!(u64, fdomain_client::fidl::FDomainResourceDialect),
10472            }
10473        }
10474
10475        #[inline]
10476        unsafe fn decode(
10477            &mut self,
10478            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10479            offset: usize,
10480            _depth: fidl::encoding::Depth,
10481        ) -> fidl::Result<()> {
10482            decoder.debug_check_bounds::<Self>(offset);
10483            // Verify that padding bytes are zero.
10484            fidl::decode!(fidl::encoding::Vector<DictionaryItem, 128>, fdomain_client::fidl::FDomainResourceDialect, &mut self.items, decoder, offset + 0, _depth)?;
10485            fidl::decode!(
10486                u64,
10487                fdomain_client::fidl::FDomainResourceDialect,
10488                &mut self.end_id,
10489                decoder,
10490                offset + 16,
10491                _depth
10492            )?;
10493            Ok(())
10494        }
10495    }
10496
10497    impl fidl::encoding::ResourceTypeMarker for DictionaryEnumerateIteratorGetNextResponse {
10498        type Borrowed<'a> = &'a mut Self;
10499        fn take_or_borrow<'a>(
10500            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10501        ) -> Self::Borrowed<'a> {
10502            value
10503        }
10504    }
10505
10506    unsafe impl fidl::encoding::TypeMarker for DictionaryEnumerateIteratorGetNextResponse {
10507        type Owned = Self;
10508
10509        #[inline(always)]
10510        fn inline_align(_context: fidl::encoding::Context) -> usize {
10511            8
10512        }
10513
10514        #[inline(always)]
10515        fn inline_size(_context: fidl::encoding::Context) -> usize {
10516            24
10517        }
10518    }
10519
10520    unsafe impl
10521        fidl::encoding::Encode<
10522            DictionaryEnumerateIteratorGetNextResponse,
10523            fdomain_client::fidl::FDomainResourceDialect,
10524        > for &mut DictionaryEnumerateIteratorGetNextResponse
10525    {
10526        #[inline]
10527        unsafe fn encode(
10528            self,
10529            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10530            offset: usize,
10531            _depth: fidl::encoding::Depth,
10532        ) -> fidl::Result<()> {
10533            encoder.debug_check_bounds::<DictionaryEnumerateIteratorGetNextResponse>(offset);
10534            // Delegate to tuple encoding.
10535            fidl::encoding::Encode::<DictionaryEnumerateIteratorGetNextResponse, fdomain_client::fidl::FDomainResourceDialect>::encode(
10536                (
10537                    <fidl::encoding::Vector<DictionaryOptionalItem, 128> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.items),
10538                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.end_id),
10539                ),
10540                encoder, offset, _depth
10541            )
10542        }
10543    }
10544    unsafe impl<
10545        T0: fidl::encoding::Encode<
10546                fidl::encoding::Vector<DictionaryOptionalItem, 128>,
10547                fdomain_client::fidl::FDomainResourceDialect,
10548            >,
10549        T1: fidl::encoding::Encode<u64, fdomain_client::fidl::FDomainResourceDialect>,
10550    >
10551        fidl::encoding::Encode<
10552            DictionaryEnumerateIteratorGetNextResponse,
10553            fdomain_client::fidl::FDomainResourceDialect,
10554        > for (T0, T1)
10555    {
10556        #[inline]
10557        unsafe fn encode(
10558            self,
10559            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10560            offset: usize,
10561            depth: fidl::encoding::Depth,
10562        ) -> fidl::Result<()> {
10563            encoder.debug_check_bounds::<DictionaryEnumerateIteratorGetNextResponse>(offset);
10564            // Zero out padding regions. There's no need to apply masks
10565            // because the unmasked parts will be overwritten by fields.
10566            // Write the fields.
10567            self.0.encode(encoder, offset + 0, depth)?;
10568            self.1.encode(encoder, offset + 16, depth)?;
10569            Ok(())
10570        }
10571    }
10572
10573    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
10574        for DictionaryEnumerateIteratorGetNextResponse
10575    {
10576        #[inline(always)]
10577        fn new_empty() -> Self {
10578            Self {
10579                items: fidl::new_empty!(fidl::encoding::Vector<DictionaryOptionalItem, 128>, fdomain_client::fidl::FDomainResourceDialect),
10580                end_id: fidl::new_empty!(u64, fdomain_client::fidl::FDomainResourceDialect),
10581            }
10582        }
10583
10584        #[inline]
10585        unsafe fn decode(
10586            &mut self,
10587            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10588            offset: usize,
10589            _depth: fidl::encoding::Depth,
10590        ) -> fidl::Result<()> {
10591            decoder.debug_check_bounds::<Self>(offset);
10592            // Verify that padding bytes are zero.
10593            fidl::decode!(fidl::encoding::Vector<DictionaryOptionalItem, 128>, fdomain_client::fidl::FDomainResourceDialect, &mut self.items, decoder, offset + 0, _depth)?;
10594            fidl::decode!(
10595                u64,
10596                fdomain_client::fidl::FDomainResourceDialect,
10597                &mut self.end_id,
10598                decoder,
10599                offset + 16,
10600                _depth
10601            )?;
10602            Ok(())
10603        }
10604    }
10605
10606    impl fidl::encoding::ResourceTypeMarker for DictionaryKeysIteratorGetNextResponse {
10607        type Borrowed<'a> = &'a mut Self;
10608        fn take_or_borrow<'a>(
10609            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10610        ) -> Self::Borrowed<'a> {
10611            value
10612        }
10613    }
10614
10615    unsafe impl fidl::encoding::TypeMarker for DictionaryKeysIteratorGetNextResponse {
10616        type Owned = Self;
10617
10618        #[inline(always)]
10619        fn inline_align(_context: fidl::encoding::Context) -> usize {
10620            8
10621        }
10622
10623        #[inline(always)]
10624        fn inline_size(_context: fidl::encoding::Context) -> usize {
10625            16
10626        }
10627    }
10628
10629    unsafe impl
10630        fidl::encoding::Encode<
10631            DictionaryKeysIteratorGetNextResponse,
10632            fdomain_client::fidl::FDomainResourceDialect,
10633        > for &mut DictionaryKeysIteratorGetNextResponse
10634    {
10635        #[inline]
10636        unsafe fn encode(
10637            self,
10638            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10639            offset: usize,
10640            _depth: fidl::encoding::Depth,
10641        ) -> fidl::Result<()> {
10642            encoder.debug_check_bounds::<DictionaryKeysIteratorGetNextResponse>(offset);
10643            // Delegate to tuple encoding.
10644            fidl::encoding::Encode::<DictionaryKeysIteratorGetNextResponse, fdomain_client::fidl::FDomainResourceDialect>::encode(
10645                (
10646                    <fidl::encoding::Vector<fidl::encoding::BoundedString<255>, 128> as fidl::encoding::ValueTypeMarker>::borrow(&self.keys),
10647                ),
10648                encoder, offset, _depth
10649            )
10650        }
10651    }
10652    unsafe impl<
10653        T0: fidl::encoding::Encode<
10654                fidl::encoding::Vector<fidl::encoding::BoundedString<255>, 128>,
10655                fdomain_client::fidl::FDomainResourceDialect,
10656            >,
10657    >
10658        fidl::encoding::Encode<
10659            DictionaryKeysIteratorGetNextResponse,
10660            fdomain_client::fidl::FDomainResourceDialect,
10661        > for (T0,)
10662    {
10663        #[inline]
10664        unsafe fn encode(
10665            self,
10666            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10667            offset: usize,
10668            depth: fidl::encoding::Depth,
10669        ) -> fidl::Result<()> {
10670            encoder.debug_check_bounds::<DictionaryKeysIteratorGetNextResponse>(offset);
10671            // Zero out padding regions. There's no need to apply masks
10672            // because the unmasked parts will be overwritten by fields.
10673            // Write the fields.
10674            self.0.encode(encoder, offset + 0, depth)?;
10675            Ok(())
10676        }
10677    }
10678
10679    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
10680        for DictionaryKeysIteratorGetNextResponse
10681    {
10682        #[inline(always)]
10683        fn new_empty() -> Self {
10684            Self {
10685                keys: fidl::new_empty!(
10686                    fidl::encoding::Vector<fidl::encoding::BoundedString<255>, 128>,
10687                    fdomain_client::fidl::FDomainResourceDialect
10688                ),
10689            }
10690        }
10691
10692        #[inline]
10693        unsafe fn decode(
10694            &mut self,
10695            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10696            offset: usize,
10697            _depth: fidl::encoding::Depth,
10698        ) -> fidl::Result<()> {
10699            decoder.debug_check_bounds::<Self>(offset);
10700            // Verify that padding bytes are zero.
10701            fidl::decode!(
10702                fidl::encoding::Vector<fidl::encoding::BoundedString<255>, 128>,
10703                fdomain_client::fidl::FDomainResourceDialect,
10704                &mut self.keys,
10705                decoder,
10706                offset + 0,
10707                _depth
10708            )?;
10709            Ok(())
10710        }
10711    }
10712
10713    impl fidl::encoding::ResourceTypeMarker for DictionaryOptionalItem {
10714        type Borrowed<'a> = &'a mut Self;
10715        fn take_or_borrow<'a>(
10716            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10717        ) -> Self::Borrowed<'a> {
10718            value
10719        }
10720    }
10721
10722    unsafe impl fidl::encoding::TypeMarker for DictionaryOptionalItem {
10723        type Owned = Self;
10724
10725        #[inline(always)]
10726        fn inline_align(_context: fidl::encoding::Context) -> usize {
10727            8
10728        }
10729
10730        #[inline(always)]
10731        fn inline_size(_context: fidl::encoding::Context) -> usize {
10732            24
10733        }
10734    }
10735
10736    unsafe impl
10737        fidl::encoding::Encode<DictionaryOptionalItem, fdomain_client::fidl::FDomainResourceDialect>
10738        for &mut DictionaryOptionalItem
10739    {
10740        #[inline]
10741        unsafe fn encode(
10742            self,
10743            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10744            offset: usize,
10745            _depth: fidl::encoding::Depth,
10746        ) -> fidl::Result<()> {
10747            encoder.debug_check_bounds::<DictionaryOptionalItem>(offset);
10748            // Delegate to tuple encoding.
10749            fidl::encoding::Encode::<DictionaryOptionalItem, fdomain_client::fidl::FDomainResourceDialect>::encode(
10750                (
10751                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(&self.key),
10752                    <fidl::encoding::Boxed<WrappedCapabilityId> as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
10753                ),
10754                encoder, offset, _depth
10755            )
10756        }
10757    }
10758    unsafe impl<
10759        T0: fidl::encoding::Encode<
10760                fidl::encoding::BoundedString<255>,
10761                fdomain_client::fidl::FDomainResourceDialect,
10762            >,
10763        T1: fidl::encoding::Encode<
10764                fidl::encoding::Boxed<WrappedCapabilityId>,
10765                fdomain_client::fidl::FDomainResourceDialect,
10766            >,
10767    >
10768        fidl::encoding::Encode<DictionaryOptionalItem, fdomain_client::fidl::FDomainResourceDialect>
10769        for (T0, T1)
10770    {
10771        #[inline]
10772        unsafe fn encode(
10773            self,
10774            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10775            offset: usize,
10776            depth: fidl::encoding::Depth,
10777        ) -> fidl::Result<()> {
10778            encoder.debug_check_bounds::<DictionaryOptionalItem>(offset);
10779            // Zero out padding regions. There's no need to apply masks
10780            // because the unmasked parts will be overwritten by fields.
10781            // Write the fields.
10782            self.0.encode(encoder, offset + 0, depth)?;
10783            self.1.encode(encoder, offset + 16, depth)?;
10784            Ok(())
10785        }
10786    }
10787
10788    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
10789        for DictionaryOptionalItem
10790    {
10791        #[inline(always)]
10792        fn new_empty() -> Self {
10793            Self {
10794                key: fidl::new_empty!(
10795                    fidl::encoding::BoundedString<255>,
10796                    fdomain_client::fidl::FDomainResourceDialect
10797                ),
10798                value: fidl::new_empty!(
10799                    fidl::encoding::Boxed<WrappedCapabilityId>,
10800                    fdomain_client::fidl::FDomainResourceDialect
10801                ),
10802            }
10803        }
10804
10805        #[inline]
10806        unsafe fn decode(
10807            &mut self,
10808            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10809            offset: usize,
10810            _depth: fidl::encoding::Depth,
10811        ) -> fidl::Result<()> {
10812            decoder.debug_check_bounds::<Self>(offset);
10813            // Verify that padding bytes are zero.
10814            fidl::decode!(
10815                fidl::encoding::BoundedString<255>,
10816                fdomain_client::fidl::FDomainResourceDialect,
10817                &mut self.key,
10818                decoder,
10819                offset + 0,
10820                _depth
10821            )?;
10822            fidl::decode!(
10823                fidl::encoding::Boxed<WrappedCapabilityId>,
10824                fdomain_client::fidl::FDomainResourceDialect,
10825                &mut self.value,
10826                decoder,
10827                offset + 16,
10828                _depth
10829            )?;
10830            Ok(())
10831        }
10832    }
10833
10834    impl fidl::encoding::ResourceTypeMarker for DictionaryRef {
10835        type Borrowed<'a> = &'a mut Self;
10836        fn take_or_borrow<'a>(
10837            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10838        ) -> Self::Borrowed<'a> {
10839            value
10840        }
10841    }
10842
10843    unsafe impl fidl::encoding::TypeMarker for DictionaryRef {
10844        type Owned = Self;
10845
10846        #[inline(always)]
10847        fn inline_align(_context: fidl::encoding::Context) -> usize {
10848            4
10849        }
10850
10851        #[inline(always)]
10852        fn inline_size(_context: fidl::encoding::Context) -> usize {
10853            4
10854        }
10855    }
10856
10857    unsafe impl fidl::encoding::Encode<DictionaryRef, fdomain_client::fidl::FDomainResourceDialect>
10858        for &mut DictionaryRef
10859    {
10860        #[inline]
10861        unsafe fn encode(
10862            self,
10863            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10864            offset: usize,
10865            _depth: fidl::encoding::Depth,
10866        ) -> fidl::Result<()> {
10867            encoder.debug_check_bounds::<DictionaryRef>(offset);
10868            // Delegate to tuple encoding.
10869            fidl::encoding::Encode::<DictionaryRef, fdomain_client::fidl::FDomainResourceDialect>::encode(
10870                (
10871                    <fidl::encoding::HandleType<fdomain_client::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.token),
10872                ),
10873                encoder, offset, _depth
10874            )
10875        }
10876    }
10877    unsafe impl<
10878        T0: fidl::encoding::Encode<
10879                fidl::encoding::HandleType<
10880                    fdomain_client::EventPair,
10881                    { fidl::ObjectType::EVENTPAIR.into_raw() },
10882                    2147483648,
10883                >,
10884                fdomain_client::fidl::FDomainResourceDialect,
10885            >,
10886    > fidl::encoding::Encode<DictionaryRef, fdomain_client::fidl::FDomainResourceDialect> for (T0,)
10887    {
10888        #[inline]
10889        unsafe fn encode(
10890            self,
10891            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10892            offset: usize,
10893            depth: fidl::encoding::Depth,
10894        ) -> fidl::Result<()> {
10895            encoder.debug_check_bounds::<DictionaryRef>(offset);
10896            // Zero out padding regions. There's no need to apply masks
10897            // because the unmasked parts will be overwritten by fields.
10898            // Write the fields.
10899            self.0.encode(encoder, offset + 0, depth)?;
10900            Ok(())
10901        }
10902    }
10903
10904    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect> for DictionaryRef {
10905        #[inline(always)]
10906        fn new_empty() -> Self {
10907            Self {
10908                token: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
10909            }
10910        }
10911
10912        #[inline]
10913        unsafe fn decode(
10914            &mut self,
10915            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10916            offset: usize,
10917            _depth: fidl::encoding::Depth,
10918        ) -> fidl::Result<()> {
10919            decoder.debug_check_bounds::<Self>(offset);
10920            // Verify that padding bytes are zero.
10921            fidl::decode!(fidl::encoding::HandleType<fdomain_client::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect, &mut self.token, decoder, offset + 0, _depth)?;
10922            Ok(())
10923        }
10924    }
10925
10926    impl fidl::encoding::ResourceTypeMarker for DirConnector {
10927        type Borrowed<'a> = &'a mut Self;
10928        fn take_or_borrow<'a>(
10929            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10930        ) -> Self::Borrowed<'a> {
10931            value
10932        }
10933    }
10934
10935    unsafe impl fidl::encoding::TypeMarker for DirConnector {
10936        type Owned = Self;
10937
10938        #[inline(always)]
10939        fn inline_align(_context: fidl::encoding::Context) -> usize {
10940            4
10941        }
10942
10943        #[inline(always)]
10944        fn inline_size(_context: fidl::encoding::Context) -> usize {
10945            4
10946        }
10947    }
10948
10949    unsafe impl fidl::encoding::Encode<DirConnector, fdomain_client::fidl::FDomainResourceDialect>
10950        for &mut DirConnector
10951    {
10952        #[inline]
10953        unsafe fn encode(
10954            self,
10955            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10956            offset: usize,
10957            _depth: fidl::encoding::Depth,
10958        ) -> fidl::Result<()> {
10959            encoder.debug_check_bounds::<DirConnector>(offset);
10960            // Delegate to tuple encoding.
10961            fidl::encoding::Encode::<DirConnector, fdomain_client::fidl::FDomainResourceDialect>::encode(
10962                (
10963                    <fidl::encoding::HandleType<fdomain_client::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.token),
10964                ),
10965                encoder, offset, _depth
10966            )
10967        }
10968    }
10969    unsafe impl<
10970        T0: fidl::encoding::Encode<
10971                fidl::encoding::HandleType<
10972                    fdomain_client::EventPair,
10973                    { fidl::ObjectType::EVENTPAIR.into_raw() },
10974                    2147483648,
10975                >,
10976                fdomain_client::fidl::FDomainResourceDialect,
10977            >,
10978    > fidl::encoding::Encode<DirConnector, fdomain_client::fidl::FDomainResourceDialect> for (T0,)
10979    {
10980        #[inline]
10981        unsafe fn encode(
10982            self,
10983            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10984            offset: usize,
10985            depth: fidl::encoding::Depth,
10986        ) -> fidl::Result<()> {
10987            encoder.debug_check_bounds::<DirConnector>(offset);
10988            // Zero out padding regions. There's no need to apply masks
10989            // because the unmasked parts will be overwritten by fields.
10990            // Write the fields.
10991            self.0.encode(encoder, offset + 0, depth)?;
10992            Ok(())
10993        }
10994    }
10995
10996    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect> for DirConnector {
10997        #[inline(always)]
10998        fn new_empty() -> Self {
10999            Self {
11000                token: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
11001            }
11002        }
11003
11004        #[inline]
11005        unsafe fn decode(
11006            &mut self,
11007            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
11008            offset: usize,
11009            _depth: fidl::encoding::Depth,
11010        ) -> fidl::Result<()> {
11011            decoder.debug_check_bounds::<Self>(offset);
11012            // Verify that padding bytes are zero.
11013            fidl::decode!(fidl::encoding::HandleType<fdomain_client::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect, &mut self.token, decoder, offset + 0, _depth)?;
11014            Ok(())
11015        }
11016    }
11017
11018    impl fidl::encoding::ResourceTypeMarker for DirEntry {
11019        type Borrowed<'a> = &'a mut Self;
11020        fn take_or_borrow<'a>(
11021            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11022        ) -> Self::Borrowed<'a> {
11023            value
11024        }
11025    }
11026
11027    unsafe impl fidl::encoding::TypeMarker for DirEntry {
11028        type Owned = Self;
11029
11030        #[inline(always)]
11031        fn inline_align(_context: fidl::encoding::Context) -> usize {
11032            4
11033        }
11034
11035        #[inline(always)]
11036        fn inline_size(_context: fidl::encoding::Context) -> usize {
11037            4
11038        }
11039    }
11040
11041    unsafe impl fidl::encoding::Encode<DirEntry, fdomain_client::fidl::FDomainResourceDialect>
11042        for &mut DirEntry
11043    {
11044        #[inline]
11045        unsafe fn encode(
11046            self,
11047            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
11048            offset: usize,
11049            _depth: fidl::encoding::Depth,
11050        ) -> fidl::Result<()> {
11051            encoder.debug_check_bounds::<DirEntry>(offset);
11052            // Delegate to tuple encoding.
11053            fidl::encoding::Encode::<DirEntry, fdomain_client::fidl::FDomainResourceDialect>::encode(
11054                (<fidl::encoding::HandleType<
11055                    fdomain_client::EventPair,
11056                    { fidl::ObjectType::EVENTPAIR.into_raw() },
11057                    2147483648,
11058                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11059                    &mut self.token
11060                ),),
11061                encoder,
11062                offset,
11063                _depth,
11064            )
11065        }
11066    }
11067    unsafe impl<
11068        T0: fidl::encoding::Encode<
11069                fidl::encoding::HandleType<
11070                    fdomain_client::EventPair,
11071                    { fidl::ObjectType::EVENTPAIR.into_raw() },
11072                    2147483648,
11073                >,
11074                fdomain_client::fidl::FDomainResourceDialect,
11075            >,
11076    > fidl::encoding::Encode<DirEntry, fdomain_client::fidl::FDomainResourceDialect> for (T0,)
11077    {
11078        #[inline]
11079        unsafe fn encode(
11080            self,
11081            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
11082            offset: usize,
11083            depth: fidl::encoding::Depth,
11084        ) -> fidl::Result<()> {
11085            encoder.debug_check_bounds::<DirEntry>(offset);
11086            // Zero out padding regions. There's no need to apply masks
11087            // because the unmasked parts will be overwritten by fields.
11088            // Write the fields.
11089            self.0.encode(encoder, offset + 0, depth)?;
11090            Ok(())
11091        }
11092    }
11093
11094    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect> for DirEntry {
11095        #[inline(always)]
11096        fn new_empty() -> Self {
11097            Self {
11098                token: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
11099            }
11100        }
11101
11102        #[inline]
11103        unsafe fn decode(
11104            &mut self,
11105            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
11106            offset: usize,
11107            _depth: fidl::encoding::Depth,
11108        ) -> fidl::Result<()> {
11109            decoder.debug_check_bounds::<Self>(offset);
11110            // Verify that padding bytes are zero.
11111            fidl::decode!(fidl::encoding::HandleType<fdomain_client::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect, &mut self.token, decoder, offset + 0, _depth)?;
11112            Ok(())
11113        }
11114    }
11115
11116    impl fidl::encoding::ResourceTypeMarker for InstanceToken {
11117        type Borrowed<'a> = &'a mut Self;
11118        fn take_or_borrow<'a>(
11119            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11120        ) -> Self::Borrowed<'a> {
11121            value
11122        }
11123    }
11124
11125    unsafe impl fidl::encoding::TypeMarker for InstanceToken {
11126        type Owned = Self;
11127
11128        #[inline(always)]
11129        fn inline_align(_context: fidl::encoding::Context) -> usize {
11130            4
11131        }
11132
11133        #[inline(always)]
11134        fn inline_size(_context: fidl::encoding::Context) -> usize {
11135            4
11136        }
11137    }
11138
11139    unsafe impl fidl::encoding::Encode<InstanceToken, fdomain_client::fidl::FDomainResourceDialect>
11140        for &mut InstanceToken
11141    {
11142        #[inline]
11143        unsafe fn encode(
11144            self,
11145            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
11146            offset: usize,
11147            _depth: fidl::encoding::Depth,
11148        ) -> fidl::Result<()> {
11149            encoder.debug_check_bounds::<InstanceToken>(offset);
11150            // Delegate to tuple encoding.
11151            fidl::encoding::Encode::<InstanceToken, fdomain_client::fidl::FDomainResourceDialect>::encode(
11152                (
11153                    <fidl::encoding::HandleType<fdomain_client::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.token),
11154                ),
11155                encoder, offset, _depth
11156            )
11157        }
11158    }
11159    unsafe impl<
11160        T0: fidl::encoding::Encode<
11161                fidl::encoding::HandleType<
11162                    fdomain_client::EventPair,
11163                    { fidl::ObjectType::EVENTPAIR.into_raw() },
11164                    2147483648,
11165                >,
11166                fdomain_client::fidl::FDomainResourceDialect,
11167            >,
11168    > fidl::encoding::Encode<InstanceToken, fdomain_client::fidl::FDomainResourceDialect> for (T0,)
11169    {
11170        #[inline]
11171        unsafe fn encode(
11172            self,
11173            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
11174            offset: usize,
11175            depth: fidl::encoding::Depth,
11176        ) -> fidl::Result<()> {
11177            encoder.debug_check_bounds::<InstanceToken>(offset);
11178            // Zero out padding regions. There's no need to apply masks
11179            // because the unmasked parts will be overwritten by fields.
11180            // Write the fields.
11181            self.0.encode(encoder, offset + 0, depth)?;
11182            Ok(())
11183        }
11184    }
11185
11186    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect> for InstanceToken {
11187        #[inline(always)]
11188        fn new_empty() -> Self {
11189            Self {
11190                token: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
11191            }
11192        }
11193
11194        #[inline]
11195        unsafe fn decode(
11196            &mut self,
11197            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
11198            offset: usize,
11199            _depth: fidl::encoding::Depth,
11200        ) -> fidl::Result<()> {
11201            decoder.debug_check_bounds::<Self>(offset);
11202            // Verify that padding bytes are zero.
11203            fidl::decode!(fidl::encoding::HandleType<fdomain_client::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect, &mut self.token, decoder, offset + 0, _depth)?;
11204            Ok(())
11205        }
11206    }
11207
11208    impl fidl::encoding::ResourceTypeMarker for ProtocolPayload {
11209        type Borrowed<'a> = &'a mut Self;
11210        fn take_or_borrow<'a>(
11211            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11212        ) -> Self::Borrowed<'a> {
11213            value
11214        }
11215    }
11216
11217    unsafe impl fidl::encoding::TypeMarker for ProtocolPayload {
11218        type Owned = Self;
11219
11220        #[inline(always)]
11221        fn inline_align(_context: fidl::encoding::Context) -> usize {
11222            4
11223        }
11224
11225        #[inline(always)]
11226        fn inline_size(_context: fidl::encoding::Context) -> usize {
11227            4
11228        }
11229    }
11230
11231    unsafe impl
11232        fidl::encoding::Encode<ProtocolPayload, fdomain_client::fidl::FDomainResourceDialect>
11233        for &mut ProtocolPayload
11234    {
11235        #[inline]
11236        unsafe fn encode(
11237            self,
11238            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
11239            offset: usize,
11240            _depth: fidl::encoding::Depth,
11241        ) -> fidl::Result<()> {
11242            encoder.debug_check_bounds::<ProtocolPayload>(offset);
11243            // Delegate to tuple encoding.
11244            fidl::encoding::Encode::<ProtocolPayload, fdomain_client::fidl::FDomainResourceDialect>::encode(
11245                (
11246                    <fidl::encoding::HandleType<fdomain_client::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.channel),
11247                ),
11248                encoder, offset, _depth
11249            )
11250        }
11251    }
11252    unsafe impl<
11253        T0: fidl::encoding::Encode<
11254                fidl::encoding::HandleType<
11255                    fdomain_client::Channel,
11256                    { fidl::ObjectType::CHANNEL.into_raw() },
11257                    2147483648,
11258                >,
11259                fdomain_client::fidl::FDomainResourceDialect,
11260            >,
11261    > fidl::encoding::Encode<ProtocolPayload, fdomain_client::fidl::FDomainResourceDialect>
11262        for (T0,)
11263    {
11264        #[inline]
11265        unsafe fn encode(
11266            self,
11267            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
11268            offset: usize,
11269            depth: fidl::encoding::Depth,
11270        ) -> fidl::Result<()> {
11271            encoder.debug_check_bounds::<ProtocolPayload>(offset);
11272            // Zero out padding regions. There's no need to apply masks
11273            // because the unmasked parts will be overwritten by fields.
11274            // Write the fields.
11275            self.0.encode(encoder, offset + 0, depth)?;
11276            Ok(())
11277        }
11278    }
11279
11280    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
11281        for ProtocolPayload
11282    {
11283        #[inline(always)]
11284        fn new_empty() -> Self {
11285            Self {
11286                channel: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
11287            }
11288        }
11289
11290        #[inline]
11291        unsafe fn decode(
11292            &mut self,
11293            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
11294            offset: usize,
11295            _depth: fidl::encoding::Depth,
11296        ) -> fidl::Result<()> {
11297            decoder.debug_check_bounds::<Self>(offset);
11298            // Verify that padding bytes are zero.
11299            fidl::decode!(fidl::encoding::HandleType<fdomain_client::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect, &mut self.channel, decoder, offset + 0, _depth)?;
11300            Ok(())
11301        }
11302    }
11303
11304    impl AggregateSource {
11305        #[inline(always)]
11306        fn max_ordinal_present(&self) -> u64 {
11307            if let Some(_) = self.renamed_instances {
11308                return 3;
11309            }
11310            if let Some(_) = self.source_instance_filter {
11311                return 2;
11312            }
11313            if let Some(_) = self.dir_connector {
11314                return 1;
11315            }
11316            0
11317        }
11318    }
11319
11320    impl fidl::encoding::ResourceTypeMarker for AggregateSource {
11321        type Borrowed<'a> = &'a mut Self;
11322        fn take_or_borrow<'a>(
11323            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11324        ) -> Self::Borrowed<'a> {
11325            value
11326        }
11327    }
11328
11329    unsafe impl fidl::encoding::TypeMarker for AggregateSource {
11330        type Owned = Self;
11331
11332        #[inline(always)]
11333        fn inline_align(_context: fidl::encoding::Context) -> usize {
11334            8
11335        }
11336
11337        #[inline(always)]
11338        fn inline_size(_context: fidl::encoding::Context) -> usize {
11339            16
11340        }
11341    }
11342
11343    unsafe impl
11344        fidl::encoding::Encode<AggregateSource, fdomain_client::fidl::FDomainResourceDialect>
11345        for &mut AggregateSource
11346    {
11347        unsafe fn encode(
11348            self,
11349            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
11350            offset: usize,
11351            mut depth: fidl::encoding::Depth,
11352        ) -> fidl::Result<()> {
11353            encoder.debug_check_bounds::<AggregateSource>(offset);
11354            // Vector header
11355            let max_ordinal: u64 = self.max_ordinal_present();
11356            encoder.write_num(max_ordinal, offset);
11357            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
11358            // Calling encoder.out_of_line_offset(0) is not allowed.
11359            if max_ordinal == 0 {
11360                return Ok(());
11361            }
11362            depth.increment()?;
11363            let envelope_size = 8;
11364            let bytes_len = max_ordinal as usize * envelope_size;
11365            #[allow(unused_variables)]
11366            let offset = encoder.out_of_line_offset(bytes_len);
11367            let mut _prev_end_offset: usize = 0;
11368            if 1 > max_ordinal {
11369                return Ok(());
11370            }
11371
11372            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11373            // are envelope_size bytes.
11374            let cur_offset: usize = (1 - 1) * envelope_size;
11375
11376            // Zero reserved fields.
11377            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11378
11379            // Safety:
11380            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11381            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11382            //   envelope_size bytes, there is always sufficient room.
11383            fidl::encoding::encode_in_envelope_optional::<
11384                DirConnector,
11385                fdomain_client::fidl::FDomainResourceDialect,
11386            >(
11387                self.dir_connector
11388                    .as_mut()
11389                    .map(<DirConnector as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
11390                encoder,
11391                offset + cur_offset,
11392                depth,
11393            )?;
11394
11395            _prev_end_offset = cur_offset + envelope_size;
11396            if 2 > max_ordinal {
11397                return Ok(());
11398            }
11399
11400            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11401            // are envelope_size bytes.
11402            let cur_offset: usize = (2 - 1) * envelope_size;
11403
11404            // Zero reserved fields.
11405            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11406
11407            // Safety:
11408            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11409            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11410            //   envelope_size bytes, there is always sufficient room.
11411            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<255>>, fdomain_client::fidl::FDomainResourceDialect>(
11412            self.source_instance_filter.as_ref().map(<fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<255>> as fidl::encoding::ValueTypeMarker>::borrow),
11413            encoder, offset + cur_offset, depth
11414        )?;
11415
11416            _prev_end_offset = cur_offset + envelope_size;
11417            if 3 > max_ordinal {
11418                return Ok(());
11419            }
11420
11421            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11422            // are envelope_size bytes.
11423            let cur_offset: usize = (3 - 1) * envelope_size;
11424
11425            // Zero reserved fields.
11426            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11427
11428            // Safety:
11429            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11430            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11431            //   envelope_size bytes, there is always sufficient room.
11432            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<fdomain_fuchsia_component_decl::NameMapping>, fdomain_client::fidl::FDomainResourceDialect>(
11433            self.renamed_instances.as_ref().map(<fidl::encoding::UnboundedVector<fdomain_fuchsia_component_decl::NameMapping> as fidl::encoding::ValueTypeMarker>::borrow),
11434            encoder, offset + cur_offset, depth
11435        )?;
11436
11437            _prev_end_offset = cur_offset + envelope_size;
11438
11439            Ok(())
11440        }
11441    }
11442
11443    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
11444        for AggregateSource
11445    {
11446        #[inline(always)]
11447        fn new_empty() -> Self {
11448            Self::default()
11449        }
11450
11451        unsafe fn decode(
11452            &mut self,
11453            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
11454            offset: usize,
11455            mut depth: fidl::encoding::Depth,
11456        ) -> fidl::Result<()> {
11457            decoder.debug_check_bounds::<Self>(offset);
11458            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
11459                None => return Err(fidl::Error::NotNullable),
11460                Some(len) => len,
11461            };
11462            // Calling decoder.out_of_line_offset(0) is not allowed.
11463            if len == 0 {
11464                return Ok(());
11465            };
11466            depth.increment()?;
11467            let envelope_size = 8;
11468            let bytes_len = len * envelope_size;
11469            let offset = decoder.out_of_line_offset(bytes_len)?;
11470            // Decode the envelope for each type.
11471            let mut _next_ordinal_to_read = 0;
11472            let mut next_offset = offset;
11473            let end_offset = offset + bytes_len;
11474            _next_ordinal_to_read += 1;
11475            if next_offset >= end_offset {
11476                return Ok(());
11477            }
11478
11479            // Decode unknown envelopes for gaps in ordinals.
11480            while _next_ordinal_to_read < 1 {
11481                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11482                _next_ordinal_to_read += 1;
11483                next_offset += envelope_size;
11484            }
11485
11486            let next_out_of_line = decoder.next_out_of_line();
11487            let handles_before = decoder.remaining_handles();
11488            if let Some((inlined, num_bytes, num_handles)) =
11489                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11490            {
11491                let member_inline_size =
11492                    <DirConnector as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11493                if inlined != (member_inline_size <= 4) {
11494                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11495                }
11496                let inner_offset;
11497                let mut inner_depth = depth.clone();
11498                if inlined {
11499                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11500                    inner_offset = next_offset;
11501                } else {
11502                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11503                    inner_depth.increment()?;
11504                }
11505                let val_ref = self.dir_connector.get_or_insert_with(|| {
11506                    fidl::new_empty!(DirConnector, fdomain_client::fidl::FDomainResourceDialect)
11507                });
11508                fidl::decode!(
11509                    DirConnector,
11510                    fdomain_client::fidl::FDomainResourceDialect,
11511                    val_ref,
11512                    decoder,
11513                    inner_offset,
11514                    inner_depth
11515                )?;
11516                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11517                {
11518                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11519                }
11520                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11521                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11522                }
11523            }
11524
11525            next_offset += envelope_size;
11526            _next_ordinal_to_read += 1;
11527            if next_offset >= end_offset {
11528                return Ok(());
11529            }
11530
11531            // Decode unknown envelopes for gaps in ordinals.
11532            while _next_ordinal_to_read < 2 {
11533                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11534                _next_ordinal_to_read += 1;
11535                next_offset += envelope_size;
11536            }
11537
11538            let next_out_of_line = decoder.next_out_of_line();
11539            let handles_before = decoder.remaining_handles();
11540            if let Some((inlined, num_bytes, num_handles)) =
11541                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11542            {
11543                let member_inline_size = <fidl::encoding::UnboundedVector<
11544                    fidl::encoding::BoundedString<255>,
11545                > as fidl::encoding::TypeMarker>::inline_size(
11546                    decoder.context
11547                );
11548                if inlined != (member_inline_size <= 4) {
11549                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11550                }
11551                let inner_offset;
11552                let mut inner_depth = depth.clone();
11553                if inlined {
11554                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11555                    inner_offset = next_offset;
11556                } else {
11557                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11558                    inner_depth.increment()?;
11559                }
11560                let val_ref = self.source_instance_filter.get_or_insert_with(|| {
11561                    fidl::new_empty!(
11562                        fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<255>>,
11563                        fdomain_client::fidl::FDomainResourceDialect
11564                    )
11565                });
11566                fidl::decode!(
11567                    fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<255>>,
11568                    fdomain_client::fidl::FDomainResourceDialect,
11569                    val_ref,
11570                    decoder,
11571                    inner_offset,
11572                    inner_depth
11573                )?;
11574                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11575                {
11576                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11577                }
11578                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11579                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11580                }
11581            }
11582
11583            next_offset += envelope_size;
11584            _next_ordinal_to_read += 1;
11585            if next_offset >= end_offset {
11586                return Ok(());
11587            }
11588
11589            // Decode unknown envelopes for gaps in ordinals.
11590            while _next_ordinal_to_read < 3 {
11591                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11592                _next_ordinal_to_read += 1;
11593                next_offset += envelope_size;
11594            }
11595
11596            let next_out_of_line = decoder.next_out_of_line();
11597            let handles_before = decoder.remaining_handles();
11598            if let Some((inlined, num_bytes, num_handles)) =
11599                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11600            {
11601                let member_inline_size = <fidl::encoding::UnboundedVector<
11602                    fdomain_fuchsia_component_decl::NameMapping,
11603                > as fidl::encoding::TypeMarker>::inline_size(
11604                    decoder.context
11605                );
11606                if inlined != (member_inline_size <= 4) {
11607                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11608                }
11609                let inner_offset;
11610                let mut inner_depth = depth.clone();
11611                if inlined {
11612                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11613                    inner_offset = next_offset;
11614                } else {
11615                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11616                    inner_depth.increment()?;
11617                }
11618                let val_ref = self.renamed_instances.get_or_insert_with(|| {
11619                    fidl::new_empty!(
11620                        fidl::encoding::UnboundedVector<
11621                            fdomain_fuchsia_component_decl::NameMapping,
11622                        >,
11623                        fdomain_client::fidl::FDomainResourceDialect
11624                    )
11625                });
11626                fidl::decode!(
11627                    fidl::encoding::UnboundedVector<fdomain_fuchsia_component_decl::NameMapping>,
11628                    fdomain_client::fidl::FDomainResourceDialect,
11629                    val_ref,
11630                    decoder,
11631                    inner_offset,
11632                    inner_depth
11633                )?;
11634                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11635                {
11636                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11637                }
11638                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11639                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11640                }
11641            }
11642
11643            next_offset += envelope_size;
11644
11645            // Decode the remaining unknown envelopes.
11646            while next_offset < end_offset {
11647                _next_ordinal_to_read += 1;
11648                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11649                next_offset += envelope_size;
11650            }
11651
11652            Ok(())
11653        }
11654    }
11655
11656    impl CapabilityStoreDirConnectorOpenRequest {
11657        #[inline(always)]
11658        fn max_ordinal_present(&self) -> u64 {
11659            if let Some(_) = self.path {
11660                return 4;
11661            }
11662            if let Some(_) = self.flags {
11663                return 3;
11664            }
11665            if let Some(_) = self.server_end {
11666                return 2;
11667            }
11668            if let Some(_) = self.id {
11669                return 1;
11670            }
11671            0
11672        }
11673    }
11674
11675    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDirConnectorOpenRequest {
11676        type Borrowed<'a> = &'a mut Self;
11677        fn take_or_borrow<'a>(
11678            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11679        ) -> Self::Borrowed<'a> {
11680            value
11681        }
11682    }
11683
11684    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDirConnectorOpenRequest {
11685        type Owned = Self;
11686
11687        #[inline(always)]
11688        fn inline_align(_context: fidl::encoding::Context) -> usize {
11689            8
11690        }
11691
11692        #[inline(always)]
11693        fn inline_size(_context: fidl::encoding::Context) -> usize {
11694            16
11695        }
11696    }
11697
11698    unsafe impl
11699        fidl::encoding::Encode<
11700            CapabilityStoreDirConnectorOpenRequest,
11701            fdomain_client::fidl::FDomainResourceDialect,
11702        > for &mut CapabilityStoreDirConnectorOpenRequest
11703    {
11704        unsafe fn encode(
11705            self,
11706            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
11707            offset: usize,
11708            mut depth: fidl::encoding::Depth,
11709        ) -> fidl::Result<()> {
11710            encoder.debug_check_bounds::<CapabilityStoreDirConnectorOpenRequest>(offset);
11711            // Vector header
11712            let max_ordinal: u64 = self.max_ordinal_present();
11713            encoder.write_num(max_ordinal, offset);
11714            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
11715            // Calling encoder.out_of_line_offset(0) is not allowed.
11716            if max_ordinal == 0 {
11717                return Ok(());
11718            }
11719            depth.increment()?;
11720            let envelope_size = 8;
11721            let bytes_len = max_ordinal as usize * envelope_size;
11722            #[allow(unused_variables)]
11723            let offset = encoder.out_of_line_offset(bytes_len);
11724            let mut _prev_end_offset: usize = 0;
11725            if 1 > max_ordinal {
11726                return Ok(());
11727            }
11728
11729            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11730            // are envelope_size bytes.
11731            let cur_offset: usize = (1 - 1) * envelope_size;
11732
11733            // Zero reserved fields.
11734            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11735
11736            // Safety:
11737            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11738            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11739            //   envelope_size bytes, there is always sufficient room.
11740            fidl::encoding::encode_in_envelope_optional::<
11741                u64,
11742                fdomain_client::fidl::FDomainResourceDialect,
11743            >(
11744                self.id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
11745                encoder,
11746                offset + cur_offset,
11747                depth,
11748            )?;
11749
11750            _prev_end_offset = cur_offset + envelope_size;
11751            if 2 > max_ordinal {
11752                return Ok(());
11753            }
11754
11755            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11756            // are envelope_size bytes.
11757            let cur_offset: usize = (2 - 1) * envelope_size;
11758
11759            // Zero reserved fields.
11760            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11761
11762            // Safety:
11763            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11764            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11765            //   envelope_size bytes, there is always sufficient room.
11766            fidl::encoding::encode_in_envelope_optional::<
11767                fidl::encoding::Endpoint<
11768                    fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
11769                >,
11770                fdomain_client::fidl::FDomainResourceDialect,
11771            >(
11772                self.server_end.as_mut().map(
11773                    <fidl::encoding::Endpoint<
11774                        fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
11775                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
11776                ),
11777                encoder,
11778                offset + cur_offset,
11779                depth,
11780            )?;
11781
11782            _prev_end_offset = cur_offset + envelope_size;
11783            if 3 > max_ordinal {
11784                return Ok(());
11785            }
11786
11787            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11788            // are envelope_size bytes.
11789            let cur_offset: usize = (3 - 1) * envelope_size;
11790
11791            // Zero reserved fields.
11792            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11793
11794            // Safety:
11795            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11796            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11797            //   envelope_size bytes, there is always sufficient room.
11798            fidl::encoding::encode_in_envelope_optional::<
11799                fdomain_fuchsia_io::Flags,
11800                fdomain_client::fidl::FDomainResourceDialect,
11801            >(
11802                self.flags
11803                    .as_ref()
11804                    .map(<fdomain_fuchsia_io::Flags as fidl::encoding::ValueTypeMarker>::borrow),
11805                encoder,
11806                offset + cur_offset,
11807                depth,
11808            )?;
11809
11810            _prev_end_offset = cur_offset + envelope_size;
11811            if 4 > max_ordinal {
11812                return Ok(());
11813            }
11814
11815            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11816            // are envelope_size bytes.
11817            let cur_offset: usize = (4 - 1) * envelope_size;
11818
11819            // Zero reserved fields.
11820            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11821
11822            // Safety:
11823            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11824            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11825            //   envelope_size bytes, there is always sufficient room.
11826            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<4095>, fdomain_client::fidl::FDomainResourceDialect>(
11827            self.path.as_ref().map(<fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow),
11828            encoder, offset + cur_offset, depth
11829        )?;
11830
11831            _prev_end_offset = cur_offset + envelope_size;
11832
11833            Ok(())
11834        }
11835    }
11836
11837    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
11838        for CapabilityStoreDirConnectorOpenRequest
11839    {
11840        #[inline(always)]
11841        fn new_empty() -> Self {
11842            Self::default()
11843        }
11844
11845        unsafe fn decode(
11846            &mut self,
11847            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
11848            offset: usize,
11849            mut depth: fidl::encoding::Depth,
11850        ) -> fidl::Result<()> {
11851            decoder.debug_check_bounds::<Self>(offset);
11852            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
11853                None => return Err(fidl::Error::NotNullable),
11854                Some(len) => len,
11855            };
11856            // Calling decoder.out_of_line_offset(0) is not allowed.
11857            if len == 0 {
11858                return Ok(());
11859            };
11860            depth.increment()?;
11861            let envelope_size = 8;
11862            let bytes_len = len * envelope_size;
11863            let offset = decoder.out_of_line_offset(bytes_len)?;
11864            // Decode the envelope for each type.
11865            let mut _next_ordinal_to_read = 0;
11866            let mut next_offset = offset;
11867            let end_offset = offset + bytes_len;
11868            _next_ordinal_to_read += 1;
11869            if next_offset >= end_offset {
11870                return Ok(());
11871            }
11872
11873            // Decode unknown envelopes for gaps in ordinals.
11874            while _next_ordinal_to_read < 1 {
11875                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11876                _next_ordinal_to_read += 1;
11877                next_offset += envelope_size;
11878            }
11879
11880            let next_out_of_line = decoder.next_out_of_line();
11881            let handles_before = decoder.remaining_handles();
11882            if let Some((inlined, num_bytes, num_handles)) =
11883                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11884            {
11885                let member_inline_size =
11886                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11887                if inlined != (member_inline_size <= 4) {
11888                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11889                }
11890                let inner_offset;
11891                let mut inner_depth = depth.clone();
11892                if inlined {
11893                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11894                    inner_offset = next_offset;
11895                } else {
11896                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11897                    inner_depth.increment()?;
11898                }
11899                let val_ref = self.id.get_or_insert_with(|| {
11900                    fidl::new_empty!(u64, fdomain_client::fidl::FDomainResourceDialect)
11901                });
11902                fidl::decode!(
11903                    u64,
11904                    fdomain_client::fidl::FDomainResourceDialect,
11905                    val_ref,
11906                    decoder,
11907                    inner_offset,
11908                    inner_depth
11909                )?;
11910                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11911                {
11912                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11913                }
11914                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11915                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11916                }
11917            }
11918
11919            next_offset += envelope_size;
11920            _next_ordinal_to_read += 1;
11921            if next_offset >= end_offset {
11922                return Ok(());
11923            }
11924
11925            // Decode unknown envelopes for gaps in ordinals.
11926            while _next_ordinal_to_read < 2 {
11927                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11928                _next_ordinal_to_read += 1;
11929                next_offset += envelope_size;
11930            }
11931
11932            let next_out_of_line = decoder.next_out_of_line();
11933            let handles_before = decoder.remaining_handles();
11934            if let Some((inlined, num_bytes, num_handles)) =
11935                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11936            {
11937                let member_inline_size = <fidl::encoding::Endpoint<
11938                    fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
11939                > as fidl::encoding::TypeMarker>::inline_size(
11940                    decoder.context
11941                );
11942                if inlined != (member_inline_size <= 4) {
11943                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11944                }
11945                let inner_offset;
11946                let mut inner_depth = depth.clone();
11947                if inlined {
11948                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11949                    inner_offset = next_offset;
11950                } else {
11951                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11952                    inner_depth.increment()?;
11953                }
11954                let val_ref = self.server_end.get_or_insert_with(|| {
11955                    fidl::new_empty!(
11956                        fidl::encoding::Endpoint<
11957                            fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
11958                        >,
11959                        fdomain_client::fidl::FDomainResourceDialect
11960                    )
11961                });
11962                fidl::decode!(
11963                    fidl::encoding::Endpoint<
11964                        fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
11965                    >,
11966                    fdomain_client::fidl::FDomainResourceDialect,
11967                    val_ref,
11968                    decoder,
11969                    inner_offset,
11970                    inner_depth
11971                )?;
11972                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11973                {
11974                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11975                }
11976                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11977                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11978                }
11979            }
11980
11981            next_offset += envelope_size;
11982            _next_ordinal_to_read += 1;
11983            if next_offset >= end_offset {
11984                return Ok(());
11985            }
11986
11987            // Decode unknown envelopes for gaps in ordinals.
11988            while _next_ordinal_to_read < 3 {
11989                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11990                _next_ordinal_to_read += 1;
11991                next_offset += envelope_size;
11992            }
11993
11994            let next_out_of_line = decoder.next_out_of_line();
11995            let handles_before = decoder.remaining_handles();
11996            if let Some((inlined, num_bytes, num_handles)) =
11997                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11998            {
11999                let member_inline_size =
12000                    <fdomain_fuchsia_io::Flags as fidl::encoding::TypeMarker>::inline_size(
12001                        decoder.context,
12002                    );
12003                if inlined != (member_inline_size <= 4) {
12004                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12005                }
12006                let inner_offset;
12007                let mut inner_depth = depth.clone();
12008                if inlined {
12009                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12010                    inner_offset = next_offset;
12011                } else {
12012                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12013                    inner_depth.increment()?;
12014                }
12015                let val_ref = self.flags.get_or_insert_with(|| {
12016                    fidl::new_empty!(
12017                        fdomain_fuchsia_io::Flags,
12018                        fdomain_client::fidl::FDomainResourceDialect
12019                    )
12020                });
12021                fidl::decode!(
12022                    fdomain_fuchsia_io::Flags,
12023                    fdomain_client::fidl::FDomainResourceDialect,
12024                    val_ref,
12025                    decoder,
12026                    inner_offset,
12027                    inner_depth
12028                )?;
12029                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12030                {
12031                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12032                }
12033                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12034                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12035                }
12036            }
12037
12038            next_offset += envelope_size;
12039            _next_ordinal_to_read += 1;
12040            if next_offset >= end_offset {
12041                return Ok(());
12042            }
12043
12044            // Decode unknown envelopes for gaps in ordinals.
12045            while _next_ordinal_to_read < 4 {
12046                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12047                _next_ordinal_to_read += 1;
12048                next_offset += envelope_size;
12049            }
12050
12051            let next_out_of_line = decoder.next_out_of_line();
12052            let handles_before = decoder.remaining_handles();
12053            if let Some((inlined, num_bytes, num_handles)) =
12054                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12055            {
12056                let member_inline_size = <fidl::encoding::BoundedString<4095> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12057                if inlined != (member_inline_size <= 4) {
12058                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12059                }
12060                let inner_offset;
12061                let mut inner_depth = depth.clone();
12062                if inlined {
12063                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12064                    inner_offset = next_offset;
12065                } else {
12066                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12067                    inner_depth.increment()?;
12068                }
12069                let val_ref = self.path.get_or_insert_with(|| {
12070                    fidl::new_empty!(
12071                        fidl::encoding::BoundedString<4095>,
12072                        fdomain_client::fidl::FDomainResourceDialect
12073                    )
12074                });
12075                fidl::decode!(
12076                    fidl::encoding::BoundedString<4095>,
12077                    fdomain_client::fidl::FDomainResourceDialect,
12078                    val_ref,
12079                    decoder,
12080                    inner_offset,
12081                    inner_depth
12082                )?;
12083                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12084                {
12085                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12086                }
12087                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12088                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12089                }
12090            }
12091
12092            next_offset += envelope_size;
12093
12094            // Decode the remaining unknown envelopes.
12095            while next_offset < end_offset {
12096                _next_ordinal_to_read += 1;
12097                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12098                next_offset += envelope_size;
12099            }
12100
12101            Ok(())
12102        }
12103    }
12104
12105    impl DirReceiverReceiveRequest {
12106        #[inline(always)]
12107        fn max_ordinal_present(&self) -> u64 {
12108            if let Some(_) = self.subdir {
12109                return 3;
12110            }
12111            if let Some(_) = self.flags {
12112                return 2;
12113            }
12114            if let Some(_) = self.channel {
12115                return 1;
12116            }
12117            0
12118        }
12119    }
12120
12121    impl fidl::encoding::ResourceTypeMarker for DirReceiverReceiveRequest {
12122        type Borrowed<'a> = &'a mut Self;
12123        fn take_or_borrow<'a>(
12124            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12125        ) -> Self::Borrowed<'a> {
12126            value
12127        }
12128    }
12129
12130    unsafe impl fidl::encoding::TypeMarker for DirReceiverReceiveRequest {
12131        type Owned = Self;
12132
12133        #[inline(always)]
12134        fn inline_align(_context: fidl::encoding::Context) -> usize {
12135            8
12136        }
12137
12138        #[inline(always)]
12139        fn inline_size(_context: fidl::encoding::Context) -> usize {
12140            16
12141        }
12142    }
12143
12144    unsafe impl
12145        fidl::encoding::Encode<
12146            DirReceiverReceiveRequest,
12147            fdomain_client::fidl::FDomainResourceDialect,
12148        > for &mut DirReceiverReceiveRequest
12149    {
12150        unsafe fn encode(
12151            self,
12152            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
12153            offset: usize,
12154            mut depth: fidl::encoding::Depth,
12155        ) -> fidl::Result<()> {
12156            encoder.debug_check_bounds::<DirReceiverReceiveRequest>(offset);
12157            // Vector header
12158            let max_ordinal: u64 = self.max_ordinal_present();
12159            encoder.write_num(max_ordinal, offset);
12160            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12161            // Calling encoder.out_of_line_offset(0) is not allowed.
12162            if max_ordinal == 0 {
12163                return Ok(());
12164            }
12165            depth.increment()?;
12166            let envelope_size = 8;
12167            let bytes_len = max_ordinal as usize * envelope_size;
12168            #[allow(unused_variables)]
12169            let offset = encoder.out_of_line_offset(bytes_len);
12170            let mut _prev_end_offset: usize = 0;
12171            if 1 > max_ordinal {
12172                return Ok(());
12173            }
12174
12175            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12176            // are envelope_size bytes.
12177            let cur_offset: usize = (1 - 1) * envelope_size;
12178
12179            // Zero reserved fields.
12180            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12181
12182            // Safety:
12183            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12184            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12185            //   envelope_size bytes, there is always sufficient room.
12186            fidl::encoding::encode_in_envelope_optional::<
12187                fidl::encoding::HandleType<
12188                    fdomain_client::Channel,
12189                    { fidl::ObjectType::CHANNEL.into_raw() },
12190                    2147483648,
12191                >,
12192                fdomain_client::fidl::FDomainResourceDialect,
12193            >(
12194                self.channel.as_mut().map(
12195                    <fidl::encoding::HandleType<
12196                        fdomain_client::Channel,
12197                        { fidl::ObjectType::CHANNEL.into_raw() },
12198                        2147483648,
12199                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
12200                ),
12201                encoder,
12202                offset + cur_offset,
12203                depth,
12204            )?;
12205
12206            _prev_end_offset = cur_offset + envelope_size;
12207            if 2 > max_ordinal {
12208                return Ok(());
12209            }
12210
12211            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12212            // are envelope_size bytes.
12213            let cur_offset: usize = (2 - 1) * envelope_size;
12214
12215            // Zero reserved fields.
12216            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12217
12218            // Safety:
12219            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12220            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12221            //   envelope_size bytes, there is always sufficient room.
12222            fidl::encoding::encode_in_envelope_optional::<
12223                fdomain_fuchsia_io::Flags,
12224                fdomain_client::fidl::FDomainResourceDialect,
12225            >(
12226                self.flags
12227                    .as_ref()
12228                    .map(<fdomain_fuchsia_io::Flags as fidl::encoding::ValueTypeMarker>::borrow),
12229                encoder,
12230                offset + cur_offset,
12231                depth,
12232            )?;
12233
12234            _prev_end_offset = cur_offset + envelope_size;
12235            if 3 > max_ordinal {
12236                return Ok(());
12237            }
12238
12239            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12240            // are envelope_size bytes.
12241            let cur_offset: usize = (3 - 1) * envelope_size;
12242
12243            // Zero reserved fields.
12244            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12245
12246            // Safety:
12247            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12248            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12249            //   envelope_size bytes, there is always sufficient room.
12250            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<4095>, fdomain_client::fidl::FDomainResourceDialect>(
12251            self.subdir.as_ref().map(<fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow),
12252            encoder, offset + cur_offset, depth
12253        )?;
12254
12255            _prev_end_offset = cur_offset + envelope_size;
12256
12257            Ok(())
12258        }
12259    }
12260
12261    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
12262        for DirReceiverReceiveRequest
12263    {
12264        #[inline(always)]
12265        fn new_empty() -> Self {
12266            Self::default()
12267        }
12268
12269        unsafe fn decode(
12270            &mut self,
12271            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
12272            offset: usize,
12273            mut depth: fidl::encoding::Depth,
12274        ) -> fidl::Result<()> {
12275            decoder.debug_check_bounds::<Self>(offset);
12276            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12277                None => return Err(fidl::Error::NotNullable),
12278                Some(len) => len,
12279            };
12280            // Calling decoder.out_of_line_offset(0) is not allowed.
12281            if len == 0 {
12282                return Ok(());
12283            };
12284            depth.increment()?;
12285            let envelope_size = 8;
12286            let bytes_len = len * envelope_size;
12287            let offset = decoder.out_of_line_offset(bytes_len)?;
12288            // Decode the envelope for each type.
12289            let mut _next_ordinal_to_read = 0;
12290            let mut next_offset = offset;
12291            let end_offset = offset + bytes_len;
12292            _next_ordinal_to_read += 1;
12293            if next_offset >= end_offset {
12294                return Ok(());
12295            }
12296
12297            // Decode unknown envelopes for gaps in ordinals.
12298            while _next_ordinal_to_read < 1 {
12299                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12300                _next_ordinal_to_read += 1;
12301                next_offset += envelope_size;
12302            }
12303
12304            let next_out_of_line = decoder.next_out_of_line();
12305            let handles_before = decoder.remaining_handles();
12306            if let Some((inlined, num_bytes, num_handles)) =
12307                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12308            {
12309                let member_inline_size = <fidl::encoding::HandleType<
12310                    fdomain_client::Channel,
12311                    { fidl::ObjectType::CHANNEL.into_raw() },
12312                    2147483648,
12313                > as fidl::encoding::TypeMarker>::inline_size(
12314                    decoder.context
12315                );
12316                if inlined != (member_inline_size <= 4) {
12317                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12318                }
12319                let inner_offset;
12320                let mut inner_depth = depth.clone();
12321                if inlined {
12322                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12323                    inner_offset = next_offset;
12324                } else {
12325                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12326                    inner_depth.increment()?;
12327                }
12328                let val_ref =
12329                self.channel.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect));
12330                fidl::decode!(fidl::encoding::HandleType<fdomain_client::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
12331                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12332                {
12333                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12334                }
12335                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12336                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12337                }
12338            }
12339
12340            next_offset += envelope_size;
12341            _next_ordinal_to_read += 1;
12342            if next_offset >= end_offset {
12343                return Ok(());
12344            }
12345
12346            // Decode unknown envelopes for gaps in ordinals.
12347            while _next_ordinal_to_read < 2 {
12348                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12349                _next_ordinal_to_read += 1;
12350                next_offset += envelope_size;
12351            }
12352
12353            let next_out_of_line = decoder.next_out_of_line();
12354            let handles_before = decoder.remaining_handles();
12355            if let Some((inlined, num_bytes, num_handles)) =
12356                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12357            {
12358                let member_inline_size =
12359                    <fdomain_fuchsia_io::Flags as fidl::encoding::TypeMarker>::inline_size(
12360                        decoder.context,
12361                    );
12362                if inlined != (member_inline_size <= 4) {
12363                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12364                }
12365                let inner_offset;
12366                let mut inner_depth = depth.clone();
12367                if inlined {
12368                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12369                    inner_offset = next_offset;
12370                } else {
12371                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12372                    inner_depth.increment()?;
12373                }
12374                let val_ref = self.flags.get_or_insert_with(|| {
12375                    fidl::new_empty!(
12376                        fdomain_fuchsia_io::Flags,
12377                        fdomain_client::fidl::FDomainResourceDialect
12378                    )
12379                });
12380                fidl::decode!(
12381                    fdomain_fuchsia_io::Flags,
12382                    fdomain_client::fidl::FDomainResourceDialect,
12383                    val_ref,
12384                    decoder,
12385                    inner_offset,
12386                    inner_depth
12387                )?;
12388                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12389                {
12390                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12391                }
12392                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12393                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12394                }
12395            }
12396
12397            next_offset += envelope_size;
12398            _next_ordinal_to_read += 1;
12399            if next_offset >= end_offset {
12400                return Ok(());
12401            }
12402
12403            // Decode unknown envelopes for gaps in ordinals.
12404            while _next_ordinal_to_read < 3 {
12405                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12406                _next_ordinal_to_read += 1;
12407                next_offset += envelope_size;
12408            }
12409
12410            let next_out_of_line = decoder.next_out_of_line();
12411            let handles_before = decoder.remaining_handles();
12412            if let Some((inlined, num_bytes, num_handles)) =
12413                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12414            {
12415                let member_inline_size = <fidl::encoding::BoundedString<4095> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12416                if inlined != (member_inline_size <= 4) {
12417                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12418                }
12419                let inner_offset;
12420                let mut inner_depth = depth.clone();
12421                if inlined {
12422                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12423                    inner_offset = next_offset;
12424                } else {
12425                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12426                    inner_depth.increment()?;
12427                }
12428                let val_ref = self.subdir.get_or_insert_with(|| {
12429                    fidl::new_empty!(
12430                        fidl::encoding::BoundedString<4095>,
12431                        fdomain_client::fidl::FDomainResourceDialect
12432                    )
12433                });
12434                fidl::decode!(
12435                    fidl::encoding::BoundedString<4095>,
12436                    fdomain_client::fidl::FDomainResourceDialect,
12437                    val_ref,
12438                    decoder,
12439                    inner_offset,
12440                    inner_depth
12441                )?;
12442                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12443                {
12444                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12445                }
12446                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12447                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12448                }
12449            }
12450
12451            next_offset += envelope_size;
12452
12453            // Decode the remaining unknown envelopes.
12454            while next_offset < end_offset {
12455                _next_ordinal_to_read += 1;
12456                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12457                next_offset += envelope_size;
12458            }
12459
12460            Ok(())
12461        }
12462    }
12463
12464    impl RouteRequest {
12465        #[inline(always)]
12466        fn max_ordinal_present(&self) -> u64 {
12467            if let Some(_) = self.requesting {
12468                return 1;
12469            }
12470            0
12471        }
12472    }
12473
12474    impl fidl::encoding::ResourceTypeMarker for RouteRequest {
12475        type Borrowed<'a> = &'a mut Self;
12476        fn take_or_borrow<'a>(
12477            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12478        ) -> Self::Borrowed<'a> {
12479            value
12480        }
12481    }
12482
12483    unsafe impl fidl::encoding::TypeMarker for RouteRequest {
12484        type Owned = Self;
12485
12486        #[inline(always)]
12487        fn inline_align(_context: fidl::encoding::Context) -> usize {
12488            8
12489        }
12490
12491        #[inline(always)]
12492        fn inline_size(_context: fidl::encoding::Context) -> usize {
12493            16
12494        }
12495    }
12496
12497    unsafe impl fidl::encoding::Encode<RouteRequest, fdomain_client::fidl::FDomainResourceDialect>
12498        for &mut RouteRequest
12499    {
12500        unsafe fn encode(
12501            self,
12502            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
12503            offset: usize,
12504            mut depth: fidl::encoding::Depth,
12505        ) -> fidl::Result<()> {
12506            encoder.debug_check_bounds::<RouteRequest>(offset);
12507            // Vector header
12508            let max_ordinal: u64 = self.max_ordinal_present();
12509            encoder.write_num(max_ordinal, offset);
12510            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12511            // Calling encoder.out_of_line_offset(0) is not allowed.
12512            if max_ordinal == 0 {
12513                return Ok(());
12514            }
12515            depth.increment()?;
12516            let envelope_size = 8;
12517            let bytes_len = max_ordinal as usize * envelope_size;
12518            #[allow(unused_variables)]
12519            let offset = encoder.out_of_line_offset(bytes_len);
12520            let mut _prev_end_offset: usize = 0;
12521            if 1 > max_ordinal {
12522                return Ok(());
12523            }
12524
12525            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12526            // are envelope_size bytes.
12527            let cur_offset: usize = (1 - 1) * envelope_size;
12528
12529            // Zero reserved fields.
12530            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12531
12532            // Safety:
12533            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12534            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12535            //   envelope_size bytes, there is always sufficient room.
12536            fidl::encoding::encode_in_envelope_optional::<
12537                InstanceToken,
12538                fdomain_client::fidl::FDomainResourceDialect,
12539            >(
12540                self.requesting
12541                    .as_mut()
12542                    .map(<InstanceToken as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
12543                encoder,
12544                offset + cur_offset,
12545                depth,
12546            )?;
12547
12548            _prev_end_offset = cur_offset + envelope_size;
12549
12550            Ok(())
12551        }
12552    }
12553
12554    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect> for RouteRequest {
12555        #[inline(always)]
12556        fn new_empty() -> Self {
12557            Self::default()
12558        }
12559
12560        unsafe fn decode(
12561            &mut self,
12562            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
12563            offset: usize,
12564            mut depth: fidl::encoding::Depth,
12565        ) -> fidl::Result<()> {
12566            decoder.debug_check_bounds::<Self>(offset);
12567            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12568                None => return Err(fidl::Error::NotNullable),
12569                Some(len) => len,
12570            };
12571            // Calling decoder.out_of_line_offset(0) is not allowed.
12572            if len == 0 {
12573                return Ok(());
12574            };
12575            depth.increment()?;
12576            let envelope_size = 8;
12577            let bytes_len = len * envelope_size;
12578            let offset = decoder.out_of_line_offset(bytes_len)?;
12579            // Decode the envelope for each type.
12580            let mut _next_ordinal_to_read = 0;
12581            let mut next_offset = offset;
12582            let end_offset = offset + bytes_len;
12583            _next_ordinal_to_read += 1;
12584            if next_offset >= end_offset {
12585                return Ok(());
12586            }
12587
12588            // Decode unknown envelopes for gaps in ordinals.
12589            while _next_ordinal_to_read < 1 {
12590                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12591                _next_ordinal_to_read += 1;
12592                next_offset += envelope_size;
12593            }
12594
12595            let next_out_of_line = decoder.next_out_of_line();
12596            let handles_before = decoder.remaining_handles();
12597            if let Some((inlined, num_bytes, num_handles)) =
12598                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12599            {
12600                let member_inline_size =
12601                    <InstanceToken as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12602                if inlined != (member_inline_size <= 4) {
12603                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12604                }
12605                let inner_offset;
12606                let mut inner_depth = depth.clone();
12607                if inlined {
12608                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12609                    inner_offset = next_offset;
12610                } else {
12611                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12612                    inner_depth.increment()?;
12613                }
12614                let val_ref = self.requesting.get_or_insert_with(|| {
12615                    fidl::new_empty!(InstanceToken, fdomain_client::fidl::FDomainResourceDialect)
12616                });
12617                fidl::decode!(
12618                    InstanceToken,
12619                    fdomain_client::fidl::FDomainResourceDialect,
12620                    val_ref,
12621                    decoder,
12622                    inner_offset,
12623                    inner_depth
12624                )?;
12625                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12626                {
12627                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12628                }
12629                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12630                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12631                }
12632            }
12633
12634            next_offset += envelope_size;
12635
12636            // Decode the remaining unknown envelopes.
12637            while next_offset < end_offset {
12638                _next_ordinal_to_read += 1;
12639                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12640                next_offset += envelope_size;
12641            }
12642
12643            Ok(())
12644        }
12645    }
12646
12647    impl fidl::encoding::ResourceTypeMarker for Capability {
12648        type Borrowed<'a> = &'a mut Self;
12649        fn take_or_borrow<'a>(
12650            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12651        ) -> Self::Borrowed<'a> {
12652            value
12653        }
12654    }
12655
12656    unsafe impl fidl::encoding::TypeMarker for Capability {
12657        type Owned = Self;
12658
12659        #[inline(always)]
12660        fn inline_align(_context: fidl::encoding::Context) -> usize {
12661            8
12662        }
12663
12664        #[inline(always)]
12665        fn inline_size(_context: fidl::encoding::Context) -> usize {
12666            16
12667        }
12668    }
12669
12670    unsafe impl fidl::encoding::Encode<Capability, fdomain_client::fidl::FDomainResourceDialect>
12671        for &mut Capability
12672    {
12673        #[inline]
12674        unsafe fn encode(
12675            self,
12676            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
12677            offset: usize,
12678            _depth: fidl::encoding::Depth,
12679        ) -> fidl::Result<()> {
12680            encoder.debug_check_bounds::<Capability>(offset);
12681            encoder.write_num::<u64>(self.ordinal(), offset);
12682            match self {
12683            Capability::Unit(ref val) => {
12684                fidl::encoding::encode_in_envelope::<Unit, fdomain_client::fidl::FDomainResourceDialect>(
12685                    <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
12686                    encoder, offset + 8, _depth
12687                )
12688            }
12689            Capability::Handle(ref mut val) => {
12690                fidl::encoding::encode_in_envelope::<fidl::encoding::HandleType<fdomain_client::NullableHandle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect>(
12691                    <fidl::encoding::HandleType<fdomain_client::NullableHandle, { fidl::ObjectType::NONE.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
12692                    encoder, offset + 8, _depth
12693                )
12694            }
12695            Capability::Data(ref val) => {
12696                fidl::encoding::encode_in_envelope::<Data, fdomain_client::fidl::FDomainResourceDialect>(
12697                    <Data as fidl::encoding::ValueTypeMarker>::borrow(val),
12698                    encoder, offset + 8, _depth
12699                )
12700            }
12701            Capability::Dictionary(ref mut val) => {
12702                fidl::encoding::encode_in_envelope::<DictionaryRef, fdomain_client::fidl::FDomainResourceDialect>(
12703                    <DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
12704                    encoder, offset + 8, _depth
12705                )
12706            }
12707            Capability::Connector(ref mut val) => {
12708                fidl::encoding::encode_in_envelope::<Connector, fdomain_client::fidl::FDomainResourceDialect>(
12709                    <Connector as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
12710                    encoder, offset + 8, _depth
12711                )
12712            }
12713            Capability::DirConnector(ref mut val) => {
12714                fidl::encoding::encode_in_envelope::<DirConnector, fdomain_client::fidl::FDomainResourceDialect>(
12715                    <DirConnector as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
12716                    encoder, offset + 8, _depth
12717                )
12718            }
12719            Capability::Directory(ref mut val) => {
12720                fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<fdomain_fuchsia_io::DirectoryMarker>>, fdomain_client::fidl::FDomainResourceDialect>(
12721                    <fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<fdomain_fuchsia_io::DirectoryMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
12722                    encoder, offset + 8, _depth
12723                )
12724            }
12725            Capability::DirEntry(ref mut val) => {
12726                fidl::encoding::encode_in_envelope::<DirEntry, fdomain_client::fidl::FDomainResourceDialect>(
12727                    <DirEntry as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
12728                    encoder, offset + 8, _depth
12729                )
12730            }
12731            Capability::ConnectorRouter(ref mut val) => {
12732                fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<ConnectorRouterMarker>>, fdomain_client::fidl::FDomainResourceDialect>(
12733                    <fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<ConnectorRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
12734                    encoder, offset + 8, _depth
12735                )
12736            }
12737            Capability::DictionaryRouter(ref mut val) => {
12738                fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<DictionaryRouterMarker>>, fdomain_client::fidl::FDomainResourceDialect>(
12739                    <fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<DictionaryRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
12740                    encoder, offset + 8, _depth
12741                )
12742            }
12743            Capability::DirEntryRouter(ref mut val) => {
12744                fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<DirEntryRouterMarker>>, fdomain_client::fidl::FDomainResourceDialect>(
12745                    <fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<DirEntryRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
12746                    encoder, offset + 8, _depth
12747                )
12748            }
12749            Capability::DataRouter(ref mut val) => {
12750                fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<DataRouterMarker>>, fdomain_client::fidl::FDomainResourceDialect>(
12751                    <fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<DataRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
12752                    encoder, offset + 8, _depth
12753                )
12754            }
12755            Capability::DirConnectorRouter(ref mut val) => {
12756                fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<DirConnectorRouterMarker>>, fdomain_client::fidl::FDomainResourceDialect>(
12757                    <fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<DirConnectorRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
12758                    encoder, offset + 8, _depth
12759                )
12760            }
12761            Capability::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
12762        }
12763        }
12764    }
12765
12766    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect> for Capability {
12767        #[inline(always)]
12768        fn new_empty() -> Self {
12769            Self::__SourceBreaking { unknown_ordinal: 0 }
12770        }
12771
12772        #[inline]
12773        unsafe fn decode(
12774            &mut self,
12775            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
12776            offset: usize,
12777            mut depth: fidl::encoding::Depth,
12778        ) -> fidl::Result<()> {
12779            decoder.debug_check_bounds::<Self>(offset);
12780            #[allow(unused_variables)]
12781            let next_out_of_line = decoder.next_out_of_line();
12782            let handles_before = decoder.remaining_handles();
12783            let (ordinal, inlined, num_bytes, num_handles) =
12784                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
12785
12786            let member_inline_size =
12787                match ordinal {
12788                    1 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12789                    2 => <fidl::encoding::HandleType<
12790                        fdomain_client::NullableHandle,
12791                        { fidl::ObjectType::NONE.into_raw() },
12792                        2147483648,
12793                    > as fidl::encoding::TypeMarker>::inline_size(
12794                        decoder.context
12795                    ),
12796                    3 => <Data as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12797                    4 => {
12798                        <DictionaryRef as fidl::encoding::TypeMarker>::inline_size(decoder.context)
12799                    }
12800                    5 => <Connector as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12801                    6 => <DirConnector as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12802                    7 => <fidl::encoding::Endpoint<
12803                        fdomain_client::fidl::ClientEnd<fdomain_fuchsia_io::DirectoryMarker>,
12804                    > as fidl::encoding::TypeMarker>::inline_size(
12805                        decoder.context
12806                    ),
12807                    8 => <DirEntry as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12808                    9 => <fidl::encoding::Endpoint<
12809                        fdomain_client::fidl::ClientEnd<ConnectorRouterMarker>,
12810                    > as fidl::encoding::TypeMarker>::inline_size(
12811                        decoder.context
12812                    ),
12813                    10 => <fidl::encoding::Endpoint<
12814                        fdomain_client::fidl::ClientEnd<DictionaryRouterMarker>,
12815                    > as fidl::encoding::TypeMarker>::inline_size(
12816                        decoder.context
12817                    ),
12818                    11 => <fidl::encoding::Endpoint<
12819                        fdomain_client::fidl::ClientEnd<DirEntryRouterMarker>,
12820                    > as fidl::encoding::TypeMarker>::inline_size(
12821                        decoder.context
12822                    ),
12823                    12 => <fidl::encoding::Endpoint<
12824                        fdomain_client::fidl::ClientEnd<DataRouterMarker>,
12825                    > as fidl::encoding::TypeMarker>::inline_size(
12826                        decoder.context
12827                    ),
12828                    13 => <fidl::encoding::Endpoint<
12829                        fdomain_client::fidl::ClientEnd<DirConnectorRouterMarker>,
12830                    > as fidl::encoding::TypeMarker>::inline_size(
12831                        decoder.context
12832                    ),
12833                    0 => return Err(fidl::Error::UnknownUnionTag),
12834                    _ => num_bytes as usize,
12835                };
12836
12837            if inlined != (member_inline_size <= 4) {
12838                return Err(fidl::Error::InvalidInlineBitInEnvelope);
12839            }
12840            let _inner_offset;
12841            if inlined {
12842                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
12843                _inner_offset = offset + 8;
12844            } else {
12845                depth.increment()?;
12846                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12847            }
12848            match ordinal {
12849                1 => {
12850                    #[allow(irrefutable_let_patterns)]
12851                    if let Capability::Unit(_) = self {
12852                        // Do nothing, read the value into the object
12853                    } else {
12854                        // Initialize `self` to the right variant
12855                        *self = Capability::Unit(fidl::new_empty!(
12856                            Unit,
12857                            fdomain_client::fidl::FDomainResourceDialect
12858                        ));
12859                    }
12860                    #[allow(irrefutable_let_patterns)]
12861                    if let Capability::Unit(ref mut val) = self {
12862                        fidl::decode!(
12863                            Unit,
12864                            fdomain_client::fidl::FDomainResourceDialect,
12865                            val,
12866                            decoder,
12867                            _inner_offset,
12868                            depth
12869                        )?;
12870                    } else {
12871                        unreachable!()
12872                    }
12873                }
12874                2 => {
12875                    #[allow(irrefutable_let_patterns)]
12876                    if let Capability::Handle(_) = self {
12877                        // Do nothing, read the value into the object
12878                    } else {
12879                        // Initialize `self` to the right variant
12880                        *self = Capability::Handle(
12881                            fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::NullableHandle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
12882                        );
12883                    }
12884                    #[allow(irrefutable_let_patterns)]
12885                    if let Capability::Handle(ref mut val) = self {
12886                        fidl::decode!(fidl::encoding::HandleType<fdomain_client::NullableHandle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect, val, decoder, _inner_offset, depth)?;
12887                    } else {
12888                        unreachable!()
12889                    }
12890                }
12891                3 => {
12892                    #[allow(irrefutable_let_patterns)]
12893                    if let Capability::Data(_) = self {
12894                        // Do nothing, read the value into the object
12895                    } else {
12896                        // Initialize `self` to the right variant
12897                        *self = Capability::Data(fidl::new_empty!(
12898                            Data,
12899                            fdomain_client::fidl::FDomainResourceDialect
12900                        ));
12901                    }
12902                    #[allow(irrefutable_let_patterns)]
12903                    if let Capability::Data(ref mut val) = self {
12904                        fidl::decode!(
12905                            Data,
12906                            fdomain_client::fidl::FDomainResourceDialect,
12907                            val,
12908                            decoder,
12909                            _inner_offset,
12910                            depth
12911                        )?;
12912                    } else {
12913                        unreachable!()
12914                    }
12915                }
12916                4 => {
12917                    #[allow(irrefutable_let_patterns)]
12918                    if let Capability::Dictionary(_) = self {
12919                        // Do nothing, read the value into the object
12920                    } else {
12921                        // Initialize `self` to the right variant
12922                        *self = Capability::Dictionary(fidl::new_empty!(
12923                            DictionaryRef,
12924                            fdomain_client::fidl::FDomainResourceDialect
12925                        ));
12926                    }
12927                    #[allow(irrefutable_let_patterns)]
12928                    if let Capability::Dictionary(ref mut val) = self {
12929                        fidl::decode!(
12930                            DictionaryRef,
12931                            fdomain_client::fidl::FDomainResourceDialect,
12932                            val,
12933                            decoder,
12934                            _inner_offset,
12935                            depth
12936                        )?;
12937                    } else {
12938                        unreachable!()
12939                    }
12940                }
12941                5 => {
12942                    #[allow(irrefutable_let_patterns)]
12943                    if let Capability::Connector(_) = self {
12944                        // Do nothing, read the value into the object
12945                    } else {
12946                        // Initialize `self` to the right variant
12947                        *self = Capability::Connector(fidl::new_empty!(
12948                            Connector,
12949                            fdomain_client::fidl::FDomainResourceDialect
12950                        ));
12951                    }
12952                    #[allow(irrefutable_let_patterns)]
12953                    if let Capability::Connector(ref mut val) = self {
12954                        fidl::decode!(
12955                            Connector,
12956                            fdomain_client::fidl::FDomainResourceDialect,
12957                            val,
12958                            decoder,
12959                            _inner_offset,
12960                            depth
12961                        )?;
12962                    } else {
12963                        unreachable!()
12964                    }
12965                }
12966                6 => {
12967                    #[allow(irrefutable_let_patterns)]
12968                    if let Capability::DirConnector(_) = self {
12969                        // Do nothing, read the value into the object
12970                    } else {
12971                        // Initialize `self` to the right variant
12972                        *self = Capability::DirConnector(fidl::new_empty!(
12973                            DirConnector,
12974                            fdomain_client::fidl::FDomainResourceDialect
12975                        ));
12976                    }
12977                    #[allow(irrefutable_let_patterns)]
12978                    if let Capability::DirConnector(ref mut val) = self {
12979                        fidl::decode!(
12980                            DirConnector,
12981                            fdomain_client::fidl::FDomainResourceDialect,
12982                            val,
12983                            decoder,
12984                            _inner_offset,
12985                            depth
12986                        )?;
12987                    } else {
12988                        unreachable!()
12989                    }
12990                }
12991                7 => {
12992                    #[allow(irrefutable_let_patterns)]
12993                    if let Capability::Directory(_) = self {
12994                        // Do nothing, read the value into the object
12995                    } else {
12996                        // Initialize `self` to the right variant
12997                        *self = Capability::Directory(fidl::new_empty!(
12998                            fidl::encoding::Endpoint<
12999                                fdomain_client::fidl::ClientEnd<
13000                                    fdomain_fuchsia_io::DirectoryMarker,
13001                                >,
13002                            >,
13003                            fdomain_client::fidl::FDomainResourceDialect
13004                        ));
13005                    }
13006                    #[allow(irrefutable_let_patterns)]
13007                    if let Capability::Directory(ref mut val) = self {
13008                        fidl::decode!(
13009                            fidl::encoding::Endpoint<
13010                                fdomain_client::fidl::ClientEnd<
13011                                    fdomain_fuchsia_io::DirectoryMarker,
13012                                >,
13013                            >,
13014                            fdomain_client::fidl::FDomainResourceDialect,
13015                            val,
13016                            decoder,
13017                            _inner_offset,
13018                            depth
13019                        )?;
13020                    } else {
13021                        unreachable!()
13022                    }
13023                }
13024                8 => {
13025                    #[allow(irrefutable_let_patterns)]
13026                    if let Capability::DirEntry(_) = self {
13027                        // Do nothing, read the value into the object
13028                    } else {
13029                        // Initialize `self` to the right variant
13030                        *self = Capability::DirEntry(fidl::new_empty!(
13031                            DirEntry,
13032                            fdomain_client::fidl::FDomainResourceDialect
13033                        ));
13034                    }
13035                    #[allow(irrefutable_let_patterns)]
13036                    if let Capability::DirEntry(ref mut val) = self {
13037                        fidl::decode!(
13038                            DirEntry,
13039                            fdomain_client::fidl::FDomainResourceDialect,
13040                            val,
13041                            decoder,
13042                            _inner_offset,
13043                            depth
13044                        )?;
13045                    } else {
13046                        unreachable!()
13047                    }
13048                }
13049                9 => {
13050                    #[allow(irrefutable_let_patterns)]
13051                    if let Capability::ConnectorRouter(_) = self {
13052                        // Do nothing, read the value into the object
13053                    } else {
13054                        // Initialize `self` to the right variant
13055                        *self = Capability::ConnectorRouter(fidl::new_empty!(
13056                            fidl::encoding::Endpoint<
13057                                fdomain_client::fidl::ClientEnd<ConnectorRouterMarker>,
13058                            >,
13059                            fdomain_client::fidl::FDomainResourceDialect
13060                        ));
13061                    }
13062                    #[allow(irrefutable_let_patterns)]
13063                    if let Capability::ConnectorRouter(ref mut val) = self {
13064                        fidl::decode!(
13065                            fidl::encoding::Endpoint<
13066                                fdomain_client::fidl::ClientEnd<ConnectorRouterMarker>,
13067                            >,
13068                            fdomain_client::fidl::FDomainResourceDialect,
13069                            val,
13070                            decoder,
13071                            _inner_offset,
13072                            depth
13073                        )?;
13074                    } else {
13075                        unreachable!()
13076                    }
13077                }
13078                10 => {
13079                    #[allow(irrefutable_let_patterns)]
13080                    if let Capability::DictionaryRouter(_) = self {
13081                        // Do nothing, read the value into the object
13082                    } else {
13083                        // Initialize `self` to the right variant
13084                        *self = Capability::DictionaryRouter(fidl::new_empty!(
13085                            fidl::encoding::Endpoint<
13086                                fdomain_client::fidl::ClientEnd<DictionaryRouterMarker>,
13087                            >,
13088                            fdomain_client::fidl::FDomainResourceDialect
13089                        ));
13090                    }
13091                    #[allow(irrefutable_let_patterns)]
13092                    if let Capability::DictionaryRouter(ref mut val) = self {
13093                        fidl::decode!(
13094                            fidl::encoding::Endpoint<
13095                                fdomain_client::fidl::ClientEnd<DictionaryRouterMarker>,
13096                            >,
13097                            fdomain_client::fidl::FDomainResourceDialect,
13098                            val,
13099                            decoder,
13100                            _inner_offset,
13101                            depth
13102                        )?;
13103                    } else {
13104                        unreachable!()
13105                    }
13106                }
13107                11 => {
13108                    #[allow(irrefutable_let_patterns)]
13109                    if let Capability::DirEntryRouter(_) = self {
13110                        // Do nothing, read the value into the object
13111                    } else {
13112                        // Initialize `self` to the right variant
13113                        *self = Capability::DirEntryRouter(fidl::new_empty!(
13114                            fidl::encoding::Endpoint<
13115                                fdomain_client::fidl::ClientEnd<DirEntryRouterMarker>,
13116                            >,
13117                            fdomain_client::fidl::FDomainResourceDialect
13118                        ));
13119                    }
13120                    #[allow(irrefutable_let_patterns)]
13121                    if let Capability::DirEntryRouter(ref mut val) = self {
13122                        fidl::decode!(
13123                            fidl::encoding::Endpoint<
13124                                fdomain_client::fidl::ClientEnd<DirEntryRouterMarker>,
13125                            >,
13126                            fdomain_client::fidl::FDomainResourceDialect,
13127                            val,
13128                            decoder,
13129                            _inner_offset,
13130                            depth
13131                        )?;
13132                    } else {
13133                        unreachable!()
13134                    }
13135                }
13136                12 => {
13137                    #[allow(irrefutable_let_patterns)]
13138                    if let Capability::DataRouter(_) = self {
13139                        // Do nothing, read the value into the object
13140                    } else {
13141                        // Initialize `self` to the right variant
13142                        *self = Capability::DataRouter(fidl::new_empty!(
13143                            fidl::encoding::Endpoint<
13144                                fdomain_client::fidl::ClientEnd<DataRouterMarker>,
13145                            >,
13146                            fdomain_client::fidl::FDomainResourceDialect
13147                        ));
13148                    }
13149                    #[allow(irrefutable_let_patterns)]
13150                    if let Capability::DataRouter(ref mut val) = self {
13151                        fidl::decode!(
13152                            fidl::encoding::Endpoint<
13153                                fdomain_client::fidl::ClientEnd<DataRouterMarker>,
13154                            >,
13155                            fdomain_client::fidl::FDomainResourceDialect,
13156                            val,
13157                            decoder,
13158                            _inner_offset,
13159                            depth
13160                        )?;
13161                    } else {
13162                        unreachable!()
13163                    }
13164                }
13165                13 => {
13166                    #[allow(irrefutable_let_patterns)]
13167                    if let Capability::DirConnectorRouter(_) = self {
13168                        // Do nothing, read the value into the object
13169                    } else {
13170                        // Initialize `self` to the right variant
13171                        *self = Capability::DirConnectorRouter(fidl::new_empty!(
13172                            fidl::encoding::Endpoint<
13173                                fdomain_client::fidl::ClientEnd<DirConnectorRouterMarker>,
13174                            >,
13175                            fdomain_client::fidl::FDomainResourceDialect
13176                        ));
13177                    }
13178                    #[allow(irrefutable_let_patterns)]
13179                    if let Capability::DirConnectorRouter(ref mut val) = self {
13180                        fidl::decode!(
13181                            fidl::encoding::Endpoint<
13182                                fdomain_client::fidl::ClientEnd<DirConnectorRouterMarker>,
13183                            >,
13184                            fdomain_client::fidl::FDomainResourceDialect,
13185                            val,
13186                            decoder,
13187                            _inner_offset,
13188                            depth
13189                        )?;
13190                    } else {
13191                        unreachable!()
13192                    }
13193                }
13194                #[allow(deprecated)]
13195                ordinal => {
13196                    for _ in 0..num_handles {
13197                        decoder.drop_next_handle()?;
13198                    }
13199                    *self = Capability::__SourceBreaking { unknown_ordinal: ordinal };
13200                }
13201            }
13202            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
13203                return Err(fidl::Error::InvalidNumBytesInEnvelope);
13204            }
13205            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13206                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13207            }
13208            Ok(())
13209        }
13210    }
13211
13212    impl fidl::encoding::ResourceTypeMarker for ConnectorRouterRouteResponse {
13213        type Borrowed<'a> = &'a mut Self;
13214        fn take_or_borrow<'a>(
13215            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13216        ) -> Self::Borrowed<'a> {
13217            value
13218        }
13219    }
13220
13221    unsafe impl fidl::encoding::TypeMarker for ConnectorRouterRouteResponse {
13222        type Owned = Self;
13223
13224        #[inline(always)]
13225        fn inline_align(_context: fidl::encoding::Context) -> usize {
13226            8
13227        }
13228
13229        #[inline(always)]
13230        fn inline_size(_context: fidl::encoding::Context) -> usize {
13231            16
13232        }
13233    }
13234
13235    unsafe impl
13236        fidl::encoding::Encode<
13237            ConnectorRouterRouteResponse,
13238            fdomain_client::fidl::FDomainResourceDialect,
13239        > for &mut ConnectorRouterRouteResponse
13240    {
13241        #[inline]
13242        unsafe fn encode(
13243            self,
13244            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
13245            offset: usize,
13246            _depth: fidl::encoding::Depth,
13247        ) -> fidl::Result<()> {
13248            encoder.debug_check_bounds::<ConnectorRouterRouteResponse>(offset);
13249            encoder.write_num::<u64>(self.ordinal(), offset);
13250            match self {
13251                ConnectorRouterRouteResponse::Connector(ref mut val) => {
13252                    fidl::encoding::encode_in_envelope::<
13253                        Connector,
13254                        fdomain_client::fidl::FDomainResourceDialect,
13255                    >(
13256                        <Connector as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
13257                        encoder,
13258                        offset + 8,
13259                        _depth,
13260                    )
13261                }
13262                ConnectorRouterRouteResponse::Unavailable(ref val) => {
13263                    fidl::encoding::encode_in_envelope::<
13264                        Unit,
13265                        fdomain_client::fidl::FDomainResourceDialect,
13266                    >(
13267                        <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
13268                        encoder,
13269                        offset + 8,
13270                        _depth,
13271                    )
13272                }
13273            }
13274        }
13275    }
13276
13277    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
13278        for ConnectorRouterRouteResponse
13279    {
13280        #[inline(always)]
13281        fn new_empty() -> Self {
13282            Self::Connector(fidl::new_empty!(
13283                Connector,
13284                fdomain_client::fidl::FDomainResourceDialect
13285            ))
13286        }
13287
13288        #[inline]
13289        unsafe fn decode(
13290            &mut self,
13291            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
13292            offset: usize,
13293            mut depth: fidl::encoding::Depth,
13294        ) -> fidl::Result<()> {
13295            decoder.debug_check_bounds::<Self>(offset);
13296            #[allow(unused_variables)]
13297            let next_out_of_line = decoder.next_out_of_line();
13298            let handles_before = decoder.remaining_handles();
13299            let (ordinal, inlined, num_bytes, num_handles) =
13300                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
13301
13302            let member_inline_size = match ordinal {
13303                1 => <Connector as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13304                2 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13305                _ => return Err(fidl::Error::UnknownUnionTag),
13306            };
13307
13308            if inlined != (member_inline_size <= 4) {
13309                return Err(fidl::Error::InvalidInlineBitInEnvelope);
13310            }
13311            let _inner_offset;
13312            if inlined {
13313                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
13314                _inner_offset = offset + 8;
13315            } else {
13316                depth.increment()?;
13317                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13318            }
13319            match ordinal {
13320                1 => {
13321                    #[allow(irrefutable_let_patterns)]
13322                    if let ConnectorRouterRouteResponse::Connector(_) = self {
13323                        // Do nothing, read the value into the object
13324                    } else {
13325                        // Initialize `self` to the right variant
13326                        *self = ConnectorRouterRouteResponse::Connector(fidl::new_empty!(
13327                            Connector,
13328                            fdomain_client::fidl::FDomainResourceDialect
13329                        ));
13330                    }
13331                    #[allow(irrefutable_let_patterns)]
13332                    if let ConnectorRouterRouteResponse::Connector(ref mut val) = self {
13333                        fidl::decode!(
13334                            Connector,
13335                            fdomain_client::fidl::FDomainResourceDialect,
13336                            val,
13337                            decoder,
13338                            _inner_offset,
13339                            depth
13340                        )?;
13341                    } else {
13342                        unreachable!()
13343                    }
13344                }
13345                2 => {
13346                    #[allow(irrefutable_let_patterns)]
13347                    if let ConnectorRouterRouteResponse::Unavailable(_) = self {
13348                        // Do nothing, read the value into the object
13349                    } else {
13350                        // Initialize `self` to the right variant
13351                        *self = ConnectorRouterRouteResponse::Unavailable(fidl::new_empty!(
13352                            Unit,
13353                            fdomain_client::fidl::FDomainResourceDialect
13354                        ));
13355                    }
13356                    #[allow(irrefutable_let_patterns)]
13357                    if let ConnectorRouterRouteResponse::Unavailable(ref mut val) = self {
13358                        fidl::decode!(
13359                            Unit,
13360                            fdomain_client::fidl::FDomainResourceDialect,
13361                            val,
13362                            decoder,
13363                            _inner_offset,
13364                            depth
13365                        )?;
13366                    } else {
13367                        unreachable!()
13368                    }
13369                }
13370                ordinal => panic!("unexpected ordinal {:?}", ordinal),
13371            }
13372            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
13373                return Err(fidl::Error::InvalidNumBytesInEnvelope);
13374            }
13375            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13376                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13377            }
13378            Ok(())
13379        }
13380    }
13381
13382    impl fidl::encoding::ResourceTypeMarker for DataRouterRouteResponse {
13383        type Borrowed<'a> = &'a mut Self;
13384        fn take_or_borrow<'a>(
13385            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13386        ) -> Self::Borrowed<'a> {
13387            value
13388        }
13389    }
13390
13391    unsafe impl fidl::encoding::TypeMarker for DataRouterRouteResponse {
13392        type Owned = Self;
13393
13394        #[inline(always)]
13395        fn inline_align(_context: fidl::encoding::Context) -> usize {
13396            8
13397        }
13398
13399        #[inline(always)]
13400        fn inline_size(_context: fidl::encoding::Context) -> usize {
13401            16
13402        }
13403    }
13404
13405    unsafe impl
13406        fidl::encoding::Encode<
13407            DataRouterRouteResponse,
13408            fdomain_client::fidl::FDomainResourceDialect,
13409        > for &mut DataRouterRouteResponse
13410    {
13411        #[inline]
13412        unsafe fn encode(
13413            self,
13414            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
13415            offset: usize,
13416            _depth: fidl::encoding::Depth,
13417        ) -> fidl::Result<()> {
13418            encoder.debug_check_bounds::<DataRouterRouteResponse>(offset);
13419            encoder.write_num::<u64>(self.ordinal(), offset);
13420            match self {
13421                DataRouterRouteResponse::Data(ref val) => fidl::encoding::encode_in_envelope::<
13422                    Data,
13423                    fdomain_client::fidl::FDomainResourceDialect,
13424                >(
13425                    <Data as fidl::encoding::ValueTypeMarker>::borrow(val),
13426                    encoder,
13427                    offset + 8,
13428                    _depth,
13429                ),
13430                DataRouterRouteResponse::Unavailable(ref val) => {
13431                    fidl::encoding::encode_in_envelope::<
13432                        Unit,
13433                        fdomain_client::fidl::FDomainResourceDialect,
13434                    >(
13435                        <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
13436                        encoder,
13437                        offset + 8,
13438                        _depth,
13439                    )
13440                }
13441            }
13442        }
13443    }
13444
13445    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
13446        for DataRouterRouteResponse
13447    {
13448        #[inline(always)]
13449        fn new_empty() -> Self {
13450            Self::Data(fidl::new_empty!(Data, fdomain_client::fidl::FDomainResourceDialect))
13451        }
13452
13453        #[inline]
13454        unsafe fn decode(
13455            &mut self,
13456            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
13457            offset: usize,
13458            mut depth: fidl::encoding::Depth,
13459        ) -> fidl::Result<()> {
13460            decoder.debug_check_bounds::<Self>(offset);
13461            #[allow(unused_variables)]
13462            let next_out_of_line = decoder.next_out_of_line();
13463            let handles_before = decoder.remaining_handles();
13464            let (ordinal, inlined, num_bytes, num_handles) =
13465                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
13466
13467            let member_inline_size = match ordinal {
13468                1 => <Data as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13469                2 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13470                _ => return Err(fidl::Error::UnknownUnionTag),
13471            };
13472
13473            if inlined != (member_inline_size <= 4) {
13474                return Err(fidl::Error::InvalidInlineBitInEnvelope);
13475            }
13476            let _inner_offset;
13477            if inlined {
13478                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
13479                _inner_offset = offset + 8;
13480            } else {
13481                depth.increment()?;
13482                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13483            }
13484            match ordinal {
13485                1 => {
13486                    #[allow(irrefutable_let_patterns)]
13487                    if let DataRouterRouteResponse::Data(_) = self {
13488                        // Do nothing, read the value into the object
13489                    } else {
13490                        // Initialize `self` to the right variant
13491                        *self = DataRouterRouteResponse::Data(fidl::new_empty!(
13492                            Data,
13493                            fdomain_client::fidl::FDomainResourceDialect
13494                        ));
13495                    }
13496                    #[allow(irrefutable_let_patterns)]
13497                    if let DataRouterRouteResponse::Data(ref mut val) = self {
13498                        fidl::decode!(
13499                            Data,
13500                            fdomain_client::fidl::FDomainResourceDialect,
13501                            val,
13502                            decoder,
13503                            _inner_offset,
13504                            depth
13505                        )?;
13506                    } else {
13507                        unreachable!()
13508                    }
13509                }
13510                2 => {
13511                    #[allow(irrefutable_let_patterns)]
13512                    if let DataRouterRouteResponse::Unavailable(_) = self {
13513                        // Do nothing, read the value into the object
13514                    } else {
13515                        // Initialize `self` to the right variant
13516                        *self = DataRouterRouteResponse::Unavailable(fidl::new_empty!(
13517                            Unit,
13518                            fdomain_client::fidl::FDomainResourceDialect
13519                        ));
13520                    }
13521                    #[allow(irrefutable_let_patterns)]
13522                    if let DataRouterRouteResponse::Unavailable(ref mut val) = self {
13523                        fidl::decode!(
13524                            Unit,
13525                            fdomain_client::fidl::FDomainResourceDialect,
13526                            val,
13527                            decoder,
13528                            _inner_offset,
13529                            depth
13530                        )?;
13531                    } else {
13532                        unreachable!()
13533                    }
13534                }
13535                ordinal => panic!("unexpected ordinal {:?}", ordinal),
13536            }
13537            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
13538                return Err(fidl::Error::InvalidNumBytesInEnvelope);
13539            }
13540            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13541                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13542            }
13543            Ok(())
13544        }
13545    }
13546
13547    impl fidl::encoding::ResourceTypeMarker for DictionaryRouterRouteResponse {
13548        type Borrowed<'a> = &'a mut Self;
13549        fn take_or_borrow<'a>(
13550            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13551        ) -> Self::Borrowed<'a> {
13552            value
13553        }
13554    }
13555
13556    unsafe impl fidl::encoding::TypeMarker for DictionaryRouterRouteResponse {
13557        type Owned = Self;
13558
13559        #[inline(always)]
13560        fn inline_align(_context: fidl::encoding::Context) -> usize {
13561            8
13562        }
13563
13564        #[inline(always)]
13565        fn inline_size(_context: fidl::encoding::Context) -> usize {
13566            16
13567        }
13568    }
13569
13570    unsafe impl
13571        fidl::encoding::Encode<
13572            DictionaryRouterRouteResponse,
13573            fdomain_client::fidl::FDomainResourceDialect,
13574        > for &mut DictionaryRouterRouteResponse
13575    {
13576        #[inline]
13577        unsafe fn encode(
13578            self,
13579            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
13580            offset: usize,
13581            _depth: fidl::encoding::Depth,
13582        ) -> fidl::Result<()> {
13583            encoder.debug_check_bounds::<DictionaryRouterRouteResponse>(offset);
13584            encoder.write_num::<u64>(self.ordinal(), offset);
13585            match self {
13586                DictionaryRouterRouteResponse::Dictionary(ref mut val) => {
13587                    fidl::encoding::encode_in_envelope::<
13588                        DictionaryRef,
13589                        fdomain_client::fidl::FDomainResourceDialect,
13590                    >(
13591                        <DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
13592                        encoder,
13593                        offset + 8,
13594                        _depth,
13595                    )
13596                }
13597                DictionaryRouterRouteResponse::Unavailable(ref val) => {
13598                    fidl::encoding::encode_in_envelope::<
13599                        Unit,
13600                        fdomain_client::fidl::FDomainResourceDialect,
13601                    >(
13602                        <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
13603                        encoder,
13604                        offset + 8,
13605                        _depth,
13606                    )
13607                }
13608            }
13609        }
13610    }
13611
13612    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
13613        for DictionaryRouterRouteResponse
13614    {
13615        #[inline(always)]
13616        fn new_empty() -> Self {
13617            Self::Dictionary(fidl::new_empty!(
13618                DictionaryRef,
13619                fdomain_client::fidl::FDomainResourceDialect
13620            ))
13621        }
13622
13623        #[inline]
13624        unsafe fn decode(
13625            &mut self,
13626            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
13627            offset: usize,
13628            mut depth: fidl::encoding::Depth,
13629        ) -> fidl::Result<()> {
13630            decoder.debug_check_bounds::<Self>(offset);
13631            #[allow(unused_variables)]
13632            let next_out_of_line = decoder.next_out_of_line();
13633            let handles_before = decoder.remaining_handles();
13634            let (ordinal, inlined, num_bytes, num_handles) =
13635                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
13636
13637            let member_inline_size = match ordinal {
13638                1 => <DictionaryRef as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13639                2 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13640                _ => return Err(fidl::Error::UnknownUnionTag),
13641            };
13642
13643            if inlined != (member_inline_size <= 4) {
13644                return Err(fidl::Error::InvalidInlineBitInEnvelope);
13645            }
13646            let _inner_offset;
13647            if inlined {
13648                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
13649                _inner_offset = offset + 8;
13650            } else {
13651                depth.increment()?;
13652                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13653            }
13654            match ordinal {
13655                1 => {
13656                    #[allow(irrefutable_let_patterns)]
13657                    if let DictionaryRouterRouteResponse::Dictionary(_) = self {
13658                        // Do nothing, read the value into the object
13659                    } else {
13660                        // Initialize `self` to the right variant
13661                        *self = DictionaryRouterRouteResponse::Dictionary(fidl::new_empty!(
13662                            DictionaryRef,
13663                            fdomain_client::fidl::FDomainResourceDialect
13664                        ));
13665                    }
13666                    #[allow(irrefutable_let_patterns)]
13667                    if let DictionaryRouterRouteResponse::Dictionary(ref mut val) = self {
13668                        fidl::decode!(
13669                            DictionaryRef,
13670                            fdomain_client::fidl::FDomainResourceDialect,
13671                            val,
13672                            decoder,
13673                            _inner_offset,
13674                            depth
13675                        )?;
13676                    } else {
13677                        unreachable!()
13678                    }
13679                }
13680                2 => {
13681                    #[allow(irrefutable_let_patterns)]
13682                    if let DictionaryRouterRouteResponse::Unavailable(_) = self {
13683                        // Do nothing, read the value into the object
13684                    } else {
13685                        // Initialize `self` to the right variant
13686                        *self = DictionaryRouterRouteResponse::Unavailable(fidl::new_empty!(
13687                            Unit,
13688                            fdomain_client::fidl::FDomainResourceDialect
13689                        ));
13690                    }
13691                    #[allow(irrefutable_let_patterns)]
13692                    if let DictionaryRouterRouteResponse::Unavailable(ref mut val) = self {
13693                        fidl::decode!(
13694                            Unit,
13695                            fdomain_client::fidl::FDomainResourceDialect,
13696                            val,
13697                            decoder,
13698                            _inner_offset,
13699                            depth
13700                        )?;
13701                    } else {
13702                        unreachable!()
13703                    }
13704                }
13705                ordinal => panic!("unexpected ordinal {:?}", ordinal),
13706            }
13707            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
13708                return Err(fidl::Error::InvalidNumBytesInEnvelope);
13709            }
13710            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13711                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13712            }
13713            Ok(())
13714        }
13715    }
13716
13717    impl fidl::encoding::ResourceTypeMarker for DirConnectorRouterRouteResponse {
13718        type Borrowed<'a> = &'a mut Self;
13719        fn take_or_borrow<'a>(
13720            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13721        ) -> Self::Borrowed<'a> {
13722            value
13723        }
13724    }
13725
13726    unsafe impl fidl::encoding::TypeMarker for DirConnectorRouterRouteResponse {
13727        type Owned = Self;
13728
13729        #[inline(always)]
13730        fn inline_align(_context: fidl::encoding::Context) -> usize {
13731            8
13732        }
13733
13734        #[inline(always)]
13735        fn inline_size(_context: fidl::encoding::Context) -> usize {
13736            16
13737        }
13738    }
13739
13740    unsafe impl
13741        fidl::encoding::Encode<
13742            DirConnectorRouterRouteResponse,
13743            fdomain_client::fidl::FDomainResourceDialect,
13744        > for &mut DirConnectorRouterRouteResponse
13745    {
13746        #[inline]
13747        unsafe fn encode(
13748            self,
13749            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
13750            offset: usize,
13751            _depth: fidl::encoding::Depth,
13752        ) -> fidl::Result<()> {
13753            encoder.debug_check_bounds::<DirConnectorRouterRouteResponse>(offset);
13754            encoder.write_num::<u64>(self.ordinal(), offset);
13755            match self {
13756                DirConnectorRouterRouteResponse::DirConnector(ref mut val) => {
13757                    fidl::encoding::encode_in_envelope::<
13758                        DirConnector,
13759                        fdomain_client::fidl::FDomainResourceDialect,
13760                    >(
13761                        <DirConnector as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
13762                        encoder,
13763                        offset + 8,
13764                        _depth,
13765                    )
13766                }
13767                DirConnectorRouterRouteResponse::Unavailable(ref val) => {
13768                    fidl::encoding::encode_in_envelope::<
13769                        Unit,
13770                        fdomain_client::fidl::FDomainResourceDialect,
13771                    >(
13772                        <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
13773                        encoder,
13774                        offset + 8,
13775                        _depth,
13776                    )
13777                }
13778            }
13779        }
13780    }
13781
13782    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
13783        for DirConnectorRouterRouteResponse
13784    {
13785        #[inline(always)]
13786        fn new_empty() -> Self {
13787            Self::DirConnector(fidl::new_empty!(
13788                DirConnector,
13789                fdomain_client::fidl::FDomainResourceDialect
13790            ))
13791        }
13792
13793        #[inline]
13794        unsafe fn decode(
13795            &mut self,
13796            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
13797            offset: usize,
13798            mut depth: fidl::encoding::Depth,
13799        ) -> fidl::Result<()> {
13800            decoder.debug_check_bounds::<Self>(offset);
13801            #[allow(unused_variables)]
13802            let next_out_of_line = decoder.next_out_of_line();
13803            let handles_before = decoder.remaining_handles();
13804            let (ordinal, inlined, num_bytes, num_handles) =
13805                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
13806
13807            let member_inline_size = match ordinal {
13808                1 => <DirConnector as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13809                2 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13810                _ => return Err(fidl::Error::UnknownUnionTag),
13811            };
13812
13813            if inlined != (member_inline_size <= 4) {
13814                return Err(fidl::Error::InvalidInlineBitInEnvelope);
13815            }
13816            let _inner_offset;
13817            if inlined {
13818                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
13819                _inner_offset = offset + 8;
13820            } else {
13821                depth.increment()?;
13822                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13823            }
13824            match ordinal {
13825                1 => {
13826                    #[allow(irrefutable_let_patterns)]
13827                    if let DirConnectorRouterRouteResponse::DirConnector(_) = self {
13828                        // Do nothing, read the value into the object
13829                    } else {
13830                        // Initialize `self` to the right variant
13831                        *self = DirConnectorRouterRouteResponse::DirConnector(fidl::new_empty!(
13832                            DirConnector,
13833                            fdomain_client::fidl::FDomainResourceDialect
13834                        ));
13835                    }
13836                    #[allow(irrefutable_let_patterns)]
13837                    if let DirConnectorRouterRouteResponse::DirConnector(ref mut val) = self {
13838                        fidl::decode!(
13839                            DirConnector,
13840                            fdomain_client::fidl::FDomainResourceDialect,
13841                            val,
13842                            decoder,
13843                            _inner_offset,
13844                            depth
13845                        )?;
13846                    } else {
13847                        unreachable!()
13848                    }
13849                }
13850                2 => {
13851                    #[allow(irrefutable_let_patterns)]
13852                    if let DirConnectorRouterRouteResponse::Unavailable(_) = self {
13853                        // Do nothing, read the value into the object
13854                    } else {
13855                        // Initialize `self` to the right variant
13856                        *self = DirConnectorRouterRouteResponse::Unavailable(fidl::new_empty!(
13857                            Unit,
13858                            fdomain_client::fidl::FDomainResourceDialect
13859                        ));
13860                    }
13861                    #[allow(irrefutable_let_patterns)]
13862                    if let DirConnectorRouterRouteResponse::Unavailable(ref mut val) = self {
13863                        fidl::decode!(
13864                            Unit,
13865                            fdomain_client::fidl::FDomainResourceDialect,
13866                            val,
13867                            decoder,
13868                            _inner_offset,
13869                            depth
13870                        )?;
13871                    } else {
13872                        unreachable!()
13873                    }
13874                }
13875                ordinal => panic!("unexpected ordinal {:?}", ordinal),
13876            }
13877            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
13878                return Err(fidl::Error::InvalidNumBytesInEnvelope);
13879            }
13880            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13881                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13882            }
13883            Ok(())
13884        }
13885    }
13886
13887    impl fidl::encoding::ResourceTypeMarker for DirEntryRouterRouteResponse {
13888        type Borrowed<'a> = &'a mut Self;
13889        fn take_or_borrow<'a>(
13890            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13891        ) -> Self::Borrowed<'a> {
13892            value
13893        }
13894    }
13895
13896    unsafe impl fidl::encoding::TypeMarker for DirEntryRouterRouteResponse {
13897        type Owned = Self;
13898
13899        #[inline(always)]
13900        fn inline_align(_context: fidl::encoding::Context) -> usize {
13901            8
13902        }
13903
13904        #[inline(always)]
13905        fn inline_size(_context: fidl::encoding::Context) -> usize {
13906            16
13907        }
13908    }
13909
13910    unsafe impl
13911        fidl::encoding::Encode<
13912            DirEntryRouterRouteResponse,
13913            fdomain_client::fidl::FDomainResourceDialect,
13914        > for &mut DirEntryRouterRouteResponse
13915    {
13916        #[inline]
13917        unsafe fn encode(
13918            self,
13919            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
13920            offset: usize,
13921            _depth: fidl::encoding::Depth,
13922        ) -> fidl::Result<()> {
13923            encoder.debug_check_bounds::<DirEntryRouterRouteResponse>(offset);
13924            encoder.write_num::<u64>(self.ordinal(), offset);
13925            match self {
13926                DirEntryRouterRouteResponse::DirEntry(ref mut val) => {
13927                    fidl::encoding::encode_in_envelope::<
13928                        DirEntry,
13929                        fdomain_client::fidl::FDomainResourceDialect,
13930                    >(
13931                        <DirEntry as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
13932                        encoder,
13933                        offset + 8,
13934                        _depth,
13935                    )
13936                }
13937                DirEntryRouterRouteResponse::Unavailable(ref val) => {
13938                    fidl::encoding::encode_in_envelope::<
13939                        Unit,
13940                        fdomain_client::fidl::FDomainResourceDialect,
13941                    >(
13942                        <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
13943                        encoder,
13944                        offset + 8,
13945                        _depth,
13946                    )
13947                }
13948            }
13949        }
13950    }
13951
13952    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
13953        for DirEntryRouterRouteResponse
13954    {
13955        #[inline(always)]
13956        fn new_empty() -> Self {
13957            Self::DirEntry(fidl::new_empty!(DirEntry, fdomain_client::fidl::FDomainResourceDialect))
13958        }
13959
13960        #[inline]
13961        unsafe fn decode(
13962            &mut self,
13963            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
13964            offset: usize,
13965            mut depth: fidl::encoding::Depth,
13966        ) -> fidl::Result<()> {
13967            decoder.debug_check_bounds::<Self>(offset);
13968            #[allow(unused_variables)]
13969            let next_out_of_line = decoder.next_out_of_line();
13970            let handles_before = decoder.remaining_handles();
13971            let (ordinal, inlined, num_bytes, num_handles) =
13972                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
13973
13974            let member_inline_size = match ordinal {
13975                1 => <DirEntry as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13976                2 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13977                _ => return Err(fidl::Error::UnknownUnionTag),
13978            };
13979
13980            if inlined != (member_inline_size <= 4) {
13981                return Err(fidl::Error::InvalidInlineBitInEnvelope);
13982            }
13983            let _inner_offset;
13984            if inlined {
13985                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
13986                _inner_offset = offset + 8;
13987            } else {
13988                depth.increment()?;
13989                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13990            }
13991            match ordinal {
13992                1 => {
13993                    #[allow(irrefutable_let_patterns)]
13994                    if let DirEntryRouterRouteResponse::DirEntry(_) = self {
13995                        // Do nothing, read the value into the object
13996                    } else {
13997                        // Initialize `self` to the right variant
13998                        *self = DirEntryRouterRouteResponse::DirEntry(fidl::new_empty!(
13999                            DirEntry,
14000                            fdomain_client::fidl::FDomainResourceDialect
14001                        ));
14002                    }
14003                    #[allow(irrefutable_let_patterns)]
14004                    if let DirEntryRouterRouteResponse::DirEntry(ref mut val) = self {
14005                        fidl::decode!(
14006                            DirEntry,
14007                            fdomain_client::fidl::FDomainResourceDialect,
14008                            val,
14009                            decoder,
14010                            _inner_offset,
14011                            depth
14012                        )?;
14013                    } else {
14014                        unreachable!()
14015                    }
14016                }
14017                2 => {
14018                    #[allow(irrefutable_let_patterns)]
14019                    if let DirEntryRouterRouteResponse::Unavailable(_) = self {
14020                        // Do nothing, read the value into the object
14021                    } else {
14022                        // Initialize `self` to the right variant
14023                        *self = DirEntryRouterRouteResponse::Unavailable(fidl::new_empty!(
14024                            Unit,
14025                            fdomain_client::fidl::FDomainResourceDialect
14026                        ));
14027                    }
14028                    #[allow(irrefutable_let_patterns)]
14029                    if let DirEntryRouterRouteResponse::Unavailable(ref mut val) = self {
14030                        fidl::decode!(
14031                            Unit,
14032                            fdomain_client::fidl::FDomainResourceDialect,
14033                            val,
14034                            decoder,
14035                            _inner_offset,
14036                            depth
14037                        )?;
14038                    } else {
14039                        unreachable!()
14040                    }
14041                }
14042                ordinal => panic!("unexpected ordinal {:?}", ordinal),
14043            }
14044            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
14045                return Err(fidl::Error::InvalidNumBytesInEnvelope);
14046            }
14047            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14048                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14049            }
14050            Ok(())
14051        }
14052    }
14053
14054    impl fidl::encoding::ResourceTypeMarker for DirectoryRouterRouteResponse {
14055        type Borrowed<'a> = &'a mut Self;
14056        fn take_or_borrow<'a>(
14057            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14058        ) -> Self::Borrowed<'a> {
14059            value
14060        }
14061    }
14062
14063    unsafe impl fidl::encoding::TypeMarker for DirectoryRouterRouteResponse {
14064        type Owned = Self;
14065
14066        #[inline(always)]
14067        fn inline_align(_context: fidl::encoding::Context) -> usize {
14068            8
14069        }
14070
14071        #[inline(always)]
14072        fn inline_size(_context: fidl::encoding::Context) -> usize {
14073            16
14074        }
14075    }
14076
14077    unsafe impl
14078        fidl::encoding::Encode<
14079            DirectoryRouterRouteResponse,
14080            fdomain_client::fidl::FDomainResourceDialect,
14081        > for &mut DirectoryRouterRouteResponse
14082    {
14083        #[inline]
14084        unsafe fn encode(
14085            self,
14086            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
14087            offset: usize,
14088            _depth: fidl::encoding::Depth,
14089        ) -> fidl::Result<()> {
14090            encoder.debug_check_bounds::<DirectoryRouterRouteResponse>(offset);
14091            encoder.write_num::<u64>(self.ordinal(), offset);
14092            match self {
14093                DirectoryRouterRouteResponse::Directory(ref mut val) => {
14094                    fidl::encoding::encode_in_envelope::<
14095                        fidl::encoding::Endpoint<
14096                            fdomain_client::fidl::ClientEnd<fdomain_fuchsia_io::DirectoryMarker>,
14097                        >,
14098                        fdomain_client::fidl::FDomainResourceDialect,
14099                    >(
14100                        <fidl::encoding::Endpoint<
14101                            fdomain_client::fidl::ClientEnd<fdomain_fuchsia_io::DirectoryMarker>,
14102                        > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
14103                            val
14104                        ),
14105                        encoder,
14106                        offset + 8,
14107                        _depth,
14108                    )
14109                }
14110                DirectoryRouterRouteResponse::Unavailable(ref val) => {
14111                    fidl::encoding::encode_in_envelope::<
14112                        Unit,
14113                        fdomain_client::fidl::FDomainResourceDialect,
14114                    >(
14115                        <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
14116                        encoder,
14117                        offset + 8,
14118                        _depth,
14119                    )
14120                }
14121            }
14122        }
14123    }
14124
14125    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
14126        for DirectoryRouterRouteResponse
14127    {
14128        #[inline(always)]
14129        fn new_empty() -> Self {
14130            Self::Directory(fidl::new_empty!(
14131                fidl::encoding::Endpoint<
14132                    fdomain_client::fidl::ClientEnd<fdomain_fuchsia_io::DirectoryMarker>,
14133                >,
14134                fdomain_client::fidl::FDomainResourceDialect
14135            ))
14136        }
14137
14138        #[inline]
14139        unsafe fn decode(
14140            &mut self,
14141            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
14142            offset: usize,
14143            mut depth: fidl::encoding::Depth,
14144        ) -> fidl::Result<()> {
14145            decoder.debug_check_bounds::<Self>(offset);
14146            #[allow(unused_variables)]
14147            let next_out_of_line = decoder.next_out_of_line();
14148            let handles_before = decoder.remaining_handles();
14149            let (ordinal, inlined, num_bytes, num_handles) =
14150                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
14151
14152            let member_inline_size = match ordinal {
14153                1 => <fidl::encoding::Endpoint<
14154                    fdomain_client::fidl::ClientEnd<fdomain_fuchsia_io::DirectoryMarker>,
14155                > as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14156                2 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14157                _ => return Err(fidl::Error::UnknownUnionTag),
14158            };
14159
14160            if inlined != (member_inline_size <= 4) {
14161                return Err(fidl::Error::InvalidInlineBitInEnvelope);
14162            }
14163            let _inner_offset;
14164            if inlined {
14165                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
14166                _inner_offset = offset + 8;
14167            } else {
14168                depth.increment()?;
14169                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14170            }
14171            match ordinal {
14172                1 => {
14173                    #[allow(irrefutable_let_patterns)]
14174                    if let DirectoryRouterRouteResponse::Directory(_) = self {
14175                        // Do nothing, read the value into the object
14176                    } else {
14177                        // Initialize `self` to the right variant
14178                        *self = DirectoryRouterRouteResponse::Directory(fidl::new_empty!(
14179                            fidl::encoding::Endpoint<
14180                                fdomain_client::fidl::ClientEnd<
14181                                    fdomain_fuchsia_io::DirectoryMarker,
14182                                >,
14183                            >,
14184                            fdomain_client::fidl::FDomainResourceDialect
14185                        ));
14186                    }
14187                    #[allow(irrefutable_let_patterns)]
14188                    if let DirectoryRouterRouteResponse::Directory(ref mut val) = self {
14189                        fidl::decode!(
14190                            fidl::encoding::Endpoint<
14191                                fdomain_client::fidl::ClientEnd<
14192                                    fdomain_fuchsia_io::DirectoryMarker,
14193                                >,
14194                            >,
14195                            fdomain_client::fidl::FDomainResourceDialect,
14196                            val,
14197                            decoder,
14198                            _inner_offset,
14199                            depth
14200                        )?;
14201                    } else {
14202                        unreachable!()
14203                    }
14204                }
14205                2 => {
14206                    #[allow(irrefutable_let_patterns)]
14207                    if let DirectoryRouterRouteResponse::Unavailable(_) = self {
14208                        // Do nothing, read the value into the object
14209                    } else {
14210                        // Initialize `self` to the right variant
14211                        *self = DirectoryRouterRouteResponse::Unavailable(fidl::new_empty!(
14212                            Unit,
14213                            fdomain_client::fidl::FDomainResourceDialect
14214                        ));
14215                    }
14216                    #[allow(irrefutable_let_patterns)]
14217                    if let DirectoryRouterRouteResponse::Unavailable(ref mut val) = self {
14218                        fidl::decode!(
14219                            Unit,
14220                            fdomain_client::fidl::FDomainResourceDialect,
14221                            val,
14222                            decoder,
14223                            _inner_offset,
14224                            depth
14225                        )?;
14226                    } else {
14227                        unreachable!()
14228                    }
14229                }
14230                ordinal => panic!("unexpected ordinal {:?}", ordinal),
14231            }
14232            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
14233                return Err(fidl::Error::InvalidNumBytesInEnvelope);
14234            }
14235            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14236                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14237            }
14238            Ok(())
14239        }
14240    }
14241}