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, Eq, Hash, Ord, PartialEq, PartialOrd)]
40pub struct CapabilityStoreDictionaryDrainRequest {
41    pub id: u64,
42    pub iterator: Option<fdomain_client::fidl::ServerEnd<DictionaryDrainIteratorMarker>>,
43}
44
45impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
46    for CapabilityStoreDictionaryDrainRequest
47{
48}
49
50#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
51pub struct CapabilityStoreDictionaryEnumerateRequest {
52    pub id: u64,
53    pub iterator: fdomain_client::fidl::ServerEnd<DictionaryEnumerateIteratorMarker>,
54}
55
56impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
57    for CapabilityStoreDictionaryEnumerateRequest
58{
59}
60
61#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
62pub struct CapabilityStoreDictionaryKeysRequest {
63    pub id: u64,
64    pub iterator: fdomain_client::fidl::ServerEnd<DictionaryKeysIteratorMarker>,
65}
66
67impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
68    for CapabilityStoreDictionaryKeysRequest
69{
70}
71
72#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
73pub struct CapabilityStoreDictionaryLegacyExportRequest {
74    pub id: u64,
75    pub server_end: fdomain_client::Channel,
76}
77
78impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
79    for CapabilityStoreDictionaryLegacyExportRequest
80{
81}
82
83#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
84pub struct CapabilityStoreDictionaryLegacyImportRequest {
85    pub id: u64,
86    pub client_end: fdomain_client::Channel,
87}
88
89impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
90    for CapabilityStoreDictionaryLegacyImportRequest
91{
92}
93
94#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
95pub struct CapabilityStoreDirConnectorCreateRequest {
96    pub id: u64,
97    pub receiver: fdomain_client::fidl::ClientEnd<DirReceiverMarker>,
98}
99
100impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
101    for CapabilityStoreDirConnectorCreateRequest
102{
103}
104
105#[derive(Debug, PartialEq)]
106pub struct CapabilityStoreImportRequest {
107    pub id: u64,
108    pub capability: Capability,
109}
110
111impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
112    for CapabilityStoreImportRequest
113{
114}
115
116#[derive(Debug, PartialEq)]
117pub struct CapabilityStoreExportResponse {
118    pub capability: Capability,
119}
120
121impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
122    for CapabilityStoreExportResponse
123{
124}
125
126#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
127pub struct Connector {
128    pub token: fdomain_client::EventPair,
129}
130
131impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for Connector {}
132
133#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
134pub struct DictionaryDrainIteratorGetNextResponse {
135    pub items: Vec<DictionaryItem>,
136    pub end_id: u64,
137}
138
139impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
140    for DictionaryDrainIteratorGetNextResponse
141{
142}
143
144#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
145pub struct DictionaryEnumerateIteratorGetNextResponse {
146    pub items: Vec<DictionaryOptionalItem>,
147    pub end_id: u64,
148}
149
150impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
151    for DictionaryEnumerateIteratorGetNextResponse
152{
153}
154
155#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
156pub struct DictionaryKeysIteratorGetNextResponse {
157    pub keys: Vec<String>,
158}
159
160impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
161    for DictionaryKeysIteratorGetNextResponse
162{
163}
164
165/// A key-value pair in a [`DictionaryRef`], where the value may be elided.
166/// This is useful for APIs that may wish to omit the value, for example if it could not be
167/// duplicated.
168#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
169pub struct DictionaryOptionalItem {
170    pub key: String,
171    pub value: Option<Box<WrappedCapabilityId>>,
172}
173
174impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for DictionaryOptionalItem {}
175
176#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
177pub struct DictionaryRef {
178    pub token: fdomain_client::EventPair,
179}
180
181impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for DictionaryRef {}
182
183#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
184pub struct DirConnector {
185    pub token: fdomain_client::EventPair,
186}
187
188impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for DirConnector {}
189
190#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
191pub struct DirEntry {
192    pub token: fdomain_client::EventPair,
193}
194
195impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for DirEntry {}
196
197/// Represents an instance in the component tree, either a component
198/// instance or component manager's instance.
199#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
200pub struct InstanceToken {
201    pub token: fdomain_client::EventPair,
202}
203
204impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for InstanceToken {}
205
206/// Contains a protocol open request.
207#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
208pub struct ProtocolPayload {
209    pub channel: fdomain_client::Channel,
210}
211
212impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for ProtocolPayload {}
213
214#[derive(Debug, Default, PartialEq)]
215pub struct CapabilityStoreDirConnectorOpenRequest {
216    pub id: Option<u64>,
217    pub server_end: Option<fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>>,
218    pub flags: Option<fdomain_fuchsia_io::Flags>,
219    pub path: Option<String>,
220    #[doc(hidden)]
221    pub __source_breaking: fidl::marker::SourceBreaking,
222}
223
224impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
225    for CapabilityStoreDirConnectorOpenRequest
226{
227}
228
229#[derive(Debug, Default, PartialEq)]
230pub struct DirReceiverReceiveRequest {
231    pub channel: Option<fdomain_client::Channel>,
232    pub flags: Option<fdomain_fuchsia_io::Flags>,
233    pub subdir: Option<String>,
234    #[doc(hidden)]
235    pub __source_breaking: fidl::marker::SourceBreaking,
236}
237
238impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for DirReceiverReceiveRequest {}
239
240/// A request for a route.
241#[derive(Debug, Default, PartialEq)]
242pub struct RouteRequest {
243    /// The component that is requesting the capability. May be omitted for a default request
244    /// (see `*Router.Route`).
245    pub requesting: Option<InstanceToken>,
246    /// Metadata associated with this capability request. May be omitted for a default request
247    /// (see `*Router.Route`).
248    pub metadata: Option<DictionaryRef>,
249    #[doc(hidden)]
250    pub __source_breaking: fidl::marker::SourceBreaking,
251}
252
253impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for RouteRequest {}
254
255#[derive(Debug)]
256pub enum Capability {
257    Unit(Unit),
258    Handle(fdomain_client::NullableHandle),
259    Data(Data),
260    Dictionary(DictionaryRef),
261    Connector(Connector),
262    DirConnector(DirConnector),
263    Directory(fdomain_client::fidl::ClientEnd<fdomain_fuchsia_io::DirectoryMarker>),
264    DirEntry(DirEntry),
265    ConnectorRouter(fdomain_client::fidl::ClientEnd<ConnectorRouterMarker>),
266    DictionaryRouter(fdomain_client::fidl::ClientEnd<DictionaryRouterMarker>),
267    DirEntryRouter(fdomain_client::fidl::ClientEnd<DirEntryRouterMarker>),
268    DataRouter(fdomain_client::fidl::ClientEnd<DataRouterMarker>),
269    DirConnectorRouter(fdomain_client::fidl::ClientEnd<DirConnectorRouterMarker>),
270    #[doc(hidden)]
271    __SourceBreaking {
272        unknown_ordinal: u64,
273    },
274}
275
276/// Pattern that matches an unknown `Capability` member.
277#[macro_export]
278macro_rules! CapabilityUnknown {
279    () => {
280        _
281    };
282}
283
284// Custom PartialEq so that unknown variants are not equal to themselves.
285impl PartialEq for Capability {
286    fn eq(&self, other: &Self) -> bool {
287        match (self, other) {
288            (Self::Unit(x), Self::Unit(y)) => *x == *y,
289            (Self::Handle(x), Self::Handle(y)) => *x == *y,
290            (Self::Data(x), Self::Data(y)) => *x == *y,
291            (Self::Dictionary(x), Self::Dictionary(y)) => *x == *y,
292            (Self::Connector(x), Self::Connector(y)) => *x == *y,
293            (Self::DirConnector(x), Self::DirConnector(y)) => *x == *y,
294            (Self::Directory(x), Self::Directory(y)) => *x == *y,
295            (Self::DirEntry(x), Self::DirEntry(y)) => *x == *y,
296            (Self::ConnectorRouter(x), Self::ConnectorRouter(y)) => *x == *y,
297            (Self::DictionaryRouter(x), Self::DictionaryRouter(y)) => *x == *y,
298            (Self::DirEntryRouter(x), Self::DirEntryRouter(y)) => *x == *y,
299            (Self::DataRouter(x), Self::DataRouter(y)) => *x == *y,
300            (Self::DirConnectorRouter(x), Self::DirConnectorRouter(y)) => *x == *y,
301            _ => false,
302        }
303    }
304}
305
306impl Capability {
307    #[inline]
308    pub fn ordinal(&self) -> u64 {
309        match *self {
310            Self::Unit(_) => 1,
311            Self::Handle(_) => 2,
312            Self::Data(_) => 3,
313            Self::Dictionary(_) => 4,
314            Self::Connector(_) => 5,
315            Self::DirConnector(_) => 6,
316            Self::Directory(_) => 7,
317            Self::DirEntry(_) => 8,
318            Self::ConnectorRouter(_) => 9,
319            Self::DictionaryRouter(_) => 10,
320            Self::DirEntryRouter(_) => 11,
321            Self::DataRouter(_) => 12,
322            Self::DirConnectorRouter(_) => 13,
323            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
324        }
325    }
326
327    #[inline]
328    pub fn unknown_variant_for_testing() -> Self {
329        Self::__SourceBreaking { unknown_ordinal: 0 }
330    }
331
332    #[inline]
333    pub fn is_unknown(&self) -> bool {
334        match self {
335            Self::__SourceBreaking { .. } => true,
336            _ => false,
337        }
338    }
339}
340
341impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for Capability {}
342
343#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
344pub enum ConnectorRouterRouteResponse {
345    Connector(Connector),
346    Unavailable(Unit),
347}
348
349impl ConnectorRouterRouteResponse {
350    #[inline]
351    pub fn ordinal(&self) -> u64 {
352        match *self {
353            Self::Connector(_) => 1,
354            Self::Unavailable(_) => 2,
355        }
356    }
357}
358
359impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
360    for ConnectorRouterRouteResponse
361{
362}
363
364#[derive(Debug, PartialEq)]
365pub enum DataRouterRouteResponse {
366    Data(Data),
367    Unavailable(Unit),
368}
369
370impl DataRouterRouteResponse {
371    #[inline]
372    pub fn ordinal(&self) -> u64 {
373        match *self {
374            Self::Data(_) => 1,
375            Self::Unavailable(_) => 2,
376        }
377    }
378}
379
380impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for DataRouterRouteResponse {}
381
382#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
383pub enum DictionaryRouterRouteResponse {
384    Dictionary(DictionaryRef),
385    Unavailable(Unit),
386}
387
388impl DictionaryRouterRouteResponse {
389    #[inline]
390    pub fn ordinal(&self) -> u64 {
391        match *self {
392            Self::Dictionary(_) => 1,
393            Self::Unavailable(_) => 2,
394        }
395    }
396}
397
398impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
399    for DictionaryRouterRouteResponse
400{
401}
402
403#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
404pub enum DirConnectorRouterRouteResponse {
405    DirConnector(DirConnector),
406    Unavailable(Unit),
407}
408
409impl DirConnectorRouterRouteResponse {
410    #[inline]
411    pub fn ordinal(&self) -> u64 {
412        match *self {
413            Self::DirConnector(_) => 1,
414            Self::Unavailable(_) => 2,
415        }
416    }
417}
418
419impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
420    for DirConnectorRouterRouteResponse
421{
422}
423
424#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
425pub enum DirEntryRouterRouteResponse {
426    DirEntry(DirEntry),
427    Unavailable(Unit),
428}
429
430impl DirEntryRouterRouteResponse {
431    #[inline]
432    pub fn ordinal(&self) -> u64 {
433        match *self {
434            Self::DirEntry(_) => 1,
435            Self::Unavailable(_) => 2,
436        }
437    }
438}
439
440impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
441    for DirEntryRouterRouteResponse
442{
443}
444
445#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
446pub enum DirectoryRouterRouteResponse {
447    Directory(fdomain_client::fidl::ClientEnd<fdomain_fuchsia_io::DirectoryMarker>),
448    Unavailable(Unit),
449}
450
451impl DirectoryRouterRouteResponse {
452    #[inline]
453    pub fn ordinal(&self) -> u64 {
454        match *self {
455            Self::Directory(_) => 1,
456            Self::Unavailable(_) => 2,
457        }
458    }
459}
460
461impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
462    for DirectoryRouterRouteResponse
463{
464}
465
466#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
467pub struct CapabilityStoreMarker;
468
469impl fdomain_client::fidl::ProtocolMarker for CapabilityStoreMarker {
470    type Proxy = CapabilityStoreProxy;
471    type RequestStream = CapabilityStoreRequestStream;
472
473    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.CapabilityStore";
474}
475impl fdomain_client::fidl::DiscoverableProtocolMarker for CapabilityStoreMarker {}
476pub type CapabilityStoreDuplicateResult = Result<(), CapabilityStoreError>;
477pub type CapabilityStoreDropResult = Result<(), CapabilityStoreError>;
478pub type CapabilityStoreExportResult = Result<Capability, CapabilityStoreError>;
479pub type CapabilityStoreImportResult = Result<(), CapabilityStoreError>;
480pub type CapabilityStoreConnectorCreateResult = Result<(), CapabilityStoreError>;
481pub type CapabilityStoreConnectorOpenResult = Result<(), CapabilityStoreError>;
482pub type CapabilityStoreDirConnectorCreateResult = Result<(), CapabilityStoreError>;
483pub type CapabilityStoreDirConnectorOpenResult = Result<(), CapabilityStoreError>;
484pub type CapabilityStoreDictionaryCreateResult = Result<(), CapabilityStoreError>;
485pub type CapabilityStoreDictionaryLegacyImportResult = Result<(), CapabilityStoreError>;
486pub type CapabilityStoreDictionaryLegacyExportResult = Result<(), CapabilityStoreError>;
487pub type CapabilityStoreDictionaryInsertResult = Result<(), CapabilityStoreError>;
488pub type CapabilityStoreDictionaryGetResult = Result<(), CapabilityStoreError>;
489pub type CapabilityStoreDictionaryRemoveResult = Result<(), CapabilityStoreError>;
490pub type CapabilityStoreDictionaryCopyResult = Result<(), CapabilityStoreError>;
491pub type CapabilityStoreDictionaryKeysResult = Result<(), CapabilityStoreError>;
492pub type CapabilityStoreDictionaryEnumerateResult = Result<(), CapabilityStoreError>;
493pub type CapabilityStoreDictionaryDrainResult = Result<(), CapabilityStoreError>;
494
495pub trait CapabilityStoreProxyInterface: Send + Sync {
496    type DuplicateResponseFut: std::future::Future<Output = Result<CapabilityStoreDuplicateResult, fidl::Error>>
497        + Send;
498    fn r#duplicate(&self, id: u64, dest_id: u64) -> Self::DuplicateResponseFut;
499    type DropResponseFut: std::future::Future<Output = Result<CapabilityStoreDropResult, fidl::Error>>
500        + Send;
501    fn r#drop(&self, id: u64) -> Self::DropResponseFut;
502    type ExportResponseFut: std::future::Future<Output = Result<CapabilityStoreExportResult, fidl::Error>>
503        + Send;
504    fn r#export(&self, id: u64) -> Self::ExportResponseFut;
505    type ImportResponseFut: std::future::Future<Output = Result<CapabilityStoreImportResult, fidl::Error>>
506        + Send;
507    fn r#import(&self, id: u64, capability: Capability) -> Self::ImportResponseFut;
508    type ConnectorCreateResponseFut: std::future::Future<Output = Result<CapabilityStoreConnectorCreateResult, fidl::Error>>
509        + Send;
510    fn r#connector_create(
511        &self,
512        id: u64,
513        receiver: fdomain_client::fidl::ClientEnd<ReceiverMarker>,
514    ) -> Self::ConnectorCreateResponseFut;
515    type ConnectorOpenResponseFut: std::future::Future<Output = Result<CapabilityStoreConnectorOpenResult, fidl::Error>>
516        + Send;
517    fn r#connector_open(
518        &self,
519        id: u64,
520        server_end: fdomain_client::Channel,
521    ) -> Self::ConnectorOpenResponseFut;
522    type DirConnectorCreateResponseFut: std::future::Future<Output = Result<CapabilityStoreDirConnectorCreateResult, fidl::Error>>
523        + Send;
524    fn r#dir_connector_create(
525        &self,
526        id: u64,
527        receiver: fdomain_client::fidl::ClientEnd<DirReceiverMarker>,
528    ) -> Self::DirConnectorCreateResponseFut;
529    type DirConnectorOpenResponseFut: std::future::Future<Output = Result<CapabilityStoreDirConnectorOpenResult, fidl::Error>>
530        + Send;
531    fn r#dir_connector_open(
532        &self,
533        payload: CapabilityStoreDirConnectorOpenRequest,
534    ) -> Self::DirConnectorOpenResponseFut;
535    type DictionaryCreateResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryCreateResult, fidl::Error>>
536        + Send;
537    fn r#dictionary_create(&self, id: u64) -> Self::DictionaryCreateResponseFut;
538    type DictionaryLegacyImportResponseFut: std::future::Future<
539            Output = Result<CapabilityStoreDictionaryLegacyImportResult, fidl::Error>,
540        > + Send;
541    fn r#dictionary_legacy_import(
542        &self,
543        id: u64,
544        client_end: fdomain_client::Channel,
545    ) -> Self::DictionaryLegacyImportResponseFut;
546    type DictionaryLegacyExportResponseFut: std::future::Future<
547            Output = Result<CapabilityStoreDictionaryLegacyExportResult, fidl::Error>,
548        > + Send;
549    fn r#dictionary_legacy_export(
550        &self,
551        id: u64,
552        server_end: fdomain_client::Channel,
553    ) -> Self::DictionaryLegacyExportResponseFut;
554    type DictionaryInsertResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryInsertResult, fidl::Error>>
555        + Send;
556    fn r#dictionary_insert(
557        &self,
558        id: u64,
559        item: &DictionaryItem,
560    ) -> Self::DictionaryInsertResponseFut;
561    type DictionaryGetResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryGetResult, fidl::Error>>
562        + Send;
563    fn r#dictionary_get(&self, id: u64, key: &str, dest_id: u64) -> Self::DictionaryGetResponseFut;
564    type DictionaryRemoveResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryRemoveResult, fidl::Error>>
565        + Send;
566    fn r#dictionary_remove(
567        &self,
568        id: u64,
569        key: &str,
570        dest_id: Option<&WrappedCapabilityId>,
571    ) -> Self::DictionaryRemoveResponseFut;
572    type DictionaryCopyResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryCopyResult, fidl::Error>>
573        + Send;
574    fn r#dictionary_copy(&self, id: u64, dest_id: u64) -> Self::DictionaryCopyResponseFut;
575    type DictionaryKeysResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryKeysResult, fidl::Error>>
576        + Send;
577    fn r#dictionary_keys(
578        &self,
579        id: u64,
580        iterator: fdomain_client::fidl::ServerEnd<DictionaryKeysIteratorMarker>,
581    ) -> Self::DictionaryKeysResponseFut;
582    type DictionaryEnumerateResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryEnumerateResult, fidl::Error>>
583        + Send;
584    fn r#dictionary_enumerate(
585        &self,
586        id: u64,
587        iterator: fdomain_client::fidl::ServerEnd<DictionaryEnumerateIteratorMarker>,
588    ) -> Self::DictionaryEnumerateResponseFut;
589    type DictionaryDrainResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryDrainResult, fidl::Error>>
590        + Send;
591    fn r#dictionary_drain(
592        &self,
593        id: u64,
594        iterator: Option<fdomain_client::fidl::ServerEnd<DictionaryDrainIteratorMarker>>,
595    ) -> Self::DictionaryDrainResponseFut;
596}
597
598#[derive(Debug, Clone)]
599pub struct CapabilityStoreProxy {
600    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
601}
602
603impl fdomain_client::fidl::Proxy for CapabilityStoreProxy {
604    type Protocol = CapabilityStoreMarker;
605
606    fn from_channel(inner: fdomain_client::Channel) -> Self {
607        Self::new(inner)
608    }
609
610    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
611        self.client.into_channel().map_err(|client| Self { client })
612    }
613
614    fn as_channel(&self) -> &fdomain_client::Channel {
615        self.client.as_channel()
616    }
617}
618
619impl CapabilityStoreProxy {
620    /// Create a new Proxy for fuchsia.component.sandbox/CapabilityStore.
621    pub fn new(channel: fdomain_client::Channel) -> Self {
622        let protocol_name =
623            <CapabilityStoreMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
624        Self { client: fidl::client::Client::new(channel, protocol_name) }
625    }
626
627    /// Get a Stream of events from the remote end of the protocol.
628    ///
629    /// # Panics
630    ///
631    /// Panics if the event stream was already taken.
632    pub fn take_event_stream(&self) -> CapabilityStoreEventStream {
633        CapabilityStoreEventStream { event_receiver: self.client.take_event_receiver() }
634    }
635
636    /// Duplicates the capability with `id` to `dest_id`.
637    ///
638    /// Errors:
639    ///
640    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
641    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
642    /// - `NOT_DUPLICATABLE` if `id` could not be duplicated.
643    pub fn r#duplicate(
644        &self,
645        mut id: u64,
646        mut dest_id: u64,
647    ) -> fidl::client::QueryResponseFut<
648        CapabilityStoreDuplicateResult,
649        fdomain_client::fidl::FDomainResourceDialect,
650    > {
651        CapabilityStoreProxyInterface::r#duplicate(self, id, dest_id)
652    }
653
654    /// Drops the capability with `id` from this [`CapabilityStore`].
655    ///
656    /// Errors:
657    ///
658    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
659    pub fn r#drop(
660        &self,
661        mut id: u64,
662    ) -> fidl::client::QueryResponseFut<
663        CapabilityStoreDropResult,
664        fdomain_client::fidl::FDomainResourceDialect,
665    > {
666        CapabilityStoreProxyInterface::r#drop(self, id)
667    }
668
669    /// Exports the capability with the client-assigned identifier `id` to
670    /// `capability`. This operation removes the capability from the store. If
671    /// this is not desired, [Duplicate] the capability first.
672    ///
673    /// Errors:
674    ///
675    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
676    pub fn r#export(
677        &self,
678        mut id: u64,
679    ) -> fidl::client::QueryResponseFut<
680        CapabilityStoreExportResult,
681        fdomain_client::fidl::FDomainResourceDialect,
682    > {
683        CapabilityStoreProxyInterface::r#export(self, id)
684    }
685
686    /// Imports `capability` into this store with the client-assigned `id`.
687    ///
688    /// Errors:
689    ///
690    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
691    /// - `BAD_CAPABILITY` if `capability` was not a valid [Capability].
692    pub fn r#import(
693        &self,
694        mut id: u64,
695        mut capability: Capability,
696    ) -> fidl::client::QueryResponseFut<
697        CapabilityStoreImportResult,
698        fdomain_client::fidl::FDomainResourceDialect,
699    > {
700        CapabilityStoreProxyInterface::r#import(self, id, capability)
701    }
702
703    /// Creates a [Connector] from a [Receiver]. Incoming connections to the [Connector] will be
704    /// dispatched to this [Receiver].
705    ///
706    /// Errors:
707    ///
708    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
709    pub fn r#connector_create(
710        &self,
711        mut id: u64,
712        mut receiver: fdomain_client::fidl::ClientEnd<ReceiverMarker>,
713    ) -> fidl::client::QueryResponseFut<
714        CapabilityStoreConnectorCreateResult,
715        fdomain_client::fidl::FDomainResourceDialect,
716    > {
717        CapabilityStoreProxyInterface::r#connector_create(self, id, receiver)
718    }
719
720    /// Open a connection from the provided [Connector] capability that will be dispatched to
721    /// the [Receiver] on the other end.
722    ///
723    /// If there is an error, it will be reported as a zx.Status epitaph on `server_end`.
724    ///
725    /// Errors:
726    ///
727    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
728    /// - `WRONG_TYPE` if `id` was not a connector capability.
729    pub fn r#connector_open(
730        &self,
731        mut id: u64,
732        mut server_end: fdomain_client::Channel,
733    ) -> fidl::client::QueryResponseFut<
734        CapabilityStoreConnectorOpenResult,
735        fdomain_client::fidl::FDomainResourceDialect,
736    > {
737        CapabilityStoreProxyInterface::r#connector_open(self, id, server_end)
738    }
739
740    /// Creates a [DirConnector] from a [DirReceiver]. Incoming connections to the [DirConnector]
741    /// will be dispatched to this [DirReceiver].
742    ///
743    /// Errors:
744    ///
745    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
746    pub fn r#dir_connector_create(
747        &self,
748        mut id: u64,
749        mut receiver: fdomain_client::fidl::ClientEnd<DirReceiverMarker>,
750    ) -> fidl::client::QueryResponseFut<
751        CapabilityStoreDirConnectorCreateResult,
752        fdomain_client::fidl::FDomainResourceDialect,
753    > {
754        CapabilityStoreProxyInterface::r#dir_connector_create(self, id, receiver)
755    }
756
757    /// Open a connection from the provided [DirConnector] capability that will
758    /// be dispatched to the [DirReceiver] on the other end. The `id` and
759    /// `server_end` arguments are required, and the `flags` and `path`
760    /// arguments are optional (a path of `.` will be used if one is not
761    /// otherwise set).
762    ///
763    /// If there was an error making the connection, it will be reported as a zx.Status
764    /// epitaph on `server_end`.
765    ///
766    /// Errors:
767    ///
768    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
769    /// - `WRONG_TYPE` if `id` was not a connector capability.
770    pub fn r#dir_connector_open(
771        &self,
772        mut payload: CapabilityStoreDirConnectorOpenRequest,
773    ) -> fidl::client::QueryResponseFut<
774        CapabilityStoreDirConnectorOpenResult,
775        fdomain_client::fidl::FDomainResourceDialect,
776    > {
777        CapabilityStoreProxyInterface::r#dir_connector_open(self, payload)
778    }
779
780    /// Creates a new empty dictionary in this [`CapabilityStore`] with client-assigned `id`.
781    ///
782    /// Errors:
783    ///
784    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
785    pub fn r#dictionary_create(
786        &self,
787        mut id: u64,
788    ) -> fidl::client::QueryResponseFut<
789        CapabilityStoreDictionaryCreateResult,
790        fdomain_client::fidl::FDomainResourceDialect,
791    > {
792        CapabilityStoreProxyInterface::r#dictionary_create(self, id)
793    }
794
795    /// Imports a dictionary in the form of a channel.
796    ///
797    /// This is a legacy API to support backward compatibility with APIs that take a [Dictionary]
798    /// channel.
799    ///
800    /// Errors:
801    ///
802    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
803    /// - `BAD_CAPABILITY` if `client_end` was not a valid dictionary channel.
804    pub fn r#dictionary_legacy_import(
805        &self,
806        mut id: u64,
807        mut client_end: fdomain_client::Channel,
808    ) -> fidl::client::QueryResponseFut<
809        CapabilityStoreDictionaryLegacyImportResult,
810        fdomain_client::fidl::FDomainResourceDialect,
811    > {
812        CapabilityStoreProxyInterface::r#dictionary_legacy_import(self, id, client_end)
813    }
814
815    /// Binds a channel to the dictionary with `id`. The channel can
816    /// be re-imported into a [CapabilityStore] with [DictionaryImportLegacy].
817    ///
818    /// This is a legacy API to support backward compatibility with APIs that take a [Dictionary]
819    /// channel.
820    ///
821    /// Errors:
822    ///
823    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
824    pub fn r#dictionary_legacy_export(
825        &self,
826        mut id: u64,
827        mut server_end: fdomain_client::Channel,
828    ) -> fidl::client::QueryResponseFut<
829        CapabilityStoreDictionaryLegacyExportResult,
830        fdomain_client::fidl::FDomainResourceDialect,
831    > {
832        CapabilityStoreProxyInterface::r#dictionary_legacy_export(self, id, server_end)
833    }
834
835    /// Inserts `item` into the dictionary with `id`. `item.value` is moved into the dictionary and
836    /// its id is released if this call succeeds.
837    ///
838    /// Errors:
839    ///
840    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
841    /// - `WRONG_TYPE` if `id` was not a dictionary.
842    /// - `INVALID_KEY` if `item.key` was invalid.
843    /// - `ITEM_ALREADY_EXISTS` if the dictionary already contains an item with `item.key`.
844    pub fn r#dictionary_insert(
845        &self,
846        mut id: u64,
847        mut item: &DictionaryItem,
848    ) -> fidl::client::QueryResponseFut<
849        CapabilityStoreDictionaryInsertResult,
850        fdomain_client::fidl::FDomainResourceDialect,
851    > {
852        CapabilityStoreProxyInterface::r#dictionary_insert(self, id, item)
853    }
854
855    /// Get a duplicate of a capability from the dictionary with `id`, which is
856    /// loaded into `dest_id`.
857    ///
858    /// Errors:
859    ///
860    /// - `ID_NOT_FOUND` if `id` was not a recognized capability id in this store.
861    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
862    /// - `WRONG_TYPE` if `id` was not a dictionary.
863    /// - `INVALID_KEY` if `item.key` was invalid.
864    /// - `ITEM_NOT_FOUND` if the dictionary does not contain `key`.
865    /// - `NOT_DUPLICATABLE` if the capability could not be duplicated.
866    pub fn r#dictionary_get(
867        &self,
868        mut id: u64,
869        mut key: &str,
870        mut dest_id: u64,
871    ) -> fidl::client::QueryResponseFut<
872        CapabilityStoreDictionaryGetResult,
873        fdomain_client::fidl::FDomainResourceDialect,
874    > {
875        CapabilityStoreProxyInterface::r#dictionary_get(self, id, key, dest_id)
876    }
877
878    /// Removes a key from the dictionary with `id`. If `dest_id` is present, loads the value
879    /// into it, otherwise discards the value.
880    ///
881    /// Errors:
882    ///
883    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
884    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
885    /// - `WRONG_TYPE` if `id` was not a dictionary.
886    /// - `INVALID_KEY` if `key` was invalid.
887    /// - `ITEM_NOT_FOUND` if the dictionary does not contain the key.
888    pub fn r#dictionary_remove(
889        &self,
890        mut id: u64,
891        mut key: &str,
892        mut dest_id: Option<&WrappedCapabilityId>,
893    ) -> fidl::client::QueryResponseFut<
894        CapabilityStoreDictionaryRemoveResult,
895        fdomain_client::fidl::FDomainResourceDialect,
896    > {
897        CapabilityStoreProxyInterface::r#dictionary_remove(self, id, key, dest_id)
898    }
899
900    /// Create a new dictionary that contains a duplicate of all the entries in
901    /// the dictionary with `id`, assigning `dest_id` to the new dictionary.
902    /// The runtime of this method is linear in the number of top-level entries
903    /// in the dictionary.
904    ///
905    /// For example, if the dictionary contains nested dictionaries, the newly
906    /// created dictionary will contain references to those same nested
907    /// dictionaries because the entries are duplicated rather than deep-copied.
908    ///
909    /// Errors:
910    ///
911    /// - `ID_NOT_FOUND` if `id` was not a valid 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    /// - `NOT_DUPLICATABLE` if one of the capabilities in `id` could not be duplicated.
915    pub fn r#dictionary_copy(
916        &self,
917        mut id: u64,
918        mut dest_id: u64,
919    ) -> fidl::client::QueryResponseFut<
920        CapabilityStoreDictionaryCopyResult,
921        fdomain_client::fidl::FDomainResourceDialect,
922    > {
923        CapabilityStoreProxyInterface::r#dictionary_copy(self, id, dest_id)
924    }
925
926    /// Enumerates the keys in the dictionary with `id`.
927    ///
928    /// Errors:
929    ///
930    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
931    /// - `WRONG_TYPE` if `id` was not a dictionary.
932    pub fn r#dictionary_keys(
933        &self,
934        mut id: u64,
935        mut iterator: fdomain_client::fidl::ServerEnd<DictionaryKeysIteratorMarker>,
936    ) -> fidl::client::QueryResponseFut<
937        CapabilityStoreDictionaryKeysResult,
938        fdomain_client::fidl::FDomainResourceDialect,
939    > {
940        CapabilityStoreProxyInterface::r#dictionary_keys(self, id, iterator)
941    }
942
943    /// Enumerates the items (keys and values) in the dictionary with `id`.
944    ///
945    /// Creates a duplicate of each value (capability). If a value could not be duplicated,
946    /// the value will be null.
947    ///
948    /// Errors:
949    ///
950    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
951    /// - `WRONG_TYPE` if `id` was not a dictionary.
952    pub fn r#dictionary_enumerate(
953        &self,
954        mut id: u64,
955        mut iterator: fdomain_client::fidl::ServerEnd<DictionaryEnumerateIteratorMarker>,
956    ) -> fidl::client::QueryResponseFut<
957        CapabilityStoreDictionaryEnumerateResult,
958        fdomain_client::fidl::FDomainResourceDialect,
959    > {
960        CapabilityStoreProxyInterface::r#dictionary_enumerate(self, id, iterator)
961    }
962
963    /// Removes all the entries in this dictionary, returning them in `contents` if provided.
964    /// If `contents` is not provided, all the items are discarded without enumerating them.
965    ///
966    /// Errors:
967    ///
968    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
969    /// - `WRONG_TYPE` if `id` was not a dictionary.
970    pub fn r#dictionary_drain(
971        &self,
972        mut id: u64,
973        mut iterator: Option<fdomain_client::fidl::ServerEnd<DictionaryDrainIteratorMarker>>,
974    ) -> fidl::client::QueryResponseFut<
975        CapabilityStoreDictionaryDrainResult,
976        fdomain_client::fidl::FDomainResourceDialect,
977    > {
978        CapabilityStoreProxyInterface::r#dictionary_drain(self, id, iterator)
979    }
980}
981
982impl CapabilityStoreProxyInterface for CapabilityStoreProxy {
983    type DuplicateResponseFut = fidl::client::QueryResponseFut<
984        CapabilityStoreDuplicateResult,
985        fdomain_client::fidl::FDomainResourceDialect,
986    >;
987    fn r#duplicate(&self, mut id: u64, mut dest_id: u64) -> Self::DuplicateResponseFut {
988        fn _decode(
989            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
990        ) -> Result<CapabilityStoreDuplicateResult, fidl::Error> {
991            let _response = fidl::client::decode_transaction_body::<
992                fidl::encoding::FlexibleResultType<
993                    fidl::encoding::EmptyStruct,
994                    CapabilityStoreError,
995                >,
996                fdomain_client::fidl::FDomainResourceDialect,
997                0x5d5d35d9c20a2184,
998            >(_buf?)?
999            .into_result_fdomain::<CapabilityStoreMarker>("duplicate")?;
1000            Ok(_response.map(|x| x))
1001        }
1002        self.client.send_query_and_decode::<
1003            CapabilityStoreDuplicateRequest,
1004            CapabilityStoreDuplicateResult,
1005        >(
1006            (id, dest_id,),
1007            0x5d5d35d9c20a2184,
1008            fidl::encoding::DynamicFlags::FLEXIBLE,
1009            _decode,
1010        )
1011    }
1012
1013    type DropResponseFut = fidl::client::QueryResponseFut<
1014        CapabilityStoreDropResult,
1015        fdomain_client::fidl::FDomainResourceDialect,
1016    >;
1017    fn r#drop(&self, mut id: u64) -> Self::DropResponseFut {
1018        fn _decode(
1019            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1020        ) -> Result<CapabilityStoreDropResult, fidl::Error> {
1021            let _response = fidl::client::decode_transaction_body::<
1022                fidl::encoding::FlexibleResultType<
1023                    fidl::encoding::EmptyStruct,
1024                    CapabilityStoreError,
1025                >,
1026                fdomain_client::fidl::FDomainResourceDialect,
1027                0xa745c0990fc2559,
1028            >(_buf?)?
1029            .into_result_fdomain::<CapabilityStoreMarker>("drop")?;
1030            Ok(_response.map(|x| x))
1031        }
1032        self.client.send_query_and_decode::<CapabilityStoreDropRequest, CapabilityStoreDropResult>(
1033            (id,),
1034            0xa745c0990fc2559,
1035            fidl::encoding::DynamicFlags::FLEXIBLE,
1036            _decode,
1037        )
1038    }
1039
1040    type ExportResponseFut = fidl::client::QueryResponseFut<
1041        CapabilityStoreExportResult,
1042        fdomain_client::fidl::FDomainResourceDialect,
1043    >;
1044    fn r#export(&self, mut id: u64) -> Self::ExportResponseFut {
1045        fn _decode(
1046            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1047        ) -> Result<CapabilityStoreExportResult, fidl::Error> {
1048            let _response = fidl::client::decode_transaction_body::<
1049                fidl::encoding::FlexibleResultType<
1050                    CapabilityStoreExportResponse,
1051                    CapabilityStoreError,
1052                >,
1053                fdomain_client::fidl::FDomainResourceDialect,
1054                0x3237a8f4748faff,
1055            >(_buf?)?
1056            .into_result_fdomain::<CapabilityStoreMarker>("export")?;
1057            Ok(_response.map(|x| x.capability))
1058        }
1059        self.client
1060            .send_query_and_decode::<CapabilityStoreExportRequest, CapabilityStoreExportResult>(
1061                (id,),
1062                0x3237a8f4748faff,
1063                fidl::encoding::DynamicFlags::FLEXIBLE,
1064                _decode,
1065            )
1066    }
1067
1068    type ImportResponseFut = fidl::client::QueryResponseFut<
1069        CapabilityStoreImportResult,
1070        fdomain_client::fidl::FDomainResourceDialect,
1071    >;
1072    fn r#import(&self, mut id: u64, mut capability: Capability) -> Self::ImportResponseFut {
1073        fn _decode(
1074            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1075        ) -> Result<CapabilityStoreImportResult, fidl::Error> {
1076            let _response = fidl::client::decode_transaction_body::<
1077                fidl::encoding::FlexibleResultType<
1078                    fidl::encoding::EmptyStruct,
1079                    CapabilityStoreError,
1080                >,
1081                fdomain_client::fidl::FDomainResourceDialect,
1082                0x1f96157a29f4539b,
1083            >(_buf?)?
1084            .into_result_fdomain::<CapabilityStoreMarker>("import")?;
1085            Ok(_response.map(|x| x))
1086        }
1087        self.client
1088            .send_query_and_decode::<CapabilityStoreImportRequest, CapabilityStoreImportResult>(
1089                (id, &mut capability),
1090                0x1f96157a29f4539b,
1091                fidl::encoding::DynamicFlags::FLEXIBLE,
1092                _decode,
1093            )
1094    }
1095
1096    type ConnectorCreateResponseFut = fidl::client::QueryResponseFut<
1097        CapabilityStoreConnectorCreateResult,
1098        fdomain_client::fidl::FDomainResourceDialect,
1099    >;
1100    fn r#connector_create(
1101        &self,
1102        mut id: u64,
1103        mut receiver: fdomain_client::fidl::ClientEnd<ReceiverMarker>,
1104    ) -> Self::ConnectorCreateResponseFut {
1105        fn _decode(
1106            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1107        ) -> Result<CapabilityStoreConnectorCreateResult, fidl::Error> {
1108            let _response = fidl::client::decode_transaction_body::<
1109                fidl::encoding::FlexibleResultType<
1110                    fidl::encoding::EmptyStruct,
1111                    CapabilityStoreError,
1112                >,
1113                fdomain_client::fidl::FDomainResourceDialect,
1114                0x29592c5d63e91c25,
1115            >(_buf?)?
1116            .into_result_fdomain::<CapabilityStoreMarker>("connector_create")?;
1117            Ok(_response.map(|x| x))
1118        }
1119        self.client.send_query_and_decode::<
1120            CapabilityStoreConnectorCreateRequest,
1121            CapabilityStoreConnectorCreateResult,
1122        >(
1123            (id, receiver,),
1124            0x29592c5d63e91c25,
1125            fidl::encoding::DynamicFlags::FLEXIBLE,
1126            _decode,
1127        )
1128    }
1129
1130    type ConnectorOpenResponseFut = fidl::client::QueryResponseFut<
1131        CapabilityStoreConnectorOpenResult,
1132        fdomain_client::fidl::FDomainResourceDialect,
1133    >;
1134    fn r#connector_open(
1135        &self,
1136        mut id: u64,
1137        mut server_end: fdomain_client::Channel,
1138    ) -> Self::ConnectorOpenResponseFut {
1139        fn _decode(
1140            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1141        ) -> Result<CapabilityStoreConnectorOpenResult, fidl::Error> {
1142            let _response = fidl::client::decode_transaction_body::<
1143                fidl::encoding::FlexibleResultType<
1144                    fidl::encoding::EmptyStruct,
1145                    CapabilityStoreError,
1146                >,
1147                fdomain_client::fidl::FDomainResourceDialect,
1148                0x537e69ab40563b9f,
1149            >(_buf?)?
1150            .into_result_fdomain::<CapabilityStoreMarker>("connector_open")?;
1151            Ok(_response.map(|x| x))
1152        }
1153        self.client.send_query_and_decode::<
1154            CapabilityStoreConnectorOpenRequest,
1155            CapabilityStoreConnectorOpenResult,
1156        >(
1157            (id, server_end,),
1158            0x537e69ab40563b9f,
1159            fidl::encoding::DynamicFlags::FLEXIBLE,
1160            _decode,
1161        )
1162    }
1163
1164    type DirConnectorCreateResponseFut = fidl::client::QueryResponseFut<
1165        CapabilityStoreDirConnectorCreateResult,
1166        fdomain_client::fidl::FDomainResourceDialect,
1167    >;
1168    fn r#dir_connector_create(
1169        &self,
1170        mut id: u64,
1171        mut receiver: fdomain_client::fidl::ClientEnd<DirReceiverMarker>,
1172    ) -> Self::DirConnectorCreateResponseFut {
1173        fn _decode(
1174            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1175        ) -> Result<CapabilityStoreDirConnectorCreateResult, fidl::Error> {
1176            let _response = fidl::client::decode_transaction_body::<
1177                fidl::encoding::FlexibleResultType<
1178                    fidl::encoding::EmptyStruct,
1179                    CapabilityStoreError,
1180                >,
1181                fdomain_client::fidl::FDomainResourceDialect,
1182                0x186138a11ccf19bb,
1183            >(_buf?)?
1184            .into_result_fdomain::<CapabilityStoreMarker>("dir_connector_create")?;
1185            Ok(_response.map(|x| x))
1186        }
1187        self.client.send_query_and_decode::<
1188            CapabilityStoreDirConnectorCreateRequest,
1189            CapabilityStoreDirConnectorCreateResult,
1190        >(
1191            (id, receiver,),
1192            0x186138a11ccf19bb,
1193            fidl::encoding::DynamicFlags::FLEXIBLE,
1194            _decode,
1195        )
1196    }
1197
1198    type DirConnectorOpenResponseFut = fidl::client::QueryResponseFut<
1199        CapabilityStoreDirConnectorOpenResult,
1200        fdomain_client::fidl::FDomainResourceDialect,
1201    >;
1202    fn r#dir_connector_open(
1203        &self,
1204        mut payload: CapabilityStoreDirConnectorOpenRequest,
1205    ) -> Self::DirConnectorOpenResponseFut {
1206        fn _decode(
1207            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1208        ) -> Result<CapabilityStoreDirConnectorOpenResult, fidl::Error> {
1209            let _response = fidl::client::decode_transaction_body::<
1210                fidl::encoding::FlexibleResultType<
1211                    fidl::encoding::EmptyStruct,
1212                    CapabilityStoreError,
1213                >,
1214                fdomain_client::fidl::FDomainResourceDialect,
1215                0x5650d3d6a3a13901,
1216            >(_buf?)?
1217            .into_result_fdomain::<CapabilityStoreMarker>("dir_connector_open")?;
1218            Ok(_response.map(|x| x))
1219        }
1220        self.client.send_query_and_decode::<
1221            CapabilityStoreDirConnectorOpenRequest,
1222            CapabilityStoreDirConnectorOpenResult,
1223        >(
1224            &mut payload,
1225            0x5650d3d6a3a13901,
1226            fidl::encoding::DynamicFlags::FLEXIBLE,
1227            _decode,
1228        )
1229    }
1230
1231    type DictionaryCreateResponseFut = fidl::client::QueryResponseFut<
1232        CapabilityStoreDictionaryCreateResult,
1233        fdomain_client::fidl::FDomainResourceDialect,
1234    >;
1235    fn r#dictionary_create(&self, mut id: u64) -> Self::DictionaryCreateResponseFut {
1236        fn _decode(
1237            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1238        ) -> Result<CapabilityStoreDictionaryCreateResult, 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                0x6997c8dfc63de093,
1246            >(_buf?)?
1247            .into_result_fdomain::<CapabilityStoreMarker>("dictionary_create")?;
1248            Ok(_response.map(|x| x))
1249        }
1250        self.client.send_query_and_decode::<
1251            CapabilityStoreDictionaryCreateRequest,
1252            CapabilityStoreDictionaryCreateResult,
1253        >(
1254            (id,),
1255            0x6997c8dfc63de093,
1256            fidl::encoding::DynamicFlags::FLEXIBLE,
1257            _decode,
1258        )
1259    }
1260
1261    type DictionaryLegacyImportResponseFut = fidl::client::QueryResponseFut<
1262        CapabilityStoreDictionaryLegacyImportResult,
1263        fdomain_client::fidl::FDomainResourceDialect,
1264    >;
1265    fn r#dictionary_legacy_import(
1266        &self,
1267        mut id: u64,
1268        mut client_end: fdomain_client::Channel,
1269    ) -> Self::DictionaryLegacyImportResponseFut {
1270        fn _decode(
1271            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1272        ) -> Result<CapabilityStoreDictionaryLegacyImportResult, fidl::Error> {
1273            let _response = fidl::client::decode_transaction_body::<
1274                fidl::encoding::FlexibleResultType<
1275                    fidl::encoding::EmptyStruct,
1276                    CapabilityStoreError,
1277                >,
1278                fdomain_client::fidl::FDomainResourceDialect,
1279                0x72fd686c37b6025f,
1280            >(_buf?)?
1281            .into_result_fdomain::<CapabilityStoreMarker>("dictionary_legacy_import")?;
1282            Ok(_response.map(|x| x))
1283        }
1284        self.client.send_query_and_decode::<
1285            CapabilityStoreDictionaryLegacyImportRequest,
1286            CapabilityStoreDictionaryLegacyImportResult,
1287        >(
1288            (id, client_end,),
1289            0x72fd686c37b6025f,
1290            fidl::encoding::DynamicFlags::FLEXIBLE,
1291            _decode,
1292        )
1293    }
1294
1295    type DictionaryLegacyExportResponseFut = fidl::client::QueryResponseFut<
1296        CapabilityStoreDictionaryLegacyExportResult,
1297        fdomain_client::fidl::FDomainResourceDialect,
1298    >;
1299    fn r#dictionary_legacy_export(
1300        &self,
1301        mut id: u64,
1302        mut server_end: fdomain_client::Channel,
1303    ) -> Self::DictionaryLegacyExportResponseFut {
1304        fn _decode(
1305            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1306        ) -> Result<CapabilityStoreDictionaryLegacyExportResult, fidl::Error> {
1307            let _response = fidl::client::decode_transaction_body::<
1308                fidl::encoding::FlexibleResultType<
1309                    fidl::encoding::EmptyStruct,
1310                    CapabilityStoreError,
1311                >,
1312                fdomain_client::fidl::FDomainResourceDialect,
1313                0x407e15cc4bde5dcd,
1314            >(_buf?)?
1315            .into_result_fdomain::<CapabilityStoreMarker>("dictionary_legacy_export")?;
1316            Ok(_response.map(|x| x))
1317        }
1318        self.client.send_query_and_decode::<
1319            CapabilityStoreDictionaryLegacyExportRequest,
1320            CapabilityStoreDictionaryLegacyExportResult,
1321        >(
1322            (id, server_end,),
1323            0x407e15cc4bde5dcd,
1324            fidl::encoding::DynamicFlags::FLEXIBLE,
1325            _decode,
1326        )
1327    }
1328
1329    type DictionaryInsertResponseFut = fidl::client::QueryResponseFut<
1330        CapabilityStoreDictionaryInsertResult,
1331        fdomain_client::fidl::FDomainResourceDialect,
1332    >;
1333    fn r#dictionary_insert(
1334        &self,
1335        mut id: u64,
1336        mut item: &DictionaryItem,
1337    ) -> Self::DictionaryInsertResponseFut {
1338        fn _decode(
1339            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1340        ) -> Result<CapabilityStoreDictionaryInsertResult, fidl::Error> {
1341            let _response = fidl::client::decode_transaction_body::<
1342                fidl::encoding::FlexibleResultType<
1343                    fidl::encoding::EmptyStruct,
1344                    CapabilityStoreError,
1345                >,
1346                fdomain_client::fidl::FDomainResourceDialect,
1347                0x7702183689d44c27,
1348            >(_buf?)?
1349            .into_result_fdomain::<CapabilityStoreMarker>("dictionary_insert")?;
1350            Ok(_response.map(|x| x))
1351        }
1352        self.client.send_query_and_decode::<
1353            CapabilityStoreDictionaryInsertRequest,
1354            CapabilityStoreDictionaryInsertResult,
1355        >(
1356            (id, item,),
1357            0x7702183689d44c27,
1358            fidl::encoding::DynamicFlags::FLEXIBLE,
1359            _decode,
1360        )
1361    }
1362
1363    type DictionaryGetResponseFut = fidl::client::QueryResponseFut<
1364        CapabilityStoreDictionaryGetResult,
1365        fdomain_client::fidl::FDomainResourceDialect,
1366    >;
1367    fn r#dictionary_get(
1368        &self,
1369        mut id: u64,
1370        mut key: &str,
1371        mut dest_id: u64,
1372    ) -> Self::DictionaryGetResponseFut {
1373        fn _decode(
1374            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1375        ) -> Result<CapabilityStoreDictionaryGetResult, fidl::Error> {
1376            let _response = fidl::client::decode_transaction_body::<
1377                fidl::encoding::FlexibleResultType<
1378                    fidl::encoding::EmptyStruct,
1379                    CapabilityStoreError,
1380                >,
1381                fdomain_client::fidl::FDomainResourceDialect,
1382                0x4d9e27538284add2,
1383            >(_buf?)?
1384            .into_result_fdomain::<CapabilityStoreMarker>("dictionary_get")?;
1385            Ok(_response.map(|x| x))
1386        }
1387        self.client.send_query_and_decode::<
1388            CapabilityStoreDictionaryGetRequest,
1389            CapabilityStoreDictionaryGetResult,
1390        >(
1391            (id, key, dest_id,),
1392            0x4d9e27538284add2,
1393            fidl::encoding::DynamicFlags::FLEXIBLE,
1394            _decode,
1395        )
1396    }
1397
1398    type DictionaryRemoveResponseFut = fidl::client::QueryResponseFut<
1399        CapabilityStoreDictionaryRemoveResult,
1400        fdomain_client::fidl::FDomainResourceDialect,
1401    >;
1402    fn r#dictionary_remove(
1403        &self,
1404        mut id: u64,
1405        mut key: &str,
1406        mut dest_id: Option<&WrappedCapabilityId>,
1407    ) -> Self::DictionaryRemoveResponseFut {
1408        fn _decode(
1409            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1410        ) -> Result<CapabilityStoreDictionaryRemoveResult, fidl::Error> {
1411            let _response = fidl::client::decode_transaction_body::<
1412                fidl::encoding::FlexibleResultType<
1413                    fidl::encoding::EmptyStruct,
1414                    CapabilityStoreError,
1415                >,
1416                fdomain_client::fidl::FDomainResourceDialect,
1417                0x4c5c025ab05d4f3,
1418            >(_buf?)?
1419            .into_result_fdomain::<CapabilityStoreMarker>("dictionary_remove")?;
1420            Ok(_response.map(|x| x))
1421        }
1422        self.client.send_query_and_decode::<
1423            CapabilityStoreDictionaryRemoveRequest,
1424            CapabilityStoreDictionaryRemoveResult,
1425        >(
1426            (id, key, dest_id,),
1427            0x4c5c025ab05d4f3,
1428            fidl::encoding::DynamicFlags::FLEXIBLE,
1429            _decode,
1430        )
1431    }
1432
1433    type DictionaryCopyResponseFut = fidl::client::QueryResponseFut<
1434        CapabilityStoreDictionaryCopyResult,
1435        fdomain_client::fidl::FDomainResourceDialect,
1436    >;
1437    fn r#dictionary_copy(&self, mut id: u64, mut dest_id: u64) -> Self::DictionaryCopyResponseFut {
1438        fn _decode(
1439            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1440        ) -> Result<CapabilityStoreDictionaryCopyResult, fidl::Error> {
1441            let _response = fidl::client::decode_transaction_body::<
1442                fidl::encoding::FlexibleResultType<
1443                    fidl::encoding::EmptyStruct,
1444                    CapabilityStoreError,
1445                >,
1446                fdomain_client::fidl::FDomainResourceDialect,
1447                0x3733ecdf4ea1b44f,
1448            >(_buf?)?
1449            .into_result_fdomain::<CapabilityStoreMarker>("dictionary_copy")?;
1450            Ok(_response.map(|x| x))
1451        }
1452        self.client.send_query_and_decode::<
1453            CapabilityStoreDictionaryCopyRequest,
1454            CapabilityStoreDictionaryCopyResult,
1455        >(
1456            (id, dest_id,),
1457            0x3733ecdf4ea1b44f,
1458            fidl::encoding::DynamicFlags::FLEXIBLE,
1459            _decode,
1460        )
1461    }
1462
1463    type DictionaryKeysResponseFut = fidl::client::QueryResponseFut<
1464        CapabilityStoreDictionaryKeysResult,
1465        fdomain_client::fidl::FDomainResourceDialect,
1466    >;
1467    fn r#dictionary_keys(
1468        &self,
1469        mut id: u64,
1470        mut iterator: fdomain_client::fidl::ServerEnd<DictionaryKeysIteratorMarker>,
1471    ) -> Self::DictionaryKeysResponseFut {
1472        fn _decode(
1473            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1474        ) -> Result<CapabilityStoreDictionaryKeysResult, fidl::Error> {
1475            let _response = fidl::client::decode_transaction_body::<
1476                fidl::encoding::FlexibleResultType<
1477                    fidl::encoding::EmptyStruct,
1478                    CapabilityStoreError,
1479                >,
1480                fdomain_client::fidl::FDomainResourceDialect,
1481                0x84b05577ceaec9e,
1482            >(_buf?)?
1483            .into_result_fdomain::<CapabilityStoreMarker>("dictionary_keys")?;
1484            Ok(_response.map(|x| x))
1485        }
1486        self.client.send_query_and_decode::<
1487            CapabilityStoreDictionaryKeysRequest,
1488            CapabilityStoreDictionaryKeysResult,
1489        >(
1490            (id, iterator,),
1491            0x84b05577ceaec9e,
1492            fidl::encoding::DynamicFlags::FLEXIBLE,
1493            _decode,
1494        )
1495    }
1496
1497    type DictionaryEnumerateResponseFut = fidl::client::QueryResponseFut<
1498        CapabilityStoreDictionaryEnumerateResult,
1499        fdomain_client::fidl::FDomainResourceDialect,
1500    >;
1501    fn r#dictionary_enumerate(
1502        &self,
1503        mut id: u64,
1504        mut iterator: fdomain_client::fidl::ServerEnd<DictionaryEnumerateIteratorMarker>,
1505    ) -> Self::DictionaryEnumerateResponseFut {
1506        fn _decode(
1507            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1508        ) -> Result<CapabilityStoreDictionaryEnumerateResult, fidl::Error> {
1509            let _response = fidl::client::decode_transaction_body::<
1510                fidl::encoding::FlexibleResultType<
1511                    fidl::encoding::EmptyStruct,
1512                    CapabilityStoreError,
1513                >,
1514                fdomain_client::fidl::FDomainResourceDialect,
1515                0xd6279b6ced04641,
1516            >(_buf?)?
1517            .into_result_fdomain::<CapabilityStoreMarker>("dictionary_enumerate")?;
1518            Ok(_response.map(|x| x))
1519        }
1520        self.client.send_query_and_decode::<
1521            CapabilityStoreDictionaryEnumerateRequest,
1522            CapabilityStoreDictionaryEnumerateResult,
1523        >(
1524            (id, iterator,),
1525            0xd6279b6ced04641,
1526            fidl::encoding::DynamicFlags::FLEXIBLE,
1527            _decode,
1528        )
1529    }
1530
1531    type DictionaryDrainResponseFut = fidl::client::QueryResponseFut<
1532        CapabilityStoreDictionaryDrainResult,
1533        fdomain_client::fidl::FDomainResourceDialect,
1534    >;
1535    fn r#dictionary_drain(
1536        &self,
1537        mut id: u64,
1538        mut iterator: Option<fdomain_client::fidl::ServerEnd<DictionaryDrainIteratorMarker>>,
1539    ) -> Self::DictionaryDrainResponseFut {
1540        fn _decode(
1541            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1542        ) -> Result<CapabilityStoreDictionaryDrainResult, fidl::Error> {
1543            let _response = fidl::client::decode_transaction_body::<
1544                fidl::encoding::FlexibleResultType<
1545                    fidl::encoding::EmptyStruct,
1546                    CapabilityStoreError,
1547                >,
1548                fdomain_client::fidl::FDomainResourceDialect,
1549                0x28a3a3f84d928cd8,
1550            >(_buf?)?
1551            .into_result_fdomain::<CapabilityStoreMarker>("dictionary_drain")?;
1552            Ok(_response.map(|x| x))
1553        }
1554        self.client.send_query_and_decode::<
1555            CapabilityStoreDictionaryDrainRequest,
1556            CapabilityStoreDictionaryDrainResult,
1557        >(
1558            (id, iterator,),
1559            0x28a3a3f84d928cd8,
1560            fidl::encoding::DynamicFlags::FLEXIBLE,
1561            _decode,
1562        )
1563    }
1564}
1565
1566pub struct CapabilityStoreEventStream {
1567    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
1568}
1569
1570impl std::marker::Unpin for CapabilityStoreEventStream {}
1571
1572impl futures::stream::FusedStream for CapabilityStoreEventStream {
1573    fn is_terminated(&self) -> bool {
1574        self.event_receiver.is_terminated()
1575    }
1576}
1577
1578impl futures::Stream for CapabilityStoreEventStream {
1579    type Item = Result<CapabilityStoreEvent, fidl::Error>;
1580
1581    fn poll_next(
1582        mut self: std::pin::Pin<&mut Self>,
1583        cx: &mut std::task::Context<'_>,
1584    ) -> std::task::Poll<Option<Self::Item>> {
1585        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1586            &mut self.event_receiver,
1587            cx
1588        )?) {
1589            Some(buf) => std::task::Poll::Ready(Some(CapabilityStoreEvent::decode(buf))),
1590            None => std::task::Poll::Ready(None),
1591        }
1592    }
1593}
1594
1595#[derive(Debug)]
1596pub enum CapabilityStoreEvent {
1597    #[non_exhaustive]
1598    _UnknownEvent {
1599        /// Ordinal of the event that was sent.
1600        ordinal: u64,
1601    },
1602}
1603
1604impl CapabilityStoreEvent {
1605    /// Decodes a message buffer as a [`CapabilityStoreEvent`].
1606    fn decode(
1607        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1608    ) -> Result<CapabilityStoreEvent, fidl::Error> {
1609        let (bytes, _handles) = buf.split_mut();
1610        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1611        debug_assert_eq!(tx_header.tx_id, 0);
1612        match tx_header.ordinal {
1613            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
1614                Ok(CapabilityStoreEvent::_UnknownEvent { ordinal: tx_header.ordinal })
1615            }
1616            _ => Err(fidl::Error::UnknownOrdinal {
1617                ordinal: tx_header.ordinal,
1618                protocol_name:
1619                    <CapabilityStoreMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
1620            }),
1621        }
1622    }
1623}
1624
1625/// A Stream of incoming requests for fuchsia.component.sandbox/CapabilityStore.
1626pub struct CapabilityStoreRequestStream {
1627    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
1628    is_terminated: bool,
1629}
1630
1631impl std::marker::Unpin for CapabilityStoreRequestStream {}
1632
1633impl futures::stream::FusedStream for CapabilityStoreRequestStream {
1634    fn is_terminated(&self) -> bool {
1635        self.is_terminated
1636    }
1637}
1638
1639impl fdomain_client::fidl::RequestStream for CapabilityStoreRequestStream {
1640    type Protocol = CapabilityStoreMarker;
1641    type ControlHandle = CapabilityStoreControlHandle;
1642
1643    fn from_channel(channel: fdomain_client::Channel) -> Self {
1644        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1645    }
1646
1647    fn control_handle(&self) -> Self::ControlHandle {
1648        CapabilityStoreControlHandle { inner: self.inner.clone() }
1649    }
1650
1651    fn into_inner(
1652        self,
1653    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
1654    {
1655        (self.inner, self.is_terminated)
1656    }
1657
1658    fn from_inner(
1659        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
1660        is_terminated: bool,
1661    ) -> Self {
1662        Self { inner, is_terminated }
1663    }
1664}
1665
1666impl futures::Stream for CapabilityStoreRequestStream {
1667    type Item = Result<CapabilityStoreRequest, fidl::Error>;
1668
1669    fn poll_next(
1670        mut self: std::pin::Pin<&mut Self>,
1671        cx: &mut std::task::Context<'_>,
1672    ) -> std::task::Poll<Option<Self::Item>> {
1673        let this = &mut *self;
1674        if this.inner.check_shutdown(cx) {
1675            this.is_terminated = true;
1676            return std::task::Poll::Ready(None);
1677        }
1678        if this.is_terminated {
1679            panic!("polled CapabilityStoreRequestStream after completion");
1680        }
1681        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
1682            |bytes, handles| {
1683                match this.inner.channel().read_etc(cx, bytes, handles) {
1684                    std::task::Poll::Ready(Ok(())) => {}
1685                    std::task::Poll::Pending => return std::task::Poll::Pending,
1686                    std::task::Poll::Ready(Err(None)) => {
1687                        this.is_terminated = true;
1688                        return std::task::Poll::Ready(None);
1689                    }
1690                    std::task::Poll::Ready(Err(Some(e))) => {
1691                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1692                            e.into(),
1693                        ))));
1694                    }
1695                }
1696
1697                // A message has been received from the channel
1698                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1699
1700                std::task::Poll::Ready(Some(match header.ordinal {
1701                0x5d5d35d9c20a2184 => {
1702                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1703                    let mut req = fidl::new_empty!(CapabilityStoreDuplicateRequest, fdomain_client::fidl::FDomainResourceDialect);
1704                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<CapabilityStoreDuplicateRequest>(&header, _body_bytes, handles, &mut req)?;
1705                    let control_handle = CapabilityStoreControlHandle {
1706                        inner: this.inner.clone(),
1707                    };
1708                    Ok(CapabilityStoreRequest::Duplicate {id: req.id,
1709dest_id: req.dest_id,
1710
1711                        responder: CapabilityStoreDuplicateResponder {
1712                            control_handle: std::mem::ManuallyDrop::new(control_handle),
1713                            tx_id: header.tx_id,
1714                        },
1715                    })
1716                }
1717                0xa745c0990fc2559 => {
1718                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1719                    let mut req = fidl::new_empty!(CapabilityStoreDropRequest, fdomain_client::fidl::FDomainResourceDialect);
1720                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<CapabilityStoreDropRequest>(&header, _body_bytes, handles, &mut req)?;
1721                    let control_handle = CapabilityStoreControlHandle {
1722                        inner: this.inner.clone(),
1723                    };
1724                    Ok(CapabilityStoreRequest::Drop {id: req.id,
1725
1726                        responder: CapabilityStoreDropResponder {
1727                            control_handle: std::mem::ManuallyDrop::new(control_handle),
1728                            tx_id: header.tx_id,
1729                        },
1730                    })
1731                }
1732                0x3237a8f4748faff => {
1733                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1734                    let mut req = fidl::new_empty!(CapabilityStoreExportRequest, fdomain_client::fidl::FDomainResourceDialect);
1735                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<CapabilityStoreExportRequest>(&header, _body_bytes, handles, &mut req)?;
1736                    let control_handle = CapabilityStoreControlHandle {
1737                        inner: this.inner.clone(),
1738                    };
1739                    Ok(CapabilityStoreRequest::Export {id: req.id,
1740
1741                        responder: CapabilityStoreExportResponder {
1742                            control_handle: std::mem::ManuallyDrop::new(control_handle),
1743                            tx_id: header.tx_id,
1744                        },
1745                    })
1746                }
1747                0x1f96157a29f4539b => {
1748                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1749                    let mut req = fidl::new_empty!(CapabilityStoreImportRequest, fdomain_client::fidl::FDomainResourceDialect);
1750                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<CapabilityStoreImportRequest>(&header, _body_bytes, handles, &mut req)?;
1751                    let control_handle = CapabilityStoreControlHandle {
1752                        inner: this.inner.clone(),
1753                    };
1754                    Ok(CapabilityStoreRequest::Import {id: req.id,
1755capability: req.capability,
1756
1757                        responder: CapabilityStoreImportResponder {
1758                            control_handle: std::mem::ManuallyDrop::new(control_handle),
1759                            tx_id: header.tx_id,
1760                        },
1761                    })
1762                }
1763                0x29592c5d63e91c25 => {
1764                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1765                    let mut req = fidl::new_empty!(CapabilityStoreConnectorCreateRequest, fdomain_client::fidl::FDomainResourceDialect);
1766                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<CapabilityStoreConnectorCreateRequest>(&header, _body_bytes, handles, &mut req)?;
1767                    let control_handle = CapabilityStoreControlHandle {
1768                        inner: this.inner.clone(),
1769                    };
1770                    Ok(CapabilityStoreRequest::ConnectorCreate {id: req.id,
1771receiver: req.receiver,
1772
1773                        responder: CapabilityStoreConnectorCreateResponder {
1774                            control_handle: std::mem::ManuallyDrop::new(control_handle),
1775                            tx_id: header.tx_id,
1776                        },
1777                    })
1778                }
1779                0x537e69ab40563b9f => {
1780                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1781                    let mut req = fidl::new_empty!(CapabilityStoreConnectorOpenRequest, fdomain_client::fidl::FDomainResourceDialect);
1782                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<CapabilityStoreConnectorOpenRequest>(&header, _body_bytes, handles, &mut req)?;
1783                    let control_handle = CapabilityStoreControlHandle {
1784                        inner: this.inner.clone(),
1785                    };
1786                    Ok(CapabilityStoreRequest::ConnectorOpen {id: req.id,
1787server_end: req.server_end,
1788
1789                        responder: CapabilityStoreConnectorOpenResponder {
1790                            control_handle: std::mem::ManuallyDrop::new(control_handle),
1791                            tx_id: header.tx_id,
1792                        },
1793                    })
1794                }
1795                0x186138a11ccf19bb => {
1796                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1797                    let mut req = fidl::new_empty!(CapabilityStoreDirConnectorCreateRequest, fdomain_client::fidl::FDomainResourceDialect);
1798                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<CapabilityStoreDirConnectorCreateRequest>(&header, _body_bytes, handles, &mut req)?;
1799                    let control_handle = CapabilityStoreControlHandle {
1800                        inner: this.inner.clone(),
1801                    };
1802                    Ok(CapabilityStoreRequest::DirConnectorCreate {id: req.id,
1803receiver: req.receiver,
1804
1805                        responder: CapabilityStoreDirConnectorCreateResponder {
1806                            control_handle: std::mem::ManuallyDrop::new(control_handle),
1807                            tx_id: header.tx_id,
1808                        },
1809                    })
1810                }
1811                0x5650d3d6a3a13901 => {
1812                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1813                    let mut req = fidl::new_empty!(CapabilityStoreDirConnectorOpenRequest, fdomain_client::fidl::FDomainResourceDialect);
1814                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<CapabilityStoreDirConnectorOpenRequest>(&header, _body_bytes, handles, &mut req)?;
1815                    let control_handle = CapabilityStoreControlHandle {
1816                        inner: this.inner.clone(),
1817                    };
1818                    Ok(CapabilityStoreRequest::DirConnectorOpen {payload: req,
1819                        responder: CapabilityStoreDirConnectorOpenResponder {
1820                            control_handle: std::mem::ManuallyDrop::new(control_handle),
1821                            tx_id: header.tx_id,
1822                        },
1823                    })
1824                }
1825                0x6997c8dfc63de093 => {
1826                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1827                    let mut req = fidl::new_empty!(CapabilityStoreDictionaryCreateRequest, fdomain_client::fidl::FDomainResourceDialect);
1828                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<CapabilityStoreDictionaryCreateRequest>(&header, _body_bytes, handles, &mut req)?;
1829                    let control_handle = CapabilityStoreControlHandle {
1830                        inner: this.inner.clone(),
1831                    };
1832                    Ok(CapabilityStoreRequest::DictionaryCreate {id: req.id,
1833
1834                        responder: CapabilityStoreDictionaryCreateResponder {
1835                            control_handle: std::mem::ManuallyDrop::new(control_handle),
1836                            tx_id: header.tx_id,
1837                        },
1838                    })
1839                }
1840                0x72fd686c37b6025f => {
1841                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1842                    let mut req = fidl::new_empty!(CapabilityStoreDictionaryLegacyImportRequest, fdomain_client::fidl::FDomainResourceDialect);
1843                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<CapabilityStoreDictionaryLegacyImportRequest>(&header, _body_bytes, handles, &mut req)?;
1844                    let control_handle = CapabilityStoreControlHandle {
1845                        inner: this.inner.clone(),
1846                    };
1847                    Ok(CapabilityStoreRequest::DictionaryLegacyImport {id: req.id,
1848client_end: req.client_end,
1849
1850                        responder: CapabilityStoreDictionaryLegacyImportResponder {
1851                            control_handle: std::mem::ManuallyDrop::new(control_handle),
1852                            tx_id: header.tx_id,
1853                        },
1854                    })
1855                }
1856                0x407e15cc4bde5dcd => {
1857                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1858                    let mut req = fidl::new_empty!(CapabilityStoreDictionaryLegacyExportRequest, fdomain_client::fidl::FDomainResourceDialect);
1859                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<CapabilityStoreDictionaryLegacyExportRequest>(&header, _body_bytes, handles, &mut req)?;
1860                    let control_handle = CapabilityStoreControlHandle {
1861                        inner: this.inner.clone(),
1862                    };
1863                    Ok(CapabilityStoreRequest::DictionaryLegacyExport {id: req.id,
1864server_end: req.server_end,
1865
1866                        responder: CapabilityStoreDictionaryLegacyExportResponder {
1867                            control_handle: std::mem::ManuallyDrop::new(control_handle),
1868                            tx_id: header.tx_id,
1869                        },
1870                    })
1871                }
1872                0x7702183689d44c27 => {
1873                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1874                    let mut req = fidl::new_empty!(CapabilityStoreDictionaryInsertRequest, fdomain_client::fidl::FDomainResourceDialect);
1875                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<CapabilityStoreDictionaryInsertRequest>(&header, _body_bytes, handles, &mut req)?;
1876                    let control_handle = CapabilityStoreControlHandle {
1877                        inner: this.inner.clone(),
1878                    };
1879                    Ok(CapabilityStoreRequest::DictionaryInsert {id: req.id,
1880item: req.item,
1881
1882                        responder: CapabilityStoreDictionaryInsertResponder {
1883                            control_handle: std::mem::ManuallyDrop::new(control_handle),
1884                            tx_id: header.tx_id,
1885                        },
1886                    })
1887                }
1888                0x4d9e27538284add2 => {
1889                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1890                    let mut req = fidl::new_empty!(CapabilityStoreDictionaryGetRequest, fdomain_client::fidl::FDomainResourceDialect);
1891                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<CapabilityStoreDictionaryGetRequest>(&header, _body_bytes, handles, &mut req)?;
1892                    let control_handle = CapabilityStoreControlHandle {
1893                        inner: this.inner.clone(),
1894                    };
1895                    Ok(CapabilityStoreRequest::DictionaryGet {id: req.id,
1896key: req.key,
1897dest_id: req.dest_id,
1898
1899                        responder: CapabilityStoreDictionaryGetResponder {
1900                            control_handle: std::mem::ManuallyDrop::new(control_handle),
1901                            tx_id: header.tx_id,
1902                        },
1903                    })
1904                }
1905                0x4c5c025ab05d4f3 => {
1906                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1907                    let mut req = fidl::new_empty!(CapabilityStoreDictionaryRemoveRequest, fdomain_client::fidl::FDomainResourceDialect);
1908                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<CapabilityStoreDictionaryRemoveRequest>(&header, _body_bytes, handles, &mut req)?;
1909                    let control_handle = CapabilityStoreControlHandle {
1910                        inner: this.inner.clone(),
1911                    };
1912                    Ok(CapabilityStoreRequest::DictionaryRemove {id: req.id,
1913key: req.key,
1914dest_id: req.dest_id,
1915
1916                        responder: CapabilityStoreDictionaryRemoveResponder {
1917                            control_handle: std::mem::ManuallyDrop::new(control_handle),
1918                            tx_id: header.tx_id,
1919                        },
1920                    })
1921                }
1922                0x3733ecdf4ea1b44f => {
1923                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1924                    let mut req = fidl::new_empty!(CapabilityStoreDictionaryCopyRequest, fdomain_client::fidl::FDomainResourceDialect);
1925                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<CapabilityStoreDictionaryCopyRequest>(&header, _body_bytes, handles, &mut req)?;
1926                    let control_handle = CapabilityStoreControlHandle {
1927                        inner: this.inner.clone(),
1928                    };
1929                    Ok(CapabilityStoreRequest::DictionaryCopy {id: req.id,
1930dest_id: req.dest_id,
1931
1932                        responder: CapabilityStoreDictionaryCopyResponder {
1933                            control_handle: std::mem::ManuallyDrop::new(control_handle),
1934                            tx_id: header.tx_id,
1935                        },
1936                    })
1937                }
1938                0x84b05577ceaec9e => {
1939                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1940                    let mut req = fidl::new_empty!(CapabilityStoreDictionaryKeysRequest, fdomain_client::fidl::FDomainResourceDialect);
1941                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<CapabilityStoreDictionaryKeysRequest>(&header, _body_bytes, handles, &mut req)?;
1942                    let control_handle = CapabilityStoreControlHandle {
1943                        inner: this.inner.clone(),
1944                    };
1945                    Ok(CapabilityStoreRequest::DictionaryKeys {id: req.id,
1946iterator: req.iterator,
1947
1948                        responder: CapabilityStoreDictionaryKeysResponder {
1949                            control_handle: std::mem::ManuallyDrop::new(control_handle),
1950                            tx_id: header.tx_id,
1951                        },
1952                    })
1953                }
1954                0xd6279b6ced04641 => {
1955                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1956                    let mut req = fidl::new_empty!(CapabilityStoreDictionaryEnumerateRequest, fdomain_client::fidl::FDomainResourceDialect);
1957                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<CapabilityStoreDictionaryEnumerateRequest>(&header, _body_bytes, handles, &mut req)?;
1958                    let control_handle = CapabilityStoreControlHandle {
1959                        inner: this.inner.clone(),
1960                    };
1961                    Ok(CapabilityStoreRequest::DictionaryEnumerate {id: req.id,
1962iterator: req.iterator,
1963
1964                        responder: CapabilityStoreDictionaryEnumerateResponder {
1965                            control_handle: std::mem::ManuallyDrop::new(control_handle),
1966                            tx_id: header.tx_id,
1967                        },
1968                    })
1969                }
1970                0x28a3a3f84d928cd8 => {
1971                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1972                    let mut req = fidl::new_empty!(CapabilityStoreDictionaryDrainRequest, fdomain_client::fidl::FDomainResourceDialect);
1973                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<CapabilityStoreDictionaryDrainRequest>(&header, _body_bytes, handles, &mut req)?;
1974                    let control_handle = CapabilityStoreControlHandle {
1975                        inner: this.inner.clone(),
1976                    };
1977                    Ok(CapabilityStoreRequest::DictionaryDrain {id: req.id,
1978iterator: req.iterator,
1979
1980                        responder: CapabilityStoreDictionaryDrainResponder {
1981                            control_handle: std::mem::ManuallyDrop::new(control_handle),
1982                            tx_id: header.tx_id,
1983                        },
1984                    })
1985                }
1986                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
1987                    Ok(CapabilityStoreRequest::_UnknownMethod {
1988                        ordinal: header.ordinal,
1989                        control_handle: CapabilityStoreControlHandle { inner: this.inner.clone() },
1990                        method_type: fidl::MethodType::OneWay,
1991                    })
1992                }
1993                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
1994                    this.inner.send_framework_err(
1995                        fidl::encoding::FrameworkErr::UnknownMethod,
1996                        header.tx_id,
1997                        header.ordinal,
1998                        header.dynamic_flags(),
1999                        (bytes, handles),
2000                    )?;
2001                    Ok(CapabilityStoreRequest::_UnknownMethod {
2002                        ordinal: header.ordinal,
2003                        control_handle: CapabilityStoreControlHandle { inner: this.inner.clone() },
2004                        method_type: fidl::MethodType::TwoWay,
2005                    })
2006                }
2007                _ => Err(fidl::Error::UnknownOrdinal {
2008                    ordinal: header.ordinal,
2009                    protocol_name: <CapabilityStoreMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
2010                }),
2011            }))
2012            },
2013        )
2014    }
2015}
2016
2017/// Protocol that represents the concept of a "capability store", a repository
2018/// for [Capability]s that are held by the component framework runtime.
2019///
2020/// [CapabilityStore] serves as the main bridge between the component runtime and clients
2021/// that enables them to operate on and exchange [Capability]s. A [CapabilityStore] instance
2022/// contains a set of [Capability]s, each of which has a [CapabilityId] assigned by the client.
2023///
2024/// Normally, a program would not exchange a [CapabilityStore] or [CapabilityId] with other
2025/// programs -- a [CapabilityStore] connection and its enclosed capabilities are intended to
2026/// be "local" to a program. Instead, if a program wishes to exchange a [Capability] with other
2027/// programs, it should [Export] the [Capability] out of the store, send the [Capability] to the
2028/// target program, which can then [Import] the capability into its own store.
2029///
2030/// [CapabilityStore] is also used to manage capability lifetimes. The lifetime of a capability is
2031/// scoped to the [CapabilityStore] in which it resides; i.e. to drop the [CapabilityStore]
2032/// connections to release the capabilities instead it. In addition, [CapabilityStore] supports a
2033/// [Drop] API to drop an individual [Capability] reference. (Note that it is possible for a
2034/// some capabilities, like [DictionaryRef], to have multiple references, in which case all of
2035/// the references must be dropped for the underlying resource to be released.)
2036///
2037/// A note about semantics: the [CapabilityStore] APIs do not return [CapabilityId]s, because
2038/// [CapabilityId]s are assigned by the client. Instead, when a method would semantically return
2039/// a capability, this is expressed by taking the destination [CapabilityId] as an output parameter.
2040#[derive(Debug)]
2041pub enum CapabilityStoreRequest {
2042    /// Duplicates the capability with `id` to `dest_id`.
2043    ///
2044    /// Errors:
2045    ///
2046    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2047    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
2048    /// - `NOT_DUPLICATABLE` if `id` could not be duplicated.
2049    Duplicate { id: u64, dest_id: u64, responder: CapabilityStoreDuplicateResponder },
2050    /// Drops the capability with `id` from this [`CapabilityStore`].
2051    ///
2052    /// Errors:
2053    ///
2054    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2055    Drop { id: u64, responder: CapabilityStoreDropResponder },
2056    /// Exports the capability with the client-assigned identifier `id` to
2057    /// `capability`. This operation removes the capability from the store. If
2058    /// this is not desired, [Duplicate] the capability first.
2059    ///
2060    /// Errors:
2061    ///
2062    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2063    Export { id: u64, responder: CapabilityStoreExportResponder },
2064    /// Imports `capability` into this store with the client-assigned `id`.
2065    ///
2066    /// Errors:
2067    ///
2068    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
2069    /// - `BAD_CAPABILITY` if `capability` was not a valid [Capability].
2070    Import { id: u64, capability: Capability, responder: CapabilityStoreImportResponder },
2071    /// Creates a [Connector] from a [Receiver]. Incoming connections to the [Connector] will be
2072    /// dispatched to this [Receiver].
2073    ///
2074    /// Errors:
2075    ///
2076    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
2077    ConnectorCreate {
2078        id: u64,
2079        receiver: fdomain_client::fidl::ClientEnd<ReceiverMarker>,
2080        responder: CapabilityStoreConnectorCreateResponder,
2081    },
2082    /// Open a connection from the provided [Connector] capability that will be dispatched to
2083    /// the [Receiver] on the other end.
2084    ///
2085    /// If there is an error, it will be reported as a zx.Status epitaph on `server_end`.
2086    ///
2087    /// Errors:
2088    ///
2089    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2090    /// - `WRONG_TYPE` if `id` was not a connector capability.
2091    ConnectorOpen {
2092        id: u64,
2093        server_end: fdomain_client::Channel,
2094        responder: CapabilityStoreConnectorOpenResponder,
2095    },
2096    /// Creates a [DirConnector] from a [DirReceiver]. Incoming connections to the [DirConnector]
2097    /// will be dispatched to this [DirReceiver].
2098    ///
2099    /// Errors:
2100    ///
2101    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
2102    DirConnectorCreate {
2103        id: u64,
2104        receiver: fdomain_client::fidl::ClientEnd<DirReceiverMarker>,
2105        responder: CapabilityStoreDirConnectorCreateResponder,
2106    },
2107    /// Open a connection from the provided [DirConnector] capability that will
2108    /// be dispatched to the [DirReceiver] on the other end. The `id` and
2109    /// `server_end` arguments are required, and the `flags` and `path`
2110    /// arguments are optional (a path of `.` will be used if one is not
2111    /// otherwise set).
2112    ///
2113    /// If there was an error making the connection, it will be reported as a zx.Status
2114    /// epitaph on `server_end`.
2115    ///
2116    /// Errors:
2117    ///
2118    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2119    /// - `WRONG_TYPE` if `id` was not a connector capability.
2120    DirConnectorOpen {
2121        payload: CapabilityStoreDirConnectorOpenRequest,
2122        responder: CapabilityStoreDirConnectorOpenResponder,
2123    },
2124    /// Creates a new empty dictionary in this [`CapabilityStore`] with client-assigned `id`.
2125    ///
2126    /// Errors:
2127    ///
2128    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
2129    DictionaryCreate { id: u64, responder: CapabilityStoreDictionaryCreateResponder },
2130    /// Imports a dictionary in the form of a channel.
2131    ///
2132    /// This is a legacy API to support backward compatibility with APIs that take a [Dictionary]
2133    /// channel.
2134    ///
2135    /// Errors:
2136    ///
2137    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
2138    /// - `BAD_CAPABILITY` if `client_end` was not a valid dictionary channel.
2139    DictionaryLegacyImport {
2140        id: u64,
2141        client_end: fdomain_client::Channel,
2142        responder: CapabilityStoreDictionaryLegacyImportResponder,
2143    },
2144    /// Binds a channel to the dictionary with `id`. The channel can
2145    /// be re-imported into a [CapabilityStore] with [DictionaryImportLegacy].
2146    ///
2147    /// This is a legacy API to support backward compatibility with APIs that take a [Dictionary]
2148    /// channel.
2149    ///
2150    /// Errors:
2151    ///
2152    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2153    DictionaryLegacyExport {
2154        id: u64,
2155        server_end: fdomain_client::Channel,
2156        responder: CapabilityStoreDictionaryLegacyExportResponder,
2157    },
2158    /// Inserts `item` into the dictionary with `id`. `item.value` is moved into the dictionary and
2159    /// its id is released if this call succeeds.
2160    ///
2161    /// Errors:
2162    ///
2163    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2164    /// - `WRONG_TYPE` if `id` was not a dictionary.
2165    /// - `INVALID_KEY` if `item.key` was invalid.
2166    /// - `ITEM_ALREADY_EXISTS` if the dictionary already contains an item with `item.key`.
2167    DictionaryInsert {
2168        id: u64,
2169        item: DictionaryItem,
2170        responder: CapabilityStoreDictionaryInsertResponder,
2171    },
2172    /// Get a duplicate of a capability from the dictionary with `id`, which is
2173    /// loaded into `dest_id`.
2174    ///
2175    /// Errors:
2176    ///
2177    /// - `ID_NOT_FOUND` if `id` was not a recognized capability id in this store.
2178    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
2179    /// - `WRONG_TYPE` if `id` was not a dictionary.
2180    /// - `INVALID_KEY` if `item.key` was invalid.
2181    /// - `ITEM_NOT_FOUND` if the dictionary does not contain `key`.
2182    /// - `NOT_DUPLICATABLE` if the capability could not be duplicated.
2183    DictionaryGet {
2184        id: u64,
2185        key: String,
2186        dest_id: u64,
2187        responder: CapabilityStoreDictionaryGetResponder,
2188    },
2189    /// Removes a key from the dictionary with `id`. If `dest_id` is present, loads the value
2190    /// into it, otherwise discards the value.
2191    ///
2192    /// Errors:
2193    ///
2194    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2195    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
2196    /// - `WRONG_TYPE` if `id` was not a dictionary.
2197    /// - `INVALID_KEY` if `key` was invalid.
2198    /// - `ITEM_NOT_FOUND` if the dictionary does not contain the key.
2199    DictionaryRemove {
2200        id: u64,
2201        key: String,
2202        dest_id: Option<Box<WrappedCapabilityId>>,
2203        responder: CapabilityStoreDictionaryRemoveResponder,
2204    },
2205    /// Create a new dictionary that contains a duplicate of all the entries in
2206    /// the dictionary with `id`, assigning `dest_id` to the new dictionary.
2207    /// The runtime of this method is linear in the number of top-level entries
2208    /// in the dictionary.
2209    ///
2210    /// For example, if the dictionary contains nested dictionaries, the newly
2211    /// created dictionary will contain references to those same nested
2212    /// dictionaries because the entries are duplicated rather than deep-copied.
2213    ///
2214    /// Errors:
2215    ///
2216    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2217    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
2218    /// - `WRONG_TYPE` if `id` was not a dictionary.
2219    /// - `NOT_DUPLICATABLE` if one of the capabilities in `id` could not be duplicated.
2220    DictionaryCopy { id: u64, dest_id: u64, responder: CapabilityStoreDictionaryCopyResponder },
2221    /// Enumerates the keys in the dictionary with `id`.
2222    ///
2223    /// Errors:
2224    ///
2225    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2226    /// - `WRONG_TYPE` if `id` was not a dictionary.
2227    DictionaryKeys {
2228        id: u64,
2229        iterator: fdomain_client::fidl::ServerEnd<DictionaryKeysIteratorMarker>,
2230        responder: CapabilityStoreDictionaryKeysResponder,
2231    },
2232    /// Enumerates the items (keys and values) in the dictionary with `id`.
2233    ///
2234    /// Creates a duplicate of each value (capability). If a value could not be duplicated,
2235    /// the value will be null.
2236    ///
2237    /// Errors:
2238    ///
2239    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2240    /// - `WRONG_TYPE` if `id` was not a dictionary.
2241    DictionaryEnumerate {
2242        id: u64,
2243        iterator: fdomain_client::fidl::ServerEnd<DictionaryEnumerateIteratorMarker>,
2244        responder: CapabilityStoreDictionaryEnumerateResponder,
2245    },
2246    /// Removes all the entries in this dictionary, returning them in `contents` if provided.
2247    /// If `contents` is not provided, all the items are discarded without enumerating them.
2248    ///
2249    /// Errors:
2250    ///
2251    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2252    /// - `WRONG_TYPE` if `id` was not a dictionary.
2253    DictionaryDrain {
2254        id: u64,
2255        iterator: Option<fdomain_client::fidl::ServerEnd<DictionaryDrainIteratorMarker>>,
2256        responder: CapabilityStoreDictionaryDrainResponder,
2257    },
2258    /// An interaction was received which does not match any known method.
2259    #[non_exhaustive]
2260    _UnknownMethod {
2261        /// Ordinal of the method that was called.
2262        ordinal: u64,
2263        control_handle: CapabilityStoreControlHandle,
2264        method_type: fidl::MethodType,
2265    },
2266}
2267
2268impl CapabilityStoreRequest {
2269    #[allow(irrefutable_let_patterns)]
2270    pub fn into_duplicate(self) -> Option<(u64, u64, CapabilityStoreDuplicateResponder)> {
2271        if let CapabilityStoreRequest::Duplicate { id, dest_id, responder } = self {
2272            Some((id, dest_id, responder))
2273        } else {
2274            None
2275        }
2276    }
2277
2278    #[allow(irrefutable_let_patterns)]
2279    pub fn into_drop(self) -> Option<(u64, CapabilityStoreDropResponder)> {
2280        if let CapabilityStoreRequest::Drop { id, responder } = self {
2281            Some((id, responder))
2282        } else {
2283            None
2284        }
2285    }
2286
2287    #[allow(irrefutable_let_patterns)]
2288    pub fn into_export(self) -> Option<(u64, CapabilityStoreExportResponder)> {
2289        if let CapabilityStoreRequest::Export { id, responder } = self {
2290            Some((id, responder))
2291        } else {
2292            None
2293        }
2294    }
2295
2296    #[allow(irrefutable_let_patterns)]
2297    pub fn into_import(self) -> Option<(u64, Capability, CapabilityStoreImportResponder)> {
2298        if let CapabilityStoreRequest::Import { id, capability, responder } = self {
2299            Some((id, capability, responder))
2300        } else {
2301            None
2302        }
2303    }
2304
2305    #[allow(irrefutable_let_patterns)]
2306    pub fn into_connector_create(
2307        self,
2308    ) -> Option<(
2309        u64,
2310        fdomain_client::fidl::ClientEnd<ReceiverMarker>,
2311        CapabilityStoreConnectorCreateResponder,
2312    )> {
2313        if let CapabilityStoreRequest::ConnectorCreate { id, receiver, responder } = self {
2314            Some((id, receiver, responder))
2315        } else {
2316            None
2317        }
2318    }
2319
2320    #[allow(irrefutable_let_patterns)]
2321    pub fn into_connector_open(
2322        self,
2323    ) -> Option<(u64, fdomain_client::Channel, CapabilityStoreConnectorOpenResponder)> {
2324        if let CapabilityStoreRequest::ConnectorOpen { id, server_end, responder } = self {
2325            Some((id, server_end, responder))
2326        } else {
2327            None
2328        }
2329    }
2330
2331    #[allow(irrefutable_let_patterns)]
2332    pub fn into_dir_connector_create(
2333        self,
2334    ) -> Option<(
2335        u64,
2336        fdomain_client::fidl::ClientEnd<DirReceiverMarker>,
2337        CapabilityStoreDirConnectorCreateResponder,
2338    )> {
2339        if let CapabilityStoreRequest::DirConnectorCreate { id, receiver, responder } = self {
2340            Some((id, receiver, responder))
2341        } else {
2342            None
2343        }
2344    }
2345
2346    #[allow(irrefutable_let_patterns)]
2347    pub fn into_dir_connector_open(
2348        self,
2349    ) -> Option<(CapabilityStoreDirConnectorOpenRequest, CapabilityStoreDirConnectorOpenResponder)>
2350    {
2351        if let CapabilityStoreRequest::DirConnectorOpen { payload, responder } = self {
2352            Some((payload, responder))
2353        } else {
2354            None
2355        }
2356    }
2357
2358    #[allow(irrefutable_let_patterns)]
2359    pub fn into_dictionary_create(self) -> Option<(u64, CapabilityStoreDictionaryCreateResponder)> {
2360        if let CapabilityStoreRequest::DictionaryCreate { id, responder } = self {
2361            Some((id, responder))
2362        } else {
2363            None
2364        }
2365    }
2366
2367    #[allow(irrefutable_let_patterns)]
2368    pub fn into_dictionary_legacy_import(
2369        self,
2370    ) -> Option<(u64, fdomain_client::Channel, CapabilityStoreDictionaryLegacyImportResponder)>
2371    {
2372        if let CapabilityStoreRequest::DictionaryLegacyImport { id, client_end, responder } = self {
2373            Some((id, client_end, responder))
2374        } else {
2375            None
2376        }
2377    }
2378
2379    #[allow(irrefutable_let_patterns)]
2380    pub fn into_dictionary_legacy_export(
2381        self,
2382    ) -> Option<(u64, fdomain_client::Channel, CapabilityStoreDictionaryLegacyExportResponder)>
2383    {
2384        if let CapabilityStoreRequest::DictionaryLegacyExport { id, server_end, responder } = self {
2385            Some((id, server_end, responder))
2386        } else {
2387            None
2388        }
2389    }
2390
2391    #[allow(irrefutable_let_patterns)]
2392    pub fn into_dictionary_insert(
2393        self,
2394    ) -> Option<(u64, DictionaryItem, CapabilityStoreDictionaryInsertResponder)> {
2395        if let CapabilityStoreRequest::DictionaryInsert { id, item, responder } = self {
2396            Some((id, item, responder))
2397        } else {
2398            None
2399        }
2400    }
2401
2402    #[allow(irrefutable_let_patterns)]
2403    pub fn into_dictionary_get(
2404        self,
2405    ) -> Option<(u64, String, u64, CapabilityStoreDictionaryGetResponder)> {
2406        if let CapabilityStoreRequest::DictionaryGet { id, key, dest_id, responder } = self {
2407            Some((id, key, dest_id, responder))
2408        } else {
2409            None
2410        }
2411    }
2412
2413    #[allow(irrefutable_let_patterns)]
2414    pub fn into_dictionary_remove(
2415        self,
2416    ) -> Option<(
2417        u64,
2418        String,
2419        Option<Box<WrappedCapabilityId>>,
2420        CapabilityStoreDictionaryRemoveResponder,
2421    )> {
2422        if let CapabilityStoreRequest::DictionaryRemove { id, key, dest_id, responder } = self {
2423            Some((id, key, dest_id, responder))
2424        } else {
2425            None
2426        }
2427    }
2428
2429    #[allow(irrefutable_let_patterns)]
2430    pub fn into_dictionary_copy(
2431        self,
2432    ) -> Option<(u64, u64, CapabilityStoreDictionaryCopyResponder)> {
2433        if let CapabilityStoreRequest::DictionaryCopy { id, dest_id, responder } = self {
2434            Some((id, dest_id, responder))
2435        } else {
2436            None
2437        }
2438    }
2439
2440    #[allow(irrefutable_let_patterns)]
2441    pub fn into_dictionary_keys(
2442        self,
2443    ) -> Option<(
2444        u64,
2445        fdomain_client::fidl::ServerEnd<DictionaryKeysIteratorMarker>,
2446        CapabilityStoreDictionaryKeysResponder,
2447    )> {
2448        if let CapabilityStoreRequest::DictionaryKeys { id, iterator, responder } = self {
2449            Some((id, iterator, responder))
2450        } else {
2451            None
2452        }
2453    }
2454
2455    #[allow(irrefutable_let_patterns)]
2456    pub fn into_dictionary_enumerate(
2457        self,
2458    ) -> Option<(
2459        u64,
2460        fdomain_client::fidl::ServerEnd<DictionaryEnumerateIteratorMarker>,
2461        CapabilityStoreDictionaryEnumerateResponder,
2462    )> {
2463        if let CapabilityStoreRequest::DictionaryEnumerate { id, iterator, responder } = self {
2464            Some((id, iterator, responder))
2465        } else {
2466            None
2467        }
2468    }
2469
2470    #[allow(irrefutable_let_patterns)]
2471    pub fn into_dictionary_drain(
2472        self,
2473    ) -> Option<(
2474        u64,
2475        Option<fdomain_client::fidl::ServerEnd<DictionaryDrainIteratorMarker>>,
2476        CapabilityStoreDictionaryDrainResponder,
2477    )> {
2478        if let CapabilityStoreRequest::DictionaryDrain { id, iterator, responder } = self {
2479            Some((id, iterator, responder))
2480        } else {
2481            None
2482        }
2483    }
2484
2485    /// Name of the method defined in FIDL
2486    pub fn method_name(&self) -> &'static str {
2487        match *self {
2488            CapabilityStoreRequest::Duplicate { .. } => "duplicate",
2489            CapabilityStoreRequest::Drop { .. } => "drop",
2490            CapabilityStoreRequest::Export { .. } => "export",
2491            CapabilityStoreRequest::Import { .. } => "import",
2492            CapabilityStoreRequest::ConnectorCreate { .. } => "connector_create",
2493            CapabilityStoreRequest::ConnectorOpen { .. } => "connector_open",
2494            CapabilityStoreRequest::DirConnectorCreate { .. } => "dir_connector_create",
2495            CapabilityStoreRequest::DirConnectorOpen { .. } => "dir_connector_open",
2496            CapabilityStoreRequest::DictionaryCreate { .. } => "dictionary_create",
2497            CapabilityStoreRequest::DictionaryLegacyImport { .. } => "dictionary_legacy_import",
2498            CapabilityStoreRequest::DictionaryLegacyExport { .. } => "dictionary_legacy_export",
2499            CapabilityStoreRequest::DictionaryInsert { .. } => "dictionary_insert",
2500            CapabilityStoreRequest::DictionaryGet { .. } => "dictionary_get",
2501            CapabilityStoreRequest::DictionaryRemove { .. } => "dictionary_remove",
2502            CapabilityStoreRequest::DictionaryCopy { .. } => "dictionary_copy",
2503            CapabilityStoreRequest::DictionaryKeys { .. } => "dictionary_keys",
2504            CapabilityStoreRequest::DictionaryEnumerate { .. } => "dictionary_enumerate",
2505            CapabilityStoreRequest::DictionaryDrain { .. } => "dictionary_drain",
2506            CapabilityStoreRequest::_UnknownMethod {
2507                method_type: fidl::MethodType::OneWay,
2508                ..
2509            } => "unknown one-way method",
2510            CapabilityStoreRequest::_UnknownMethod {
2511                method_type: fidl::MethodType::TwoWay,
2512                ..
2513            } => "unknown two-way method",
2514        }
2515    }
2516}
2517
2518#[derive(Debug, Clone)]
2519pub struct CapabilityStoreControlHandle {
2520    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
2521}
2522
2523impl fdomain_client::fidl::ControlHandle for CapabilityStoreControlHandle {
2524    fn shutdown(&self) {
2525        self.inner.shutdown()
2526    }
2527
2528    fn is_closed(&self) -> bool {
2529        self.inner.channel().is_closed()
2530    }
2531    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
2532        self.inner.channel().on_closed()
2533    }
2534}
2535
2536impl CapabilityStoreControlHandle {}
2537
2538#[must_use = "FIDL methods require a response to be sent"]
2539#[derive(Debug)]
2540pub struct CapabilityStoreDuplicateResponder {
2541    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
2542    tx_id: u32,
2543}
2544
2545/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
2546/// if the responder is dropped without sending a response, so that the client
2547/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2548impl std::ops::Drop for CapabilityStoreDuplicateResponder {
2549    fn drop(&mut self) {
2550        self.control_handle.shutdown();
2551        // Safety: drops once, never accessed again
2552        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2553    }
2554}
2555
2556impl fdomain_client::fidl::Responder for CapabilityStoreDuplicateResponder {
2557    type ControlHandle = CapabilityStoreControlHandle;
2558
2559    fn control_handle(&self) -> &CapabilityStoreControlHandle {
2560        &self.control_handle
2561    }
2562
2563    fn drop_without_shutdown(mut self) {
2564        // Safety: drops once, never accessed again due to mem::forget
2565        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2566        // Prevent Drop from running (which would shut down the channel)
2567        std::mem::forget(self);
2568    }
2569}
2570
2571impl CapabilityStoreDuplicateResponder {
2572    /// Sends a response to the FIDL transaction.
2573    ///
2574    /// Sets the channel to shutdown if an error occurs.
2575    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
2576        let _result = self.send_raw(result);
2577        if _result.is_err() {
2578            self.control_handle.shutdown();
2579        }
2580        self.drop_without_shutdown();
2581        _result
2582    }
2583
2584    /// Similar to "send" but does not shutdown the channel if an error occurs.
2585    pub fn send_no_shutdown_on_err(
2586        self,
2587        mut result: Result<(), CapabilityStoreError>,
2588    ) -> Result<(), fidl::Error> {
2589        let _result = self.send_raw(result);
2590        self.drop_without_shutdown();
2591        _result
2592    }
2593
2594    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
2595        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
2596            fidl::encoding::EmptyStruct,
2597            CapabilityStoreError,
2598        >>(
2599            fidl::encoding::FlexibleResult::new(result),
2600            self.tx_id,
2601            0x5d5d35d9c20a2184,
2602            fidl::encoding::DynamicFlags::FLEXIBLE,
2603        )
2604    }
2605}
2606
2607#[must_use = "FIDL methods require a response to be sent"]
2608#[derive(Debug)]
2609pub struct CapabilityStoreDropResponder {
2610    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
2611    tx_id: u32,
2612}
2613
2614/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
2615/// if the responder is dropped without sending a response, so that the client
2616/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2617impl std::ops::Drop for CapabilityStoreDropResponder {
2618    fn drop(&mut self) {
2619        self.control_handle.shutdown();
2620        // Safety: drops once, never accessed again
2621        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2622    }
2623}
2624
2625impl fdomain_client::fidl::Responder for CapabilityStoreDropResponder {
2626    type ControlHandle = CapabilityStoreControlHandle;
2627
2628    fn control_handle(&self) -> &CapabilityStoreControlHandle {
2629        &self.control_handle
2630    }
2631
2632    fn drop_without_shutdown(mut self) {
2633        // Safety: drops once, never accessed again due to mem::forget
2634        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2635        // Prevent Drop from running (which would shut down the channel)
2636        std::mem::forget(self);
2637    }
2638}
2639
2640impl CapabilityStoreDropResponder {
2641    /// Sends a response to the FIDL transaction.
2642    ///
2643    /// Sets the channel to shutdown if an error occurs.
2644    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
2645        let _result = self.send_raw(result);
2646        if _result.is_err() {
2647            self.control_handle.shutdown();
2648        }
2649        self.drop_without_shutdown();
2650        _result
2651    }
2652
2653    /// Similar to "send" but does not shutdown the channel if an error occurs.
2654    pub fn send_no_shutdown_on_err(
2655        self,
2656        mut result: Result<(), CapabilityStoreError>,
2657    ) -> Result<(), fidl::Error> {
2658        let _result = self.send_raw(result);
2659        self.drop_without_shutdown();
2660        _result
2661    }
2662
2663    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
2664        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
2665            fidl::encoding::EmptyStruct,
2666            CapabilityStoreError,
2667        >>(
2668            fidl::encoding::FlexibleResult::new(result),
2669            self.tx_id,
2670            0xa745c0990fc2559,
2671            fidl::encoding::DynamicFlags::FLEXIBLE,
2672        )
2673    }
2674}
2675
2676#[must_use = "FIDL methods require a response to be sent"]
2677#[derive(Debug)]
2678pub struct CapabilityStoreExportResponder {
2679    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
2680    tx_id: u32,
2681}
2682
2683/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
2684/// if the responder is dropped without sending a response, so that the client
2685/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2686impl std::ops::Drop for CapabilityStoreExportResponder {
2687    fn drop(&mut self) {
2688        self.control_handle.shutdown();
2689        // Safety: drops once, never accessed again
2690        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2691    }
2692}
2693
2694impl fdomain_client::fidl::Responder for CapabilityStoreExportResponder {
2695    type ControlHandle = CapabilityStoreControlHandle;
2696
2697    fn control_handle(&self) -> &CapabilityStoreControlHandle {
2698        &self.control_handle
2699    }
2700
2701    fn drop_without_shutdown(mut self) {
2702        // Safety: drops once, never accessed again due to mem::forget
2703        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2704        // Prevent Drop from running (which would shut down the channel)
2705        std::mem::forget(self);
2706    }
2707}
2708
2709impl CapabilityStoreExportResponder {
2710    /// Sends a response to the FIDL transaction.
2711    ///
2712    /// Sets the channel to shutdown if an error occurs.
2713    pub fn send(
2714        self,
2715        mut result: Result<Capability, CapabilityStoreError>,
2716    ) -> Result<(), fidl::Error> {
2717        let _result = self.send_raw(result);
2718        if _result.is_err() {
2719            self.control_handle.shutdown();
2720        }
2721        self.drop_without_shutdown();
2722        _result
2723    }
2724
2725    /// Similar to "send" but does not shutdown the channel if an error occurs.
2726    pub fn send_no_shutdown_on_err(
2727        self,
2728        mut result: Result<Capability, CapabilityStoreError>,
2729    ) -> Result<(), fidl::Error> {
2730        let _result = self.send_raw(result);
2731        self.drop_without_shutdown();
2732        _result
2733    }
2734
2735    fn send_raw(
2736        &self,
2737        mut result: Result<Capability, CapabilityStoreError>,
2738    ) -> Result<(), fidl::Error> {
2739        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
2740            CapabilityStoreExportResponse,
2741            CapabilityStoreError,
2742        >>(
2743            fidl::encoding::FlexibleResult::new(
2744                result.as_mut().map_err(|e| *e).map(|capability| (capability,)),
2745            ),
2746            self.tx_id,
2747            0x3237a8f4748faff,
2748            fidl::encoding::DynamicFlags::FLEXIBLE,
2749        )
2750    }
2751}
2752
2753#[must_use = "FIDL methods require a response to be sent"]
2754#[derive(Debug)]
2755pub struct CapabilityStoreImportResponder {
2756    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
2757    tx_id: u32,
2758}
2759
2760/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
2761/// if the responder is dropped without sending a response, so that the client
2762/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2763impl std::ops::Drop for CapabilityStoreImportResponder {
2764    fn drop(&mut self) {
2765        self.control_handle.shutdown();
2766        // Safety: drops once, never accessed again
2767        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2768    }
2769}
2770
2771impl fdomain_client::fidl::Responder for CapabilityStoreImportResponder {
2772    type ControlHandle = CapabilityStoreControlHandle;
2773
2774    fn control_handle(&self) -> &CapabilityStoreControlHandle {
2775        &self.control_handle
2776    }
2777
2778    fn drop_without_shutdown(mut self) {
2779        // Safety: drops once, never accessed again due to mem::forget
2780        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2781        // Prevent Drop from running (which would shut down the channel)
2782        std::mem::forget(self);
2783    }
2784}
2785
2786impl CapabilityStoreImportResponder {
2787    /// Sends a response to the FIDL transaction.
2788    ///
2789    /// Sets the channel to shutdown if an error occurs.
2790    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
2791        let _result = self.send_raw(result);
2792        if _result.is_err() {
2793            self.control_handle.shutdown();
2794        }
2795        self.drop_without_shutdown();
2796        _result
2797    }
2798
2799    /// Similar to "send" but does not shutdown the channel if an error occurs.
2800    pub fn send_no_shutdown_on_err(
2801        self,
2802        mut result: Result<(), CapabilityStoreError>,
2803    ) -> Result<(), fidl::Error> {
2804        let _result = self.send_raw(result);
2805        self.drop_without_shutdown();
2806        _result
2807    }
2808
2809    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
2810        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
2811            fidl::encoding::EmptyStruct,
2812            CapabilityStoreError,
2813        >>(
2814            fidl::encoding::FlexibleResult::new(result),
2815            self.tx_id,
2816            0x1f96157a29f4539b,
2817            fidl::encoding::DynamicFlags::FLEXIBLE,
2818        )
2819    }
2820}
2821
2822#[must_use = "FIDL methods require a response to be sent"]
2823#[derive(Debug)]
2824pub struct CapabilityStoreConnectorCreateResponder {
2825    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
2826    tx_id: u32,
2827}
2828
2829/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
2830/// if the responder is dropped without sending a response, so that the client
2831/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2832impl std::ops::Drop for CapabilityStoreConnectorCreateResponder {
2833    fn drop(&mut self) {
2834        self.control_handle.shutdown();
2835        // Safety: drops once, never accessed again
2836        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2837    }
2838}
2839
2840impl fdomain_client::fidl::Responder for CapabilityStoreConnectorCreateResponder {
2841    type ControlHandle = CapabilityStoreControlHandle;
2842
2843    fn control_handle(&self) -> &CapabilityStoreControlHandle {
2844        &self.control_handle
2845    }
2846
2847    fn drop_without_shutdown(mut self) {
2848        // Safety: drops once, never accessed again due to mem::forget
2849        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2850        // Prevent Drop from running (which would shut down the channel)
2851        std::mem::forget(self);
2852    }
2853}
2854
2855impl CapabilityStoreConnectorCreateResponder {
2856    /// Sends a response to the FIDL transaction.
2857    ///
2858    /// Sets the channel to shutdown if an error occurs.
2859    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
2860        let _result = self.send_raw(result);
2861        if _result.is_err() {
2862            self.control_handle.shutdown();
2863        }
2864        self.drop_without_shutdown();
2865        _result
2866    }
2867
2868    /// Similar to "send" but does not shutdown the channel if an error occurs.
2869    pub fn send_no_shutdown_on_err(
2870        self,
2871        mut result: Result<(), CapabilityStoreError>,
2872    ) -> Result<(), fidl::Error> {
2873        let _result = self.send_raw(result);
2874        self.drop_without_shutdown();
2875        _result
2876    }
2877
2878    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
2879        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
2880            fidl::encoding::EmptyStruct,
2881            CapabilityStoreError,
2882        >>(
2883            fidl::encoding::FlexibleResult::new(result),
2884            self.tx_id,
2885            0x29592c5d63e91c25,
2886            fidl::encoding::DynamicFlags::FLEXIBLE,
2887        )
2888    }
2889}
2890
2891#[must_use = "FIDL methods require a response to be sent"]
2892#[derive(Debug)]
2893pub struct CapabilityStoreConnectorOpenResponder {
2894    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
2895    tx_id: u32,
2896}
2897
2898/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
2899/// if the responder is dropped without sending a response, so that the client
2900/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2901impl std::ops::Drop for CapabilityStoreConnectorOpenResponder {
2902    fn drop(&mut self) {
2903        self.control_handle.shutdown();
2904        // Safety: drops once, never accessed again
2905        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2906    }
2907}
2908
2909impl fdomain_client::fidl::Responder for CapabilityStoreConnectorOpenResponder {
2910    type ControlHandle = CapabilityStoreControlHandle;
2911
2912    fn control_handle(&self) -> &CapabilityStoreControlHandle {
2913        &self.control_handle
2914    }
2915
2916    fn drop_without_shutdown(mut self) {
2917        // Safety: drops once, never accessed again due to mem::forget
2918        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2919        // Prevent Drop from running (which would shut down the channel)
2920        std::mem::forget(self);
2921    }
2922}
2923
2924impl CapabilityStoreConnectorOpenResponder {
2925    /// Sends a response to the FIDL transaction.
2926    ///
2927    /// Sets the channel to shutdown if an error occurs.
2928    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
2929        let _result = self.send_raw(result);
2930        if _result.is_err() {
2931            self.control_handle.shutdown();
2932        }
2933        self.drop_without_shutdown();
2934        _result
2935    }
2936
2937    /// Similar to "send" but does not shutdown the channel if an error occurs.
2938    pub fn send_no_shutdown_on_err(
2939        self,
2940        mut result: Result<(), CapabilityStoreError>,
2941    ) -> Result<(), fidl::Error> {
2942        let _result = self.send_raw(result);
2943        self.drop_without_shutdown();
2944        _result
2945    }
2946
2947    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
2948        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
2949            fidl::encoding::EmptyStruct,
2950            CapabilityStoreError,
2951        >>(
2952            fidl::encoding::FlexibleResult::new(result),
2953            self.tx_id,
2954            0x537e69ab40563b9f,
2955            fidl::encoding::DynamicFlags::FLEXIBLE,
2956        )
2957    }
2958}
2959
2960#[must_use = "FIDL methods require a response to be sent"]
2961#[derive(Debug)]
2962pub struct CapabilityStoreDirConnectorCreateResponder {
2963    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
2964    tx_id: u32,
2965}
2966
2967/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
2968/// if the responder is dropped without sending a response, so that the client
2969/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2970impl std::ops::Drop for CapabilityStoreDirConnectorCreateResponder {
2971    fn drop(&mut self) {
2972        self.control_handle.shutdown();
2973        // Safety: drops once, never accessed again
2974        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2975    }
2976}
2977
2978impl fdomain_client::fidl::Responder for CapabilityStoreDirConnectorCreateResponder {
2979    type ControlHandle = CapabilityStoreControlHandle;
2980
2981    fn control_handle(&self) -> &CapabilityStoreControlHandle {
2982        &self.control_handle
2983    }
2984
2985    fn drop_without_shutdown(mut self) {
2986        // Safety: drops once, never accessed again due to mem::forget
2987        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2988        // Prevent Drop from running (which would shut down the channel)
2989        std::mem::forget(self);
2990    }
2991}
2992
2993impl CapabilityStoreDirConnectorCreateResponder {
2994    /// Sends a response to the FIDL transaction.
2995    ///
2996    /// Sets the channel to shutdown if an error occurs.
2997    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
2998        let _result = self.send_raw(result);
2999        if _result.is_err() {
3000            self.control_handle.shutdown();
3001        }
3002        self.drop_without_shutdown();
3003        _result
3004    }
3005
3006    /// Similar to "send" but does not shutdown the channel if an error occurs.
3007    pub fn send_no_shutdown_on_err(
3008        self,
3009        mut result: Result<(), CapabilityStoreError>,
3010    ) -> Result<(), fidl::Error> {
3011        let _result = self.send_raw(result);
3012        self.drop_without_shutdown();
3013        _result
3014    }
3015
3016    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3017        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3018            fidl::encoding::EmptyStruct,
3019            CapabilityStoreError,
3020        >>(
3021            fidl::encoding::FlexibleResult::new(result),
3022            self.tx_id,
3023            0x186138a11ccf19bb,
3024            fidl::encoding::DynamicFlags::FLEXIBLE,
3025        )
3026    }
3027}
3028
3029#[must_use = "FIDL methods require a response to be sent"]
3030#[derive(Debug)]
3031pub struct CapabilityStoreDirConnectorOpenResponder {
3032    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3033    tx_id: u32,
3034}
3035
3036/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3037/// if the responder is dropped without sending a response, so that the client
3038/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3039impl std::ops::Drop for CapabilityStoreDirConnectorOpenResponder {
3040    fn drop(&mut self) {
3041        self.control_handle.shutdown();
3042        // Safety: drops once, never accessed again
3043        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3044    }
3045}
3046
3047impl fdomain_client::fidl::Responder for CapabilityStoreDirConnectorOpenResponder {
3048    type ControlHandle = CapabilityStoreControlHandle;
3049
3050    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3051        &self.control_handle
3052    }
3053
3054    fn drop_without_shutdown(mut self) {
3055        // Safety: drops once, never accessed again due to mem::forget
3056        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3057        // Prevent Drop from running (which would shut down the channel)
3058        std::mem::forget(self);
3059    }
3060}
3061
3062impl CapabilityStoreDirConnectorOpenResponder {
3063    /// Sends a response to the FIDL transaction.
3064    ///
3065    /// Sets the channel to shutdown if an error occurs.
3066    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3067        let _result = self.send_raw(result);
3068        if _result.is_err() {
3069            self.control_handle.shutdown();
3070        }
3071        self.drop_without_shutdown();
3072        _result
3073    }
3074
3075    /// Similar to "send" but does not shutdown the channel if an error occurs.
3076    pub fn send_no_shutdown_on_err(
3077        self,
3078        mut result: Result<(), CapabilityStoreError>,
3079    ) -> Result<(), fidl::Error> {
3080        let _result = self.send_raw(result);
3081        self.drop_without_shutdown();
3082        _result
3083    }
3084
3085    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3086        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3087            fidl::encoding::EmptyStruct,
3088            CapabilityStoreError,
3089        >>(
3090            fidl::encoding::FlexibleResult::new(result),
3091            self.tx_id,
3092            0x5650d3d6a3a13901,
3093            fidl::encoding::DynamicFlags::FLEXIBLE,
3094        )
3095    }
3096}
3097
3098#[must_use = "FIDL methods require a response to be sent"]
3099#[derive(Debug)]
3100pub struct CapabilityStoreDictionaryCreateResponder {
3101    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3102    tx_id: u32,
3103}
3104
3105/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3106/// if the responder is dropped without sending a response, so that the client
3107/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3108impl std::ops::Drop for CapabilityStoreDictionaryCreateResponder {
3109    fn drop(&mut self) {
3110        self.control_handle.shutdown();
3111        // Safety: drops once, never accessed again
3112        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3113    }
3114}
3115
3116impl fdomain_client::fidl::Responder for CapabilityStoreDictionaryCreateResponder {
3117    type ControlHandle = CapabilityStoreControlHandle;
3118
3119    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3120        &self.control_handle
3121    }
3122
3123    fn drop_without_shutdown(mut self) {
3124        // Safety: drops once, never accessed again due to mem::forget
3125        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3126        // Prevent Drop from running (which would shut down the channel)
3127        std::mem::forget(self);
3128    }
3129}
3130
3131impl CapabilityStoreDictionaryCreateResponder {
3132    /// Sends a response to the FIDL transaction.
3133    ///
3134    /// Sets the channel to shutdown if an error occurs.
3135    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3136        let _result = self.send_raw(result);
3137        if _result.is_err() {
3138            self.control_handle.shutdown();
3139        }
3140        self.drop_without_shutdown();
3141        _result
3142    }
3143
3144    /// Similar to "send" but does not shutdown the channel if an error occurs.
3145    pub fn send_no_shutdown_on_err(
3146        self,
3147        mut result: Result<(), CapabilityStoreError>,
3148    ) -> Result<(), fidl::Error> {
3149        let _result = self.send_raw(result);
3150        self.drop_without_shutdown();
3151        _result
3152    }
3153
3154    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3155        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3156            fidl::encoding::EmptyStruct,
3157            CapabilityStoreError,
3158        >>(
3159            fidl::encoding::FlexibleResult::new(result),
3160            self.tx_id,
3161            0x6997c8dfc63de093,
3162            fidl::encoding::DynamicFlags::FLEXIBLE,
3163        )
3164    }
3165}
3166
3167#[must_use = "FIDL methods require a response to be sent"]
3168#[derive(Debug)]
3169pub struct CapabilityStoreDictionaryLegacyImportResponder {
3170    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3171    tx_id: u32,
3172}
3173
3174/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3175/// if the responder is dropped without sending a response, so that the client
3176/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3177impl std::ops::Drop for CapabilityStoreDictionaryLegacyImportResponder {
3178    fn drop(&mut self) {
3179        self.control_handle.shutdown();
3180        // Safety: drops once, never accessed again
3181        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3182    }
3183}
3184
3185impl fdomain_client::fidl::Responder for CapabilityStoreDictionaryLegacyImportResponder {
3186    type ControlHandle = CapabilityStoreControlHandle;
3187
3188    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3189        &self.control_handle
3190    }
3191
3192    fn drop_without_shutdown(mut self) {
3193        // Safety: drops once, never accessed again due to mem::forget
3194        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3195        // Prevent Drop from running (which would shut down the channel)
3196        std::mem::forget(self);
3197    }
3198}
3199
3200impl CapabilityStoreDictionaryLegacyImportResponder {
3201    /// Sends a response to the FIDL transaction.
3202    ///
3203    /// Sets the channel to shutdown if an error occurs.
3204    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3205        let _result = self.send_raw(result);
3206        if _result.is_err() {
3207            self.control_handle.shutdown();
3208        }
3209        self.drop_without_shutdown();
3210        _result
3211    }
3212
3213    /// Similar to "send" but does not shutdown the channel if an error occurs.
3214    pub fn send_no_shutdown_on_err(
3215        self,
3216        mut result: Result<(), CapabilityStoreError>,
3217    ) -> Result<(), fidl::Error> {
3218        let _result = self.send_raw(result);
3219        self.drop_without_shutdown();
3220        _result
3221    }
3222
3223    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3224        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3225            fidl::encoding::EmptyStruct,
3226            CapabilityStoreError,
3227        >>(
3228            fidl::encoding::FlexibleResult::new(result),
3229            self.tx_id,
3230            0x72fd686c37b6025f,
3231            fidl::encoding::DynamicFlags::FLEXIBLE,
3232        )
3233    }
3234}
3235
3236#[must_use = "FIDL methods require a response to be sent"]
3237#[derive(Debug)]
3238pub struct CapabilityStoreDictionaryLegacyExportResponder {
3239    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3240    tx_id: u32,
3241}
3242
3243/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3244/// if the responder is dropped without sending a response, so that the client
3245/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3246impl std::ops::Drop for CapabilityStoreDictionaryLegacyExportResponder {
3247    fn drop(&mut self) {
3248        self.control_handle.shutdown();
3249        // Safety: drops once, never accessed again
3250        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3251    }
3252}
3253
3254impl fdomain_client::fidl::Responder for CapabilityStoreDictionaryLegacyExportResponder {
3255    type ControlHandle = CapabilityStoreControlHandle;
3256
3257    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3258        &self.control_handle
3259    }
3260
3261    fn drop_without_shutdown(mut self) {
3262        // Safety: drops once, never accessed again due to mem::forget
3263        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3264        // Prevent Drop from running (which would shut down the channel)
3265        std::mem::forget(self);
3266    }
3267}
3268
3269impl CapabilityStoreDictionaryLegacyExportResponder {
3270    /// Sends a response to the FIDL transaction.
3271    ///
3272    /// Sets the channel to shutdown if an error occurs.
3273    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3274        let _result = self.send_raw(result);
3275        if _result.is_err() {
3276            self.control_handle.shutdown();
3277        }
3278        self.drop_without_shutdown();
3279        _result
3280    }
3281
3282    /// Similar to "send" but does not shutdown the channel if an error occurs.
3283    pub fn send_no_shutdown_on_err(
3284        self,
3285        mut result: Result<(), CapabilityStoreError>,
3286    ) -> Result<(), fidl::Error> {
3287        let _result = self.send_raw(result);
3288        self.drop_without_shutdown();
3289        _result
3290    }
3291
3292    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3293        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3294            fidl::encoding::EmptyStruct,
3295            CapabilityStoreError,
3296        >>(
3297            fidl::encoding::FlexibleResult::new(result),
3298            self.tx_id,
3299            0x407e15cc4bde5dcd,
3300            fidl::encoding::DynamicFlags::FLEXIBLE,
3301        )
3302    }
3303}
3304
3305#[must_use = "FIDL methods require a response to be sent"]
3306#[derive(Debug)]
3307pub struct CapabilityStoreDictionaryInsertResponder {
3308    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3309    tx_id: u32,
3310}
3311
3312/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3313/// if the responder is dropped without sending a response, so that the client
3314/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3315impl std::ops::Drop for CapabilityStoreDictionaryInsertResponder {
3316    fn drop(&mut self) {
3317        self.control_handle.shutdown();
3318        // Safety: drops once, never accessed again
3319        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3320    }
3321}
3322
3323impl fdomain_client::fidl::Responder for CapabilityStoreDictionaryInsertResponder {
3324    type ControlHandle = CapabilityStoreControlHandle;
3325
3326    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3327        &self.control_handle
3328    }
3329
3330    fn drop_without_shutdown(mut self) {
3331        // Safety: drops once, never accessed again due to mem::forget
3332        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3333        // Prevent Drop from running (which would shut down the channel)
3334        std::mem::forget(self);
3335    }
3336}
3337
3338impl CapabilityStoreDictionaryInsertResponder {
3339    /// Sends a response to the FIDL transaction.
3340    ///
3341    /// Sets the channel to shutdown if an error occurs.
3342    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3343        let _result = self.send_raw(result);
3344        if _result.is_err() {
3345            self.control_handle.shutdown();
3346        }
3347        self.drop_without_shutdown();
3348        _result
3349    }
3350
3351    /// Similar to "send" but does not shutdown the channel if an error occurs.
3352    pub fn send_no_shutdown_on_err(
3353        self,
3354        mut result: Result<(), CapabilityStoreError>,
3355    ) -> Result<(), fidl::Error> {
3356        let _result = self.send_raw(result);
3357        self.drop_without_shutdown();
3358        _result
3359    }
3360
3361    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3362        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3363            fidl::encoding::EmptyStruct,
3364            CapabilityStoreError,
3365        >>(
3366            fidl::encoding::FlexibleResult::new(result),
3367            self.tx_id,
3368            0x7702183689d44c27,
3369            fidl::encoding::DynamicFlags::FLEXIBLE,
3370        )
3371    }
3372}
3373
3374#[must_use = "FIDL methods require a response to be sent"]
3375#[derive(Debug)]
3376pub struct CapabilityStoreDictionaryGetResponder {
3377    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3378    tx_id: u32,
3379}
3380
3381/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3382/// if the responder is dropped without sending a response, so that the client
3383/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3384impl std::ops::Drop for CapabilityStoreDictionaryGetResponder {
3385    fn drop(&mut self) {
3386        self.control_handle.shutdown();
3387        // Safety: drops once, never accessed again
3388        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3389    }
3390}
3391
3392impl fdomain_client::fidl::Responder for CapabilityStoreDictionaryGetResponder {
3393    type ControlHandle = CapabilityStoreControlHandle;
3394
3395    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3396        &self.control_handle
3397    }
3398
3399    fn drop_without_shutdown(mut self) {
3400        // Safety: drops once, never accessed again due to mem::forget
3401        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3402        // Prevent Drop from running (which would shut down the channel)
3403        std::mem::forget(self);
3404    }
3405}
3406
3407impl CapabilityStoreDictionaryGetResponder {
3408    /// Sends a response to the FIDL transaction.
3409    ///
3410    /// Sets the channel to shutdown if an error occurs.
3411    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3412        let _result = self.send_raw(result);
3413        if _result.is_err() {
3414            self.control_handle.shutdown();
3415        }
3416        self.drop_without_shutdown();
3417        _result
3418    }
3419
3420    /// Similar to "send" but does not shutdown the channel if an error occurs.
3421    pub fn send_no_shutdown_on_err(
3422        self,
3423        mut result: Result<(), CapabilityStoreError>,
3424    ) -> Result<(), fidl::Error> {
3425        let _result = self.send_raw(result);
3426        self.drop_without_shutdown();
3427        _result
3428    }
3429
3430    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3431        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3432            fidl::encoding::EmptyStruct,
3433            CapabilityStoreError,
3434        >>(
3435            fidl::encoding::FlexibleResult::new(result),
3436            self.tx_id,
3437            0x4d9e27538284add2,
3438            fidl::encoding::DynamicFlags::FLEXIBLE,
3439        )
3440    }
3441}
3442
3443#[must_use = "FIDL methods require a response to be sent"]
3444#[derive(Debug)]
3445pub struct CapabilityStoreDictionaryRemoveResponder {
3446    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3447    tx_id: u32,
3448}
3449
3450/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3451/// if the responder is dropped without sending a response, so that the client
3452/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3453impl std::ops::Drop for CapabilityStoreDictionaryRemoveResponder {
3454    fn drop(&mut self) {
3455        self.control_handle.shutdown();
3456        // Safety: drops once, never accessed again
3457        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3458    }
3459}
3460
3461impl fdomain_client::fidl::Responder for CapabilityStoreDictionaryRemoveResponder {
3462    type ControlHandle = CapabilityStoreControlHandle;
3463
3464    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3465        &self.control_handle
3466    }
3467
3468    fn drop_without_shutdown(mut self) {
3469        // Safety: drops once, never accessed again due to mem::forget
3470        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3471        // Prevent Drop from running (which would shut down the channel)
3472        std::mem::forget(self);
3473    }
3474}
3475
3476impl CapabilityStoreDictionaryRemoveResponder {
3477    /// Sends a response to the FIDL transaction.
3478    ///
3479    /// Sets the channel to shutdown if an error occurs.
3480    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3481        let _result = self.send_raw(result);
3482        if _result.is_err() {
3483            self.control_handle.shutdown();
3484        }
3485        self.drop_without_shutdown();
3486        _result
3487    }
3488
3489    /// Similar to "send" but does not shutdown the channel if an error occurs.
3490    pub fn send_no_shutdown_on_err(
3491        self,
3492        mut result: Result<(), CapabilityStoreError>,
3493    ) -> Result<(), fidl::Error> {
3494        let _result = self.send_raw(result);
3495        self.drop_without_shutdown();
3496        _result
3497    }
3498
3499    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3500        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3501            fidl::encoding::EmptyStruct,
3502            CapabilityStoreError,
3503        >>(
3504            fidl::encoding::FlexibleResult::new(result),
3505            self.tx_id,
3506            0x4c5c025ab05d4f3,
3507            fidl::encoding::DynamicFlags::FLEXIBLE,
3508        )
3509    }
3510}
3511
3512#[must_use = "FIDL methods require a response to be sent"]
3513#[derive(Debug)]
3514pub struct CapabilityStoreDictionaryCopyResponder {
3515    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3516    tx_id: u32,
3517}
3518
3519/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3520/// if the responder is dropped without sending a response, so that the client
3521/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3522impl std::ops::Drop for CapabilityStoreDictionaryCopyResponder {
3523    fn drop(&mut self) {
3524        self.control_handle.shutdown();
3525        // Safety: drops once, never accessed again
3526        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3527    }
3528}
3529
3530impl fdomain_client::fidl::Responder for CapabilityStoreDictionaryCopyResponder {
3531    type ControlHandle = CapabilityStoreControlHandle;
3532
3533    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3534        &self.control_handle
3535    }
3536
3537    fn drop_without_shutdown(mut self) {
3538        // Safety: drops once, never accessed again due to mem::forget
3539        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3540        // Prevent Drop from running (which would shut down the channel)
3541        std::mem::forget(self);
3542    }
3543}
3544
3545impl CapabilityStoreDictionaryCopyResponder {
3546    /// Sends a response to the FIDL transaction.
3547    ///
3548    /// Sets the channel to shutdown if an error occurs.
3549    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3550        let _result = self.send_raw(result);
3551        if _result.is_err() {
3552            self.control_handle.shutdown();
3553        }
3554        self.drop_without_shutdown();
3555        _result
3556    }
3557
3558    /// Similar to "send" but does not shutdown the channel if an error occurs.
3559    pub fn send_no_shutdown_on_err(
3560        self,
3561        mut result: Result<(), CapabilityStoreError>,
3562    ) -> Result<(), fidl::Error> {
3563        let _result = self.send_raw(result);
3564        self.drop_without_shutdown();
3565        _result
3566    }
3567
3568    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3569        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3570            fidl::encoding::EmptyStruct,
3571            CapabilityStoreError,
3572        >>(
3573            fidl::encoding::FlexibleResult::new(result),
3574            self.tx_id,
3575            0x3733ecdf4ea1b44f,
3576            fidl::encoding::DynamicFlags::FLEXIBLE,
3577        )
3578    }
3579}
3580
3581#[must_use = "FIDL methods require a response to be sent"]
3582#[derive(Debug)]
3583pub struct CapabilityStoreDictionaryKeysResponder {
3584    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3585    tx_id: u32,
3586}
3587
3588/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3589/// if the responder is dropped without sending a response, so that the client
3590/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3591impl std::ops::Drop for CapabilityStoreDictionaryKeysResponder {
3592    fn drop(&mut self) {
3593        self.control_handle.shutdown();
3594        // Safety: drops once, never accessed again
3595        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3596    }
3597}
3598
3599impl fdomain_client::fidl::Responder for CapabilityStoreDictionaryKeysResponder {
3600    type ControlHandle = CapabilityStoreControlHandle;
3601
3602    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3603        &self.control_handle
3604    }
3605
3606    fn drop_without_shutdown(mut self) {
3607        // Safety: drops once, never accessed again due to mem::forget
3608        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3609        // Prevent Drop from running (which would shut down the channel)
3610        std::mem::forget(self);
3611    }
3612}
3613
3614impl CapabilityStoreDictionaryKeysResponder {
3615    /// Sends a response to the FIDL transaction.
3616    ///
3617    /// Sets the channel to shutdown if an error occurs.
3618    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3619        let _result = self.send_raw(result);
3620        if _result.is_err() {
3621            self.control_handle.shutdown();
3622        }
3623        self.drop_without_shutdown();
3624        _result
3625    }
3626
3627    /// Similar to "send" but does not shutdown the channel if an error occurs.
3628    pub fn send_no_shutdown_on_err(
3629        self,
3630        mut result: Result<(), CapabilityStoreError>,
3631    ) -> Result<(), fidl::Error> {
3632        let _result = self.send_raw(result);
3633        self.drop_without_shutdown();
3634        _result
3635    }
3636
3637    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3638        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3639            fidl::encoding::EmptyStruct,
3640            CapabilityStoreError,
3641        >>(
3642            fidl::encoding::FlexibleResult::new(result),
3643            self.tx_id,
3644            0x84b05577ceaec9e,
3645            fidl::encoding::DynamicFlags::FLEXIBLE,
3646        )
3647    }
3648}
3649
3650#[must_use = "FIDL methods require a response to be sent"]
3651#[derive(Debug)]
3652pub struct CapabilityStoreDictionaryEnumerateResponder {
3653    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3654    tx_id: u32,
3655}
3656
3657/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3658/// if the responder is dropped without sending a response, so that the client
3659/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3660impl std::ops::Drop for CapabilityStoreDictionaryEnumerateResponder {
3661    fn drop(&mut self) {
3662        self.control_handle.shutdown();
3663        // Safety: drops once, never accessed again
3664        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3665    }
3666}
3667
3668impl fdomain_client::fidl::Responder for CapabilityStoreDictionaryEnumerateResponder {
3669    type ControlHandle = CapabilityStoreControlHandle;
3670
3671    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3672        &self.control_handle
3673    }
3674
3675    fn drop_without_shutdown(mut self) {
3676        // Safety: drops once, never accessed again due to mem::forget
3677        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3678        // Prevent Drop from running (which would shut down the channel)
3679        std::mem::forget(self);
3680    }
3681}
3682
3683impl CapabilityStoreDictionaryEnumerateResponder {
3684    /// Sends a response to the FIDL transaction.
3685    ///
3686    /// Sets the channel to shutdown if an error occurs.
3687    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3688        let _result = self.send_raw(result);
3689        if _result.is_err() {
3690            self.control_handle.shutdown();
3691        }
3692        self.drop_without_shutdown();
3693        _result
3694    }
3695
3696    /// Similar to "send" but does not shutdown the channel if an error occurs.
3697    pub fn send_no_shutdown_on_err(
3698        self,
3699        mut result: Result<(), CapabilityStoreError>,
3700    ) -> Result<(), fidl::Error> {
3701        let _result = self.send_raw(result);
3702        self.drop_without_shutdown();
3703        _result
3704    }
3705
3706    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3707        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3708            fidl::encoding::EmptyStruct,
3709            CapabilityStoreError,
3710        >>(
3711            fidl::encoding::FlexibleResult::new(result),
3712            self.tx_id,
3713            0xd6279b6ced04641,
3714            fidl::encoding::DynamicFlags::FLEXIBLE,
3715        )
3716    }
3717}
3718
3719#[must_use = "FIDL methods require a response to be sent"]
3720#[derive(Debug)]
3721pub struct CapabilityStoreDictionaryDrainResponder {
3722    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3723    tx_id: u32,
3724}
3725
3726/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3727/// if the responder is dropped without sending a response, so that the client
3728/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3729impl std::ops::Drop for CapabilityStoreDictionaryDrainResponder {
3730    fn drop(&mut self) {
3731        self.control_handle.shutdown();
3732        // Safety: drops once, never accessed again
3733        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3734    }
3735}
3736
3737impl fdomain_client::fidl::Responder for CapabilityStoreDictionaryDrainResponder {
3738    type ControlHandle = CapabilityStoreControlHandle;
3739
3740    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3741        &self.control_handle
3742    }
3743
3744    fn drop_without_shutdown(mut self) {
3745        // Safety: drops once, never accessed again due to mem::forget
3746        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3747        // Prevent Drop from running (which would shut down the channel)
3748        std::mem::forget(self);
3749    }
3750}
3751
3752impl CapabilityStoreDictionaryDrainResponder {
3753    /// Sends a response to the FIDL transaction.
3754    ///
3755    /// Sets the channel to shutdown if an error occurs.
3756    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3757        let _result = self.send_raw(result);
3758        if _result.is_err() {
3759            self.control_handle.shutdown();
3760        }
3761        self.drop_without_shutdown();
3762        _result
3763    }
3764
3765    /// Similar to "send" but does not shutdown the channel if an error occurs.
3766    pub fn send_no_shutdown_on_err(
3767        self,
3768        mut result: Result<(), CapabilityStoreError>,
3769    ) -> Result<(), fidl::Error> {
3770        let _result = self.send_raw(result);
3771        self.drop_without_shutdown();
3772        _result
3773    }
3774
3775    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3776        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3777            fidl::encoding::EmptyStruct,
3778            CapabilityStoreError,
3779        >>(
3780            fidl::encoding::FlexibleResult::new(result),
3781            self.tx_id,
3782            0x28a3a3f84d928cd8,
3783            fidl::encoding::DynamicFlags::FLEXIBLE,
3784        )
3785    }
3786}
3787
3788#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3789pub struct ConnectorRouterMarker;
3790
3791impl fdomain_client::fidl::ProtocolMarker for ConnectorRouterMarker {
3792    type Proxy = ConnectorRouterProxy;
3793    type RequestStream = ConnectorRouterRequestStream;
3794
3795    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.ConnectorRouter";
3796}
3797impl fdomain_client::fidl::DiscoverableProtocolMarker for ConnectorRouterMarker {}
3798pub type ConnectorRouterRouteResult = Result<ConnectorRouterRouteResponse, RouterError>;
3799
3800pub trait ConnectorRouterProxyInterface: Send + Sync {
3801    type RouteResponseFut: std::future::Future<Output = Result<ConnectorRouterRouteResult, fidl::Error>>
3802        + Send;
3803    fn r#route(&self, payload: RouteRequest) -> Self::RouteResponseFut;
3804}
3805
3806#[derive(Debug, Clone)]
3807pub struct ConnectorRouterProxy {
3808    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
3809}
3810
3811impl fdomain_client::fidl::Proxy for ConnectorRouterProxy {
3812    type Protocol = ConnectorRouterMarker;
3813
3814    fn from_channel(inner: fdomain_client::Channel) -> Self {
3815        Self::new(inner)
3816    }
3817
3818    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
3819        self.client.into_channel().map_err(|client| Self { client })
3820    }
3821
3822    fn as_channel(&self) -> &fdomain_client::Channel {
3823        self.client.as_channel()
3824    }
3825}
3826
3827impl ConnectorRouterProxy {
3828    /// Create a new Proxy for fuchsia.component.sandbox/ConnectorRouter.
3829    pub fn new(channel: fdomain_client::Channel) -> Self {
3830        let protocol_name =
3831            <ConnectorRouterMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
3832        Self { client: fidl::client::Client::new(channel, protocol_name) }
3833    }
3834
3835    /// Get a Stream of events from the remote end of the protocol.
3836    ///
3837    /// # Panics
3838    ///
3839    /// Panics if the event stream was already taken.
3840    pub fn take_event_stream(&self) -> ConnectorRouterEventStream {
3841        ConnectorRouterEventStream { event_receiver: self.client.take_event_receiver() }
3842    }
3843
3844    pub fn r#route(
3845        &self,
3846        mut payload: RouteRequest,
3847    ) -> fidl::client::QueryResponseFut<
3848        ConnectorRouterRouteResult,
3849        fdomain_client::fidl::FDomainResourceDialect,
3850    > {
3851        ConnectorRouterProxyInterface::r#route(self, payload)
3852    }
3853}
3854
3855impl ConnectorRouterProxyInterface for ConnectorRouterProxy {
3856    type RouteResponseFut = fidl::client::QueryResponseFut<
3857        ConnectorRouterRouteResult,
3858        fdomain_client::fidl::FDomainResourceDialect,
3859    >;
3860    fn r#route(&self, mut payload: RouteRequest) -> Self::RouteResponseFut {
3861        fn _decode(
3862            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3863        ) -> Result<ConnectorRouterRouteResult, fidl::Error> {
3864            let _response = fidl::client::decode_transaction_body::<
3865                fidl::encoding::FlexibleResultType<ConnectorRouterRouteResponse, RouterError>,
3866                fdomain_client::fidl::FDomainResourceDialect,
3867                0x74dbb8bc13730766,
3868            >(_buf?)?
3869            .into_result_fdomain::<ConnectorRouterMarker>("route")?;
3870            Ok(_response.map(|x| x))
3871        }
3872        self.client.send_query_and_decode::<RouteRequest, ConnectorRouterRouteResult>(
3873            &mut payload,
3874            0x74dbb8bc13730766,
3875            fidl::encoding::DynamicFlags::FLEXIBLE,
3876            _decode,
3877        )
3878    }
3879}
3880
3881pub struct ConnectorRouterEventStream {
3882    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
3883}
3884
3885impl std::marker::Unpin for ConnectorRouterEventStream {}
3886
3887impl futures::stream::FusedStream for ConnectorRouterEventStream {
3888    fn is_terminated(&self) -> bool {
3889        self.event_receiver.is_terminated()
3890    }
3891}
3892
3893impl futures::Stream for ConnectorRouterEventStream {
3894    type Item = Result<ConnectorRouterEvent, fidl::Error>;
3895
3896    fn poll_next(
3897        mut self: std::pin::Pin<&mut Self>,
3898        cx: &mut std::task::Context<'_>,
3899    ) -> std::task::Poll<Option<Self::Item>> {
3900        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3901            &mut self.event_receiver,
3902            cx
3903        )?) {
3904            Some(buf) => std::task::Poll::Ready(Some(ConnectorRouterEvent::decode(buf))),
3905            None => std::task::Poll::Ready(None),
3906        }
3907    }
3908}
3909
3910#[derive(Debug)]
3911pub enum ConnectorRouterEvent {
3912    #[non_exhaustive]
3913    _UnknownEvent {
3914        /// Ordinal of the event that was sent.
3915        ordinal: u64,
3916    },
3917}
3918
3919impl ConnectorRouterEvent {
3920    /// Decodes a message buffer as a [`ConnectorRouterEvent`].
3921    fn decode(
3922        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3923    ) -> Result<ConnectorRouterEvent, fidl::Error> {
3924        let (bytes, _handles) = buf.split_mut();
3925        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3926        debug_assert_eq!(tx_header.tx_id, 0);
3927        match tx_header.ordinal {
3928            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
3929                Ok(ConnectorRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
3930            }
3931            _ => Err(fidl::Error::UnknownOrdinal {
3932                ordinal: tx_header.ordinal,
3933                protocol_name:
3934                    <ConnectorRouterMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
3935            }),
3936        }
3937    }
3938}
3939
3940/// A Stream of incoming requests for fuchsia.component.sandbox/ConnectorRouter.
3941pub struct ConnectorRouterRequestStream {
3942    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
3943    is_terminated: bool,
3944}
3945
3946impl std::marker::Unpin for ConnectorRouterRequestStream {}
3947
3948impl futures::stream::FusedStream for ConnectorRouterRequestStream {
3949    fn is_terminated(&self) -> bool {
3950        self.is_terminated
3951    }
3952}
3953
3954impl fdomain_client::fidl::RequestStream for ConnectorRouterRequestStream {
3955    type Protocol = ConnectorRouterMarker;
3956    type ControlHandle = ConnectorRouterControlHandle;
3957
3958    fn from_channel(channel: fdomain_client::Channel) -> Self {
3959        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3960    }
3961
3962    fn control_handle(&self) -> Self::ControlHandle {
3963        ConnectorRouterControlHandle { inner: self.inner.clone() }
3964    }
3965
3966    fn into_inner(
3967        self,
3968    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
3969    {
3970        (self.inner, self.is_terminated)
3971    }
3972
3973    fn from_inner(
3974        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
3975        is_terminated: bool,
3976    ) -> Self {
3977        Self { inner, is_terminated }
3978    }
3979}
3980
3981impl futures::Stream for ConnectorRouterRequestStream {
3982    type Item = Result<ConnectorRouterRequest, fidl::Error>;
3983
3984    fn poll_next(
3985        mut self: std::pin::Pin<&mut Self>,
3986        cx: &mut std::task::Context<'_>,
3987    ) -> std::task::Poll<Option<Self::Item>> {
3988        let this = &mut *self;
3989        if this.inner.check_shutdown(cx) {
3990            this.is_terminated = true;
3991            return std::task::Poll::Ready(None);
3992        }
3993        if this.is_terminated {
3994            panic!("polled ConnectorRouterRequestStream after completion");
3995        }
3996        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
3997            |bytes, handles| {
3998                match this.inner.channel().read_etc(cx, bytes, handles) {
3999                    std::task::Poll::Ready(Ok(())) => {}
4000                    std::task::Poll::Pending => return std::task::Poll::Pending,
4001                    std::task::Poll::Ready(Err(None)) => {
4002                        this.is_terminated = true;
4003                        return std::task::Poll::Ready(None);
4004                    }
4005                    std::task::Poll::Ready(Err(Some(e))) => {
4006                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4007                            e.into(),
4008                        ))));
4009                    }
4010                }
4011
4012                // A message has been received from the channel
4013                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4014
4015                std::task::Poll::Ready(Some(match header.ordinal {
4016                0x74dbb8bc13730766 => {
4017                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4018                    let mut req = fidl::new_empty!(RouteRequest, fdomain_client::fidl::FDomainResourceDialect);
4019                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<RouteRequest>(&header, _body_bytes, handles, &mut req)?;
4020                    let control_handle = ConnectorRouterControlHandle {
4021                        inner: this.inner.clone(),
4022                    };
4023                    Ok(ConnectorRouterRequest::Route {payload: req,
4024                        responder: ConnectorRouterRouteResponder {
4025                            control_handle: std::mem::ManuallyDrop::new(control_handle),
4026                            tx_id: header.tx_id,
4027                        },
4028                    })
4029                }
4030                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4031                    Ok(ConnectorRouterRequest::_UnknownMethod {
4032                        ordinal: header.ordinal,
4033                        control_handle: ConnectorRouterControlHandle { inner: this.inner.clone() },
4034                        method_type: fidl::MethodType::OneWay,
4035                    })
4036                }
4037                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4038                    this.inner.send_framework_err(
4039                        fidl::encoding::FrameworkErr::UnknownMethod,
4040                        header.tx_id,
4041                        header.ordinal,
4042                        header.dynamic_flags(),
4043                        (bytes, handles),
4044                    )?;
4045                    Ok(ConnectorRouterRequest::_UnknownMethod {
4046                        ordinal: header.ordinal,
4047                        control_handle: ConnectorRouterControlHandle { inner: this.inner.clone() },
4048                        method_type: fidl::MethodType::TwoWay,
4049                    })
4050                }
4051                _ => Err(fidl::Error::UnknownOrdinal {
4052                    ordinal: header.ordinal,
4053                    protocol_name: <ConnectorRouterMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
4054                }),
4055            }))
4056            },
4057        )
4058    }
4059}
4060
4061#[derive(Debug)]
4062pub enum ConnectorRouterRequest {
4063    Route {
4064        payload: RouteRequest,
4065        responder: ConnectorRouterRouteResponder,
4066    },
4067    /// An interaction was received which does not match any known method.
4068    #[non_exhaustive]
4069    _UnknownMethod {
4070        /// Ordinal of the method that was called.
4071        ordinal: u64,
4072        control_handle: ConnectorRouterControlHandle,
4073        method_type: fidl::MethodType,
4074    },
4075}
4076
4077impl ConnectorRouterRequest {
4078    #[allow(irrefutable_let_patterns)]
4079    pub fn into_route(self) -> Option<(RouteRequest, ConnectorRouterRouteResponder)> {
4080        if let ConnectorRouterRequest::Route { payload, responder } = self {
4081            Some((payload, responder))
4082        } else {
4083            None
4084        }
4085    }
4086
4087    /// Name of the method defined in FIDL
4088    pub fn method_name(&self) -> &'static str {
4089        match *self {
4090            ConnectorRouterRequest::Route { .. } => "route",
4091            ConnectorRouterRequest::_UnknownMethod {
4092                method_type: fidl::MethodType::OneWay,
4093                ..
4094            } => "unknown one-way method",
4095            ConnectorRouterRequest::_UnknownMethod {
4096                method_type: fidl::MethodType::TwoWay,
4097                ..
4098            } => "unknown two-way method",
4099        }
4100    }
4101}
4102
4103#[derive(Debug, Clone)]
4104pub struct ConnectorRouterControlHandle {
4105    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
4106}
4107
4108impl fdomain_client::fidl::ControlHandle for ConnectorRouterControlHandle {
4109    fn shutdown(&self) {
4110        self.inner.shutdown()
4111    }
4112
4113    fn is_closed(&self) -> bool {
4114        self.inner.channel().is_closed()
4115    }
4116    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
4117        self.inner.channel().on_closed()
4118    }
4119}
4120
4121impl ConnectorRouterControlHandle {}
4122
4123#[must_use = "FIDL methods require a response to be sent"]
4124#[derive(Debug)]
4125pub struct ConnectorRouterRouteResponder {
4126    control_handle: std::mem::ManuallyDrop<ConnectorRouterControlHandle>,
4127    tx_id: u32,
4128}
4129
4130/// Set the the channel to be shutdown (see [`ConnectorRouterControlHandle::shutdown`])
4131/// if the responder is dropped without sending a response, so that the client
4132/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4133impl std::ops::Drop for ConnectorRouterRouteResponder {
4134    fn drop(&mut self) {
4135        self.control_handle.shutdown();
4136        // Safety: drops once, never accessed again
4137        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4138    }
4139}
4140
4141impl fdomain_client::fidl::Responder for ConnectorRouterRouteResponder {
4142    type ControlHandle = ConnectorRouterControlHandle;
4143
4144    fn control_handle(&self) -> &ConnectorRouterControlHandle {
4145        &self.control_handle
4146    }
4147
4148    fn drop_without_shutdown(mut self) {
4149        // Safety: drops once, never accessed again due to mem::forget
4150        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4151        // Prevent Drop from running (which would shut down the channel)
4152        std::mem::forget(self);
4153    }
4154}
4155
4156impl ConnectorRouterRouteResponder {
4157    /// Sends a response to the FIDL transaction.
4158    ///
4159    /// Sets the channel to shutdown if an error occurs.
4160    pub fn send(
4161        self,
4162        mut result: Result<ConnectorRouterRouteResponse, RouterError>,
4163    ) -> Result<(), fidl::Error> {
4164        let _result = self.send_raw(result);
4165        if _result.is_err() {
4166            self.control_handle.shutdown();
4167        }
4168        self.drop_without_shutdown();
4169        _result
4170    }
4171
4172    /// Similar to "send" but does not shutdown the channel if an error occurs.
4173    pub fn send_no_shutdown_on_err(
4174        self,
4175        mut result: Result<ConnectorRouterRouteResponse, RouterError>,
4176    ) -> Result<(), fidl::Error> {
4177        let _result = self.send_raw(result);
4178        self.drop_without_shutdown();
4179        _result
4180    }
4181
4182    fn send_raw(
4183        &self,
4184        mut result: Result<ConnectorRouterRouteResponse, RouterError>,
4185    ) -> Result<(), fidl::Error> {
4186        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4187            ConnectorRouterRouteResponse,
4188            RouterError,
4189        >>(
4190            fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
4191            self.tx_id,
4192            0x74dbb8bc13730766,
4193            fidl::encoding::DynamicFlags::FLEXIBLE,
4194        )
4195    }
4196}
4197
4198#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4199pub struct DataRouterMarker;
4200
4201impl fdomain_client::fidl::ProtocolMarker for DataRouterMarker {
4202    type Proxy = DataRouterProxy;
4203    type RequestStream = DataRouterRequestStream;
4204
4205    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.DataRouter";
4206}
4207impl fdomain_client::fidl::DiscoverableProtocolMarker for DataRouterMarker {}
4208pub type DataRouterRouteResult = Result<DataRouterRouteResponse, RouterError>;
4209
4210pub trait DataRouterProxyInterface: Send + Sync {
4211    type RouteResponseFut: std::future::Future<Output = Result<DataRouterRouteResult, fidl::Error>>
4212        + Send;
4213    fn r#route(&self, payload: RouteRequest) -> Self::RouteResponseFut;
4214}
4215
4216#[derive(Debug, Clone)]
4217pub struct DataRouterProxy {
4218    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
4219}
4220
4221impl fdomain_client::fidl::Proxy for DataRouterProxy {
4222    type Protocol = DataRouterMarker;
4223
4224    fn from_channel(inner: fdomain_client::Channel) -> Self {
4225        Self::new(inner)
4226    }
4227
4228    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
4229        self.client.into_channel().map_err(|client| Self { client })
4230    }
4231
4232    fn as_channel(&self) -> &fdomain_client::Channel {
4233        self.client.as_channel()
4234    }
4235}
4236
4237impl DataRouterProxy {
4238    /// Create a new Proxy for fuchsia.component.sandbox/DataRouter.
4239    pub fn new(channel: fdomain_client::Channel) -> Self {
4240        let protocol_name = <DataRouterMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
4241        Self { client: fidl::client::Client::new(channel, protocol_name) }
4242    }
4243
4244    /// Get a Stream of events from the remote end of the protocol.
4245    ///
4246    /// # Panics
4247    ///
4248    /// Panics if the event stream was already taken.
4249    pub fn take_event_stream(&self) -> DataRouterEventStream {
4250        DataRouterEventStream { event_receiver: self.client.take_event_receiver() }
4251    }
4252
4253    pub fn r#route(
4254        &self,
4255        mut payload: RouteRequest,
4256    ) -> fidl::client::QueryResponseFut<
4257        DataRouterRouteResult,
4258        fdomain_client::fidl::FDomainResourceDialect,
4259    > {
4260        DataRouterProxyInterface::r#route(self, payload)
4261    }
4262}
4263
4264impl DataRouterProxyInterface for DataRouterProxy {
4265    type RouteResponseFut = fidl::client::QueryResponseFut<
4266        DataRouterRouteResult,
4267        fdomain_client::fidl::FDomainResourceDialect,
4268    >;
4269    fn r#route(&self, mut payload: RouteRequest) -> Self::RouteResponseFut {
4270        fn _decode(
4271            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4272        ) -> Result<DataRouterRouteResult, fidl::Error> {
4273            let _response = fidl::client::decode_transaction_body::<
4274                fidl::encoding::FlexibleResultType<DataRouterRouteResponse, RouterError>,
4275                fdomain_client::fidl::FDomainResourceDialect,
4276                0x2e87dc44dfc53804,
4277            >(_buf?)?
4278            .into_result_fdomain::<DataRouterMarker>("route")?;
4279            Ok(_response.map(|x| x))
4280        }
4281        self.client.send_query_and_decode::<RouteRequest, DataRouterRouteResult>(
4282            &mut payload,
4283            0x2e87dc44dfc53804,
4284            fidl::encoding::DynamicFlags::FLEXIBLE,
4285            _decode,
4286        )
4287    }
4288}
4289
4290pub struct DataRouterEventStream {
4291    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
4292}
4293
4294impl std::marker::Unpin for DataRouterEventStream {}
4295
4296impl futures::stream::FusedStream for DataRouterEventStream {
4297    fn is_terminated(&self) -> bool {
4298        self.event_receiver.is_terminated()
4299    }
4300}
4301
4302impl futures::Stream for DataRouterEventStream {
4303    type Item = Result<DataRouterEvent, fidl::Error>;
4304
4305    fn poll_next(
4306        mut self: std::pin::Pin<&mut Self>,
4307        cx: &mut std::task::Context<'_>,
4308    ) -> std::task::Poll<Option<Self::Item>> {
4309        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4310            &mut self.event_receiver,
4311            cx
4312        )?) {
4313            Some(buf) => std::task::Poll::Ready(Some(DataRouterEvent::decode(buf))),
4314            None => std::task::Poll::Ready(None),
4315        }
4316    }
4317}
4318
4319#[derive(Debug)]
4320pub enum DataRouterEvent {
4321    #[non_exhaustive]
4322    _UnknownEvent {
4323        /// Ordinal of the event that was sent.
4324        ordinal: u64,
4325    },
4326}
4327
4328impl DataRouterEvent {
4329    /// Decodes a message buffer as a [`DataRouterEvent`].
4330    fn decode(
4331        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4332    ) -> Result<DataRouterEvent, fidl::Error> {
4333        let (bytes, _handles) = buf.split_mut();
4334        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4335        debug_assert_eq!(tx_header.tx_id, 0);
4336        match tx_header.ordinal {
4337            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4338                Ok(DataRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
4339            }
4340            _ => Err(fidl::Error::UnknownOrdinal {
4341                ordinal: tx_header.ordinal,
4342                protocol_name:
4343                    <DataRouterMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
4344            }),
4345        }
4346    }
4347}
4348
4349/// A Stream of incoming requests for fuchsia.component.sandbox/DataRouter.
4350pub struct DataRouterRequestStream {
4351    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
4352    is_terminated: bool,
4353}
4354
4355impl std::marker::Unpin for DataRouterRequestStream {}
4356
4357impl futures::stream::FusedStream for DataRouterRequestStream {
4358    fn is_terminated(&self) -> bool {
4359        self.is_terminated
4360    }
4361}
4362
4363impl fdomain_client::fidl::RequestStream for DataRouterRequestStream {
4364    type Protocol = DataRouterMarker;
4365    type ControlHandle = DataRouterControlHandle;
4366
4367    fn from_channel(channel: fdomain_client::Channel) -> Self {
4368        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4369    }
4370
4371    fn control_handle(&self) -> Self::ControlHandle {
4372        DataRouterControlHandle { inner: self.inner.clone() }
4373    }
4374
4375    fn into_inner(
4376        self,
4377    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
4378    {
4379        (self.inner, self.is_terminated)
4380    }
4381
4382    fn from_inner(
4383        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
4384        is_terminated: bool,
4385    ) -> Self {
4386        Self { inner, is_terminated }
4387    }
4388}
4389
4390impl futures::Stream for DataRouterRequestStream {
4391    type Item = Result<DataRouterRequest, fidl::Error>;
4392
4393    fn poll_next(
4394        mut self: std::pin::Pin<&mut Self>,
4395        cx: &mut std::task::Context<'_>,
4396    ) -> std::task::Poll<Option<Self::Item>> {
4397        let this = &mut *self;
4398        if this.inner.check_shutdown(cx) {
4399            this.is_terminated = true;
4400            return std::task::Poll::Ready(None);
4401        }
4402        if this.is_terminated {
4403            panic!("polled DataRouterRequestStream after completion");
4404        }
4405        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
4406            |bytes, handles| {
4407                match this.inner.channel().read_etc(cx, bytes, handles) {
4408                    std::task::Poll::Ready(Ok(())) => {}
4409                    std::task::Poll::Pending => return std::task::Poll::Pending,
4410                    std::task::Poll::Ready(Err(None)) => {
4411                        this.is_terminated = true;
4412                        return std::task::Poll::Ready(None);
4413                    }
4414                    std::task::Poll::Ready(Err(Some(e))) => {
4415                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4416                            e.into(),
4417                        ))));
4418                    }
4419                }
4420
4421                // A message has been received from the channel
4422                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4423
4424                std::task::Poll::Ready(Some(match header.ordinal {
4425                    0x2e87dc44dfc53804 => {
4426                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4427                        let mut req = fidl::new_empty!(
4428                            RouteRequest,
4429                            fdomain_client::fidl::FDomainResourceDialect
4430                        );
4431                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<RouteRequest>(&header, _body_bytes, handles, &mut req)?;
4432                        let control_handle = DataRouterControlHandle { inner: this.inner.clone() };
4433                        Ok(DataRouterRequest::Route {
4434                            payload: req,
4435                            responder: DataRouterRouteResponder {
4436                                control_handle: std::mem::ManuallyDrop::new(control_handle),
4437                                tx_id: header.tx_id,
4438                            },
4439                        })
4440                    }
4441                    _ if header.tx_id == 0
4442                        && header
4443                            .dynamic_flags()
4444                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
4445                    {
4446                        Ok(DataRouterRequest::_UnknownMethod {
4447                            ordinal: header.ordinal,
4448                            control_handle: DataRouterControlHandle { inner: this.inner.clone() },
4449                            method_type: fidl::MethodType::OneWay,
4450                        })
4451                    }
4452                    _ if header
4453                        .dynamic_flags()
4454                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
4455                    {
4456                        this.inner.send_framework_err(
4457                            fidl::encoding::FrameworkErr::UnknownMethod,
4458                            header.tx_id,
4459                            header.ordinal,
4460                            header.dynamic_flags(),
4461                            (bytes, handles),
4462                        )?;
4463                        Ok(DataRouterRequest::_UnknownMethod {
4464                            ordinal: header.ordinal,
4465                            control_handle: DataRouterControlHandle { inner: this.inner.clone() },
4466                            method_type: fidl::MethodType::TwoWay,
4467                        })
4468                    }
4469                    _ => Err(fidl::Error::UnknownOrdinal {
4470                        ordinal: header.ordinal,
4471                        protocol_name:
4472                            <DataRouterMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
4473                    }),
4474                }))
4475            },
4476        )
4477    }
4478}
4479
4480#[derive(Debug)]
4481pub enum DataRouterRequest {
4482    Route {
4483        payload: RouteRequest,
4484        responder: DataRouterRouteResponder,
4485    },
4486    /// An interaction was received which does not match any known method.
4487    #[non_exhaustive]
4488    _UnknownMethod {
4489        /// Ordinal of the method that was called.
4490        ordinal: u64,
4491        control_handle: DataRouterControlHandle,
4492        method_type: fidl::MethodType,
4493    },
4494}
4495
4496impl DataRouterRequest {
4497    #[allow(irrefutable_let_patterns)]
4498    pub fn into_route(self) -> Option<(RouteRequest, DataRouterRouteResponder)> {
4499        if let DataRouterRequest::Route { payload, responder } = self {
4500            Some((payload, responder))
4501        } else {
4502            None
4503        }
4504    }
4505
4506    /// Name of the method defined in FIDL
4507    pub fn method_name(&self) -> &'static str {
4508        match *self {
4509            DataRouterRequest::Route { .. } => "route",
4510            DataRouterRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
4511                "unknown one-way method"
4512            }
4513            DataRouterRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
4514                "unknown two-way method"
4515            }
4516        }
4517    }
4518}
4519
4520#[derive(Debug, Clone)]
4521pub struct DataRouterControlHandle {
4522    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
4523}
4524
4525impl fdomain_client::fidl::ControlHandle for DataRouterControlHandle {
4526    fn shutdown(&self) {
4527        self.inner.shutdown()
4528    }
4529
4530    fn is_closed(&self) -> bool {
4531        self.inner.channel().is_closed()
4532    }
4533    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
4534        self.inner.channel().on_closed()
4535    }
4536}
4537
4538impl DataRouterControlHandle {}
4539
4540#[must_use = "FIDL methods require a response to be sent"]
4541#[derive(Debug)]
4542pub struct DataRouterRouteResponder {
4543    control_handle: std::mem::ManuallyDrop<DataRouterControlHandle>,
4544    tx_id: u32,
4545}
4546
4547/// Set the the channel to be shutdown (see [`DataRouterControlHandle::shutdown`])
4548/// if the responder is dropped without sending a response, so that the client
4549/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4550impl std::ops::Drop for DataRouterRouteResponder {
4551    fn drop(&mut self) {
4552        self.control_handle.shutdown();
4553        // Safety: drops once, never accessed again
4554        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4555    }
4556}
4557
4558impl fdomain_client::fidl::Responder for DataRouterRouteResponder {
4559    type ControlHandle = DataRouterControlHandle;
4560
4561    fn control_handle(&self) -> &DataRouterControlHandle {
4562        &self.control_handle
4563    }
4564
4565    fn drop_without_shutdown(mut self) {
4566        // Safety: drops once, never accessed again due to mem::forget
4567        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4568        // Prevent Drop from running (which would shut down the channel)
4569        std::mem::forget(self);
4570    }
4571}
4572
4573impl DataRouterRouteResponder {
4574    /// Sends a response to the FIDL transaction.
4575    ///
4576    /// Sets the channel to shutdown if an error occurs.
4577    pub fn send(
4578        self,
4579        mut result: Result<DataRouterRouteResponse, RouterError>,
4580    ) -> Result<(), fidl::Error> {
4581        let _result = self.send_raw(result);
4582        if _result.is_err() {
4583            self.control_handle.shutdown();
4584        }
4585        self.drop_without_shutdown();
4586        _result
4587    }
4588
4589    /// Similar to "send" but does not shutdown the channel if an error occurs.
4590    pub fn send_no_shutdown_on_err(
4591        self,
4592        mut result: Result<DataRouterRouteResponse, RouterError>,
4593    ) -> Result<(), fidl::Error> {
4594        let _result = self.send_raw(result);
4595        self.drop_without_shutdown();
4596        _result
4597    }
4598
4599    fn send_raw(
4600        &self,
4601        mut result: Result<DataRouterRouteResponse, RouterError>,
4602    ) -> Result<(), fidl::Error> {
4603        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4604            DataRouterRouteResponse,
4605            RouterError,
4606        >>(
4607            fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
4608            self.tx_id,
4609            0x2e87dc44dfc53804,
4610            fidl::encoding::DynamicFlags::FLEXIBLE,
4611        )
4612    }
4613}
4614
4615#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4616pub struct DictionaryMarker;
4617
4618impl fdomain_client::fidl::ProtocolMarker for DictionaryMarker {
4619    type Proxy = DictionaryProxy;
4620    type RequestStream = DictionaryRequestStream;
4621
4622    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.Dictionary";
4623}
4624impl fdomain_client::fidl::DiscoverableProtocolMarker for DictionaryMarker {}
4625
4626pub trait DictionaryProxyInterface: Send + Sync {}
4627
4628#[derive(Debug, Clone)]
4629pub struct DictionaryProxy {
4630    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
4631}
4632
4633impl fdomain_client::fidl::Proxy for DictionaryProxy {
4634    type Protocol = DictionaryMarker;
4635
4636    fn from_channel(inner: fdomain_client::Channel) -> Self {
4637        Self::new(inner)
4638    }
4639
4640    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
4641        self.client.into_channel().map_err(|client| Self { client })
4642    }
4643
4644    fn as_channel(&self) -> &fdomain_client::Channel {
4645        self.client.as_channel()
4646    }
4647}
4648
4649impl DictionaryProxy {
4650    /// Create a new Proxy for fuchsia.component.sandbox/Dictionary.
4651    pub fn new(channel: fdomain_client::Channel) -> Self {
4652        let protocol_name = <DictionaryMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
4653        Self { client: fidl::client::Client::new(channel, protocol_name) }
4654    }
4655
4656    /// Get a Stream of events from the remote end of the protocol.
4657    ///
4658    /// # Panics
4659    ///
4660    /// Panics if the event stream was already taken.
4661    pub fn take_event_stream(&self) -> DictionaryEventStream {
4662        DictionaryEventStream { event_receiver: self.client.take_event_receiver() }
4663    }
4664}
4665
4666impl DictionaryProxyInterface for DictionaryProxy {}
4667
4668pub struct DictionaryEventStream {
4669    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
4670}
4671
4672impl std::marker::Unpin for DictionaryEventStream {}
4673
4674impl futures::stream::FusedStream for DictionaryEventStream {
4675    fn is_terminated(&self) -> bool {
4676        self.event_receiver.is_terminated()
4677    }
4678}
4679
4680impl futures::Stream for DictionaryEventStream {
4681    type Item = Result<DictionaryEvent, fidl::Error>;
4682
4683    fn poll_next(
4684        mut self: std::pin::Pin<&mut Self>,
4685        cx: &mut std::task::Context<'_>,
4686    ) -> std::task::Poll<Option<Self::Item>> {
4687        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4688            &mut self.event_receiver,
4689            cx
4690        )?) {
4691            Some(buf) => std::task::Poll::Ready(Some(DictionaryEvent::decode(buf))),
4692            None => std::task::Poll::Ready(None),
4693        }
4694    }
4695}
4696
4697#[derive(Debug)]
4698pub enum DictionaryEvent {
4699    #[non_exhaustive]
4700    _UnknownEvent {
4701        /// Ordinal of the event that was sent.
4702        ordinal: u64,
4703    },
4704}
4705
4706impl DictionaryEvent {
4707    /// Decodes a message buffer as a [`DictionaryEvent`].
4708    fn decode(
4709        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4710    ) -> Result<DictionaryEvent, fidl::Error> {
4711        let (bytes, _handles) = buf.split_mut();
4712        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4713        debug_assert_eq!(tx_header.tx_id, 0);
4714        match tx_header.ordinal {
4715            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4716                Ok(DictionaryEvent::_UnknownEvent { ordinal: tx_header.ordinal })
4717            }
4718            _ => Err(fidl::Error::UnknownOrdinal {
4719                ordinal: tx_header.ordinal,
4720                protocol_name:
4721                    <DictionaryMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
4722            }),
4723        }
4724    }
4725}
4726
4727/// A Stream of incoming requests for fuchsia.component.sandbox/Dictionary.
4728pub struct DictionaryRequestStream {
4729    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
4730    is_terminated: bool,
4731}
4732
4733impl std::marker::Unpin for DictionaryRequestStream {}
4734
4735impl futures::stream::FusedStream for DictionaryRequestStream {
4736    fn is_terminated(&self) -> bool {
4737        self.is_terminated
4738    }
4739}
4740
4741impl fdomain_client::fidl::RequestStream for DictionaryRequestStream {
4742    type Protocol = DictionaryMarker;
4743    type ControlHandle = DictionaryControlHandle;
4744
4745    fn from_channel(channel: fdomain_client::Channel) -> Self {
4746        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4747    }
4748
4749    fn control_handle(&self) -> Self::ControlHandle {
4750        DictionaryControlHandle { inner: self.inner.clone() }
4751    }
4752
4753    fn into_inner(
4754        self,
4755    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
4756    {
4757        (self.inner, self.is_terminated)
4758    }
4759
4760    fn from_inner(
4761        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
4762        is_terminated: bool,
4763    ) -> Self {
4764        Self { inner, is_terminated }
4765    }
4766}
4767
4768impl futures::Stream for DictionaryRequestStream {
4769    type Item = Result<DictionaryRequest, fidl::Error>;
4770
4771    fn poll_next(
4772        mut self: std::pin::Pin<&mut Self>,
4773        cx: &mut std::task::Context<'_>,
4774    ) -> std::task::Poll<Option<Self::Item>> {
4775        let this = &mut *self;
4776        if this.inner.check_shutdown(cx) {
4777            this.is_terminated = true;
4778            return std::task::Poll::Ready(None);
4779        }
4780        if this.is_terminated {
4781            panic!("polled DictionaryRequestStream after completion");
4782        }
4783        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
4784            |bytes, handles| {
4785                match this.inner.channel().read_etc(cx, bytes, handles) {
4786                    std::task::Poll::Ready(Ok(())) => {}
4787                    std::task::Poll::Pending => return std::task::Poll::Pending,
4788                    std::task::Poll::Ready(Err(None)) => {
4789                        this.is_terminated = true;
4790                        return std::task::Poll::Ready(None);
4791                    }
4792                    std::task::Poll::Ready(Err(Some(e))) => {
4793                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4794                            e.into(),
4795                        ))));
4796                    }
4797                }
4798
4799                // A message has been received from the channel
4800                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4801
4802                std::task::Poll::Ready(Some(match header.ordinal {
4803                    _ if header.tx_id == 0
4804                        && header
4805                            .dynamic_flags()
4806                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
4807                    {
4808                        Ok(DictionaryRequest::_UnknownMethod {
4809                            ordinal: header.ordinal,
4810                            control_handle: DictionaryControlHandle { inner: this.inner.clone() },
4811                            method_type: fidl::MethodType::OneWay,
4812                        })
4813                    }
4814                    _ if header
4815                        .dynamic_flags()
4816                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
4817                    {
4818                        this.inner.send_framework_err(
4819                            fidl::encoding::FrameworkErr::UnknownMethod,
4820                            header.tx_id,
4821                            header.ordinal,
4822                            header.dynamic_flags(),
4823                            (bytes, handles),
4824                        )?;
4825                        Ok(DictionaryRequest::_UnknownMethod {
4826                            ordinal: header.ordinal,
4827                            control_handle: DictionaryControlHandle { inner: this.inner.clone() },
4828                            method_type: fidl::MethodType::TwoWay,
4829                        })
4830                    }
4831                    _ => Err(fidl::Error::UnknownOrdinal {
4832                        ordinal: header.ordinal,
4833                        protocol_name:
4834                            <DictionaryMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
4835                    }),
4836                }))
4837            },
4838        )
4839    }
4840}
4841
4842#[derive(Debug)]
4843pub enum DictionaryRequest {
4844    /// An interaction was received which does not match any known method.
4845    #[non_exhaustive]
4846    _UnknownMethod {
4847        /// Ordinal of the method that was called.
4848        ordinal: u64,
4849        control_handle: DictionaryControlHandle,
4850        method_type: fidl::MethodType,
4851    },
4852}
4853
4854impl DictionaryRequest {
4855    /// Name of the method defined in FIDL
4856    pub fn method_name(&self) -> &'static str {
4857        match *self {
4858            DictionaryRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
4859                "unknown one-way method"
4860            }
4861            DictionaryRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
4862                "unknown two-way method"
4863            }
4864        }
4865    }
4866}
4867
4868#[derive(Debug, Clone)]
4869pub struct DictionaryControlHandle {
4870    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
4871}
4872
4873impl fdomain_client::fidl::ControlHandle for DictionaryControlHandle {
4874    fn shutdown(&self) {
4875        self.inner.shutdown()
4876    }
4877
4878    fn is_closed(&self) -> bool {
4879        self.inner.channel().is_closed()
4880    }
4881    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
4882        self.inner.channel().on_closed()
4883    }
4884}
4885
4886impl DictionaryControlHandle {}
4887
4888#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4889pub struct DictionaryDrainIteratorMarker;
4890
4891impl fdomain_client::fidl::ProtocolMarker for DictionaryDrainIteratorMarker {
4892    type Proxy = DictionaryDrainIteratorProxy;
4893    type RequestStream = DictionaryDrainIteratorRequestStream;
4894
4895    const DEBUG_NAME: &'static str = "(anonymous) DictionaryDrainIterator";
4896}
4897pub type DictionaryDrainIteratorGetNextResult =
4898    Result<(Vec<DictionaryItem>, u64), CapabilityStoreError>;
4899
4900pub trait DictionaryDrainIteratorProxyInterface: Send + Sync {
4901    type GetNextResponseFut: std::future::Future<Output = Result<DictionaryDrainIteratorGetNextResult, fidl::Error>>
4902        + Send;
4903    fn r#get_next(&self, start_id: u64, limit: u32) -> Self::GetNextResponseFut;
4904}
4905
4906#[derive(Debug, Clone)]
4907pub struct DictionaryDrainIteratorProxy {
4908    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
4909}
4910
4911impl fdomain_client::fidl::Proxy for DictionaryDrainIteratorProxy {
4912    type Protocol = DictionaryDrainIteratorMarker;
4913
4914    fn from_channel(inner: fdomain_client::Channel) -> Self {
4915        Self::new(inner)
4916    }
4917
4918    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
4919        self.client.into_channel().map_err(|client| Self { client })
4920    }
4921
4922    fn as_channel(&self) -> &fdomain_client::Channel {
4923        self.client.as_channel()
4924    }
4925}
4926
4927impl DictionaryDrainIteratorProxy {
4928    /// Create a new Proxy for fuchsia.component.sandbox/DictionaryDrainIterator.
4929    pub fn new(channel: fdomain_client::Channel) -> Self {
4930        let protocol_name =
4931            <DictionaryDrainIteratorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
4932        Self { client: fidl::client::Client::new(channel, protocol_name) }
4933    }
4934
4935    /// Get a Stream of events from the remote end of the protocol.
4936    ///
4937    /// # Panics
4938    ///
4939    /// Panics if the event stream was already taken.
4940    pub fn take_event_stream(&self) -> DictionaryDrainIteratorEventStream {
4941        DictionaryDrainIteratorEventStream { event_receiver: self.client.take_event_receiver() }
4942    }
4943
4944    /// Returns the next batch of results for a [Dictionary.Drain] call, returning up to
4945    /// `limit` results. `limit` can be at most [MAX_DICTIONARY_ITERATOR_CHUNK].
4946    ///
4947    /// Each returned capability will be assigned a monotonically increasing [CapabilityId] starting
4948    /// from `start_id`.
4949    ///
4950    /// In addition to the `items`, returns `end_id`, which is one more than the highest id reserved
4951    /// by [GetNext]. `end_id` can be used as the `start_id` for the next call to [GetNext].
4952    ///
4953    /// If [GetNext] returns an error, the server will also close the channel.
4954    ///
4955    /// Errors:
4956    ///
4957    /// - `ID_ALREADY_EXISTS` if some id in the range `[start_id, limit)` already exists in this
4958    ///   store.
4959    /// - `INVALID_ARGS` if `limit` was `0` or greater than `MAX_DICTIONARY_ITERATOR_CHUNK`.
4960    pub fn r#get_next(
4961        &self,
4962        mut start_id: u64,
4963        mut limit: u32,
4964    ) -> fidl::client::QueryResponseFut<
4965        DictionaryDrainIteratorGetNextResult,
4966        fdomain_client::fidl::FDomainResourceDialect,
4967    > {
4968        DictionaryDrainIteratorProxyInterface::r#get_next(self, start_id, limit)
4969    }
4970}
4971
4972impl DictionaryDrainIteratorProxyInterface for DictionaryDrainIteratorProxy {
4973    type GetNextResponseFut = fidl::client::QueryResponseFut<
4974        DictionaryDrainIteratorGetNextResult,
4975        fdomain_client::fidl::FDomainResourceDialect,
4976    >;
4977    fn r#get_next(&self, mut start_id: u64, mut limit: u32) -> Self::GetNextResponseFut {
4978        fn _decode(
4979            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4980        ) -> Result<DictionaryDrainIteratorGetNextResult, fidl::Error> {
4981            let _response = fidl::client::decode_transaction_body::<
4982                fidl::encoding::FlexibleResultType<
4983                    DictionaryDrainIteratorGetNextResponse,
4984                    CapabilityStoreError,
4985                >,
4986                fdomain_client::fidl::FDomainResourceDialect,
4987                0x4f8082ca1ee26061,
4988            >(_buf?)?
4989            .into_result_fdomain::<DictionaryDrainIteratorMarker>("get_next")?;
4990            Ok(_response.map(|x| (x.items, x.end_id)))
4991        }
4992        self.client.send_query_and_decode::<
4993            DictionaryDrainIteratorGetNextRequest,
4994            DictionaryDrainIteratorGetNextResult,
4995        >(
4996            (start_id, limit,),
4997            0x4f8082ca1ee26061,
4998            fidl::encoding::DynamicFlags::FLEXIBLE,
4999            _decode,
5000        )
5001    }
5002}
5003
5004pub struct DictionaryDrainIteratorEventStream {
5005    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
5006}
5007
5008impl std::marker::Unpin for DictionaryDrainIteratorEventStream {}
5009
5010impl futures::stream::FusedStream for DictionaryDrainIteratorEventStream {
5011    fn is_terminated(&self) -> bool {
5012        self.event_receiver.is_terminated()
5013    }
5014}
5015
5016impl futures::Stream for DictionaryDrainIteratorEventStream {
5017    type Item = Result<DictionaryDrainIteratorEvent, fidl::Error>;
5018
5019    fn poll_next(
5020        mut self: std::pin::Pin<&mut Self>,
5021        cx: &mut std::task::Context<'_>,
5022    ) -> std::task::Poll<Option<Self::Item>> {
5023        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5024            &mut self.event_receiver,
5025            cx
5026        )?) {
5027            Some(buf) => std::task::Poll::Ready(Some(DictionaryDrainIteratorEvent::decode(buf))),
5028            None => std::task::Poll::Ready(None),
5029        }
5030    }
5031}
5032
5033#[derive(Debug)]
5034pub enum DictionaryDrainIteratorEvent {
5035    #[non_exhaustive]
5036    _UnknownEvent {
5037        /// Ordinal of the event that was sent.
5038        ordinal: u64,
5039    },
5040}
5041
5042impl DictionaryDrainIteratorEvent {
5043    /// Decodes a message buffer as a [`DictionaryDrainIteratorEvent`].
5044    fn decode(
5045        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5046    ) -> Result<DictionaryDrainIteratorEvent, fidl::Error> {
5047        let (bytes, _handles) = buf.split_mut();
5048        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5049        debug_assert_eq!(tx_header.tx_id, 0);
5050        match tx_header.ordinal {
5051            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
5052                Ok(DictionaryDrainIteratorEvent::_UnknownEvent {
5053                    ordinal: tx_header.ordinal,
5054                })
5055            }
5056            _ => Err(fidl::Error::UnknownOrdinal {
5057                ordinal: tx_header.ordinal,
5058                protocol_name: <DictionaryDrainIteratorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
5059            })
5060        }
5061    }
5062}
5063
5064/// A Stream of incoming requests for fuchsia.component.sandbox/DictionaryDrainIterator.
5065pub struct DictionaryDrainIteratorRequestStream {
5066    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
5067    is_terminated: bool,
5068}
5069
5070impl std::marker::Unpin for DictionaryDrainIteratorRequestStream {}
5071
5072impl futures::stream::FusedStream for DictionaryDrainIteratorRequestStream {
5073    fn is_terminated(&self) -> bool {
5074        self.is_terminated
5075    }
5076}
5077
5078impl fdomain_client::fidl::RequestStream for DictionaryDrainIteratorRequestStream {
5079    type Protocol = DictionaryDrainIteratorMarker;
5080    type ControlHandle = DictionaryDrainIteratorControlHandle;
5081
5082    fn from_channel(channel: fdomain_client::Channel) -> Self {
5083        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5084    }
5085
5086    fn control_handle(&self) -> Self::ControlHandle {
5087        DictionaryDrainIteratorControlHandle { inner: self.inner.clone() }
5088    }
5089
5090    fn into_inner(
5091        self,
5092    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
5093    {
5094        (self.inner, self.is_terminated)
5095    }
5096
5097    fn from_inner(
5098        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
5099        is_terminated: bool,
5100    ) -> Self {
5101        Self { inner, is_terminated }
5102    }
5103}
5104
5105impl futures::Stream for DictionaryDrainIteratorRequestStream {
5106    type Item = Result<DictionaryDrainIteratorRequest, fidl::Error>;
5107
5108    fn poll_next(
5109        mut self: std::pin::Pin<&mut Self>,
5110        cx: &mut std::task::Context<'_>,
5111    ) -> std::task::Poll<Option<Self::Item>> {
5112        let this = &mut *self;
5113        if this.inner.check_shutdown(cx) {
5114            this.is_terminated = true;
5115            return std::task::Poll::Ready(None);
5116        }
5117        if this.is_terminated {
5118            panic!("polled DictionaryDrainIteratorRequestStream after completion");
5119        }
5120        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
5121            |bytes, handles| {
5122                match this.inner.channel().read_etc(cx, bytes, handles) {
5123                    std::task::Poll::Ready(Ok(())) => {}
5124                    std::task::Poll::Pending => return std::task::Poll::Pending,
5125                    std::task::Poll::Ready(Err(None)) => {
5126                        this.is_terminated = true;
5127                        return std::task::Poll::Ready(None);
5128                    }
5129                    std::task::Poll::Ready(Err(Some(e))) => {
5130                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5131                            e.into(),
5132                        ))));
5133                    }
5134                }
5135
5136                // A message has been received from the channel
5137                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5138
5139                std::task::Poll::Ready(Some(match header.ordinal {
5140                0x4f8082ca1ee26061 => {
5141                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5142                    let mut req = fidl::new_empty!(DictionaryDrainIteratorGetNextRequest, fdomain_client::fidl::FDomainResourceDialect);
5143                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<DictionaryDrainIteratorGetNextRequest>(&header, _body_bytes, handles, &mut req)?;
5144                    let control_handle = DictionaryDrainIteratorControlHandle {
5145                        inner: this.inner.clone(),
5146                    };
5147                    Ok(DictionaryDrainIteratorRequest::GetNext {start_id: req.start_id,
5148limit: req.limit,
5149
5150                        responder: DictionaryDrainIteratorGetNextResponder {
5151                            control_handle: std::mem::ManuallyDrop::new(control_handle),
5152                            tx_id: header.tx_id,
5153                        },
5154                    })
5155                }
5156                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
5157                    Ok(DictionaryDrainIteratorRequest::_UnknownMethod {
5158                        ordinal: header.ordinal,
5159                        control_handle: DictionaryDrainIteratorControlHandle { inner: this.inner.clone() },
5160                        method_type: fidl::MethodType::OneWay,
5161                    })
5162                }
5163                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
5164                    this.inner.send_framework_err(
5165                        fidl::encoding::FrameworkErr::UnknownMethod,
5166                        header.tx_id,
5167                        header.ordinal,
5168                        header.dynamic_flags(),
5169                        (bytes, handles),
5170                    )?;
5171                    Ok(DictionaryDrainIteratorRequest::_UnknownMethod {
5172                        ordinal: header.ordinal,
5173                        control_handle: DictionaryDrainIteratorControlHandle { inner: this.inner.clone() },
5174                        method_type: fidl::MethodType::TwoWay,
5175                    })
5176                }
5177                _ => Err(fidl::Error::UnknownOrdinal {
5178                    ordinal: header.ordinal,
5179                    protocol_name: <DictionaryDrainIteratorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
5180                }),
5181            }))
5182            },
5183        )
5184    }
5185}
5186
5187#[derive(Debug)]
5188pub enum DictionaryDrainIteratorRequest {
5189    /// Returns the next batch of results for a [Dictionary.Drain] call, returning up to
5190    /// `limit` results. `limit` can be at most [MAX_DICTIONARY_ITERATOR_CHUNK].
5191    ///
5192    /// Each returned capability will be assigned a monotonically increasing [CapabilityId] starting
5193    /// from `start_id`.
5194    ///
5195    /// In addition to the `items`, returns `end_id`, which is one more than the highest id reserved
5196    /// by [GetNext]. `end_id` can be used as the `start_id` for the next call to [GetNext].
5197    ///
5198    /// If [GetNext] returns an error, the server will also close the channel.
5199    ///
5200    /// Errors:
5201    ///
5202    /// - `ID_ALREADY_EXISTS` if some id in the range `[start_id, limit)` already exists in this
5203    ///   store.
5204    /// - `INVALID_ARGS` if `limit` was `0` or greater than `MAX_DICTIONARY_ITERATOR_CHUNK`.
5205    GetNext { start_id: u64, limit: u32, responder: DictionaryDrainIteratorGetNextResponder },
5206    /// An interaction was received which does not match any known method.
5207    #[non_exhaustive]
5208    _UnknownMethod {
5209        /// Ordinal of the method that was called.
5210        ordinal: u64,
5211        control_handle: DictionaryDrainIteratorControlHandle,
5212        method_type: fidl::MethodType,
5213    },
5214}
5215
5216impl DictionaryDrainIteratorRequest {
5217    #[allow(irrefutable_let_patterns)]
5218    pub fn into_get_next(self) -> Option<(u64, u32, DictionaryDrainIteratorGetNextResponder)> {
5219        if let DictionaryDrainIteratorRequest::GetNext { start_id, limit, responder } = self {
5220            Some((start_id, limit, responder))
5221        } else {
5222            None
5223        }
5224    }
5225
5226    /// Name of the method defined in FIDL
5227    pub fn method_name(&self) -> &'static str {
5228        match *self {
5229            DictionaryDrainIteratorRequest::GetNext { .. } => "get_next",
5230            DictionaryDrainIteratorRequest::_UnknownMethod {
5231                method_type: fidl::MethodType::OneWay,
5232                ..
5233            } => "unknown one-way method",
5234            DictionaryDrainIteratorRequest::_UnknownMethod {
5235                method_type: fidl::MethodType::TwoWay,
5236                ..
5237            } => "unknown two-way method",
5238        }
5239    }
5240}
5241
5242#[derive(Debug, Clone)]
5243pub struct DictionaryDrainIteratorControlHandle {
5244    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
5245}
5246
5247impl fdomain_client::fidl::ControlHandle for DictionaryDrainIteratorControlHandle {
5248    fn shutdown(&self) {
5249        self.inner.shutdown()
5250    }
5251
5252    fn is_closed(&self) -> bool {
5253        self.inner.channel().is_closed()
5254    }
5255    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
5256        self.inner.channel().on_closed()
5257    }
5258}
5259
5260impl DictionaryDrainIteratorControlHandle {}
5261
5262#[must_use = "FIDL methods require a response to be sent"]
5263#[derive(Debug)]
5264pub struct DictionaryDrainIteratorGetNextResponder {
5265    control_handle: std::mem::ManuallyDrop<DictionaryDrainIteratorControlHandle>,
5266    tx_id: u32,
5267}
5268
5269/// Set the the channel to be shutdown (see [`DictionaryDrainIteratorControlHandle::shutdown`])
5270/// if the responder is dropped without sending a response, so that the client
5271/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5272impl std::ops::Drop for DictionaryDrainIteratorGetNextResponder {
5273    fn drop(&mut self) {
5274        self.control_handle.shutdown();
5275        // Safety: drops once, never accessed again
5276        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5277    }
5278}
5279
5280impl fdomain_client::fidl::Responder for DictionaryDrainIteratorGetNextResponder {
5281    type ControlHandle = DictionaryDrainIteratorControlHandle;
5282
5283    fn control_handle(&self) -> &DictionaryDrainIteratorControlHandle {
5284        &self.control_handle
5285    }
5286
5287    fn drop_without_shutdown(mut self) {
5288        // Safety: drops once, never accessed again due to mem::forget
5289        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5290        // Prevent Drop from running (which would shut down the channel)
5291        std::mem::forget(self);
5292    }
5293}
5294
5295impl DictionaryDrainIteratorGetNextResponder {
5296    /// Sends a response to the FIDL transaction.
5297    ///
5298    /// Sets the channel to shutdown if an error occurs.
5299    pub fn send(
5300        self,
5301        mut result: Result<(&[DictionaryItem], u64), CapabilityStoreError>,
5302    ) -> Result<(), fidl::Error> {
5303        let _result = self.send_raw(result);
5304        if _result.is_err() {
5305            self.control_handle.shutdown();
5306        }
5307        self.drop_without_shutdown();
5308        _result
5309    }
5310
5311    /// Similar to "send" but does not shutdown the channel if an error occurs.
5312    pub fn send_no_shutdown_on_err(
5313        self,
5314        mut result: Result<(&[DictionaryItem], u64), CapabilityStoreError>,
5315    ) -> Result<(), fidl::Error> {
5316        let _result = self.send_raw(result);
5317        self.drop_without_shutdown();
5318        _result
5319    }
5320
5321    fn send_raw(
5322        &self,
5323        mut result: Result<(&[DictionaryItem], u64), CapabilityStoreError>,
5324    ) -> Result<(), fidl::Error> {
5325        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
5326            DictionaryDrainIteratorGetNextResponse,
5327            CapabilityStoreError,
5328        >>(
5329            fidl::encoding::FlexibleResult::new(result),
5330            self.tx_id,
5331            0x4f8082ca1ee26061,
5332            fidl::encoding::DynamicFlags::FLEXIBLE,
5333        )
5334    }
5335}
5336
5337#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5338pub struct DictionaryEnumerateIteratorMarker;
5339
5340impl fdomain_client::fidl::ProtocolMarker for DictionaryEnumerateIteratorMarker {
5341    type Proxy = DictionaryEnumerateIteratorProxy;
5342    type RequestStream = DictionaryEnumerateIteratorRequestStream;
5343
5344    const DEBUG_NAME: &'static str = "(anonymous) DictionaryEnumerateIterator";
5345}
5346pub type DictionaryEnumerateIteratorGetNextResult =
5347    Result<(Vec<DictionaryOptionalItem>, u64), CapabilityStoreError>;
5348
5349pub trait DictionaryEnumerateIteratorProxyInterface: Send + Sync {
5350    type GetNextResponseFut: std::future::Future<Output = Result<DictionaryEnumerateIteratorGetNextResult, fidl::Error>>
5351        + Send;
5352    fn r#get_next(&self, start_id: u64, limit: u32) -> Self::GetNextResponseFut;
5353}
5354
5355#[derive(Debug, Clone)]
5356pub struct DictionaryEnumerateIteratorProxy {
5357    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
5358}
5359
5360impl fdomain_client::fidl::Proxy for DictionaryEnumerateIteratorProxy {
5361    type Protocol = DictionaryEnumerateIteratorMarker;
5362
5363    fn from_channel(inner: fdomain_client::Channel) -> Self {
5364        Self::new(inner)
5365    }
5366
5367    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
5368        self.client.into_channel().map_err(|client| Self { client })
5369    }
5370
5371    fn as_channel(&self) -> &fdomain_client::Channel {
5372        self.client.as_channel()
5373    }
5374}
5375
5376impl DictionaryEnumerateIteratorProxy {
5377    /// Create a new Proxy for fuchsia.component.sandbox/DictionaryEnumerateIterator.
5378    pub fn new(channel: fdomain_client::Channel) -> Self {
5379        let protocol_name =
5380            <DictionaryEnumerateIteratorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
5381        Self { client: fidl::client::Client::new(channel, protocol_name) }
5382    }
5383
5384    /// Get a Stream of events from the remote end of the protocol.
5385    ///
5386    /// # Panics
5387    ///
5388    /// Panics if the event stream was already taken.
5389    pub fn take_event_stream(&self) -> DictionaryEnumerateIteratorEventStream {
5390        DictionaryEnumerateIteratorEventStream { event_receiver: self.client.take_event_receiver() }
5391    }
5392
5393    /// Returns the next batch of results for a [Dictionary.Enumerate] call, returning up to
5394    /// `limit` results. `limit` can be at most [MAX_DICTIONARY_ITERATOR_CHUNK].
5395    ///
5396    /// The value of each of `items` is a duplicate of the original capability
5397    /// ([CapabilityStore.Duplicate]), unless it could not be duplicated, it which case it will
5398    /// be null.
5399    ///
5400    /// Each returned capability will be assigned a monotonically increasing [CapabilityId] starting
5401    /// from `start_id`.
5402    ///
5403    /// In addition to the `items`, returns `end_id`, which is one more than the highest id reserved
5404    /// by [GetNext]. `end_id` can be used as the `start_id` for the next call to [GetNext].
5405    ///
5406    /// If [GetNext] returns an error, the server will also close the channel.
5407    ///
5408    /// Errors:
5409    ///
5410    /// - `ID_ALREADY_EXISTS` if some id in the range `[start_id, limit)` already exists in this
5411    ///   store.
5412    /// - `INVALID_ARGS` if `limit` was `0` or greater than `MAX_DICTIONARY_ITERATOR_CHUNK`.
5413    pub fn r#get_next(
5414        &self,
5415        mut start_id: u64,
5416        mut limit: u32,
5417    ) -> fidl::client::QueryResponseFut<
5418        DictionaryEnumerateIteratorGetNextResult,
5419        fdomain_client::fidl::FDomainResourceDialect,
5420    > {
5421        DictionaryEnumerateIteratorProxyInterface::r#get_next(self, start_id, limit)
5422    }
5423}
5424
5425impl DictionaryEnumerateIteratorProxyInterface for DictionaryEnumerateIteratorProxy {
5426    type GetNextResponseFut = fidl::client::QueryResponseFut<
5427        DictionaryEnumerateIteratorGetNextResult,
5428        fdomain_client::fidl::FDomainResourceDialect,
5429    >;
5430    fn r#get_next(&self, mut start_id: u64, mut limit: u32) -> Self::GetNextResponseFut {
5431        fn _decode(
5432            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5433        ) -> Result<DictionaryEnumerateIteratorGetNextResult, fidl::Error> {
5434            let _response = fidl::client::decode_transaction_body::<
5435                fidl::encoding::FlexibleResultType<
5436                    DictionaryEnumerateIteratorGetNextResponse,
5437                    CapabilityStoreError,
5438                >,
5439                fdomain_client::fidl::FDomainResourceDialect,
5440                0x14f8bc286512f5cf,
5441            >(_buf?)?
5442            .into_result_fdomain::<DictionaryEnumerateIteratorMarker>("get_next")?;
5443            Ok(_response.map(|x| (x.items, x.end_id)))
5444        }
5445        self.client.send_query_and_decode::<
5446            DictionaryEnumerateIteratorGetNextRequest,
5447            DictionaryEnumerateIteratorGetNextResult,
5448        >(
5449            (start_id, limit,),
5450            0x14f8bc286512f5cf,
5451            fidl::encoding::DynamicFlags::FLEXIBLE,
5452            _decode,
5453        )
5454    }
5455}
5456
5457pub struct DictionaryEnumerateIteratorEventStream {
5458    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
5459}
5460
5461impl std::marker::Unpin for DictionaryEnumerateIteratorEventStream {}
5462
5463impl futures::stream::FusedStream for DictionaryEnumerateIteratorEventStream {
5464    fn is_terminated(&self) -> bool {
5465        self.event_receiver.is_terminated()
5466    }
5467}
5468
5469impl futures::Stream for DictionaryEnumerateIteratorEventStream {
5470    type Item = Result<DictionaryEnumerateIteratorEvent, fidl::Error>;
5471
5472    fn poll_next(
5473        mut self: std::pin::Pin<&mut Self>,
5474        cx: &mut std::task::Context<'_>,
5475    ) -> std::task::Poll<Option<Self::Item>> {
5476        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5477            &mut self.event_receiver,
5478            cx
5479        )?) {
5480            Some(buf) => {
5481                std::task::Poll::Ready(Some(DictionaryEnumerateIteratorEvent::decode(buf)))
5482            }
5483            None => std::task::Poll::Ready(None),
5484        }
5485    }
5486}
5487
5488#[derive(Debug)]
5489pub enum DictionaryEnumerateIteratorEvent {
5490    #[non_exhaustive]
5491    _UnknownEvent {
5492        /// Ordinal of the event that was sent.
5493        ordinal: u64,
5494    },
5495}
5496
5497impl DictionaryEnumerateIteratorEvent {
5498    /// Decodes a message buffer as a [`DictionaryEnumerateIteratorEvent`].
5499    fn decode(
5500        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5501    ) -> Result<DictionaryEnumerateIteratorEvent, fidl::Error> {
5502        let (bytes, _handles) = buf.split_mut();
5503        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5504        debug_assert_eq!(tx_header.tx_id, 0);
5505        match tx_header.ordinal {
5506            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
5507                Ok(DictionaryEnumerateIteratorEvent::_UnknownEvent {
5508                    ordinal: tx_header.ordinal,
5509                })
5510            }
5511            _ => Err(fidl::Error::UnknownOrdinal {
5512                ordinal: tx_header.ordinal,
5513                protocol_name: <DictionaryEnumerateIteratorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
5514            })
5515        }
5516    }
5517}
5518
5519/// A Stream of incoming requests for fuchsia.component.sandbox/DictionaryEnumerateIterator.
5520pub struct DictionaryEnumerateIteratorRequestStream {
5521    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
5522    is_terminated: bool,
5523}
5524
5525impl std::marker::Unpin for DictionaryEnumerateIteratorRequestStream {}
5526
5527impl futures::stream::FusedStream for DictionaryEnumerateIteratorRequestStream {
5528    fn is_terminated(&self) -> bool {
5529        self.is_terminated
5530    }
5531}
5532
5533impl fdomain_client::fidl::RequestStream for DictionaryEnumerateIteratorRequestStream {
5534    type Protocol = DictionaryEnumerateIteratorMarker;
5535    type ControlHandle = DictionaryEnumerateIteratorControlHandle;
5536
5537    fn from_channel(channel: fdomain_client::Channel) -> Self {
5538        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5539    }
5540
5541    fn control_handle(&self) -> Self::ControlHandle {
5542        DictionaryEnumerateIteratorControlHandle { inner: self.inner.clone() }
5543    }
5544
5545    fn into_inner(
5546        self,
5547    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
5548    {
5549        (self.inner, self.is_terminated)
5550    }
5551
5552    fn from_inner(
5553        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
5554        is_terminated: bool,
5555    ) -> Self {
5556        Self { inner, is_terminated }
5557    }
5558}
5559
5560impl futures::Stream for DictionaryEnumerateIteratorRequestStream {
5561    type Item = Result<DictionaryEnumerateIteratorRequest, fidl::Error>;
5562
5563    fn poll_next(
5564        mut self: std::pin::Pin<&mut Self>,
5565        cx: &mut std::task::Context<'_>,
5566    ) -> std::task::Poll<Option<Self::Item>> {
5567        let this = &mut *self;
5568        if this.inner.check_shutdown(cx) {
5569            this.is_terminated = true;
5570            return std::task::Poll::Ready(None);
5571        }
5572        if this.is_terminated {
5573            panic!("polled DictionaryEnumerateIteratorRequestStream after completion");
5574        }
5575        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
5576            |bytes, handles| {
5577                match this.inner.channel().read_etc(cx, bytes, handles) {
5578                    std::task::Poll::Ready(Ok(())) => {}
5579                    std::task::Poll::Pending => return std::task::Poll::Pending,
5580                    std::task::Poll::Ready(Err(None)) => {
5581                        this.is_terminated = true;
5582                        return std::task::Poll::Ready(None);
5583                    }
5584                    std::task::Poll::Ready(Err(Some(e))) => {
5585                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5586                            e.into(),
5587                        ))));
5588                    }
5589                }
5590
5591                // A message has been received from the channel
5592                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5593
5594                std::task::Poll::Ready(Some(match header.ordinal {
5595                0x14f8bc286512f5cf => {
5596                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5597                    let mut req = fidl::new_empty!(DictionaryEnumerateIteratorGetNextRequest, fdomain_client::fidl::FDomainResourceDialect);
5598                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<DictionaryEnumerateIteratorGetNextRequest>(&header, _body_bytes, handles, &mut req)?;
5599                    let control_handle = DictionaryEnumerateIteratorControlHandle {
5600                        inner: this.inner.clone(),
5601                    };
5602                    Ok(DictionaryEnumerateIteratorRequest::GetNext {start_id: req.start_id,
5603limit: req.limit,
5604
5605                        responder: DictionaryEnumerateIteratorGetNextResponder {
5606                            control_handle: std::mem::ManuallyDrop::new(control_handle),
5607                            tx_id: header.tx_id,
5608                        },
5609                    })
5610                }
5611                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
5612                    Ok(DictionaryEnumerateIteratorRequest::_UnknownMethod {
5613                        ordinal: header.ordinal,
5614                        control_handle: DictionaryEnumerateIteratorControlHandle { inner: this.inner.clone() },
5615                        method_type: fidl::MethodType::OneWay,
5616                    })
5617                }
5618                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
5619                    this.inner.send_framework_err(
5620                        fidl::encoding::FrameworkErr::UnknownMethod,
5621                        header.tx_id,
5622                        header.ordinal,
5623                        header.dynamic_flags(),
5624                        (bytes, handles),
5625                    )?;
5626                    Ok(DictionaryEnumerateIteratorRequest::_UnknownMethod {
5627                        ordinal: header.ordinal,
5628                        control_handle: DictionaryEnumerateIteratorControlHandle { inner: this.inner.clone() },
5629                        method_type: fidl::MethodType::TwoWay,
5630                    })
5631                }
5632                _ => Err(fidl::Error::UnknownOrdinal {
5633                    ordinal: header.ordinal,
5634                    protocol_name: <DictionaryEnumerateIteratorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
5635                }),
5636            }))
5637            },
5638        )
5639    }
5640}
5641
5642#[derive(Debug)]
5643pub enum DictionaryEnumerateIteratorRequest {
5644    /// Returns the next batch of results for a [Dictionary.Enumerate] call, returning up to
5645    /// `limit` results. `limit` can be at most [MAX_DICTIONARY_ITERATOR_CHUNK].
5646    ///
5647    /// The value of each of `items` is a duplicate of the original capability
5648    /// ([CapabilityStore.Duplicate]), unless it could not be duplicated, it which case it will
5649    /// be null.
5650    ///
5651    /// Each returned capability will be assigned a monotonically increasing [CapabilityId] starting
5652    /// from `start_id`.
5653    ///
5654    /// In addition to the `items`, returns `end_id`, which is one more than the highest id reserved
5655    /// by [GetNext]. `end_id` can be used as the `start_id` for the next call to [GetNext].
5656    ///
5657    /// If [GetNext] returns an error, the server will also close the channel.
5658    ///
5659    /// Errors:
5660    ///
5661    /// - `ID_ALREADY_EXISTS` if some id in the range `[start_id, limit)` already exists in this
5662    ///   store.
5663    /// - `INVALID_ARGS` if `limit` was `0` or greater than `MAX_DICTIONARY_ITERATOR_CHUNK`.
5664    GetNext { start_id: u64, limit: u32, responder: DictionaryEnumerateIteratorGetNextResponder },
5665    /// An interaction was received which does not match any known method.
5666    #[non_exhaustive]
5667    _UnknownMethod {
5668        /// Ordinal of the method that was called.
5669        ordinal: u64,
5670        control_handle: DictionaryEnumerateIteratorControlHandle,
5671        method_type: fidl::MethodType,
5672    },
5673}
5674
5675impl DictionaryEnumerateIteratorRequest {
5676    #[allow(irrefutable_let_patterns)]
5677    pub fn into_get_next(self) -> Option<(u64, u32, DictionaryEnumerateIteratorGetNextResponder)> {
5678        if let DictionaryEnumerateIteratorRequest::GetNext { start_id, limit, responder } = self {
5679            Some((start_id, limit, responder))
5680        } else {
5681            None
5682        }
5683    }
5684
5685    /// Name of the method defined in FIDL
5686    pub fn method_name(&self) -> &'static str {
5687        match *self {
5688            DictionaryEnumerateIteratorRequest::GetNext { .. } => "get_next",
5689            DictionaryEnumerateIteratorRequest::_UnknownMethod {
5690                method_type: fidl::MethodType::OneWay,
5691                ..
5692            } => "unknown one-way method",
5693            DictionaryEnumerateIteratorRequest::_UnknownMethod {
5694                method_type: fidl::MethodType::TwoWay,
5695                ..
5696            } => "unknown two-way method",
5697        }
5698    }
5699}
5700
5701#[derive(Debug, Clone)]
5702pub struct DictionaryEnumerateIteratorControlHandle {
5703    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
5704}
5705
5706impl fdomain_client::fidl::ControlHandle for DictionaryEnumerateIteratorControlHandle {
5707    fn shutdown(&self) {
5708        self.inner.shutdown()
5709    }
5710
5711    fn is_closed(&self) -> bool {
5712        self.inner.channel().is_closed()
5713    }
5714    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
5715        self.inner.channel().on_closed()
5716    }
5717}
5718
5719impl DictionaryEnumerateIteratorControlHandle {}
5720
5721#[must_use = "FIDL methods require a response to be sent"]
5722#[derive(Debug)]
5723pub struct DictionaryEnumerateIteratorGetNextResponder {
5724    control_handle: std::mem::ManuallyDrop<DictionaryEnumerateIteratorControlHandle>,
5725    tx_id: u32,
5726}
5727
5728/// Set the the channel to be shutdown (see [`DictionaryEnumerateIteratorControlHandle::shutdown`])
5729/// if the responder is dropped without sending a response, so that the client
5730/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5731impl std::ops::Drop for DictionaryEnumerateIteratorGetNextResponder {
5732    fn drop(&mut self) {
5733        self.control_handle.shutdown();
5734        // Safety: drops once, never accessed again
5735        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5736    }
5737}
5738
5739impl fdomain_client::fidl::Responder for DictionaryEnumerateIteratorGetNextResponder {
5740    type ControlHandle = DictionaryEnumerateIteratorControlHandle;
5741
5742    fn control_handle(&self) -> &DictionaryEnumerateIteratorControlHandle {
5743        &self.control_handle
5744    }
5745
5746    fn drop_without_shutdown(mut self) {
5747        // Safety: drops once, never accessed again due to mem::forget
5748        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5749        // Prevent Drop from running (which would shut down the channel)
5750        std::mem::forget(self);
5751    }
5752}
5753
5754impl DictionaryEnumerateIteratorGetNextResponder {
5755    /// Sends a response to the FIDL transaction.
5756    ///
5757    /// Sets the channel to shutdown if an error occurs.
5758    pub fn send(
5759        self,
5760        mut result: Result<(Vec<DictionaryOptionalItem>, u64), CapabilityStoreError>,
5761    ) -> Result<(), fidl::Error> {
5762        let _result = self.send_raw(result);
5763        if _result.is_err() {
5764            self.control_handle.shutdown();
5765        }
5766        self.drop_without_shutdown();
5767        _result
5768    }
5769
5770    /// Similar to "send" but does not shutdown the channel if an error occurs.
5771    pub fn send_no_shutdown_on_err(
5772        self,
5773        mut result: Result<(Vec<DictionaryOptionalItem>, u64), CapabilityStoreError>,
5774    ) -> Result<(), fidl::Error> {
5775        let _result = self.send_raw(result);
5776        self.drop_without_shutdown();
5777        _result
5778    }
5779
5780    fn send_raw(
5781        &self,
5782        mut result: Result<(Vec<DictionaryOptionalItem>, u64), CapabilityStoreError>,
5783    ) -> Result<(), fidl::Error> {
5784        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
5785            DictionaryEnumerateIteratorGetNextResponse,
5786            CapabilityStoreError,
5787        >>(
5788            fidl::encoding::FlexibleResult::new(
5789                result
5790                    .as_mut()
5791                    .map_err(|e| *e)
5792                    .map(|(items, end_id)| (items.as_mut_slice(), *end_id)),
5793            ),
5794            self.tx_id,
5795            0x14f8bc286512f5cf,
5796            fidl::encoding::DynamicFlags::FLEXIBLE,
5797        )
5798    }
5799}
5800
5801#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5802pub struct DictionaryKeysIteratorMarker;
5803
5804impl fdomain_client::fidl::ProtocolMarker for DictionaryKeysIteratorMarker {
5805    type Proxy = DictionaryKeysIteratorProxy;
5806    type RequestStream = DictionaryKeysIteratorRequestStream;
5807
5808    const DEBUG_NAME: &'static str = "(anonymous) DictionaryKeysIterator";
5809}
5810
5811pub trait DictionaryKeysIteratorProxyInterface: Send + Sync {
5812    type GetNextResponseFut: std::future::Future<Output = Result<Vec<String>, fidl::Error>> + Send;
5813    fn r#get_next(&self) -> Self::GetNextResponseFut;
5814}
5815
5816#[derive(Debug, Clone)]
5817pub struct DictionaryKeysIteratorProxy {
5818    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
5819}
5820
5821impl fdomain_client::fidl::Proxy for DictionaryKeysIteratorProxy {
5822    type Protocol = DictionaryKeysIteratorMarker;
5823
5824    fn from_channel(inner: fdomain_client::Channel) -> Self {
5825        Self::new(inner)
5826    }
5827
5828    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
5829        self.client.into_channel().map_err(|client| Self { client })
5830    }
5831
5832    fn as_channel(&self) -> &fdomain_client::Channel {
5833        self.client.as_channel()
5834    }
5835}
5836
5837impl DictionaryKeysIteratorProxy {
5838    /// Create a new Proxy for fuchsia.component.sandbox/DictionaryKeysIterator.
5839    pub fn new(channel: fdomain_client::Channel) -> Self {
5840        let protocol_name =
5841            <DictionaryKeysIteratorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
5842        Self { client: fidl::client::Client::new(channel, protocol_name) }
5843    }
5844
5845    /// Get a Stream of events from the remote end of the protocol.
5846    ///
5847    /// # Panics
5848    ///
5849    /// Panics if the event stream was already taken.
5850    pub fn take_event_stream(&self) -> DictionaryKeysIteratorEventStream {
5851        DictionaryKeysIteratorEventStream { event_receiver: self.client.take_event_receiver() }
5852    }
5853
5854    pub fn r#get_next(
5855        &self,
5856    ) -> fidl::client::QueryResponseFut<Vec<String>, fdomain_client::fidl::FDomainResourceDialect>
5857    {
5858        DictionaryKeysIteratorProxyInterface::r#get_next(self)
5859    }
5860}
5861
5862impl DictionaryKeysIteratorProxyInterface for DictionaryKeysIteratorProxy {
5863    type GetNextResponseFut =
5864        fidl::client::QueryResponseFut<Vec<String>, fdomain_client::fidl::FDomainResourceDialect>;
5865    fn r#get_next(&self) -> Self::GetNextResponseFut {
5866        fn _decode(
5867            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5868        ) -> Result<Vec<String>, fidl::Error> {
5869            let _response = fidl::client::decode_transaction_body::<
5870                fidl::encoding::FlexibleType<DictionaryKeysIteratorGetNextResponse>,
5871                fdomain_client::fidl::FDomainResourceDialect,
5872                0x453828cbacca7d53,
5873            >(_buf?)?
5874            .into_result_fdomain::<DictionaryKeysIteratorMarker>("get_next")?;
5875            Ok(_response.keys)
5876        }
5877        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<String>>(
5878            (),
5879            0x453828cbacca7d53,
5880            fidl::encoding::DynamicFlags::FLEXIBLE,
5881            _decode,
5882        )
5883    }
5884}
5885
5886pub struct DictionaryKeysIteratorEventStream {
5887    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
5888}
5889
5890impl std::marker::Unpin for DictionaryKeysIteratorEventStream {}
5891
5892impl futures::stream::FusedStream for DictionaryKeysIteratorEventStream {
5893    fn is_terminated(&self) -> bool {
5894        self.event_receiver.is_terminated()
5895    }
5896}
5897
5898impl futures::Stream for DictionaryKeysIteratorEventStream {
5899    type Item = Result<DictionaryKeysIteratorEvent, fidl::Error>;
5900
5901    fn poll_next(
5902        mut self: std::pin::Pin<&mut Self>,
5903        cx: &mut std::task::Context<'_>,
5904    ) -> std::task::Poll<Option<Self::Item>> {
5905        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5906            &mut self.event_receiver,
5907            cx
5908        )?) {
5909            Some(buf) => std::task::Poll::Ready(Some(DictionaryKeysIteratorEvent::decode(buf))),
5910            None => std::task::Poll::Ready(None),
5911        }
5912    }
5913}
5914
5915#[derive(Debug)]
5916pub enum DictionaryKeysIteratorEvent {
5917    #[non_exhaustive]
5918    _UnknownEvent {
5919        /// Ordinal of the event that was sent.
5920        ordinal: u64,
5921    },
5922}
5923
5924impl DictionaryKeysIteratorEvent {
5925    /// Decodes a message buffer as a [`DictionaryKeysIteratorEvent`].
5926    fn decode(
5927        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5928    ) -> Result<DictionaryKeysIteratorEvent, fidl::Error> {
5929        let (bytes, _handles) = buf.split_mut();
5930        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5931        debug_assert_eq!(tx_header.tx_id, 0);
5932        match tx_header.ordinal {
5933            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
5934                Ok(DictionaryKeysIteratorEvent::_UnknownEvent {
5935                    ordinal: tx_header.ordinal,
5936                })
5937            }
5938            _ => Err(fidl::Error::UnknownOrdinal {
5939                ordinal: tx_header.ordinal,
5940                protocol_name: <DictionaryKeysIteratorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
5941            })
5942        }
5943    }
5944}
5945
5946/// A Stream of incoming requests for fuchsia.component.sandbox/DictionaryKeysIterator.
5947pub struct DictionaryKeysIteratorRequestStream {
5948    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
5949    is_terminated: bool,
5950}
5951
5952impl std::marker::Unpin for DictionaryKeysIteratorRequestStream {}
5953
5954impl futures::stream::FusedStream for DictionaryKeysIteratorRequestStream {
5955    fn is_terminated(&self) -> bool {
5956        self.is_terminated
5957    }
5958}
5959
5960impl fdomain_client::fidl::RequestStream for DictionaryKeysIteratorRequestStream {
5961    type Protocol = DictionaryKeysIteratorMarker;
5962    type ControlHandle = DictionaryKeysIteratorControlHandle;
5963
5964    fn from_channel(channel: fdomain_client::Channel) -> Self {
5965        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5966    }
5967
5968    fn control_handle(&self) -> Self::ControlHandle {
5969        DictionaryKeysIteratorControlHandle { inner: self.inner.clone() }
5970    }
5971
5972    fn into_inner(
5973        self,
5974    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
5975    {
5976        (self.inner, self.is_terminated)
5977    }
5978
5979    fn from_inner(
5980        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
5981        is_terminated: bool,
5982    ) -> Self {
5983        Self { inner, is_terminated }
5984    }
5985}
5986
5987impl futures::Stream for DictionaryKeysIteratorRequestStream {
5988    type Item = Result<DictionaryKeysIteratorRequest, fidl::Error>;
5989
5990    fn poll_next(
5991        mut self: std::pin::Pin<&mut Self>,
5992        cx: &mut std::task::Context<'_>,
5993    ) -> std::task::Poll<Option<Self::Item>> {
5994        let this = &mut *self;
5995        if this.inner.check_shutdown(cx) {
5996            this.is_terminated = true;
5997            return std::task::Poll::Ready(None);
5998        }
5999        if this.is_terminated {
6000            panic!("polled DictionaryKeysIteratorRequestStream after completion");
6001        }
6002        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
6003            |bytes, handles| {
6004                match this.inner.channel().read_etc(cx, bytes, handles) {
6005                    std::task::Poll::Ready(Ok(())) => {}
6006                    std::task::Poll::Pending => return std::task::Poll::Pending,
6007                    std::task::Poll::Ready(Err(None)) => {
6008                        this.is_terminated = true;
6009                        return std::task::Poll::Ready(None);
6010                    }
6011                    std::task::Poll::Ready(Err(Some(e))) => {
6012                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6013                            e.into(),
6014                        ))));
6015                    }
6016                }
6017
6018                // A message has been received from the channel
6019                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6020
6021                std::task::Poll::Ready(Some(match header.ordinal {
6022                0x453828cbacca7d53 => {
6023                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6024                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fdomain_client::fidl::FDomainResourceDialect);
6025                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6026                    let control_handle = DictionaryKeysIteratorControlHandle {
6027                        inner: this.inner.clone(),
6028                    };
6029                    Ok(DictionaryKeysIteratorRequest::GetNext {
6030                        responder: DictionaryKeysIteratorGetNextResponder {
6031                            control_handle: std::mem::ManuallyDrop::new(control_handle),
6032                            tx_id: header.tx_id,
6033                        },
6034                    })
6035                }
6036                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6037                    Ok(DictionaryKeysIteratorRequest::_UnknownMethod {
6038                        ordinal: header.ordinal,
6039                        control_handle: DictionaryKeysIteratorControlHandle { inner: this.inner.clone() },
6040                        method_type: fidl::MethodType::OneWay,
6041                    })
6042                }
6043                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6044                    this.inner.send_framework_err(
6045                        fidl::encoding::FrameworkErr::UnknownMethod,
6046                        header.tx_id,
6047                        header.ordinal,
6048                        header.dynamic_flags(),
6049                        (bytes, handles),
6050                    )?;
6051                    Ok(DictionaryKeysIteratorRequest::_UnknownMethod {
6052                        ordinal: header.ordinal,
6053                        control_handle: DictionaryKeysIteratorControlHandle { inner: this.inner.clone() },
6054                        method_type: fidl::MethodType::TwoWay,
6055                    })
6056                }
6057                _ => Err(fidl::Error::UnknownOrdinal {
6058                    ordinal: header.ordinal,
6059                    protocol_name: <DictionaryKeysIteratorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
6060                }),
6061            }))
6062            },
6063        )
6064    }
6065}
6066
6067#[derive(Debug)]
6068pub enum DictionaryKeysIteratorRequest {
6069    GetNext {
6070        responder: DictionaryKeysIteratorGetNextResponder,
6071    },
6072    /// An interaction was received which does not match any known method.
6073    #[non_exhaustive]
6074    _UnknownMethod {
6075        /// Ordinal of the method that was called.
6076        ordinal: u64,
6077        control_handle: DictionaryKeysIteratorControlHandle,
6078        method_type: fidl::MethodType,
6079    },
6080}
6081
6082impl DictionaryKeysIteratorRequest {
6083    #[allow(irrefutable_let_patterns)]
6084    pub fn into_get_next(self) -> Option<(DictionaryKeysIteratorGetNextResponder)> {
6085        if let DictionaryKeysIteratorRequest::GetNext { responder } = self {
6086            Some((responder))
6087        } else {
6088            None
6089        }
6090    }
6091
6092    /// Name of the method defined in FIDL
6093    pub fn method_name(&self) -> &'static str {
6094        match *self {
6095            DictionaryKeysIteratorRequest::GetNext { .. } => "get_next",
6096            DictionaryKeysIteratorRequest::_UnknownMethod {
6097                method_type: fidl::MethodType::OneWay,
6098                ..
6099            } => "unknown one-way method",
6100            DictionaryKeysIteratorRequest::_UnknownMethod {
6101                method_type: fidl::MethodType::TwoWay,
6102                ..
6103            } => "unknown two-way method",
6104        }
6105    }
6106}
6107
6108#[derive(Debug, Clone)]
6109pub struct DictionaryKeysIteratorControlHandle {
6110    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
6111}
6112
6113impl fdomain_client::fidl::ControlHandle for DictionaryKeysIteratorControlHandle {
6114    fn shutdown(&self) {
6115        self.inner.shutdown()
6116    }
6117
6118    fn is_closed(&self) -> bool {
6119        self.inner.channel().is_closed()
6120    }
6121    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
6122        self.inner.channel().on_closed()
6123    }
6124}
6125
6126impl DictionaryKeysIteratorControlHandle {}
6127
6128#[must_use = "FIDL methods require a response to be sent"]
6129#[derive(Debug)]
6130pub struct DictionaryKeysIteratorGetNextResponder {
6131    control_handle: std::mem::ManuallyDrop<DictionaryKeysIteratorControlHandle>,
6132    tx_id: u32,
6133}
6134
6135/// Set the the channel to be shutdown (see [`DictionaryKeysIteratorControlHandle::shutdown`])
6136/// if the responder is dropped without sending a response, so that the client
6137/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6138impl std::ops::Drop for DictionaryKeysIteratorGetNextResponder {
6139    fn drop(&mut self) {
6140        self.control_handle.shutdown();
6141        // Safety: drops once, never accessed again
6142        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6143    }
6144}
6145
6146impl fdomain_client::fidl::Responder for DictionaryKeysIteratorGetNextResponder {
6147    type ControlHandle = DictionaryKeysIteratorControlHandle;
6148
6149    fn control_handle(&self) -> &DictionaryKeysIteratorControlHandle {
6150        &self.control_handle
6151    }
6152
6153    fn drop_without_shutdown(mut self) {
6154        // Safety: drops once, never accessed again due to mem::forget
6155        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6156        // Prevent Drop from running (which would shut down the channel)
6157        std::mem::forget(self);
6158    }
6159}
6160
6161impl DictionaryKeysIteratorGetNextResponder {
6162    /// Sends a response to the FIDL transaction.
6163    ///
6164    /// Sets the channel to shutdown if an error occurs.
6165    pub fn send(self, mut keys: &[String]) -> Result<(), fidl::Error> {
6166        let _result = self.send_raw(keys);
6167        if _result.is_err() {
6168            self.control_handle.shutdown();
6169        }
6170        self.drop_without_shutdown();
6171        _result
6172    }
6173
6174    /// Similar to "send" but does not shutdown the channel if an error occurs.
6175    pub fn send_no_shutdown_on_err(self, mut keys: &[String]) -> Result<(), fidl::Error> {
6176        let _result = self.send_raw(keys);
6177        self.drop_without_shutdown();
6178        _result
6179    }
6180
6181    fn send_raw(&self, mut keys: &[String]) -> Result<(), fidl::Error> {
6182        self.control_handle
6183            .inner
6184            .send::<fidl::encoding::FlexibleType<DictionaryKeysIteratorGetNextResponse>>(
6185                fidl::encoding::Flexible::new((keys,)),
6186                self.tx_id,
6187                0x453828cbacca7d53,
6188                fidl::encoding::DynamicFlags::FLEXIBLE,
6189            )
6190    }
6191}
6192
6193#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6194pub struct DictionaryRouterMarker;
6195
6196impl fdomain_client::fidl::ProtocolMarker for DictionaryRouterMarker {
6197    type Proxy = DictionaryRouterProxy;
6198    type RequestStream = DictionaryRouterRequestStream;
6199
6200    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.DictionaryRouter";
6201}
6202impl fdomain_client::fidl::DiscoverableProtocolMarker for DictionaryRouterMarker {}
6203pub type DictionaryRouterRouteResult = Result<DictionaryRouterRouteResponse, RouterError>;
6204
6205pub trait DictionaryRouterProxyInterface: Send + Sync {
6206    type RouteResponseFut: std::future::Future<Output = Result<DictionaryRouterRouteResult, fidl::Error>>
6207        + Send;
6208    fn r#route(&self, payload: RouteRequest) -> Self::RouteResponseFut;
6209}
6210
6211#[derive(Debug, Clone)]
6212pub struct DictionaryRouterProxy {
6213    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
6214}
6215
6216impl fdomain_client::fidl::Proxy for DictionaryRouterProxy {
6217    type Protocol = DictionaryRouterMarker;
6218
6219    fn from_channel(inner: fdomain_client::Channel) -> Self {
6220        Self::new(inner)
6221    }
6222
6223    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
6224        self.client.into_channel().map_err(|client| Self { client })
6225    }
6226
6227    fn as_channel(&self) -> &fdomain_client::Channel {
6228        self.client.as_channel()
6229    }
6230}
6231
6232impl DictionaryRouterProxy {
6233    /// Create a new Proxy for fuchsia.component.sandbox/DictionaryRouter.
6234    pub fn new(channel: fdomain_client::Channel) -> Self {
6235        let protocol_name =
6236            <DictionaryRouterMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
6237        Self { client: fidl::client::Client::new(channel, protocol_name) }
6238    }
6239
6240    /// Get a Stream of events from the remote end of the protocol.
6241    ///
6242    /// # Panics
6243    ///
6244    /// Panics if the event stream was already taken.
6245    pub fn take_event_stream(&self) -> DictionaryRouterEventStream {
6246        DictionaryRouterEventStream { event_receiver: self.client.take_event_receiver() }
6247    }
6248
6249    pub fn r#route(
6250        &self,
6251        mut payload: RouteRequest,
6252    ) -> fidl::client::QueryResponseFut<
6253        DictionaryRouterRouteResult,
6254        fdomain_client::fidl::FDomainResourceDialect,
6255    > {
6256        DictionaryRouterProxyInterface::r#route(self, payload)
6257    }
6258}
6259
6260impl DictionaryRouterProxyInterface for DictionaryRouterProxy {
6261    type RouteResponseFut = fidl::client::QueryResponseFut<
6262        DictionaryRouterRouteResult,
6263        fdomain_client::fidl::FDomainResourceDialect,
6264    >;
6265    fn r#route(&self, mut payload: RouteRequest) -> Self::RouteResponseFut {
6266        fn _decode(
6267            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6268        ) -> Result<DictionaryRouterRouteResult, fidl::Error> {
6269            let _response = fidl::client::decode_transaction_body::<
6270                fidl::encoding::FlexibleResultType<DictionaryRouterRouteResponse, RouterError>,
6271                fdomain_client::fidl::FDomainResourceDialect,
6272                0x714c65bfe54bd79f,
6273            >(_buf?)?
6274            .into_result_fdomain::<DictionaryRouterMarker>("route")?;
6275            Ok(_response.map(|x| x))
6276        }
6277        self.client.send_query_and_decode::<RouteRequest, DictionaryRouterRouteResult>(
6278            &mut payload,
6279            0x714c65bfe54bd79f,
6280            fidl::encoding::DynamicFlags::FLEXIBLE,
6281            _decode,
6282        )
6283    }
6284}
6285
6286pub struct DictionaryRouterEventStream {
6287    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
6288}
6289
6290impl std::marker::Unpin for DictionaryRouterEventStream {}
6291
6292impl futures::stream::FusedStream for DictionaryRouterEventStream {
6293    fn is_terminated(&self) -> bool {
6294        self.event_receiver.is_terminated()
6295    }
6296}
6297
6298impl futures::Stream for DictionaryRouterEventStream {
6299    type Item = Result<DictionaryRouterEvent, fidl::Error>;
6300
6301    fn poll_next(
6302        mut self: std::pin::Pin<&mut Self>,
6303        cx: &mut std::task::Context<'_>,
6304    ) -> std::task::Poll<Option<Self::Item>> {
6305        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6306            &mut self.event_receiver,
6307            cx
6308        )?) {
6309            Some(buf) => std::task::Poll::Ready(Some(DictionaryRouterEvent::decode(buf))),
6310            None => std::task::Poll::Ready(None),
6311        }
6312    }
6313}
6314
6315#[derive(Debug)]
6316pub enum DictionaryRouterEvent {
6317    #[non_exhaustive]
6318    _UnknownEvent {
6319        /// Ordinal of the event that was sent.
6320        ordinal: u64,
6321    },
6322}
6323
6324impl DictionaryRouterEvent {
6325    /// Decodes a message buffer as a [`DictionaryRouterEvent`].
6326    fn decode(
6327        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6328    ) -> Result<DictionaryRouterEvent, fidl::Error> {
6329        let (bytes, _handles) = buf.split_mut();
6330        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6331        debug_assert_eq!(tx_header.tx_id, 0);
6332        match tx_header.ordinal {
6333            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6334                Ok(DictionaryRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
6335            }
6336            _ => Err(fidl::Error::UnknownOrdinal {
6337                ordinal: tx_header.ordinal,
6338                protocol_name:
6339                    <DictionaryRouterMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
6340            }),
6341        }
6342    }
6343}
6344
6345/// A Stream of incoming requests for fuchsia.component.sandbox/DictionaryRouter.
6346pub struct DictionaryRouterRequestStream {
6347    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
6348    is_terminated: bool,
6349}
6350
6351impl std::marker::Unpin for DictionaryRouterRequestStream {}
6352
6353impl futures::stream::FusedStream for DictionaryRouterRequestStream {
6354    fn is_terminated(&self) -> bool {
6355        self.is_terminated
6356    }
6357}
6358
6359impl fdomain_client::fidl::RequestStream for DictionaryRouterRequestStream {
6360    type Protocol = DictionaryRouterMarker;
6361    type ControlHandle = DictionaryRouterControlHandle;
6362
6363    fn from_channel(channel: fdomain_client::Channel) -> Self {
6364        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6365    }
6366
6367    fn control_handle(&self) -> Self::ControlHandle {
6368        DictionaryRouterControlHandle { inner: self.inner.clone() }
6369    }
6370
6371    fn into_inner(
6372        self,
6373    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
6374    {
6375        (self.inner, self.is_terminated)
6376    }
6377
6378    fn from_inner(
6379        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
6380        is_terminated: bool,
6381    ) -> Self {
6382        Self { inner, is_terminated }
6383    }
6384}
6385
6386impl futures::Stream for DictionaryRouterRequestStream {
6387    type Item = Result<DictionaryRouterRequest, fidl::Error>;
6388
6389    fn poll_next(
6390        mut self: std::pin::Pin<&mut Self>,
6391        cx: &mut std::task::Context<'_>,
6392    ) -> std::task::Poll<Option<Self::Item>> {
6393        let this = &mut *self;
6394        if this.inner.check_shutdown(cx) {
6395            this.is_terminated = true;
6396            return std::task::Poll::Ready(None);
6397        }
6398        if this.is_terminated {
6399            panic!("polled DictionaryRouterRequestStream after completion");
6400        }
6401        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
6402            |bytes, handles| {
6403                match this.inner.channel().read_etc(cx, bytes, handles) {
6404                    std::task::Poll::Ready(Ok(())) => {}
6405                    std::task::Poll::Pending => return std::task::Poll::Pending,
6406                    std::task::Poll::Ready(Err(None)) => {
6407                        this.is_terminated = true;
6408                        return std::task::Poll::Ready(None);
6409                    }
6410                    std::task::Poll::Ready(Err(Some(e))) => {
6411                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6412                            e.into(),
6413                        ))));
6414                    }
6415                }
6416
6417                // A message has been received from the channel
6418                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6419
6420                std::task::Poll::Ready(Some(match header.ordinal {
6421                0x714c65bfe54bd79f => {
6422                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6423                    let mut req = fidl::new_empty!(RouteRequest, fdomain_client::fidl::FDomainResourceDialect);
6424                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<RouteRequest>(&header, _body_bytes, handles, &mut req)?;
6425                    let control_handle = DictionaryRouterControlHandle {
6426                        inner: this.inner.clone(),
6427                    };
6428                    Ok(DictionaryRouterRequest::Route {payload: req,
6429                        responder: DictionaryRouterRouteResponder {
6430                            control_handle: std::mem::ManuallyDrop::new(control_handle),
6431                            tx_id: header.tx_id,
6432                        },
6433                    })
6434                }
6435                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6436                    Ok(DictionaryRouterRequest::_UnknownMethod {
6437                        ordinal: header.ordinal,
6438                        control_handle: DictionaryRouterControlHandle { inner: this.inner.clone() },
6439                        method_type: fidl::MethodType::OneWay,
6440                    })
6441                }
6442                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6443                    this.inner.send_framework_err(
6444                        fidl::encoding::FrameworkErr::UnknownMethod,
6445                        header.tx_id,
6446                        header.ordinal,
6447                        header.dynamic_flags(),
6448                        (bytes, handles),
6449                    )?;
6450                    Ok(DictionaryRouterRequest::_UnknownMethod {
6451                        ordinal: header.ordinal,
6452                        control_handle: DictionaryRouterControlHandle { inner: this.inner.clone() },
6453                        method_type: fidl::MethodType::TwoWay,
6454                    })
6455                }
6456                _ => Err(fidl::Error::UnknownOrdinal {
6457                    ordinal: header.ordinal,
6458                    protocol_name: <DictionaryRouterMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
6459                }),
6460            }))
6461            },
6462        )
6463    }
6464}
6465
6466#[derive(Debug)]
6467pub enum DictionaryRouterRequest {
6468    Route {
6469        payload: RouteRequest,
6470        responder: DictionaryRouterRouteResponder,
6471    },
6472    /// An interaction was received which does not match any known method.
6473    #[non_exhaustive]
6474    _UnknownMethod {
6475        /// Ordinal of the method that was called.
6476        ordinal: u64,
6477        control_handle: DictionaryRouterControlHandle,
6478        method_type: fidl::MethodType,
6479    },
6480}
6481
6482impl DictionaryRouterRequest {
6483    #[allow(irrefutable_let_patterns)]
6484    pub fn into_route(self) -> Option<(RouteRequest, DictionaryRouterRouteResponder)> {
6485        if let DictionaryRouterRequest::Route { payload, responder } = self {
6486            Some((payload, responder))
6487        } else {
6488            None
6489        }
6490    }
6491
6492    /// Name of the method defined in FIDL
6493    pub fn method_name(&self) -> &'static str {
6494        match *self {
6495            DictionaryRouterRequest::Route { .. } => "route",
6496            DictionaryRouterRequest::_UnknownMethod {
6497                method_type: fidl::MethodType::OneWay,
6498                ..
6499            } => "unknown one-way method",
6500            DictionaryRouterRequest::_UnknownMethod {
6501                method_type: fidl::MethodType::TwoWay,
6502                ..
6503            } => "unknown two-way method",
6504        }
6505    }
6506}
6507
6508#[derive(Debug, Clone)]
6509pub struct DictionaryRouterControlHandle {
6510    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
6511}
6512
6513impl fdomain_client::fidl::ControlHandle for DictionaryRouterControlHandle {
6514    fn shutdown(&self) {
6515        self.inner.shutdown()
6516    }
6517
6518    fn is_closed(&self) -> bool {
6519        self.inner.channel().is_closed()
6520    }
6521    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
6522        self.inner.channel().on_closed()
6523    }
6524}
6525
6526impl DictionaryRouterControlHandle {}
6527
6528#[must_use = "FIDL methods require a response to be sent"]
6529#[derive(Debug)]
6530pub struct DictionaryRouterRouteResponder {
6531    control_handle: std::mem::ManuallyDrop<DictionaryRouterControlHandle>,
6532    tx_id: u32,
6533}
6534
6535/// Set the the channel to be shutdown (see [`DictionaryRouterControlHandle::shutdown`])
6536/// if the responder is dropped without sending a response, so that the client
6537/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6538impl std::ops::Drop for DictionaryRouterRouteResponder {
6539    fn drop(&mut self) {
6540        self.control_handle.shutdown();
6541        // Safety: drops once, never accessed again
6542        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6543    }
6544}
6545
6546impl fdomain_client::fidl::Responder for DictionaryRouterRouteResponder {
6547    type ControlHandle = DictionaryRouterControlHandle;
6548
6549    fn control_handle(&self) -> &DictionaryRouterControlHandle {
6550        &self.control_handle
6551    }
6552
6553    fn drop_without_shutdown(mut self) {
6554        // Safety: drops once, never accessed again due to mem::forget
6555        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6556        // Prevent Drop from running (which would shut down the channel)
6557        std::mem::forget(self);
6558    }
6559}
6560
6561impl DictionaryRouterRouteResponder {
6562    /// Sends a response to the FIDL transaction.
6563    ///
6564    /// Sets the channel to shutdown if an error occurs.
6565    pub fn send(
6566        self,
6567        mut result: Result<DictionaryRouterRouteResponse, RouterError>,
6568    ) -> Result<(), fidl::Error> {
6569        let _result = self.send_raw(result);
6570        if _result.is_err() {
6571            self.control_handle.shutdown();
6572        }
6573        self.drop_without_shutdown();
6574        _result
6575    }
6576
6577    /// Similar to "send" but does not shutdown the channel if an error occurs.
6578    pub fn send_no_shutdown_on_err(
6579        self,
6580        mut result: Result<DictionaryRouterRouteResponse, RouterError>,
6581    ) -> Result<(), fidl::Error> {
6582        let _result = self.send_raw(result);
6583        self.drop_without_shutdown();
6584        _result
6585    }
6586
6587    fn send_raw(
6588        &self,
6589        mut result: Result<DictionaryRouterRouteResponse, RouterError>,
6590    ) -> Result<(), fidl::Error> {
6591        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
6592            DictionaryRouterRouteResponse,
6593            RouterError,
6594        >>(
6595            fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
6596            self.tx_id,
6597            0x714c65bfe54bd79f,
6598            fidl::encoding::DynamicFlags::FLEXIBLE,
6599        )
6600    }
6601}
6602
6603#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6604pub struct DirConnectorRouterMarker;
6605
6606impl fdomain_client::fidl::ProtocolMarker for DirConnectorRouterMarker {
6607    type Proxy = DirConnectorRouterProxy;
6608    type RequestStream = DirConnectorRouterRequestStream;
6609
6610    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.DirConnectorRouter";
6611}
6612impl fdomain_client::fidl::DiscoverableProtocolMarker for DirConnectorRouterMarker {}
6613pub type DirConnectorRouterRouteResult = Result<DirConnectorRouterRouteResponse, RouterError>;
6614
6615pub trait DirConnectorRouterProxyInterface: Send + Sync {
6616    type RouteResponseFut: std::future::Future<Output = Result<DirConnectorRouterRouteResult, fidl::Error>>
6617        + Send;
6618    fn r#route(&self, payload: RouteRequest) -> Self::RouteResponseFut;
6619}
6620
6621#[derive(Debug, Clone)]
6622pub struct DirConnectorRouterProxy {
6623    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
6624}
6625
6626impl fdomain_client::fidl::Proxy for DirConnectorRouterProxy {
6627    type Protocol = DirConnectorRouterMarker;
6628
6629    fn from_channel(inner: fdomain_client::Channel) -> Self {
6630        Self::new(inner)
6631    }
6632
6633    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
6634        self.client.into_channel().map_err(|client| Self { client })
6635    }
6636
6637    fn as_channel(&self) -> &fdomain_client::Channel {
6638        self.client.as_channel()
6639    }
6640}
6641
6642impl DirConnectorRouterProxy {
6643    /// Create a new Proxy for fuchsia.component.sandbox/DirConnectorRouter.
6644    pub fn new(channel: fdomain_client::Channel) -> Self {
6645        let protocol_name =
6646            <DirConnectorRouterMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
6647        Self { client: fidl::client::Client::new(channel, protocol_name) }
6648    }
6649
6650    /// Get a Stream of events from the remote end of the protocol.
6651    ///
6652    /// # Panics
6653    ///
6654    /// Panics if the event stream was already taken.
6655    pub fn take_event_stream(&self) -> DirConnectorRouterEventStream {
6656        DirConnectorRouterEventStream { event_receiver: self.client.take_event_receiver() }
6657    }
6658
6659    pub fn r#route(
6660        &self,
6661        mut payload: RouteRequest,
6662    ) -> fidl::client::QueryResponseFut<
6663        DirConnectorRouterRouteResult,
6664        fdomain_client::fidl::FDomainResourceDialect,
6665    > {
6666        DirConnectorRouterProxyInterface::r#route(self, payload)
6667    }
6668}
6669
6670impl DirConnectorRouterProxyInterface for DirConnectorRouterProxy {
6671    type RouteResponseFut = fidl::client::QueryResponseFut<
6672        DirConnectorRouterRouteResult,
6673        fdomain_client::fidl::FDomainResourceDialect,
6674    >;
6675    fn r#route(&self, mut payload: RouteRequest) -> Self::RouteResponseFut {
6676        fn _decode(
6677            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6678        ) -> Result<DirConnectorRouterRouteResult, fidl::Error> {
6679            let _response = fidl::client::decode_transaction_body::<
6680                fidl::encoding::FlexibleResultType<DirConnectorRouterRouteResponse, RouterError>,
6681                fdomain_client::fidl::FDomainResourceDialect,
6682                0xd7e0f01da2c8e40,
6683            >(_buf?)?
6684            .into_result_fdomain::<DirConnectorRouterMarker>("route")?;
6685            Ok(_response.map(|x| x))
6686        }
6687        self.client.send_query_and_decode::<RouteRequest, DirConnectorRouterRouteResult>(
6688            &mut payload,
6689            0xd7e0f01da2c8e40,
6690            fidl::encoding::DynamicFlags::FLEXIBLE,
6691            _decode,
6692        )
6693    }
6694}
6695
6696pub struct DirConnectorRouterEventStream {
6697    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
6698}
6699
6700impl std::marker::Unpin for DirConnectorRouterEventStream {}
6701
6702impl futures::stream::FusedStream for DirConnectorRouterEventStream {
6703    fn is_terminated(&self) -> bool {
6704        self.event_receiver.is_terminated()
6705    }
6706}
6707
6708impl futures::Stream for DirConnectorRouterEventStream {
6709    type Item = Result<DirConnectorRouterEvent, fidl::Error>;
6710
6711    fn poll_next(
6712        mut self: std::pin::Pin<&mut Self>,
6713        cx: &mut std::task::Context<'_>,
6714    ) -> std::task::Poll<Option<Self::Item>> {
6715        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6716            &mut self.event_receiver,
6717            cx
6718        )?) {
6719            Some(buf) => std::task::Poll::Ready(Some(DirConnectorRouterEvent::decode(buf))),
6720            None => std::task::Poll::Ready(None),
6721        }
6722    }
6723}
6724
6725#[derive(Debug)]
6726pub enum DirConnectorRouterEvent {
6727    #[non_exhaustive]
6728    _UnknownEvent {
6729        /// Ordinal of the event that was sent.
6730        ordinal: u64,
6731    },
6732}
6733
6734impl DirConnectorRouterEvent {
6735    /// Decodes a message buffer as a [`DirConnectorRouterEvent`].
6736    fn decode(
6737        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6738    ) -> Result<DirConnectorRouterEvent, fidl::Error> {
6739        let (bytes, _handles) = buf.split_mut();
6740        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6741        debug_assert_eq!(tx_header.tx_id, 0);
6742        match tx_header.ordinal {
6743            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6744                Ok(DirConnectorRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
6745            }
6746            _ => Err(fidl::Error::UnknownOrdinal {
6747                ordinal: tx_header.ordinal,
6748                protocol_name:
6749                    <DirConnectorRouterMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
6750            }),
6751        }
6752    }
6753}
6754
6755/// A Stream of incoming requests for fuchsia.component.sandbox/DirConnectorRouter.
6756pub struct DirConnectorRouterRequestStream {
6757    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
6758    is_terminated: bool,
6759}
6760
6761impl std::marker::Unpin for DirConnectorRouterRequestStream {}
6762
6763impl futures::stream::FusedStream for DirConnectorRouterRequestStream {
6764    fn is_terminated(&self) -> bool {
6765        self.is_terminated
6766    }
6767}
6768
6769impl fdomain_client::fidl::RequestStream for DirConnectorRouterRequestStream {
6770    type Protocol = DirConnectorRouterMarker;
6771    type ControlHandle = DirConnectorRouterControlHandle;
6772
6773    fn from_channel(channel: fdomain_client::Channel) -> Self {
6774        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6775    }
6776
6777    fn control_handle(&self) -> Self::ControlHandle {
6778        DirConnectorRouterControlHandle { inner: self.inner.clone() }
6779    }
6780
6781    fn into_inner(
6782        self,
6783    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
6784    {
6785        (self.inner, self.is_terminated)
6786    }
6787
6788    fn from_inner(
6789        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
6790        is_terminated: bool,
6791    ) -> Self {
6792        Self { inner, is_terminated }
6793    }
6794}
6795
6796impl futures::Stream for DirConnectorRouterRequestStream {
6797    type Item = Result<DirConnectorRouterRequest, fidl::Error>;
6798
6799    fn poll_next(
6800        mut self: std::pin::Pin<&mut Self>,
6801        cx: &mut std::task::Context<'_>,
6802    ) -> std::task::Poll<Option<Self::Item>> {
6803        let this = &mut *self;
6804        if this.inner.check_shutdown(cx) {
6805            this.is_terminated = true;
6806            return std::task::Poll::Ready(None);
6807        }
6808        if this.is_terminated {
6809            panic!("polled DirConnectorRouterRequestStream after completion");
6810        }
6811        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
6812            |bytes, handles| {
6813                match this.inner.channel().read_etc(cx, bytes, handles) {
6814                    std::task::Poll::Ready(Ok(())) => {}
6815                    std::task::Poll::Pending => return std::task::Poll::Pending,
6816                    std::task::Poll::Ready(Err(None)) => {
6817                        this.is_terminated = true;
6818                        return std::task::Poll::Ready(None);
6819                    }
6820                    std::task::Poll::Ready(Err(Some(e))) => {
6821                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6822                            e.into(),
6823                        ))));
6824                    }
6825                }
6826
6827                // A message has been received from the channel
6828                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6829
6830                std::task::Poll::Ready(Some(match header.ordinal {
6831                0xd7e0f01da2c8e40 => {
6832                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6833                    let mut req = fidl::new_empty!(RouteRequest, fdomain_client::fidl::FDomainResourceDialect);
6834                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<RouteRequest>(&header, _body_bytes, handles, &mut req)?;
6835                    let control_handle = DirConnectorRouterControlHandle {
6836                        inner: this.inner.clone(),
6837                    };
6838                    Ok(DirConnectorRouterRequest::Route {payload: req,
6839                        responder: DirConnectorRouterRouteResponder {
6840                            control_handle: std::mem::ManuallyDrop::new(control_handle),
6841                            tx_id: header.tx_id,
6842                        },
6843                    })
6844                }
6845                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6846                    Ok(DirConnectorRouterRequest::_UnknownMethod {
6847                        ordinal: header.ordinal,
6848                        control_handle: DirConnectorRouterControlHandle { inner: this.inner.clone() },
6849                        method_type: fidl::MethodType::OneWay,
6850                    })
6851                }
6852                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6853                    this.inner.send_framework_err(
6854                        fidl::encoding::FrameworkErr::UnknownMethod,
6855                        header.tx_id,
6856                        header.ordinal,
6857                        header.dynamic_flags(),
6858                        (bytes, handles),
6859                    )?;
6860                    Ok(DirConnectorRouterRequest::_UnknownMethod {
6861                        ordinal: header.ordinal,
6862                        control_handle: DirConnectorRouterControlHandle { inner: this.inner.clone() },
6863                        method_type: fidl::MethodType::TwoWay,
6864                    })
6865                }
6866                _ => Err(fidl::Error::UnknownOrdinal {
6867                    ordinal: header.ordinal,
6868                    protocol_name: <DirConnectorRouterMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
6869                }),
6870            }))
6871            },
6872        )
6873    }
6874}
6875
6876#[derive(Debug)]
6877pub enum DirConnectorRouterRequest {
6878    Route {
6879        payload: RouteRequest,
6880        responder: DirConnectorRouterRouteResponder,
6881    },
6882    /// An interaction was received which does not match any known method.
6883    #[non_exhaustive]
6884    _UnknownMethod {
6885        /// Ordinal of the method that was called.
6886        ordinal: u64,
6887        control_handle: DirConnectorRouterControlHandle,
6888        method_type: fidl::MethodType,
6889    },
6890}
6891
6892impl DirConnectorRouterRequest {
6893    #[allow(irrefutable_let_patterns)]
6894    pub fn into_route(self) -> Option<(RouteRequest, DirConnectorRouterRouteResponder)> {
6895        if let DirConnectorRouterRequest::Route { payload, responder } = self {
6896            Some((payload, responder))
6897        } else {
6898            None
6899        }
6900    }
6901
6902    /// Name of the method defined in FIDL
6903    pub fn method_name(&self) -> &'static str {
6904        match *self {
6905            DirConnectorRouterRequest::Route { .. } => "route",
6906            DirConnectorRouterRequest::_UnknownMethod {
6907                method_type: fidl::MethodType::OneWay,
6908                ..
6909            } => "unknown one-way method",
6910            DirConnectorRouterRequest::_UnknownMethod {
6911                method_type: fidl::MethodType::TwoWay,
6912                ..
6913            } => "unknown two-way method",
6914        }
6915    }
6916}
6917
6918#[derive(Debug, Clone)]
6919pub struct DirConnectorRouterControlHandle {
6920    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
6921}
6922
6923impl fdomain_client::fidl::ControlHandle for DirConnectorRouterControlHandle {
6924    fn shutdown(&self) {
6925        self.inner.shutdown()
6926    }
6927
6928    fn is_closed(&self) -> bool {
6929        self.inner.channel().is_closed()
6930    }
6931    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
6932        self.inner.channel().on_closed()
6933    }
6934}
6935
6936impl DirConnectorRouterControlHandle {}
6937
6938#[must_use = "FIDL methods require a response to be sent"]
6939#[derive(Debug)]
6940pub struct DirConnectorRouterRouteResponder {
6941    control_handle: std::mem::ManuallyDrop<DirConnectorRouterControlHandle>,
6942    tx_id: u32,
6943}
6944
6945/// Set the the channel to be shutdown (see [`DirConnectorRouterControlHandle::shutdown`])
6946/// if the responder is dropped without sending a response, so that the client
6947/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6948impl std::ops::Drop for DirConnectorRouterRouteResponder {
6949    fn drop(&mut self) {
6950        self.control_handle.shutdown();
6951        // Safety: drops once, never accessed again
6952        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6953    }
6954}
6955
6956impl fdomain_client::fidl::Responder for DirConnectorRouterRouteResponder {
6957    type ControlHandle = DirConnectorRouterControlHandle;
6958
6959    fn control_handle(&self) -> &DirConnectorRouterControlHandle {
6960        &self.control_handle
6961    }
6962
6963    fn drop_without_shutdown(mut self) {
6964        // Safety: drops once, never accessed again due to mem::forget
6965        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6966        // Prevent Drop from running (which would shut down the channel)
6967        std::mem::forget(self);
6968    }
6969}
6970
6971impl DirConnectorRouterRouteResponder {
6972    /// Sends a response to the FIDL transaction.
6973    ///
6974    /// Sets the channel to shutdown if an error occurs.
6975    pub fn send(
6976        self,
6977        mut result: Result<DirConnectorRouterRouteResponse, RouterError>,
6978    ) -> Result<(), fidl::Error> {
6979        let _result = self.send_raw(result);
6980        if _result.is_err() {
6981            self.control_handle.shutdown();
6982        }
6983        self.drop_without_shutdown();
6984        _result
6985    }
6986
6987    /// Similar to "send" but does not shutdown the channel if an error occurs.
6988    pub fn send_no_shutdown_on_err(
6989        self,
6990        mut result: Result<DirConnectorRouterRouteResponse, RouterError>,
6991    ) -> Result<(), fidl::Error> {
6992        let _result = self.send_raw(result);
6993        self.drop_without_shutdown();
6994        _result
6995    }
6996
6997    fn send_raw(
6998        &self,
6999        mut result: Result<DirConnectorRouterRouteResponse, RouterError>,
7000    ) -> Result<(), fidl::Error> {
7001        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
7002            DirConnectorRouterRouteResponse,
7003            RouterError,
7004        >>(
7005            fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
7006            self.tx_id,
7007            0xd7e0f01da2c8e40,
7008            fidl::encoding::DynamicFlags::FLEXIBLE,
7009        )
7010    }
7011}
7012
7013#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
7014pub struct DirEntryRouterMarker;
7015
7016impl fdomain_client::fidl::ProtocolMarker for DirEntryRouterMarker {
7017    type Proxy = DirEntryRouterProxy;
7018    type RequestStream = DirEntryRouterRequestStream;
7019
7020    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.DirEntryRouter";
7021}
7022impl fdomain_client::fidl::DiscoverableProtocolMarker for DirEntryRouterMarker {}
7023pub type DirEntryRouterRouteResult = Result<DirEntryRouterRouteResponse, RouterError>;
7024
7025pub trait DirEntryRouterProxyInterface: Send + Sync {
7026    type RouteResponseFut: std::future::Future<Output = Result<DirEntryRouterRouteResult, fidl::Error>>
7027        + Send;
7028    fn r#route(&self, payload: RouteRequest) -> Self::RouteResponseFut;
7029}
7030
7031#[derive(Debug, Clone)]
7032pub struct DirEntryRouterProxy {
7033    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
7034}
7035
7036impl fdomain_client::fidl::Proxy for DirEntryRouterProxy {
7037    type Protocol = DirEntryRouterMarker;
7038
7039    fn from_channel(inner: fdomain_client::Channel) -> Self {
7040        Self::new(inner)
7041    }
7042
7043    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
7044        self.client.into_channel().map_err(|client| Self { client })
7045    }
7046
7047    fn as_channel(&self) -> &fdomain_client::Channel {
7048        self.client.as_channel()
7049    }
7050}
7051
7052impl DirEntryRouterProxy {
7053    /// Create a new Proxy for fuchsia.component.sandbox/DirEntryRouter.
7054    pub fn new(channel: fdomain_client::Channel) -> Self {
7055        let protocol_name =
7056            <DirEntryRouterMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
7057        Self { client: fidl::client::Client::new(channel, protocol_name) }
7058    }
7059
7060    /// Get a Stream of events from the remote end of the protocol.
7061    ///
7062    /// # Panics
7063    ///
7064    /// Panics if the event stream was already taken.
7065    pub fn take_event_stream(&self) -> DirEntryRouterEventStream {
7066        DirEntryRouterEventStream { event_receiver: self.client.take_event_receiver() }
7067    }
7068
7069    pub fn r#route(
7070        &self,
7071        mut payload: RouteRequest,
7072    ) -> fidl::client::QueryResponseFut<
7073        DirEntryRouterRouteResult,
7074        fdomain_client::fidl::FDomainResourceDialect,
7075    > {
7076        DirEntryRouterProxyInterface::r#route(self, payload)
7077    }
7078}
7079
7080impl DirEntryRouterProxyInterface for DirEntryRouterProxy {
7081    type RouteResponseFut = fidl::client::QueryResponseFut<
7082        DirEntryRouterRouteResult,
7083        fdomain_client::fidl::FDomainResourceDialect,
7084    >;
7085    fn r#route(&self, mut payload: RouteRequest) -> Self::RouteResponseFut {
7086        fn _decode(
7087            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7088        ) -> Result<DirEntryRouterRouteResult, fidl::Error> {
7089            let _response = fidl::client::decode_transaction_body::<
7090                fidl::encoding::FlexibleResultType<DirEntryRouterRouteResponse, RouterError>,
7091                fdomain_client::fidl::FDomainResourceDialect,
7092                0x1ac694001c208bd2,
7093            >(_buf?)?
7094            .into_result_fdomain::<DirEntryRouterMarker>("route")?;
7095            Ok(_response.map(|x| x))
7096        }
7097        self.client.send_query_and_decode::<RouteRequest, DirEntryRouterRouteResult>(
7098            &mut payload,
7099            0x1ac694001c208bd2,
7100            fidl::encoding::DynamicFlags::FLEXIBLE,
7101            _decode,
7102        )
7103    }
7104}
7105
7106pub struct DirEntryRouterEventStream {
7107    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
7108}
7109
7110impl std::marker::Unpin for DirEntryRouterEventStream {}
7111
7112impl futures::stream::FusedStream for DirEntryRouterEventStream {
7113    fn is_terminated(&self) -> bool {
7114        self.event_receiver.is_terminated()
7115    }
7116}
7117
7118impl futures::Stream for DirEntryRouterEventStream {
7119    type Item = Result<DirEntryRouterEvent, fidl::Error>;
7120
7121    fn poll_next(
7122        mut self: std::pin::Pin<&mut Self>,
7123        cx: &mut std::task::Context<'_>,
7124    ) -> std::task::Poll<Option<Self::Item>> {
7125        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7126            &mut self.event_receiver,
7127            cx
7128        )?) {
7129            Some(buf) => std::task::Poll::Ready(Some(DirEntryRouterEvent::decode(buf))),
7130            None => std::task::Poll::Ready(None),
7131        }
7132    }
7133}
7134
7135#[derive(Debug)]
7136pub enum DirEntryRouterEvent {
7137    #[non_exhaustive]
7138    _UnknownEvent {
7139        /// Ordinal of the event that was sent.
7140        ordinal: u64,
7141    },
7142}
7143
7144impl DirEntryRouterEvent {
7145    /// Decodes a message buffer as a [`DirEntryRouterEvent`].
7146    fn decode(
7147        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7148    ) -> Result<DirEntryRouterEvent, fidl::Error> {
7149        let (bytes, _handles) = buf.split_mut();
7150        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7151        debug_assert_eq!(tx_header.tx_id, 0);
7152        match tx_header.ordinal {
7153            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7154                Ok(DirEntryRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
7155            }
7156            _ => Err(fidl::Error::UnknownOrdinal {
7157                ordinal: tx_header.ordinal,
7158                protocol_name:
7159                    <DirEntryRouterMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
7160            }),
7161        }
7162    }
7163}
7164
7165/// A Stream of incoming requests for fuchsia.component.sandbox/DirEntryRouter.
7166pub struct DirEntryRouterRequestStream {
7167    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
7168    is_terminated: bool,
7169}
7170
7171impl std::marker::Unpin for DirEntryRouterRequestStream {}
7172
7173impl futures::stream::FusedStream for DirEntryRouterRequestStream {
7174    fn is_terminated(&self) -> bool {
7175        self.is_terminated
7176    }
7177}
7178
7179impl fdomain_client::fidl::RequestStream for DirEntryRouterRequestStream {
7180    type Protocol = DirEntryRouterMarker;
7181    type ControlHandle = DirEntryRouterControlHandle;
7182
7183    fn from_channel(channel: fdomain_client::Channel) -> Self {
7184        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7185    }
7186
7187    fn control_handle(&self) -> Self::ControlHandle {
7188        DirEntryRouterControlHandle { inner: self.inner.clone() }
7189    }
7190
7191    fn into_inner(
7192        self,
7193    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
7194    {
7195        (self.inner, self.is_terminated)
7196    }
7197
7198    fn from_inner(
7199        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
7200        is_terminated: bool,
7201    ) -> Self {
7202        Self { inner, is_terminated }
7203    }
7204}
7205
7206impl futures::Stream for DirEntryRouterRequestStream {
7207    type Item = Result<DirEntryRouterRequest, fidl::Error>;
7208
7209    fn poll_next(
7210        mut self: std::pin::Pin<&mut Self>,
7211        cx: &mut std::task::Context<'_>,
7212    ) -> std::task::Poll<Option<Self::Item>> {
7213        let this = &mut *self;
7214        if this.inner.check_shutdown(cx) {
7215            this.is_terminated = true;
7216            return std::task::Poll::Ready(None);
7217        }
7218        if this.is_terminated {
7219            panic!("polled DirEntryRouterRequestStream after completion");
7220        }
7221        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
7222            |bytes, handles| {
7223                match this.inner.channel().read_etc(cx, bytes, handles) {
7224                    std::task::Poll::Ready(Ok(())) => {}
7225                    std::task::Poll::Pending => return std::task::Poll::Pending,
7226                    std::task::Poll::Ready(Err(None)) => {
7227                        this.is_terminated = true;
7228                        return std::task::Poll::Ready(None);
7229                    }
7230                    std::task::Poll::Ready(Err(Some(e))) => {
7231                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7232                            e.into(),
7233                        ))));
7234                    }
7235                }
7236
7237                // A message has been received from the channel
7238                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7239
7240                std::task::Poll::Ready(Some(match header.ordinal {
7241                0x1ac694001c208bd2 => {
7242                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7243                    let mut req = fidl::new_empty!(RouteRequest, fdomain_client::fidl::FDomainResourceDialect);
7244                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<RouteRequest>(&header, _body_bytes, handles, &mut req)?;
7245                    let control_handle = DirEntryRouterControlHandle {
7246                        inner: this.inner.clone(),
7247                    };
7248                    Ok(DirEntryRouterRequest::Route {payload: req,
7249                        responder: DirEntryRouterRouteResponder {
7250                            control_handle: std::mem::ManuallyDrop::new(control_handle),
7251                            tx_id: header.tx_id,
7252                        },
7253                    })
7254                }
7255                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7256                    Ok(DirEntryRouterRequest::_UnknownMethod {
7257                        ordinal: header.ordinal,
7258                        control_handle: DirEntryRouterControlHandle { inner: this.inner.clone() },
7259                        method_type: fidl::MethodType::OneWay,
7260                    })
7261                }
7262                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7263                    this.inner.send_framework_err(
7264                        fidl::encoding::FrameworkErr::UnknownMethod,
7265                        header.tx_id,
7266                        header.ordinal,
7267                        header.dynamic_flags(),
7268                        (bytes, handles),
7269                    )?;
7270                    Ok(DirEntryRouterRequest::_UnknownMethod {
7271                        ordinal: header.ordinal,
7272                        control_handle: DirEntryRouterControlHandle { inner: this.inner.clone() },
7273                        method_type: fidl::MethodType::TwoWay,
7274                    })
7275                }
7276                _ => Err(fidl::Error::UnknownOrdinal {
7277                    ordinal: header.ordinal,
7278                    protocol_name: <DirEntryRouterMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
7279                }),
7280            }))
7281            },
7282        )
7283    }
7284}
7285
7286#[derive(Debug)]
7287pub enum DirEntryRouterRequest {
7288    Route {
7289        payload: RouteRequest,
7290        responder: DirEntryRouterRouteResponder,
7291    },
7292    /// An interaction was received which does not match any known method.
7293    #[non_exhaustive]
7294    _UnknownMethod {
7295        /// Ordinal of the method that was called.
7296        ordinal: u64,
7297        control_handle: DirEntryRouterControlHandle,
7298        method_type: fidl::MethodType,
7299    },
7300}
7301
7302impl DirEntryRouterRequest {
7303    #[allow(irrefutable_let_patterns)]
7304    pub fn into_route(self) -> Option<(RouteRequest, DirEntryRouterRouteResponder)> {
7305        if let DirEntryRouterRequest::Route { payload, responder } = self {
7306            Some((payload, responder))
7307        } else {
7308            None
7309        }
7310    }
7311
7312    /// Name of the method defined in FIDL
7313    pub fn method_name(&self) -> &'static str {
7314        match *self {
7315            DirEntryRouterRequest::Route { .. } => "route",
7316            DirEntryRouterRequest::_UnknownMethod {
7317                method_type: fidl::MethodType::OneWay, ..
7318            } => "unknown one-way method",
7319            DirEntryRouterRequest::_UnknownMethod {
7320                method_type: fidl::MethodType::TwoWay, ..
7321            } => "unknown two-way method",
7322        }
7323    }
7324}
7325
7326#[derive(Debug, Clone)]
7327pub struct DirEntryRouterControlHandle {
7328    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
7329}
7330
7331impl fdomain_client::fidl::ControlHandle for DirEntryRouterControlHandle {
7332    fn shutdown(&self) {
7333        self.inner.shutdown()
7334    }
7335
7336    fn is_closed(&self) -> bool {
7337        self.inner.channel().is_closed()
7338    }
7339    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
7340        self.inner.channel().on_closed()
7341    }
7342}
7343
7344impl DirEntryRouterControlHandle {}
7345
7346#[must_use = "FIDL methods require a response to be sent"]
7347#[derive(Debug)]
7348pub struct DirEntryRouterRouteResponder {
7349    control_handle: std::mem::ManuallyDrop<DirEntryRouterControlHandle>,
7350    tx_id: u32,
7351}
7352
7353/// Set the the channel to be shutdown (see [`DirEntryRouterControlHandle::shutdown`])
7354/// if the responder is dropped without sending a response, so that the client
7355/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7356impl std::ops::Drop for DirEntryRouterRouteResponder {
7357    fn drop(&mut self) {
7358        self.control_handle.shutdown();
7359        // Safety: drops once, never accessed again
7360        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7361    }
7362}
7363
7364impl fdomain_client::fidl::Responder for DirEntryRouterRouteResponder {
7365    type ControlHandle = DirEntryRouterControlHandle;
7366
7367    fn control_handle(&self) -> &DirEntryRouterControlHandle {
7368        &self.control_handle
7369    }
7370
7371    fn drop_without_shutdown(mut self) {
7372        // Safety: drops once, never accessed again due to mem::forget
7373        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7374        // Prevent Drop from running (which would shut down the channel)
7375        std::mem::forget(self);
7376    }
7377}
7378
7379impl DirEntryRouterRouteResponder {
7380    /// Sends a response to the FIDL transaction.
7381    ///
7382    /// Sets the channel to shutdown if an error occurs.
7383    pub fn send(
7384        self,
7385        mut result: Result<DirEntryRouterRouteResponse, RouterError>,
7386    ) -> Result<(), fidl::Error> {
7387        let _result = self.send_raw(result);
7388        if _result.is_err() {
7389            self.control_handle.shutdown();
7390        }
7391        self.drop_without_shutdown();
7392        _result
7393    }
7394
7395    /// Similar to "send" but does not shutdown the channel if an error occurs.
7396    pub fn send_no_shutdown_on_err(
7397        self,
7398        mut result: Result<DirEntryRouterRouteResponse, RouterError>,
7399    ) -> Result<(), fidl::Error> {
7400        let _result = self.send_raw(result);
7401        self.drop_without_shutdown();
7402        _result
7403    }
7404
7405    fn send_raw(
7406        &self,
7407        mut result: Result<DirEntryRouterRouteResponse, RouterError>,
7408    ) -> Result<(), fidl::Error> {
7409        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
7410            DirEntryRouterRouteResponse,
7411            RouterError,
7412        >>(
7413            fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
7414            self.tx_id,
7415            0x1ac694001c208bd2,
7416            fidl::encoding::DynamicFlags::FLEXIBLE,
7417        )
7418    }
7419}
7420
7421#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
7422pub struct DirReceiverMarker;
7423
7424impl fdomain_client::fidl::ProtocolMarker for DirReceiverMarker {
7425    type Proxy = DirReceiverProxy;
7426    type RequestStream = DirReceiverRequestStream;
7427
7428    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.DirReceiver";
7429}
7430impl fdomain_client::fidl::DiscoverableProtocolMarker for DirReceiverMarker {}
7431
7432pub trait DirReceiverProxyInterface: Send + Sync {
7433    fn r#receive(&self, payload: DirReceiverReceiveRequest) -> Result<(), fidl::Error>;
7434}
7435
7436#[derive(Debug, Clone)]
7437pub struct DirReceiverProxy {
7438    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
7439}
7440
7441impl fdomain_client::fidl::Proxy for DirReceiverProxy {
7442    type Protocol = DirReceiverMarker;
7443
7444    fn from_channel(inner: fdomain_client::Channel) -> Self {
7445        Self::new(inner)
7446    }
7447
7448    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
7449        self.client.into_channel().map_err(|client| Self { client })
7450    }
7451
7452    fn as_channel(&self) -> &fdomain_client::Channel {
7453        self.client.as_channel()
7454    }
7455}
7456
7457impl DirReceiverProxy {
7458    /// Create a new Proxy for fuchsia.component.sandbox/DirReceiver.
7459    pub fn new(channel: fdomain_client::Channel) -> Self {
7460        let protocol_name = <DirReceiverMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
7461        Self { client: fidl::client::Client::new(channel, protocol_name) }
7462    }
7463
7464    /// Get a Stream of events from the remote end of the protocol.
7465    ///
7466    /// # Panics
7467    ///
7468    /// Panics if the event stream was already taken.
7469    pub fn take_event_stream(&self) -> DirReceiverEventStream {
7470        DirReceiverEventStream { event_receiver: self.client.take_event_receiver() }
7471    }
7472
7473    /// Sends a directory channel to this receiver.
7474    ///
7475    /// The server should implement this method by forwarding `channel` to a vfs instance
7476    /// of the language appropriate `vfs` library.
7477    pub fn r#receive(&self, mut payload: DirReceiverReceiveRequest) -> Result<(), fidl::Error> {
7478        DirReceiverProxyInterface::r#receive(self, payload)
7479    }
7480}
7481
7482impl DirReceiverProxyInterface for DirReceiverProxy {
7483    fn r#receive(&self, mut payload: DirReceiverReceiveRequest) -> Result<(), fidl::Error> {
7484        self.client.send::<DirReceiverReceiveRequest>(
7485            &mut payload,
7486            0xcdc3e9b89fe7bb4,
7487            fidl::encoding::DynamicFlags::FLEXIBLE,
7488        )
7489    }
7490}
7491
7492pub struct DirReceiverEventStream {
7493    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
7494}
7495
7496impl std::marker::Unpin for DirReceiverEventStream {}
7497
7498impl futures::stream::FusedStream for DirReceiverEventStream {
7499    fn is_terminated(&self) -> bool {
7500        self.event_receiver.is_terminated()
7501    }
7502}
7503
7504impl futures::Stream for DirReceiverEventStream {
7505    type Item = Result<DirReceiverEvent, fidl::Error>;
7506
7507    fn poll_next(
7508        mut self: std::pin::Pin<&mut Self>,
7509        cx: &mut std::task::Context<'_>,
7510    ) -> std::task::Poll<Option<Self::Item>> {
7511        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7512            &mut self.event_receiver,
7513            cx
7514        )?) {
7515            Some(buf) => std::task::Poll::Ready(Some(DirReceiverEvent::decode(buf))),
7516            None => std::task::Poll::Ready(None),
7517        }
7518    }
7519}
7520
7521#[derive(Debug)]
7522pub enum DirReceiverEvent {
7523    #[non_exhaustive]
7524    _UnknownEvent {
7525        /// Ordinal of the event that was sent.
7526        ordinal: u64,
7527    },
7528}
7529
7530impl DirReceiverEvent {
7531    /// Decodes a message buffer as a [`DirReceiverEvent`].
7532    fn decode(
7533        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7534    ) -> Result<DirReceiverEvent, fidl::Error> {
7535        let (bytes, _handles) = buf.split_mut();
7536        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7537        debug_assert_eq!(tx_header.tx_id, 0);
7538        match tx_header.ordinal {
7539            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7540                Ok(DirReceiverEvent::_UnknownEvent { ordinal: tx_header.ordinal })
7541            }
7542            _ => Err(fidl::Error::UnknownOrdinal {
7543                ordinal: tx_header.ordinal,
7544                protocol_name:
7545                    <DirReceiverMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
7546            }),
7547        }
7548    }
7549}
7550
7551/// A Stream of incoming requests for fuchsia.component.sandbox/DirReceiver.
7552pub struct DirReceiverRequestStream {
7553    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
7554    is_terminated: bool,
7555}
7556
7557impl std::marker::Unpin for DirReceiverRequestStream {}
7558
7559impl futures::stream::FusedStream for DirReceiverRequestStream {
7560    fn is_terminated(&self) -> bool {
7561        self.is_terminated
7562    }
7563}
7564
7565impl fdomain_client::fidl::RequestStream for DirReceiverRequestStream {
7566    type Protocol = DirReceiverMarker;
7567    type ControlHandle = DirReceiverControlHandle;
7568
7569    fn from_channel(channel: fdomain_client::Channel) -> Self {
7570        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7571    }
7572
7573    fn control_handle(&self) -> Self::ControlHandle {
7574        DirReceiverControlHandle { inner: self.inner.clone() }
7575    }
7576
7577    fn into_inner(
7578        self,
7579    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
7580    {
7581        (self.inner, self.is_terminated)
7582    }
7583
7584    fn from_inner(
7585        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
7586        is_terminated: bool,
7587    ) -> Self {
7588        Self { inner, is_terminated }
7589    }
7590}
7591
7592impl futures::Stream for DirReceiverRequestStream {
7593    type Item = Result<DirReceiverRequest, fidl::Error>;
7594
7595    fn poll_next(
7596        mut self: std::pin::Pin<&mut Self>,
7597        cx: &mut std::task::Context<'_>,
7598    ) -> std::task::Poll<Option<Self::Item>> {
7599        let this = &mut *self;
7600        if this.inner.check_shutdown(cx) {
7601            this.is_terminated = true;
7602            return std::task::Poll::Ready(None);
7603        }
7604        if this.is_terminated {
7605            panic!("polled DirReceiverRequestStream after completion");
7606        }
7607        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
7608            |bytes, handles| {
7609                match this.inner.channel().read_etc(cx, bytes, handles) {
7610                    std::task::Poll::Ready(Ok(())) => {}
7611                    std::task::Poll::Pending => return std::task::Poll::Pending,
7612                    std::task::Poll::Ready(Err(None)) => {
7613                        this.is_terminated = true;
7614                        return std::task::Poll::Ready(None);
7615                    }
7616                    std::task::Poll::Ready(Err(Some(e))) => {
7617                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7618                            e.into(),
7619                        ))));
7620                    }
7621                }
7622
7623                // A message has been received from the channel
7624                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7625
7626                std::task::Poll::Ready(Some(match header.ordinal {
7627                    0xcdc3e9b89fe7bb4 => {
7628                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
7629                        let mut req = fidl::new_empty!(
7630                            DirReceiverReceiveRequest,
7631                            fdomain_client::fidl::FDomainResourceDialect
7632                        );
7633                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<DirReceiverReceiveRequest>(&header, _body_bytes, handles, &mut req)?;
7634                        let control_handle = DirReceiverControlHandle { inner: this.inner.clone() };
7635                        Ok(DirReceiverRequest::Receive { payload: req, control_handle })
7636                    }
7637                    _ if header.tx_id == 0
7638                        && header
7639                            .dynamic_flags()
7640                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
7641                    {
7642                        Ok(DirReceiverRequest::_UnknownMethod {
7643                            ordinal: header.ordinal,
7644                            control_handle: DirReceiverControlHandle { inner: this.inner.clone() },
7645                            method_type: fidl::MethodType::OneWay,
7646                        })
7647                    }
7648                    _ if header
7649                        .dynamic_flags()
7650                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
7651                    {
7652                        this.inner.send_framework_err(
7653                            fidl::encoding::FrameworkErr::UnknownMethod,
7654                            header.tx_id,
7655                            header.ordinal,
7656                            header.dynamic_flags(),
7657                            (bytes, handles),
7658                        )?;
7659                        Ok(DirReceiverRequest::_UnknownMethod {
7660                            ordinal: header.ordinal,
7661                            control_handle: DirReceiverControlHandle { inner: this.inner.clone() },
7662                            method_type: fidl::MethodType::TwoWay,
7663                        })
7664                    }
7665                    _ => Err(fidl::Error::UnknownOrdinal {
7666                        ordinal: header.ordinal,
7667                        protocol_name:
7668                            <DirReceiverMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
7669                    }),
7670                }))
7671            },
7672        )
7673    }
7674}
7675
7676/// A receiver is served by components and allows them to receive directory channels
7677/// framework.
7678#[derive(Debug)]
7679pub enum DirReceiverRequest {
7680    /// Sends a directory channel to this receiver.
7681    ///
7682    /// The server should implement this method by forwarding `channel` to a vfs instance
7683    /// of the language appropriate `vfs` library.
7684    Receive { payload: DirReceiverReceiveRequest, control_handle: DirReceiverControlHandle },
7685    /// An interaction was received which does not match any known method.
7686    #[non_exhaustive]
7687    _UnknownMethod {
7688        /// Ordinal of the method that was called.
7689        ordinal: u64,
7690        control_handle: DirReceiverControlHandle,
7691        method_type: fidl::MethodType,
7692    },
7693}
7694
7695impl DirReceiverRequest {
7696    #[allow(irrefutable_let_patterns)]
7697    pub fn into_receive(self) -> Option<(DirReceiverReceiveRequest, DirReceiverControlHandle)> {
7698        if let DirReceiverRequest::Receive { payload, control_handle } = self {
7699            Some((payload, control_handle))
7700        } else {
7701            None
7702        }
7703    }
7704
7705    /// Name of the method defined in FIDL
7706    pub fn method_name(&self) -> &'static str {
7707        match *self {
7708            DirReceiverRequest::Receive { .. } => "receive",
7709            DirReceiverRequest::_UnknownMethod {
7710                method_type: fidl::MethodType::OneWay, ..
7711            } => "unknown one-way method",
7712            DirReceiverRequest::_UnknownMethod {
7713                method_type: fidl::MethodType::TwoWay, ..
7714            } => "unknown two-way method",
7715        }
7716    }
7717}
7718
7719#[derive(Debug, Clone)]
7720pub struct DirReceiverControlHandle {
7721    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
7722}
7723
7724impl fdomain_client::fidl::ControlHandle for DirReceiverControlHandle {
7725    fn shutdown(&self) {
7726        self.inner.shutdown()
7727    }
7728
7729    fn is_closed(&self) -> bool {
7730        self.inner.channel().is_closed()
7731    }
7732    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
7733        self.inner.channel().on_closed()
7734    }
7735}
7736
7737impl DirReceiverControlHandle {}
7738
7739#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
7740pub struct DirectoryRouterMarker;
7741
7742impl fdomain_client::fidl::ProtocolMarker for DirectoryRouterMarker {
7743    type Proxy = DirectoryRouterProxy;
7744    type RequestStream = DirectoryRouterRequestStream;
7745
7746    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.DirectoryRouter";
7747}
7748impl fdomain_client::fidl::DiscoverableProtocolMarker for DirectoryRouterMarker {}
7749pub type DirectoryRouterRouteResult = Result<DirectoryRouterRouteResponse, RouterError>;
7750
7751pub trait DirectoryRouterProxyInterface: Send + Sync {
7752    type RouteResponseFut: std::future::Future<Output = Result<DirectoryRouterRouteResult, fidl::Error>>
7753        + Send;
7754    fn r#route(&self, payload: RouteRequest) -> Self::RouteResponseFut;
7755}
7756
7757#[derive(Debug, Clone)]
7758pub struct DirectoryRouterProxy {
7759    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
7760}
7761
7762impl fdomain_client::fidl::Proxy for DirectoryRouterProxy {
7763    type Protocol = DirectoryRouterMarker;
7764
7765    fn from_channel(inner: fdomain_client::Channel) -> Self {
7766        Self::new(inner)
7767    }
7768
7769    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
7770        self.client.into_channel().map_err(|client| Self { client })
7771    }
7772
7773    fn as_channel(&self) -> &fdomain_client::Channel {
7774        self.client.as_channel()
7775    }
7776}
7777
7778impl DirectoryRouterProxy {
7779    /// Create a new Proxy for fuchsia.component.sandbox/DirectoryRouter.
7780    pub fn new(channel: fdomain_client::Channel) -> Self {
7781        let protocol_name =
7782            <DirectoryRouterMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
7783        Self { client: fidl::client::Client::new(channel, protocol_name) }
7784    }
7785
7786    /// Get a Stream of events from the remote end of the protocol.
7787    ///
7788    /// # Panics
7789    ///
7790    /// Panics if the event stream was already taken.
7791    pub fn take_event_stream(&self) -> DirectoryRouterEventStream {
7792        DirectoryRouterEventStream { event_receiver: self.client.take_event_receiver() }
7793    }
7794
7795    pub fn r#route(
7796        &self,
7797        mut payload: RouteRequest,
7798    ) -> fidl::client::QueryResponseFut<
7799        DirectoryRouterRouteResult,
7800        fdomain_client::fidl::FDomainResourceDialect,
7801    > {
7802        DirectoryRouterProxyInterface::r#route(self, payload)
7803    }
7804}
7805
7806impl DirectoryRouterProxyInterface for DirectoryRouterProxy {
7807    type RouteResponseFut = fidl::client::QueryResponseFut<
7808        DirectoryRouterRouteResult,
7809        fdomain_client::fidl::FDomainResourceDialect,
7810    >;
7811    fn r#route(&self, mut payload: RouteRequest) -> Self::RouteResponseFut {
7812        fn _decode(
7813            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7814        ) -> Result<DirectoryRouterRouteResult, fidl::Error> {
7815            let _response = fidl::client::decode_transaction_body::<
7816                fidl::encoding::FlexibleResultType<DirectoryRouterRouteResponse, RouterError>,
7817                fdomain_client::fidl::FDomainResourceDialect,
7818                0x683b6c6be21b0f21,
7819            >(_buf?)?
7820            .into_result_fdomain::<DirectoryRouterMarker>("route")?;
7821            Ok(_response.map(|x| x))
7822        }
7823        self.client.send_query_and_decode::<RouteRequest, DirectoryRouterRouteResult>(
7824            &mut payload,
7825            0x683b6c6be21b0f21,
7826            fidl::encoding::DynamicFlags::FLEXIBLE,
7827            _decode,
7828        )
7829    }
7830}
7831
7832pub struct DirectoryRouterEventStream {
7833    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
7834}
7835
7836impl std::marker::Unpin for DirectoryRouterEventStream {}
7837
7838impl futures::stream::FusedStream for DirectoryRouterEventStream {
7839    fn is_terminated(&self) -> bool {
7840        self.event_receiver.is_terminated()
7841    }
7842}
7843
7844impl futures::Stream for DirectoryRouterEventStream {
7845    type Item = Result<DirectoryRouterEvent, fidl::Error>;
7846
7847    fn poll_next(
7848        mut self: std::pin::Pin<&mut Self>,
7849        cx: &mut std::task::Context<'_>,
7850    ) -> std::task::Poll<Option<Self::Item>> {
7851        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7852            &mut self.event_receiver,
7853            cx
7854        )?) {
7855            Some(buf) => std::task::Poll::Ready(Some(DirectoryRouterEvent::decode(buf))),
7856            None => std::task::Poll::Ready(None),
7857        }
7858    }
7859}
7860
7861#[derive(Debug)]
7862pub enum DirectoryRouterEvent {
7863    #[non_exhaustive]
7864    _UnknownEvent {
7865        /// Ordinal of the event that was sent.
7866        ordinal: u64,
7867    },
7868}
7869
7870impl DirectoryRouterEvent {
7871    /// Decodes a message buffer as a [`DirectoryRouterEvent`].
7872    fn decode(
7873        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7874    ) -> Result<DirectoryRouterEvent, fidl::Error> {
7875        let (bytes, _handles) = buf.split_mut();
7876        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7877        debug_assert_eq!(tx_header.tx_id, 0);
7878        match tx_header.ordinal {
7879            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7880                Ok(DirectoryRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
7881            }
7882            _ => Err(fidl::Error::UnknownOrdinal {
7883                ordinal: tx_header.ordinal,
7884                protocol_name:
7885                    <DirectoryRouterMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
7886            }),
7887        }
7888    }
7889}
7890
7891/// A Stream of incoming requests for fuchsia.component.sandbox/DirectoryRouter.
7892pub struct DirectoryRouterRequestStream {
7893    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
7894    is_terminated: bool,
7895}
7896
7897impl std::marker::Unpin for DirectoryRouterRequestStream {}
7898
7899impl futures::stream::FusedStream for DirectoryRouterRequestStream {
7900    fn is_terminated(&self) -> bool {
7901        self.is_terminated
7902    }
7903}
7904
7905impl fdomain_client::fidl::RequestStream for DirectoryRouterRequestStream {
7906    type Protocol = DirectoryRouterMarker;
7907    type ControlHandle = DirectoryRouterControlHandle;
7908
7909    fn from_channel(channel: fdomain_client::Channel) -> Self {
7910        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7911    }
7912
7913    fn control_handle(&self) -> Self::ControlHandle {
7914        DirectoryRouterControlHandle { inner: self.inner.clone() }
7915    }
7916
7917    fn into_inner(
7918        self,
7919    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
7920    {
7921        (self.inner, self.is_terminated)
7922    }
7923
7924    fn from_inner(
7925        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
7926        is_terminated: bool,
7927    ) -> Self {
7928        Self { inner, is_terminated }
7929    }
7930}
7931
7932impl futures::Stream for DirectoryRouterRequestStream {
7933    type Item = Result<DirectoryRouterRequest, fidl::Error>;
7934
7935    fn poll_next(
7936        mut self: std::pin::Pin<&mut Self>,
7937        cx: &mut std::task::Context<'_>,
7938    ) -> std::task::Poll<Option<Self::Item>> {
7939        let this = &mut *self;
7940        if this.inner.check_shutdown(cx) {
7941            this.is_terminated = true;
7942            return std::task::Poll::Ready(None);
7943        }
7944        if this.is_terminated {
7945            panic!("polled DirectoryRouterRequestStream after completion");
7946        }
7947        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
7948            |bytes, handles| {
7949                match this.inner.channel().read_etc(cx, bytes, handles) {
7950                    std::task::Poll::Ready(Ok(())) => {}
7951                    std::task::Poll::Pending => return std::task::Poll::Pending,
7952                    std::task::Poll::Ready(Err(None)) => {
7953                        this.is_terminated = true;
7954                        return std::task::Poll::Ready(None);
7955                    }
7956                    std::task::Poll::Ready(Err(Some(e))) => {
7957                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7958                            e.into(),
7959                        ))));
7960                    }
7961                }
7962
7963                // A message has been received from the channel
7964                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7965
7966                std::task::Poll::Ready(Some(match header.ordinal {
7967                0x683b6c6be21b0f21 => {
7968                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7969                    let mut req = fidl::new_empty!(RouteRequest, fdomain_client::fidl::FDomainResourceDialect);
7970                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<RouteRequest>(&header, _body_bytes, handles, &mut req)?;
7971                    let control_handle = DirectoryRouterControlHandle {
7972                        inner: this.inner.clone(),
7973                    };
7974                    Ok(DirectoryRouterRequest::Route {payload: req,
7975                        responder: DirectoryRouterRouteResponder {
7976                            control_handle: std::mem::ManuallyDrop::new(control_handle),
7977                            tx_id: header.tx_id,
7978                        },
7979                    })
7980                }
7981                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7982                    Ok(DirectoryRouterRequest::_UnknownMethod {
7983                        ordinal: header.ordinal,
7984                        control_handle: DirectoryRouterControlHandle { inner: this.inner.clone() },
7985                        method_type: fidl::MethodType::OneWay,
7986                    })
7987                }
7988                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7989                    this.inner.send_framework_err(
7990                        fidl::encoding::FrameworkErr::UnknownMethod,
7991                        header.tx_id,
7992                        header.ordinal,
7993                        header.dynamic_flags(),
7994                        (bytes, handles),
7995                    )?;
7996                    Ok(DirectoryRouterRequest::_UnknownMethod {
7997                        ordinal: header.ordinal,
7998                        control_handle: DirectoryRouterControlHandle { inner: this.inner.clone() },
7999                        method_type: fidl::MethodType::TwoWay,
8000                    })
8001                }
8002                _ => Err(fidl::Error::UnknownOrdinal {
8003                    ordinal: header.ordinal,
8004                    protocol_name: <DirectoryRouterMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
8005                }),
8006            }))
8007            },
8008        )
8009    }
8010}
8011
8012#[derive(Debug)]
8013pub enum DirectoryRouterRequest {
8014    Route {
8015        payload: RouteRequest,
8016        responder: DirectoryRouterRouteResponder,
8017    },
8018    /// An interaction was received which does not match any known method.
8019    #[non_exhaustive]
8020    _UnknownMethod {
8021        /// Ordinal of the method that was called.
8022        ordinal: u64,
8023        control_handle: DirectoryRouterControlHandle,
8024        method_type: fidl::MethodType,
8025    },
8026}
8027
8028impl DirectoryRouterRequest {
8029    #[allow(irrefutable_let_patterns)]
8030    pub fn into_route(self) -> Option<(RouteRequest, DirectoryRouterRouteResponder)> {
8031        if let DirectoryRouterRequest::Route { payload, responder } = self {
8032            Some((payload, responder))
8033        } else {
8034            None
8035        }
8036    }
8037
8038    /// Name of the method defined in FIDL
8039    pub fn method_name(&self) -> &'static str {
8040        match *self {
8041            DirectoryRouterRequest::Route { .. } => "route",
8042            DirectoryRouterRequest::_UnknownMethod {
8043                method_type: fidl::MethodType::OneWay,
8044                ..
8045            } => "unknown one-way method",
8046            DirectoryRouterRequest::_UnknownMethod {
8047                method_type: fidl::MethodType::TwoWay,
8048                ..
8049            } => "unknown two-way method",
8050        }
8051    }
8052}
8053
8054#[derive(Debug, Clone)]
8055pub struct DirectoryRouterControlHandle {
8056    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
8057}
8058
8059impl fdomain_client::fidl::ControlHandle for DirectoryRouterControlHandle {
8060    fn shutdown(&self) {
8061        self.inner.shutdown()
8062    }
8063
8064    fn is_closed(&self) -> bool {
8065        self.inner.channel().is_closed()
8066    }
8067    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
8068        self.inner.channel().on_closed()
8069    }
8070}
8071
8072impl DirectoryRouterControlHandle {}
8073
8074#[must_use = "FIDL methods require a response to be sent"]
8075#[derive(Debug)]
8076pub struct DirectoryRouterRouteResponder {
8077    control_handle: std::mem::ManuallyDrop<DirectoryRouterControlHandle>,
8078    tx_id: u32,
8079}
8080
8081/// Set the the channel to be shutdown (see [`DirectoryRouterControlHandle::shutdown`])
8082/// if the responder is dropped without sending a response, so that the client
8083/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8084impl std::ops::Drop for DirectoryRouterRouteResponder {
8085    fn drop(&mut self) {
8086        self.control_handle.shutdown();
8087        // Safety: drops once, never accessed again
8088        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8089    }
8090}
8091
8092impl fdomain_client::fidl::Responder for DirectoryRouterRouteResponder {
8093    type ControlHandle = DirectoryRouterControlHandle;
8094
8095    fn control_handle(&self) -> &DirectoryRouterControlHandle {
8096        &self.control_handle
8097    }
8098
8099    fn drop_without_shutdown(mut self) {
8100        // Safety: drops once, never accessed again due to mem::forget
8101        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8102        // Prevent Drop from running (which would shut down the channel)
8103        std::mem::forget(self);
8104    }
8105}
8106
8107impl DirectoryRouterRouteResponder {
8108    /// Sends a response to the FIDL transaction.
8109    ///
8110    /// Sets the channel to shutdown if an error occurs.
8111    pub fn send(
8112        self,
8113        mut result: Result<DirectoryRouterRouteResponse, RouterError>,
8114    ) -> Result<(), fidl::Error> {
8115        let _result = self.send_raw(result);
8116        if _result.is_err() {
8117            self.control_handle.shutdown();
8118        }
8119        self.drop_without_shutdown();
8120        _result
8121    }
8122
8123    /// Similar to "send" but does not shutdown the channel if an error occurs.
8124    pub fn send_no_shutdown_on_err(
8125        self,
8126        mut result: Result<DirectoryRouterRouteResponse, RouterError>,
8127    ) -> Result<(), fidl::Error> {
8128        let _result = self.send_raw(result);
8129        self.drop_without_shutdown();
8130        _result
8131    }
8132
8133    fn send_raw(
8134        &self,
8135        mut result: Result<DirectoryRouterRouteResponse, RouterError>,
8136    ) -> Result<(), fidl::Error> {
8137        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
8138            DirectoryRouterRouteResponse,
8139            RouterError,
8140        >>(
8141            fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
8142            self.tx_id,
8143            0x683b6c6be21b0f21,
8144            fidl::encoding::DynamicFlags::FLEXIBLE,
8145        )
8146    }
8147}
8148
8149#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
8150pub struct ReceiverMarker;
8151
8152impl fdomain_client::fidl::ProtocolMarker for ReceiverMarker {
8153    type Proxy = ReceiverProxy;
8154    type RequestStream = ReceiverRequestStream;
8155
8156    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.Receiver";
8157}
8158impl fdomain_client::fidl::DiscoverableProtocolMarker for ReceiverMarker {}
8159
8160pub trait ReceiverProxyInterface: Send + Sync {
8161    fn r#receive(&self, channel: fdomain_client::Channel) -> Result<(), fidl::Error>;
8162}
8163
8164#[derive(Debug, Clone)]
8165pub struct ReceiverProxy {
8166    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
8167}
8168
8169impl fdomain_client::fidl::Proxy for ReceiverProxy {
8170    type Protocol = ReceiverMarker;
8171
8172    fn from_channel(inner: fdomain_client::Channel) -> Self {
8173        Self::new(inner)
8174    }
8175
8176    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
8177        self.client.into_channel().map_err(|client| Self { client })
8178    }
8179
8180    fn as_channel(&self) -> &fdomain_client::Channel {
8181        self.client.as_channel()
8182    }
8183}
8184
8185impl ReceiverProxy {
8186    /// Create a new Proxy for fuchsia.component.sandbox/Receiver.
8187    pub fn new(channel: fdomain_client::Channel) -> Self {
8188        let protocol_name = <ReceiverMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
8189        Self { client: fidl::client::Client::new(channel, protocol_name) }
8190    }
8191
8192    /// Get a Stream of events from the remote end of the protocol.
8193    ///
8194    /// # Panics
8195    ///
8196    /// Panics if the event stream was already taken.
8197    pub fn take_event_stream(&self) -> ReceiverEventStream {
8198        ReceiverEventStream { event_receiver: self.client.take_event_receiver() }
8199    }
8200
8201    /// Sends a channel to this receiver.
8202    pub fn r#receive(&self, mut channel: fdomain_client::Channel) -> Result<(), fidl::Error> {
8203        ReceiverProxyInterface::r#receive(self, channel)
8204    }
8205}
8206
8207impl ReceiverProxyInterface for ReceiverProxy {
8208    fn r#receive(&self, mut channel: fdomain_client::Channel) -> Result<(), fidl::Error> {
8209        self.client.send::<ProtocolPayload>(
8210            (channel,),
8211            0x4bae18ab7aa1a94,
8212            fidl::encoding::DynamicFlags::FLEXIBLE,
8213        )
8214    }
8215}
8216
8217pub struct ReceiverEventStream {
8218    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
8219}
8220
8221impl std::marker::Unpin for ReceiverEventStream {}
8222
8223impl futures::stream::FusedStream for ReceiverEventStream {
8224    fn is_terminated(&self) -> bool {
8225        self.event_receiver.is_terminated()
8226    }
8227}
8228
8229impl futures::Stream for ReceiverEventStream {
8230    type Item = Result<ReceiverEvent, fidl::Error>;
8231
8232    fn poll_next(
8233        mut self: std::pin::Pin<&mut Self>,
8234        cx: &mut std::task::Context<'_>,
8235    ) -> std::task::Poll<Option<Self::Item>> {
8236        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
8237            &mut self.event_receiver,
8238            cx
8239        )?) {
8240            Some(buf) => std::task::Poll::Ready(Some(ReceiverEvent::decode(buf))),
8241            None => std::task::Poll::Ready(None),
8242        }
8243    }
8244}
8245
8246#[derive(Debug)]
8247pub enum ReceiverEvent {
8248    #[non_exhaustive]
8249    _UnknownEvent {
8250        /// Ordinal of the event that was sent.
8251        ordinal: u64,
8252    },
8253}
8254
8255impl ReceiverEvent {
8256    /// Decodes a message buffer as a [`ReceiverEvent`].
8257    fn decode(
8258        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
8259    ) -> Result<ReceiverEvent, fidl::Error> {
8260        let (bytes, _handles) = buf.split_mut();
8261        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8262        debug_assert_eq!(tx_header.tx_id, 0);
8263        match tx_header.ordinal {
8264            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
8265                Ok(ReceiverEvent::_UnknownEvent { ordinal: tx_header.ordinal })
8266            }
8267            _ => Err(fidl::Error::UnknownOrdinal {
8268                ordinal: tx_header.ordinal,
8269                protocol_name: <ReceiverMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
8270            }),
8271        }
8272    }
8273}
8274
8275/// A Stream of incoming requests for fuchsia.component.sandbox/Receiver.
8276pub struct ReceiverRequestStream {
8277    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
8278    is_terminated: bool,
8279}
8280
8281impl std::marker::Unpin for ReceiverRequestStream {}
8282
8283impl futures::stream::FusedStream for ReceiverRequestStream {
8284    fn is_terminated(&self) -> bool {
8285        self.is_terminated
8286    }
8287}
8288
8289impl fdomain_client::fidl::RequestStream for ReceiverRequestStream {
8290    type Protocol = ReceiverMarker;
8291    type ControlHandle = ReceiverControlHandle;
8292
8293    fn from_channel(channel: fdomain_client::Channel) -> Self {
8294        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
8295    }
8296
8297    fn control_handle(&self) -> Self::ControlHandle {
8298        ReceiverControlHandle { inner: self.inner.clone() }
8299    }
8300
8301    fn into_inner(
8302        self,
8303    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
8304    {
8305        (self.inner, self.is_terminated)
8306    }
8307
8308    fn from_inner(
8309        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
8310        is_terminated: bool,
8311    ) -> Self {
8312        Self { inner, is_terminated }
8313    }
8314}
8315
8316impl futures::Stream for ReceiverRequestStream {
8317    type Item = Result<ReceiverRequest, fidl::Error>;
8318
8319    fn poll_next(
8320        mut self: std::pin::Pin<&mut Self>,
8321        cx: &mut std::task::Context<'_>,
8322    ) -> std::task::Poll<Option<Self::Item>> {
8323        let this = &mut *self;
8324        if this.inner.check_shutdown(cx) {
8325            this.is_terminated = true;
8326            return std::task::Poll::Ready(None);
8327        }
8328        if this.is_terminated {
8329            panic!("polled ReceiverRequestStream after completion");
8330        }
8331        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
8332            |bytes, handles| {
8333                match this.inner.channel().read_etc(cx, bytes, handles) {
8334                    std::task::Poll::Ready(Ok(())) => {}
8335                    std::task::Poll::Pending => return std::task::Poll::Pending,
8336                    std::task::Poll::Ready(Err(None)) => {
8337                        this.is_terminated = true;
8338                        return std::task::Poll::Ready(None);
8339                    }
8340                    std::task::Poll::Ready(Err(Some(e))) => {
8341                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
8342                            e.into(),
8343                        ))));
8344                    }
8345                }
8346
8347                // A message has been received from the channel
8348                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8349
8350                std::task::Poll::Ready(Some(match header.ordinal {
8351                    0x4bae18ab7aa1a94 => {
8352                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
8353                        let mut req = fidl::new_empty!(
8354                            ProtocolPayload,
8355                            fdomain_client::fidl::FDomainResourceDialect
8356                        );
8357                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<ProtocolPayload>(&header, _body_bytes, handles, &mut req)?;
8358                        let control_handle = ReceiverControlHandle { inner: this.inner.clone() };
8359                        Ok(ReceiverRequest::Receive { channel: req.channel, control_handle })
8360                    }
8361                    _ if header.tx_id == 0
8362                        && header
8363                            .dynamic_flags()
8364                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
8365                    {
8366                        Ok(ReceiverRequest::_UnknownMethod {
8367                            ordinal: header.ordinal,
8368                            control_handle: ReceiverControlHandle { inner: this.inner.clone() },
8369                            method_type: fidl::MethodType::OneWay,
8370                        })
8371                    }
8372                    _ if header
8373                        .dynamic_flags()
8374                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
8375                    {
8376                        this.inner.send_framework_err(
8377                            fidl::encoding::FrameworkErr::UnknownMethod,
8378                            header.tx_id,
8379                            header.ordinal,
8380                            header.dynamic_flags(),
8381                            (bytes, handles),
8382                        )?;
8383                        Ok(ReceiverRequest::_UnknownMethod {
8384                            ordinal: header.ordinal,
8385                            control_handle: ReceiverControlHandle { inner: this.inner.clone() },
8386                            method_type: fidl::MethodType::TwoWay,
8387                        })
8388                    }
8389                    _ => Err(fidl::Error::UnknownOrdinal {
8390                        ordinal: header.ordinal,
8391                        protocol_name:
8392                            <ReceiverMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
8393                    }),
8394                }))
8395            },
8396        )
8397    }
8398}
8399
8400/// A receiver is served by components and allows them to receive channels
8401/// from the framework.
8402#[derive(Debug)]
8403pub enum ReceiverRequest {
8404    /// Sends a channel to this receiver.
8405    Receive { channel: fdomain_client::Channel, control_handle: ReceiverControlHandle },
8406    /// An interaction was received which does not match any known method.
8407    #[non_exhaustive]
8408    _UnknownMethod {
8409        /// Ordinal of the method that was called.
8410        ordinal: u64,
8411        control_handle: ReceiverControlHandle,
8412        method_type: fidl::MethodType,
8413    },
8414}
8415
8416impl ReceiverRequest {
8417    #[allow(irrefutable_let_patterns)]
8418    pub fn into_receive(self) -> Option<(fdomain_client::Channel, ReceiverControlHandle)> {
8419        if let ReceiverRequest::Receive { channel, control_handle } = self {
8420            Some((channel, control_handle))
8421        } else {
8422            None
8423        }
8424    }
8425
8426    /// Name of the method defined in FIDL
8427    pub fn method_name(&self) -> &'static str {
8428        match *self {
8429            ReceiverRequest::Receive { .. } => "receive",
8430            ReceiverRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
8431                "unknown one-way method"
8432            }
8433            ReceiverRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
8434                "unknown two-way method"
8435            }
8436        }
8437    }
8438}
8439
8440#[derive(Debug, Clone)]
8441pub struct ReceiverControlHandle {
8442    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
8443}
8444
8445impl fdomain_client::fidl::ControlHandle for ReceiverControlHandle {
8446    fn shutdown(&self) {
8447        self.inner.shutdown()
8448    }
8449
8450    fn is_closed(&self) -> bool {
8451        self.inner.channel().is_closed()
8452    }
8453    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
8454        self.inner.channel().on_closed()
8455    }
8456}
8457
8458impl ReceiverControlHandle {}
8459
8460mod internal {
8461    use super::*;
8462
8463    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreConnectorCreateRequest {
8464        type Borrowed<'a> = &'a mut Self;
8465        fn take_or_borrow<'a>(
8466            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8467        ) -> Self::Borrowed<'a> {
8468            value
8469        }
8470    }
8471
8472    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreConnectorCreateRequest {
8473        type Owned = Self;
8474
8475        #[inline(always)]
8476        fn inline_align(_context: fidl::encoding::Context) -> usize {
8477            8
8478        }
8479
8480        #[inline(always)]
8481        fn inline_size(_context: fidl::encoding::Context) -> usize {
8482            16
8483        }
8484    }
8485
8486    unsafe impl
8487        fidl::encoding::Encode<
8488            CapabilityStoreConnectorCreateRequest,
8489            fdomain_client::fidl::FDomainResourceDialect,
8490        > for &mut CapabilityStoreConnectorCreateRequest
8491    {
8492        #[inline]
8493        unsafe fn encode(
8494            self,
8495            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8496            offset: usize,
8497            _depth: fidl::encoding::Depth,
8498        ) -> fidl::Result<()> {
8499            encoder.debug_check_bounds::<CapabilityStoreConnectorCreateRequest>(offset);
8500            // Delegate to tuple encoding.
8501            fidl::encoding::Encode::<CapabilityStoreConnectorCreateRequest, fdomain_client::fidl::FDomainResourceDialect>::encode(
8502                (
8503                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
8504                    <fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<ReceiverMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.receiver),
8505                ),
8506                encoder, offset, _depth
8507            )
8508        }
8509    }
8510    unsafe impl<
8511        T0: fidl::encoding::Encode<u64, fdomain_client::fidl::FDomainResourceDialect>,
8512        T1: fidl::encoding::Encode<
8513                fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<ReceiverMarker>>,
8514                fdomain_client::fidl::FDomainResourceDialect,
8515            >,
8516    >
8517        fidl::encoding::Encode<
8518            CapabilityStoreConnectorCreateRequest,
8519            fdomain_client::fidl::FDomainResourceDialect,
8520        > for (T0, T1)
8521    {
8522        #[inline]
8523        unsafe fn encode(
8524            self,
8525            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8526            offset: usize,
8527            depth: fidl::encoding::Depth,
8528        ) -> fidl::Result<()> {
8529            encoder.debug_check_bounds::<CapabilityStoreConnectorCreateRequest>(offset);
8530            // Zero out padding regions. There's no need to apply masks
8531            // because the unmasked parts will be overwritten by fields.
8532            unsafe {
8533                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
8534                (ptr as *mut u64).write_unaligned(0);
8535            }
8536            // Write the fields.
8537            self.0.encode(encoder, offset + 0, depth)?;
8538            self.1.encode(encoder, offset + 8, depth)?;
8539            Ok(())
8540        }
8541    }
8542
8543    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
8544        for CapabilityStoreConnectorCreateRequest
8545    {
8546        #[inline(always)]
8547        fn new_empty() -> Self {
8548            Self {
8549                id: fidl::new_empty!(u64, fdomain_client::fidl::FDomainResourceDialect),
8550                receiver: fidl::new_empty!(
8551                    fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<ReceiverMarker>>,
8552                    fdomain_client::fidl::FDomainResourceDialect
8553                ),
8554            }
8555        }
8556
8557        #[inline]
8558        unsafe fn decode(
8559            &mut self,
8560            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8561            offset: usize,
8562            _depth: fidl::encoding::Depth,
8563        ) -> fidl::Result<()> {
8564            decoder.debug_check_bounds::<Self>(offset);
8565            // Verify that padding bytes are zero.
8566            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
8567            let padval = unsafe { (ptr as *const u64).read_unaligned() };
8568            let mask = 0xffffffff00000000u64;
8569            let maskedval = padval & mask;
8570            if maskedval != 0 {
8571                return Err(fidl::Error::NonZeroPadding {
8572                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
8573                });
8574            }
8575            fidl::decode!(
8576                u64,
8577                fdomain_client::fidl::FDomainResourceDialect,
8578                &mut self.id,
8579                decoder,
8580                offset + 0,
8581                _depth
8582            )?;
8583            fidl::decode!(
8584                fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<ReceiverMarker>>,
8585                fdomain_client::fidl::FDomainResourceDialect,
8586                &mut self.receiver,
8587                decoder,
8588                offset + 8,
8589                _depth
8590            )?;
8591            Ok(())
8592        }
8593    }
8594
8595    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreConnectorOpenRequest {
8596        type Borrowed<'a> = &'a mut Self;
8597        fn take_or_borrow<'a>(
8598            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8599        ) -> Self::Borrowed<'a> {
8600            value
8601        }
8602    }
8603
8604    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreConnectorOpenRequest {
8605        type Owned = Self;
8606
8607        #[inline(always)]
8608        fn inline_align(_context: fidl::encoding::Context) -> usize {
8609            8
8610        }
8611
8612        #[inline(always)]
8613        fn inline_size(_context: fidl::encoding::Context) -> usize {
8614            16
8615        }
8616    }
8617
8618    unsafe impl
8619        fidl::encoding::Encode<
8620            CapabilityStoreConnectorOpenRequest,
8621            fdomain_client::fidl::FDomainResourceDialect,
8622        > for &mut CapabilityStoreConnectorOpenRequest
8623    {
8624        #[inline]
8625        unsafe fn encode(
8626            self,
8627            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8628            offset: usize,
8629            _depth: fidl::encoding::Depth,
8630        ) -> fidl::Result<()> {
8631            encoder.debug_check_bounds::<CapabilityStoreConnectorOpenRequest>(offset);
8632            // Delegate to tuple encoding.
8633            fidl::encoding::Encode::<
8634                CapabilityStoreConnectorOpenRequest,
8635                fdomain_client::fidl::FDomainResourceDialect,
8636            >::encode(
8637                (
8638                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
8639                    <fidl::encoding::HandleType<
8640                        fdomain_client::Channel,
8641                        { fidl::ObjectType::CHANNEL.into_raw() },
8642                        2147483648,
8643                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
8644                        &mut self.server_end
8645                    ),
8646                ),
8647                encoder,
8648                offset,
8649                _depth,
8650            )
8651        }
8652    }
8653    unsafe impl<
8654        T0: fidl::encoding::Encode<u64, fdomain_client::fidl::FDomainResourceDialect>,
8655        T1: fidl::encoding::Encode<
8656                fidl::encoding::HandleType<
8657                    fdomain_client::Channel,
8658                    { fidl::ObjectType::CHANNEL.into_raw() },
8659                    2147483648,
8660                >,
8661                fdomain_client::fidl::FDomainResourceDialect,
8662            >,
8663    >
8664        fidl::encoding::Encode<
8665            CapabilityStoreConnectorOpenRequest,
8666            fdomain_client::fidl::FDomainResourceDialect,
8667        > for (T0, T1)
8668    {
8669        #[inline]
8670        unsafe fn encode(
8671            self,
8672            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8673            offset: usize,
8674            depth: fidl::encoding::Depth,
8675        ) -> fidl::Result<()> {
8676            encoder.debug_check_bounds::<CapabilityStoreConnectorOpenRequest>(offset);
8677            // Zero out padding regions. There's no need to apply masks
8678            // because the unmasked parts will be overwritten by fields.
8679            unsafe {
8680                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
8681                (ptr as *mut u64).write_unaligned(0);
8682            }
8683            // Write the fields.
8684            self.0.encode(encoder, offset + 0, depth)?;
8685            self.1.encode(encoder, offset + 8, depth)?;
8686            Ok(())
8687        }
8688    }
8689
8690    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
8691        for CapabilityStoreConnectorOpenRequest
8692    {
8693        #[inline(always)]
8694        fn new_empty() -> Self {
8695            Self {
8696                id: fidl::new_empty!(u64, fdomain_client::fidl::FDomainResourceDialect),
8697                server_end: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
8698            }
8699        }
8700
8701        #[inline]
8702        unsafe fn decode(
8703            &mut self,
8704            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8705            offset: usize,
8706            _depth: fidl::encoding::Depth,
8707        ) -> fidl::Result<()> {
8708            decoder.debug_check_bounds::<Self>(offset);
8709            // Verify that padding bytes are zero.
8710            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
8711            let padval = unsafe { (ptr as *const u64).read_unaligned() };
8712            let mask = 0xffffffff00000000u64;
8713            let maskedval = padval & mask;
8714            if maskedval != 0 {
8715                return Err(fidl::Error::NonZeroPadding {
8716                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
8717                });
8718            }
8719            fidl::decode!(
8720                u64,
8721                fdomain_client::fidl::FDomainResourceDialect,
8722                &mut self.id,
8723                decoder,
8724                offset + 0,
8725                _depth
8726            )?;
8727            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)?;
8728            Ok(())
8729        }
8730    }
8731
8732    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDictionaryDrainRequest {
8733        type Borrowed<'a> = &'a mut Self;
8734        fn take_or_borrow<'a>(
8735            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8736        ) -> Self::Borrowed<'a> {
8737            value
8738        }
8739    }
8740
8741    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDictionaryDrainRequest {
8742        type Owned = Self;
8743
8744        #[inline(always)]
8745        fn inline_align(_context: fidl::encoding::Context) -> usize {
8746            8
8747        }
8748
8749        #[inline(always)]
8750        fn inline_size(_context: fidl::encoding::Context) -> usize {
8751            16
8752        }
8753    }
8754
8755    unsafe impl
8756        fidl::encoding::Encode<
8757            CapabilityStoreDictionaryDrainRequest,
8758            fdomain_client::fidl::FDomainResourceDialect,
8759        > for &mut CapabilityStoreDictionaryDrainRequest
8760    {
8761        #[inline]
8762        unsafe fn encode(
8763            self,
8764            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8765            offset: usize,
8766            _depth: fidl::encoding::Depth,
8767        ) -> fidl::Result<()> {
8768            encoder.debug_check_bounds::<CapabilityStoreDictionaryDrainRequest>(offset);
8769            // Delegate to tuple encoding.
8770            fidl::encoding::Encode::<
8771                CapabilityStoreDictionaryDrainRequest,
8772                fdomain_client::fidl::FDomainResourceDialect,
8773            >::encode(
8774                (
8775                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
8776                    <fidl::encoding::Optional<
8777                        fidl::encoding::Endpoint<
8778                            fdomain_client::fidl::ServerEnd<DictionaryDrainIteratorMarker>,
8779                        >,
8780                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
8781                        &mut self.iterator
8782                    ),
8783                ),
8784                encoder,
8785                offset,
8786                _depth,
8787            )
8788        }
8789    }
8790    unsafe impl<
8791        T0: fidl::encoding::Encode<u64, fdomain_client::fidl::FDomainResourceDialect>,
8792        T1: fidl::encoding::Encode<
8793                fidl::encoding::Optional<
8794                    fidl::encoding::Endpoint<
8795                        fdomain_client::fidl::ServerEnd<DictionaryDrainIteratorMarker>,
8796                    >,
8797                >,
8798                fdomain_client::fidl::FDomainResourceDialect,
8799            >,
8800    >
8801        fidl::encoding::Encode<
8802            CapabilityStoreDictionaryDrainRequest,
8803            fdomain_client::fidl::FDomainResourceDialect,
8804        > for (T0, T1)
8805    {
8806        #[inline]
8807        unsafe fn encode(
8808            self,
8809            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8810            offset: usize,
8811            depth: fidl::encoding::Depth,
8812        ) -> fidl::Result<()> {
8813            encoder.debug_check_bounds::<CapabilityStoreDictionaryDrainRequest>(offset);
8814            // Zero out padding regions. There's no need to apply masks
8815            // because the unmasked parts will be overwritten by fields.
8816            unsafe {
8817                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
8818                (ptr as *mut u64).write_unaligned(0);
8819            }
8820            // Write the fields.
8821            self.0.encode(encoder, offset + 0, depth)?;
8822            self.1.encode(encoder, offset + 8, depth)?;
8823            Ok(())
8824        }
8825    }
8826
8827    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
8828        for CapabilityStoreDictionaryDrainRequest
8829    {
8830        #[inline(always)]
8831        fn new_empty() -> Self {
8832            Self {
8833                id: fidl::new_empty!(u64, fdomain_client::fidl::FDomainResourceDialect),
8834                iterator: fidl::new_empty!(
8835                    fidl::encoding::Optional<
8836                        fidl::encoding::Endpoint<
8837                            fdomain_client::fidl::ServerEnd<DictionaryDrainIteratorMarker>,
8838                        >,
8839                    >,
8840                    fdomain_client::fidl::FDomainResourceDialect
8841                ),
8842            }
8843        }
8844
8845        #[inline]
8846        unsafe fn decode(
8847            &mut self,
8848            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8849            offset: usize,
8850            _depth: fidl::encoding::Depth,
8851        ) -> fidl::Result<()> {
8852            decoder.debug_check_bounds::<Self>(offset);
8853            // Verify that padding bytes are zero.
8854            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
8855            let padval = unsafe { (ptr as *const u64).read_unaligned() };
8856            let mask = 0xffffffff00000000u64;
8857            let maskedval = padval & mask;
8858            if maskedval != 0 {
8859                return Err(fidl::Error::NonZeroPadding {
8860                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
8861                });
8862            }
8863            fidl::decode!(
8864                u64,
8865                fdomain_client::fidl::FDomainResourceDialect,
8866                &mut self.id,
8867                decoder,
8868                offset + 0,
8869                _depth
8870            )?;
8871            fidl::decode!(
8872                fidl::encoding::Optional<
8873                    fidl::encoding::Endpoint<
8874                        fdomain_client::fidl::ServerEnd<DictionaryDrainIteratorMarker>,
8875                    >,
8876                >,
8877                fdomain_client::fidl::FDomainResourceDialect,
8878                &mut self.iterator,
8879                decoder,
8880                offset + 8,
8881                _depth
8882            )?;
8883            Ok(())
8884        }
8885    }
8886
8887    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDictionaryEnumerateRequest {
8888        type Borrowed<'a> = &'a mut Self;
8889        fn take_or_borrow<'a>(
8890            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8891        ) -> Self::Borrowed<'a> {
8892            value
8893        }
8894    }
8895
8896    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDictionaryEnumerateRequest {
8897        type Owned = Self;
8898
8899        #[inline(always)]
8900        fn inline_align(_context: fidl::encoding::Context) -> usize {
8901            8
8902        }
8903
8904        #[inline(always)]
8905        fn inline_size(_context: fidl::encoding::Context) -> usize {
8906            16
8907        }
8908    }
8909
8910    unsafe impl
8911        fidl::encoding::Encode<
8912            CapabilityStoreDictionaryEnumerateRequest,
8913            fdomain_client::fidl::FDomainResourceDialect,
8914        > for &mut CapabilityStoreDictionaryEnumerateRequest
8915    {
8916        #[inline]
8917        unsafe fn encode(
8918            self,
8919            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8920            offset: usize,
8921            _depth: fidl::encoding::Depth,
8922        ) -> fidl::Result<()> {
8923            encoder.debug_check_bounds::<CapabilityStoreDictionaryEnumerateRequest>(offset);
8924            // Delegate to tuple encoding.
8925            fidl::encoding::Encode::<
8926                CapabilityStoreDictionaryEnumerateRequest,
8927                fdomain_client::fidl::FDomainResourceDialect,
8928            >::encode(
8929                (
8930                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
8931                    <fidl::encoding::Endpoint<
8932                        fdomain_client::fidl::ServerEnd<DictionaryEnumerateIteratorMarker>,
8933                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
8934                        &mut self.iterator
8935                    ),
8936                ),
8937                encoder,
8938                offset,
8939                _depth,
8940            )
8941        }
8942    }
8943    unsafe impl<
8944        T0: fidl::encoding::Encode<u64, fdomain_client::fidl::FDomainResourceDialect>,
8945        T1: fidl::encoding::Encode<
8946                fidl::encoding::Endpoint<
8947                    fdomain_client::fidl::ServerEnd<DictionaryEnumerateIteratorMarker>,
8948                >,
8949                fdomain_client::fidl::FDomainResourceDialect,
8950            >,
8951    >
8952        fidl::encoding::Encode<
8953            CapabilityStoreDictionaryEnumerateRequest,
8954            fdomain_client::fidl::FDomainResourceDialect,
8955        > for (T0, T1)
8956    {
8957        #[inline]
8958        unsafe fn encode(
8959            self,
8960            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8961            offset: usize,
8962            depth: fidl::encoding::Depth,
8963        ) -> fidl::Result<()> {
8964            encoder.debug_check_bounds::<CapabilityStoreDictionaryEnumerateRequest>(offset);
8965            // Zero out padding regions. There's no need to apply masks
8966            // because the unmasked parts will be overwritten by fields.
8967            unsafe {
8968                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
8969                (ptr as *mut u64).write_unaligned(0);
8970            }
8971            // Write the fields.
8972            self.0.encode(encoder, offset + 0, depth)?;
8973            self.1.encode(encoder, offset + 8, depth)?;
8974            Ok(())
8975        }
8976    }
8977
8978    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
8979        for CapabilityStoreDictionaryEnumerateRequest
8980    {
8981        #[inline(always)]
8982        fn new_empty() -> Self {
8983            Self {
8984                id: fidl::new_empty!(u64, fdomain_client::fidl::FDomainResourceDialect),
8985                iterator: fidl::new_empty!(
8986                    fidl::encoding::Endpoint<
8987                        fdomain_client::fidl::ServerEnd<DictionaryEnumerateIteratorMarker>,
8988                    >,
8989                    fdomain_client::fidl::FDomainResourceDialect
8990                ),
8991            }
8992        }
8993
8994        #[inline]
8995        unsafe fn decode(
8996            &mut self,
8997            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8998            offset: usize,
8999            _depth: fidl::encoding::Depth,
9000        ) -> fidl::Result<()> {
9001            decoder.debug_check_bounds::<Self>(offset);
9002            // Verify that padding bytes are zero.
9003            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
9004            let padval = unsafe { (ptr as *const u64).read_unaligned() };
9005            let mask = 0xffffffff00000000u64;
9006            let maskedval = padval & mask;
9007            if maskedval != 0 {
9008                return Err(fidl::Error::NonZeroPadding {
9009                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
9010                });
9011            }
9012            fidl::decode!(
9013                u64,
9014                fdomain_client::fidl::FDomainResourceDialect,
9015                &mut self.id,
9016                decoder,
9017                offset + 0,
9018                _depth
9019            )?;
9020            fidl::decode!(
9021                fidl::encoding::Endpoint<
9022                    fdomain_client::fidl::ServerEnd<DictionaryEnumerateIteratorMarker>,
9023                >,
9024                fdomain_client::fidl::FDomainResourceDialect,
9025                &mut self.iterator,
9026                decoder,
9027                offset + 8,
9028                _depth
9029            )?;
9030            Ok(())
9031        }
9032    }
9033
9034    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDictionaryKeysRequest {
9035        type Borrowed<'a> = &'a mut Self;
9036        fn take_or_borrow<'a>(
9037            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9038        ) -> Self::Borrowed<'a> {
9039            value
9040        }
9041    }
9042
9043    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDictionaryKeysRequest {
9044        type Owned = Self;
9045
9046        #[inline(always)]
9047        fn inline_align(_context: fidl::encoding::Context) -> usize {
9048            8
9049        }
9050
9051        #[inline(always)]
9052        fn inline_size(_context: fidl::encoding::Context) -> usize {
9053            16
9054        }
9055    }
9056
9057    unsafe impl
9058        fidl::encoding::Encode<
9059            CapabilityStoreDictionaryKeysRequest,
9060            fdomain_client::fidl::FDomainResourceDialect,
9061        > for &mut CapabilityStoreDictionaryKeysRequest
9062    {
9063        #[inline]
9064        unsafe fn encode(
9065            self,
9066            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9067            offset: usize,
9068            _depth: fidl::encoding::Depth,
9069        ) -> fidl::Result<()> {
9070            encoder.debug_check_bounds::<CapabilityStoreDictionaryKeysRequest>(offset);
9071            // Delegate to tuple encoding.
9072            fidl::encoding::Encode::<
9073                CapabilityStoreDictionaryKeysRequest,
9074                fdomain_client::fidl::FDomainResourceDialect,
9075            >::encode(
9076                (
9077                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
9078                    <fidl::encoding::Endpoint<
9079                        fdomain_client::fidl::ServerEnd<DictionaryKeysIteratorMarker>,
9080                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9081                        &mut self.iterator
9082                    ),
9083                ),
9084                encoder,
9085                offset,
9086                _depth,
9087            )
9088        }
9089    }
9090    unsafe impl<
9091        T0: fidl::encoding::Encode<u64, fdomain_client::fidl::FDomainResourceDialect>,
9092        T1: fidl::encoding::Encode<
9093                fidl::encoding::Endpoint<
9094                    fdomain_client::fidl::ServerEnd<DictionaryKeysIteratorMarker>,
9095                >,
9096                fdomain_client::fidl::FDomainResourceDialect,
9097            >,
9098    >
9099        fidl::encoding::Encode<
9100            CapabilityStoreDictionaryKeysRequest,
9101            fdomain_client::fidl::FDomainResourceDialect,
9102        > for (T0, T1)
9103    {
9104        #[inline]
9105        unsafe fn encode(
9106            self,
9107            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9108            offset: usize,
9109            depth: fidl::encoding::Depth,
9110        ) -> fidl::Result<()> {
9111            encoder.debug_check_bounds::<CapabilityStoreDictionaryKeysRequest>(offset);
9112            // Zero out padding regions. There's no need to apply masks
9113            // because the unmasked parts will be overwritten by fields.
9114            unsafe {
9115                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
9116                (ptr as *mut u64).write_unaligned(0);
9117            }
9118            // Write the fields.
9119            self.0.encode(encoder, offset + 0, depth)?;
9120            self.1.encode(encoder, offset + 8, depth)?;
9121            Ok(())
9122        }
9123    }
9124
9125    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
9126        for CapabilityStoreDictionaryKeysRequest
9127    {
9128        #[inline(always)]
9129        fn new_empty() -> Self {
9130            Self {
9131                id: fidl::new_empty!(u64, fdomain_client::fidl::FDomainResourceDialect),
9132                iterator: fidl::new_empty!(
9133                    fidl::encoding::Endpoint<
9134                        fdomain_client::fidl::ServerEnd<DictionaryKeysIteratorMarker>,
9135                    >,
9136                    fdomain_client::fidl::FDomainResourceDialect
9137                ),
9138            }
9139        }
9140
9141        #[inline]
9142        unsafe fn decode(
9143            &mut self,
9144            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9145            offset: usize,
9146            _depth: fidl::encoding::Depth,
9147        ) -> fidl::Result<()> {
9148            decoder.debug_check_bounds::<Self>(offset);
9149            // Verify that padding bytes are zero.
9150            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
9151            let padval = unsafe { (ptr as *const u64).read_unaligned() };
9152            let mask = 0xffffffff00000000u64;
9153            let maskedval = padval & mask;
9154            if maskedval != 0 {
9155                return Err(fidl::Error::NonZeroPadding {
9156                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
9157                });
9158            }
9159            fidl::decode!(
9160                u64,
9161                fdomain_client::fidl::FDomainResourceDialect,
9162                &mut self.id,
9163                decoder,
9164                offset + 0,
9165                _depth
9166            )?;
9167            fidl::decode!(
9168                fidl::encoding::Endpoint<
9169                    fdomain_client::fidl::ServerEnd<DictionaryKeysIteratorMarker>,
9170                >,
9171                fdomain_client::fidl::FDomainResourceDialect,
9172                &mut self.iterator,
9173                decoder,
9174                offset + 8,
9175                _depth
9176            )?;
9177            Ok(())
9178        }
9179    }
9180
9181    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDictionaryLegacyExportRequest {
9182        type Borrowed<'a> = &'a mut Self;
9183        fn take_or_borrow<'a>(
9184            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9185        ) -> Self::Borrowed<'a> {
9186            value
9187        }
9188    }
9189
9190    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDictionaryLegacyExportRequest {
9191        type Owned = Self;
9192
9193        #[inline(always)]
9194        fn inline_align(_context: fidl::encoding::Context) -> usize {
9195            8
9196        }
9197
9198        #[inline(always)]
9199        fn inline_size(_context: fidl::encoding::Context) -> usize {
9200            16
9201        }
9202    }
9203
9204    unsafe impl
9205        fidl::encoding::Encode<
9206            CapabilityStoreDictionaryLegacyExportRequest,
9207            fdomain_client::fidl::FDomainResourceDialect,
9208        > for &mut CapabilityStoreDictionaryLegacyExportRequest
9209    {
9210        #[inline]
9211        unsafe fn encode(
9212            self,
9213            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9214            offset: usize,
9215            _depth: fidl::encoding::Depth,
9216        ) -> fidl::Result<()> {
9217            encoder.debug_check_bounds::<CapabilityStoreDictionaryLegacyExportRequest>(offset);
9218            // Delegate to tuple encoding.
9219            fidl::encoding::Encode::<
9220                CapabilityStoreDictionaryLegacyExportRequest,
9221                fdomain_client::fidl::FDomainResourceDialect,
9222            >::encode(
9223                (
9224                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
9225                    <fidl::encoding::HandleType<
9226                        fdomain_client::Channel,
9227                        { fidl::ObjectType::CHANNEL.into_raw() },
9228                        2147483648,
9229                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9230                        &mut self.server_end
9231                    ),
9232                ),
9233                encoder,
9234                offset,
9235                _depth,
9236            )
9237        }
9238    }
9239    unsafe impl<
9240        T0: fidl::encoding::Encode<u64, fdomain_client::fidl::FDomainResourceDialect>,
9241        T1: fidl::encoding::Encode<
9242                fidl::encoding::HandleType<
9243                    fdomain_client::Channel,
9244                    { fidl::ObjectType::CHANNEL.into_raw() },
9245                    2147483648,
9246                >,
9247                fdomain_client::fidl::FDomainResourceDialect,
9248            >,
9249    >
9250        fidl::encoding::Encode<
9251            CapabilityStoreDictionaryLegacyExportRequest,
9252            fdomain_client::fidl::FDomainResourceDialect,
9253        > for (T0, T1)
9254    {
9255        #[inline]
9256        unsafe fn encode(
9257            self,
9258            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9259            offset: usize,
9260            depth: fidl::encoding::Depth,
9261        ) -> fidl::Result<()> {
9262            encoder.debug_check_bounds::<CapabilityStoreDictionaryLegacyExportRequest>(offset);
9263            // Zero out padding regions. There's no need to apply masks
9264            // because the unmasked parts will be overwritten by fields.
9265            unsafe {
9266                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
9267                (ptr as *mut u64).write_unaligned(0);
9268            }
9269            // Write the fields.
9270            self.0.encode(encoder, offset + 0, depth)?;
9271            self.1.encode(encoder, offset + 8, depth)?;
9272            Ok(())
9273        }
9274    }
9275
9276    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
9277        for CapabilityStoreDictionaryLegacyExportRequest
9278    {
9279        #[inline(always)]
9280        fn new_empty() -> Self {
9281            Self {
9282                id: fidl::new_empty!(u64, fdomain_client::fidl::FDomainResourceDialect),
9283                server_end: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
9284            }
9285        }
9286
9287        #[inline]
9288        unsafe fn decode(
9289            &mut self,
9290            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9291            offset: usize,
9292            _depth: fidl::encoding::Depth,
9293        ) -> fidl::Result<()> {
9294            decoder.debug_check_bounds::<Self>(offset);
9295            // Verify that padding bytes are zero.
9296            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
9297            let padval = unsafe { (ptr as *const u64).read_unaligned() };
9298            let mask = 0xffffffff00000000u64;
9299            let maskedval = padval & mask;
9300            if maskedval != 0 {
9301                return Err(fidl::Error::NonZeroPadding {
9302                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
9303                });
9304            }
9305            fidl::decode!(
9306                u64,
9307                fdomain_client::fidl::FDomainResourceDialect,
9308                &mut self.id,
9309                decoder,
9310                offset + 0,
9311                _depth
9312            )?;
9313            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)?;
9314            Ok(())
9315        }
9316    }
9317
9318    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDictionaryLegacyImportRequest {
9319        type Borrowed<'a> = &'a mut Self;
9320        fn take_or_borrow<'a>(
9321            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9322        ) -> Self::Borrowed<'a> {
9323            value
9324        }
9325    }
9326
9327    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDictionaryLegacyImportRequest {
9328        type Owned = Self;
9329
9330        #[inline(always)]
9331        fn inline_align(_context: fidl::encoding::Context) -> usize {
9332            8
9333        }
9334
9335        #[inline(always)]
9336        fn inline_size(_context: fidl::encoding::Context) -> usize {
9337            16
9338        }
9339    }
9340
9341    unsafe impl
9342        fidl::encoding::Encode<
9343            CapabilityStoreDictionaryLegacyImportRequest,
9344            fdomain_client::fidl::FDomainResourceDialect,
9345        > for &mut CapabilityStoreDictionaryLegacyImportRequest
9346    {
9347        #[inline]
9348        unsafe fn encode(
9349            self,
9350            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9351            offset: usize,
9352            _depth: fidl::encoding::Depth,
9353        ) -> fidl::Result<()> {
9354            encoder.debug_check_bounds::<CapabilityStoreDictionaryLegacyImportRequest>(offset);
9355            // Delegate to tuple encoding.
9356            fidl::encoding::Encode::<
9357                CapabilityStoreDictionaryLegacyImportRequest,
9358                fdomain_client::fidl::FDomainResourceDialect,
9359            >::encode(
9360                (
9361                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
9362                    <fidl::encoding::HandleType<
9363                        fdomain_client::Channel,
9364                        { fidl::ObjectType::CHANNEL.into_raw() },
9365                        2147483648,
9366                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9367                        &mut self.client_end
9368                    ),
9369                ),
9370                encoder,
9371                offset,
9372                _depth,
9373            )
9374        }
9375    }
9376    unsafe impl<
9377        T0: fidl::encoding::Encode<u64, fdomain_client::fidl::FDomainResourceDialect>,
9378        T1: fidl::encoding::Encode<
9379                fidl::encoding::HandleType<
9380                    fdomain_client::Channel,
9381                    { fidl::ObjectType::CHANNEL.into_raw() },
9382                    2147483648,
9383                >,
9384                fdomain_client::fidl::FDomainResourceDialect,
9385            >,
9386    >
9387        fidl::encoding::Encode<
9388            CapabilityStoreDictionaryLegacyImportRequest,
9389            fdomain_client::fidl::FDomainResourceDialect,
9390        > for (T0, T1)
9391    {
9392        #[inline]
9393        unsafe fn encode(
9394            self,
9395            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9396            offset: usize,
9397            depth: fidl::encoding::Depth,
9398        ) -> fidl::Result<()> {
9399            encoder.debug_check_bounds::<CapabilityStoreDictionaryLegacyImportRequest>(offset);
9400            // Zero out padding regions. There's no need to apply masks
9401            // because the unmasked parts will be overwritten by fields.
9402            unsafe {
9403                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
9404                (ptr as *mut u64).write_unaligned(0);
9405            }
9406            // Write the fields.
9407            self.0.encode(encoder, offset + 0, depth)?;
9408            self.1.encode(encoder, offset + 8, depth)?;
9409            Ok(())
9410        }
9411    }
9412
9413    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
9414        for CapabilityStoreDictionaryLegacyImportRequest
9415    {
9416        #[inline(always)]
9417        fn new_empty() -> Self {
9418            Self {
9419                id: fidl::new_empty!(u64, fdomain_client::fidl::FDomainResourceDialect),
9420                client_end: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
9421            }
9422        }
9423
9424        #[inline]
9425        unsafe fn decode(
9426            &mut self,
9427            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9428            offset: usize,
9429            _depth: fidl::encoding::Depth,
9430        ) -> fidl::Result<()> {
9431            decoder.debug_check_bounds::<Self>(offset);
9432            // Verify that padding bytes are zero.
9433            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
9434            let padval = unsafe { (ptr as *const u64).read_unaligned() };
9435            let mask = 0xffffffff00000000u64;
9436            let maskedval = padval & mask;
9437            if maskedval != 0 {
9438                return Err(fidl::Error::NonZeroPadding {
9439                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
9440                });
9441            }
9442            fidl::decode!(
9443                u64,
9444                fdomain_client::fidl::FDomainResourceDialect,
9445                &mut self.id,
9446                decoder,
9447                offset + 0,
9448                _depth
9449            )?;
9450            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)?;
9451            Ok(())
9452        }
9453    }
9454
9455    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDirConnectorCreateRequest {
9456        type Borrowed<'a> = &'a mut Self;
9457        fn take_or_borrow<'a>(
9458            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9459        ) -> Self::Borrowed<'a> {
9460            value
9461        }
9462    }
9463
9464    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDirConnectorCreateRequest {
9465        type Owned = Self;
9466
9467        #[inline(always)]
9468        fn inline_align(_context: fidl::encoding::Context) -> usize {
9469            8
9470        }
9471
9472        #[inline(always)]
9473        fn inline_size(_context: fidl::encoding::Context) -> usize {
9474            16
9475        }
9476    }
9477
9478    unsafe impl
9479        fidl::encoding::Encode<
9480            CapabilityStoreDirConnectorCreateRequest,
9481            fdomain_client::fidl::FDomainResourceDialect,
9482        > for &mut CapabilityStoreDirConnectorCreateRequest
9483    {
9484        #[inline]
9485        unsafe fn encode(
9486            self,
9487            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9488            offset: usize,
9489            _depth: fidl::encoding::Depth,
9490        ) -> fidl::Result<()> {
9491            encoder.debug_check_bounds::<CapabilityStoreDirConnectorCreateRequest>(offset);
9492            // Delegate to tuple encoding.
9493            fidl::encoding::Encode::<CapabilityStoreDirConnectorCreateRequest, fdomain_client::fidl::FDomainResourceDialect>::encode(
9494                (
9495                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
9496                    <fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<DirReceiverMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.receiver),
9497                ),
9498                encoder, offset, _depth
9499            )
9500        }
9501    }
9502    unsafe impl<
9503        T0: fidl::encoding::Encode<u64, fdomain_client::fidl::FDomainResourceDialect>,
9504        T1: fidl::encoding::Encode<
9505                fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<DirReceiverMarker>>,
9506                fdomain_client::fidl::FDomainResourceDialect,
9507            >,
9508    >
9509        fidl::encoding::Encode<
9510            CapabilityStoreDirConnectorCreateRequest,
9511            fdomain_client::fidl::FDomainResourceDialect,
9512        > for (T0, T1)
9513    {
9514        #[inline]
9515        unsafe fn encode(
9516            self,
9517            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9518            offset: usize,
9519            depth: fidl::encoding::Depth,
9520        ) -> fidl::Result<()> {
9521            encoder.debug_check_bounds::<CapabilityStoreDirConnectorCreateRequest>(offset);
9522            // Zero out padding regions. There's no need to apply masks
9523            // because the unmasked parts will be overwritten by fields.
9524            unsafe {
9525                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
9526                (ptr as *mut u64).write_unaligned(0);
9527            }
9528            // Write the fields.
9529            self.0.encode(encoder, offset + 0, depth)?;
9530            self.1.encode(encoder, offset + 8, depth)?;
9531            Ok(())
9532        }
9533    }
9534
9535    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
9536        for CapabilityStoreDirConnectorCreateRequest
9537    {
9538        #[inline(always)]
9539        fn new_empty() -> Self {
9540            Self {
9541                id: fidl::new_empty!(u64, fdomain_client::fidl::FDomainResourceDialect),
9542                receiver: fidl::new_empty!(
9543                    fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<DirReceiverMarker>>,
9544                    fdomain_client::fidl::FDomainResourceDialect
9545                ),
9546            }
9547        }
9548
9549        #[inline]
9550        unsafe fn decode(
9551            &mut self,
9552            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9553            offset: usize,
9554            _depth: fidl::encoding::Depth,
9555        ) -> fidl::Result<()> {
9556            decoder.debug_check_bounds::<Self>(offset);
9557            // Verify that padding bytes are zero.
9558            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
9559            let padval = unsafe { (ptr as *const u64).read_unaligned() };
9560            let mask = 0xffffffff00000000u64;
9561            let maskedval = padval & mask;
9562            if maskedval != 0 {
9563                return Err(fidl::Error::NonZeroPadding {
9564                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
9565                });
9566            }
9567            fidl::decode!(
9568                u64,
9569                fdomain_client::fidl::FDomainResourceDialect,
9570                &mut self.id,
9571                decoder,
9572                offset + 0,
9573                _depth
9574            )?;
9575            fidl::decode!(
9576                fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<DirReceiverMarker>>,
9577                fdomain_client::fidl::FDomainResourceDialect,
9578                &mut self.receiver,
9579                decoder,
9580                offset + 8,
9581                _depth
9582            )?;
9583            Ok(())
9584        }
9585    }
9586
9587    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreImportRequest {
9588        type Borrowed<'a> = &'a mut Self;
9589        fn take_or_borrow<'a>(
9590            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9591        ) -> Self::Borrowed<'a> {
9592            value
9593        }
9594    }
9595
9596    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreImportRequest {
9597        type Owned = Self;
9598
9599        #[inline(always)]
9600        fn inline_align(_context: fidl::encoding::Context) -> usize {
9601            8
9602        }
9603
9604        #[inline(always)]
9605        fn inline_size(_context: fidl::encoding::Context) -> usize {
9606            24
9607        }
9608    }
9609
9610    unsafe impl
9611        fidl::encoding::Encode<
9612            CapabilityStoreImportRequest,
9613            fdomain_client::fidl::FDomainResourceDialect,
9614        > for &mut CapabilityStoreImportRequest
9615    {
9616        #[inline]
9617        unsafe fn encode(
9618            self,
9619            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9620            offset: usize,
9621            _depth: fidl::encoding::Depth,
9622        ) -> fidl::Result<()> {
9623            encoder.debug_check_bounds::<CapabilityStoreImportRequest>(offset);
9624            // Delegate to tuple encoding.
9625            fidl::encoding::Encode::<
9626                CapabilityStoreImportRequest,
9627                fdomain_client::fidl::FDomainResourceDialect,
9628            >::encode(
9629                (
9630                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
9631                    <Capability as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9632                        &mut self.capability,
9633                    ),
9634                ),
9635                encoder,
9636                offset,
9637                _depth,
9638            )
9639        }
9640    }
9641    unsafe impl<
9642        T0: fidl::encoding::Encode<u64, fdomain_client::fidl::FDomainResourceDialect>,
9643        T1: fidl::encoding::Encode<Capability, fdomain_client::fidl::FDomainResourceDialect>,
9644    >
9645        fidl::encoding::Encode<
9646            CapabilityStoreImportRequest,
9647            fdomain_client::fidl::FDomainResourceDialect,
9648        > for (T0, T1)
9649    {
9650        #[inline]
9651        unsafe fn encode(
9652            self,
9653            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9654            offset: usize,
9655            depth: fidl::encoding::Depth,
9656        ) -> fidl::Result<()> {
9657            encoder.debug_check_bounds::<CapabilityStoreImportRequest>(offset);
9658            // Zero out padding regions. There's no need to apply masks
9659            // because the unmasked parts will be overwritten by fields.
9660            // Write the fields.
9661            self.0.encode(encoder, offset + 0, depth)?;
9662            self.1.encode(encoder, offset + 8, depth)?;
9663            Ok(())
9664        }
9665    }
9666
9667    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
9668        for CapabilityStoreImportRequest
9669    {
9670        #[inline(always)]
9671        fn new_empty() -> Self {
9672            Self {
9673                id: fidl::new_empty!(u64, fdomain_client::fidl::FDomainResourceDialect),
9674                capability: fidl::new_empty!(
9675                    Capability,
9676                    fdomain_client::fidl::FDomainResourceDialect
9677                ),
9678            }
9679        }
9680
9681        #[inline]
9682        unsafe fn decode(
9683            &mut self,
9684            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9685            offset: usize,
9686            _depth: fidl::encoding::Depth,
9687        ) -> fidl::Result<()> {
9688            decoder.debug_check_bounds::<Self>(offset);
9689            // Verify that padding bytes are zero.
9690            fidl::decode!(
9691                u64,
9692                fdomain_client::fidl::FDomainResourceDialect,
9693                &mut self.id,
9694                decoder,
9695                offset + 0,
9696                _depth
9697            )?;
9698            fidl::decode!(
9699                Capability,
9700                fdomain_client::fidl::FDomainResourceDialect,
9701                &mut self.capability,
9702                decoder,
9703                offset + 8,
9704                _depth
9705            )?;
9706            Ok(())
9707        }
9708    }
9709
9710    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreExportResponse {
9711        type Borrowed<'a> = &'a mut Self;
9712        fn take_or_borrow<'a>(
9713            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9714        ) -> Self::Borrowed<'a> {
9715            value
9716        }
9717    }
9718
9719    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreExportResponse {
9720        type Owned = Self;
9721
9722        #[inline(always)]
9723        fn inline_align(_context: fidl::encoding::Context) -> usize {
9724            8
9725        }
9726
9727        #[inline(always)]
9728        fn inline_size(_context: fidl::encoding::Context) -> usize {
9729            16
9730        }
9731    }
9732
9733    unsafe impl
9734        fidl::encoding::Encode<
9735            CapabilityStoreExportResponse,
9736            fdomain_client::fidl::FDomainResourceDialect,
9737        > for &mut CapabilityStoreExportResponse
9738    {
9739        #[inline]
9740        unsafe fn encode(
9741            self,
9742            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9743            offset: usize,
9744            _depth: fidl::encoding::Depth,
9745        ) -> fidl::Result<()> {
9746            encoder.debug_check_bounds::<CapabilityStoreExportResponse>(offset);
9747            // Delegate to tuple encoding.
9748            fidl::encoding::Encode::<
9749                CapabilityStoreExportResponse,
9750                fdomain_client::fidl::FDomainResourceDialect,
9751            >::encode(
9752                (<Capability as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9753                    &mut self.capability,
9754                ),),
9755                encoder,
9756                offset,
9757                _depth,
9758            )
9759        }
9760    }
9761    unsafe impl<
9762        T0: fidl::encoding::Encode<Capability, fdomain_client::fidl::FDomainResourceDialect>,
9763    >
9764        fidl::encoding::Encode<
9765            CapabilityStoreExportResponse,
9766            fdomain_client::fidl::FDomainResourceDialect,
9767        > for (T0,)
9768    {
9769        #[inline]
9770        unsafe fn encode(
9771            self,
9772            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9773            offset: usize,
9774            depth: fidl::encoding::Depth,
9775        ) -> fidl::Result<()> {
9776            encoder.debug_check_bounds::<CapabilityStoreExportResponse>(offset);
9777            // Zero out padding regions. There's no need to apply masks
9778            // because the unmasked parts will be overwritten by fields.
9779            // Write the fields.
9780            self.0.encode(encoder, offset + 0, depth)?;
9781            Ok(())
9782        }
9783    }
9784
9785    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
9786        for CapabilityStoreExportResponse
9787    {
9788        #[inline(always)]
9789        fn new_empty() -> Self {
9790            Self {
9791                capability: fidl::new_empty!(
9792                    Capability,
9793                    fdomain_client::fidl::FDomainResourceDialect
9794                ),
9795            }
9796        }
9797
9798        #[inline]
9799        unsafe fn decode(
9800            &mut self,
9801            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9802            offset: usize,
9803            _depth: fidl::encoding::Depth,
9804        ) -> fidl::Result<()> {
9805            decoder.debug_check_bounds::<Self>(offset);
9806            // Verify that padding bytes are zero.
9807            fidl::decode!(
9808                Capability,
9809                fdomain_client::fidl::FDomainResourceDialect,
9810                &mut self.capability,
9811                decoder,
9812                offset + 0,
9813                _depth
9814            )?;
9815            Ok(())
9816        }
9817    }
9818
9819    impl fidl::encoding::ResourceTypeMarker for Connector {
9820        type Borrowed<'a> = &'a mut Self;
9821        fn take_or_borrow<'a>(
9822            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9823        ) -> Self::Borrowed<'a> {
9824            value
9825        }
9826    }
9827
9828    unsafe impl fidl::encoding::TypeMarker for Connector {
9829        type Owned = Self;
9830
9831        #[inline(always)]
9832        fn inline_align(_context: fidl::encoding::Context) -> usize {
9833            4
9834        }
9835
9836        #[inline(always)]
9837        fn inline_size(_context: fidl::encoding::Context) -> usize {
9838            4
9839        }
9840    }
9841
9842    unsafe impl fidl::encoding::Encode<Connector, fdomain_client::fidl::FDomainResourceDialect>
9843        for &mut Connector
9844    {
9845        #[inline]
9846        unsafe fn encode(
9847            self,
9848            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9849            offset: usize,
9850            _depth: fidl::encoding::Depth,
9851        ) -> fidl::Result<()> {
9852            encoder.debug_check_bounds::<Connector>(offset);
9853            // Delegate to tuple encoding.
9854            fidl::encoding::Encode::<Connector, fdomain_client::fidl::FDomainResourceDialect>::encode(
9855                (
9856                    <fidl::encoding::HandleType<fdomain_client::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.token),
9857                ),
9858                encoder, offset, _depth
9859            )
9860        }
9861    }
9862    unsafe impl<
9863        T0: fidl::encoding::Encode<
9864                fidl::encoding::HandleType<
9865                    fdomain_client::EventPair,
9866                    { fidl::ObjectType::EVENTPAIR.into_raw() },
9867                    2147483648,
9868                >,
9869                fdomain_client::fidl::FDomainResourceDialect,
9870            >,
9871    > fidl::encoding::Encode<Connector, fdomain_client::fidl::FDomainResourceDialect> for (T0,)
9872    {
9873        #[inline]
9874        unsafe fn encode(
9875            self,
9876            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9877            offset: usize,
9878            depth: fidl::encoding::Depth,
9879        ) -> fidl::Result<()> {
9880            encoder.debug_check_bounds::<Connector>(offset);
9881            // Zero out padding regions. There's no need to apply masks
9882            // because the unmasked parts will be overwritten by fields.
9883            // Write the fields.
9884            self.0.encode(encoder, offset + 0, depth)?;
9885            Ok(())
9886        }
9887    }
9888
9889    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect> for Connector {
9890        #[inline(always)]
9891        fn new_empty() -> Self {
9892            Self {
9893                token: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
9894            }
9895        }
9896
9897        #[inline]
9898        unsafe fn decode(
9899            &mut self,
9900            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9901            offset: usize,
9902            _depth: fidl::encoding::Depth,
9903        ) -> fidl::Result<()> {
9904            decoder.debug_check_bounds::<Self>(offset);
9905            // Verify that padding bytes are zero.
9906            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)?;
9907            Ok(())
9908        }
9909    }
9910
9911    impl fidl::encoding::ResourceTypeMarker for DictionaryDrainIteratorGetNextResponse {
9912        type Borrowed<'a> = &'a mut Self;
9913        fn take_or_borrow<'a>(
9914            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9915        ) -> Self::Borrowed<'a> {
9916            value
9917        }
9918    }
9919
9920    unsafe impl fidl::encoding::TypeMarker for DictionaryDrainIteratorGetNextResponse {
9921        type Owned = Self;
9922
9923        #[inline(always)]
9924        fn inline_align(_context: fidl::encoding::Context) -> usize {
9925            8
9926        }
9927
9928        #[inline(always)]
9929        fn inline_size(_context: fidl::encoding::Context) -> usize {
9930            24
9931        }
9932    }
9933
9934    unsafe impl
9935        fidl::encoding::Encode<
9936            DictionaryDrainIteratorGetNextResponse,
9937            fdomain_client::fidl::FDomainResourceDialect,
9938        > for &mut DictionaryDrainIteratorGetNextResponse
9939    {
9940        #[inline]
9941        unsafe fn encode(
9942            self,
9943            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9944            offset: usize,
9945            _depth: fidl::encoding::Depth,
9946        ) -> fidl::Result<()> {
9947            encoder.debug_check_bounds::<DictionaryDrainIteratorGetNextResponse>(offset);
9948            // Delegate to tuple encoding.
9949            fidl::encoding::Encode::<DictionaryDrainIteratorGetNextResponse, fdomain_client::fidl::FDomainResourceDialect>::encode(
9950                (
9951                    <fidl::encoding::Vector<DictionaryItem, 128> as fidl::encoding::ValueTypeMarker>::borrow(&self.items),
9952                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.end_id),
9953                ),
9954                encoder, offset, _depth
9955            )
9956        }
9957    }
9958    unsafe impl<
9959        T0: fidl::encoding::Encode<
9960                fidl::encoding::Vector<DictionaryItem, 128>,
9961                fdomain_client::fidl::FDomainResourceDialect,
9962            >,
9963        T1: fidl::encoding::Encode<u64, fdomain_client::fidl::FDomainResourceDialect>,
9964    >
9965        fidl::encoding::Encode<
9966            DictionaryDrainIteratorGetNextResponse,
9967            fdomain_client::fidl::FDomainResourceDialect,
9968        > for (T0, T1)
9969    {
9970        #[inline]
9971        unsafe fn encode(
9972            self,
9973            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9974            offset: usize,
9975            depth: fidl::encoding::Depth,
9976        ) -> fidl::Result<()> {
9977            encoder.debug_check_bounds::<DictionaryDrainIteratorGetNextResponse>(offset);
9978            // Zero out padding regions. There's no need to apply masks
9979            // because the unmasked parts will be overwritten by fields.
9980            // Write the fields.
9981            self.0.encode(encoder, offset + 0, depth)?;
9982            self.1.encode(encoder, offset + 16, depth)?;
9983            Ok(())
9984        }
9985    }
9986
9987    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
9988        for DictionaryDrainIteratorGetNextResponse
9989    {
9990        #[inline(always)]
9991        fn new_empty() -> Self {
9992            Self {
9993                items: fidl::new_empty!(fidl::encoding::Vector<DictionaryItem, 128>, fdomain_client::fidl::FDomainResourceDialect),
9994                end_id: fidl::new_empty!(u64, fdomain_client::fidl::FDomainResourceDialect),
9995            }
9996        }
9997
9998        #[inline]
9999        unsafe fn decode(
10000            &mut self,
10001            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10002            offset: usize,
10003            _depth: fidl::encoding::Depth,
10004        ) -> fidl::Result<()> {
10005            decoder.debug_check_bounds::<Self>(offset);
10006            // Verify that padding bytes are zero.
10007            fidl::decode!(fidl::encoding::Vector<DictionaryItem, 128>, fdomain_client::fidl::FDomainResourceDialect, &mut self.items, decoder, offset + 0, _depth)?;
10008            fidl::decode!(
10009                u64,
10010                fdomain_client::fidl::FDomainResourceDialect,
10011                &mut self.end_id,
10012                decoder,
10013                offset + 16,
10014                _depth
10015            )?;
10016            Ok(())
10017        }
10018    }
10019
10020    impl fidl::encoding::ResourceTypeMarker for DictionaryEnumerateIteratorGetNextResponse {
10021        type Borrowed<'a> = &'a mut Self;
10022        fn take_or_borrow<'a>(
10023            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10024        ) -> Self::Borrowed<'a> {
10025            value
10026        }
10027    }
10028
10029    unsafe impl fidl::encoding::TypeMarker for DictionaryEnumerateIteratorGetNextResponse {
10030        type Owned = Self;
10031
10032        #[inline(always)]
10033        fn inline_align(_context: fidl::encoding::Context) -> usize {
10034            8
10035        }
10036
10037        #[inline(always)]
10038        fn inline_size(_context: fidl::encoding::Context) -> usize {
10039            24
10040        }
10041    }
10042
10043    unsafe impl
10044        fidl::encoding::Encode<
10045            DictionaryEnumerateIteratorGetNextResponse,
10046            fdomain_client::fidl::FDomainResourceDialect,
10047        > for &mut DictionaryEnumerateIteratorGetNextResponse
10048    {
10049        #[inline]
10050        unsafe fn encode(
10051            self,
10052            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10053            offset: usize,
10054            _depth: fidl::encoding::Depth,
10055        ) -> fidl::Result<()> {
10056            encoder.debug_check_bounds::<DictionaryEnumerateIteratorGetNextResponse>(offset);
10057            // Delegate to tuple encoding.
10058            fidl::encoding::Encode::<DictionaryEnumerateIteratorGetNextResponse, fdomain_client::fidl::FDomainResourceDialect>::encode(
10059                (
10060                    <fidl::encoding::Vector<DictionaryOptionalItem, 128> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.items),
10061                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.end_id),
10062                ),
10063                encoder, offset, _depth
10064            )
10065        }
10066    }
10067    unsafe impl<
10068        T0: fidl::encoding::Encode<
10069                fidl::encoding::Vector<DictionaryOptionalItem, 128>,
10070                fdomain_client::fidl::FDomainResourceDialect,
10071            >,
10072        T1: fidl::encoding::Encode<u64, fdomain_client::fidl::FDomainResourceDialect>,
10073    >
10074        fidl::encoding::Encode<
10075            DictionaryEnumerateIteratorGetNextResponse,
10076            fdomain_client::fidl::FDomainResourceDialect,
10077        > for (T0, T1)
10078    {
10079        #[inline]
10080        unsafe fn encode(
10081            self,
10082            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10083            offset: usize,
10084            depth: fidl::encoding::Depth,
10085        ) -> fidl::Result<()> {
10086            encoder.debug_check_bounds::<DictionaryEnumerateIteratorGetNextResponse>(offset);
10087            // Zero out padding regions. There's no need to apply masks
10088            // because the unmasked parts will be overwritten by fields.
10089            // Write the fields.
10090            self.0.encode(encoder, offset + 0, depth)?;
10091            self.1.encode(encoder, offset + 16, depth)?;
10092            Ok(())
10093        }
10094    }
10095
10096    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
10097        for DictionaryEnumerateIteratorGetNextResponse
10098    {
10099        #[inline(always)]
10100        fn new_empty() -> Self {
10101            Self {
10102                items: fidl::new_empty!(fidl::encoding::Vector<DictionaryOptionalItem, 128>, fdomain_client::fidl::FDomainResourceDialect),
10103                end_id: fidl::new_empty!(u64, fdomain_client::fidl::FDomainResourceDialect),
10104            }
10105        }
10106
10107        #[inline]
10108        unsafe fn decode(
10109            &mut self,
10110            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10111            offset: usize,
10112            _depth: fidl::encoding::Depth,
10113        ) -> fidl::Result<()> {
10114            decoder.debug_check_bounds::<Self>(offset);
10115            // Verify that padding bytes are zero.
10116            fidl::decode!(fidl::encoding::Vector<DictionaryOptionalItem, 128>, fdomain_client::fidl::FDomainResourceDialect, &mut self.items, decoder, offset + 0, _depth)?;
10117            fidl::decode!(
10118                u64,
10119                fdomain_client::fidl::FDomainResourceDialect,
10120                &mut self.end_id,
10121                decoder,
10122                offset + 16,
10123                _depth
10124            )?;
10125            Ok(())
10126        }
10127    }
10128
10129    impl fidl::encoding::ResourceTypeMarker for DictionaryKeysIteratorGetNextResponse {
10130        type Borrowed<'a> = &'a mut Self;
10131        fn take_or_borrow<'a>(
10132            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10133        ) -> Self::Borrowed<'a> {
10134            value
10135        }
10136    }
10137
10138    unsafe impl fidl::encoding::TypeMarker for DictionaryKeysIteratorGetNextResponse {
10139        type Owned = Self;
10140
10141        #[inline(always)]
10142        fn inline_align(_context: fidl::encoding::Context) -> usize {
10143            8
10144        }
10145
10146        #[inline(always)]
10147        fn inline_size(_context: fidl::encoding::Context) -> usize {
10148            16
10149        }
10150    }
10151
10152    unsafe impl
10153        fidl::encoding::Encode<
10154            DictionaryKeysIteratorGetNextResponse,
10155            fdomain_client::fidl::FDomainResourceDialect,
10156        > for &mut DictionaryKeysIteratorGetNextResponse
10157    {
10158        #[inline]
10159        unsafe fn encode(
10160            self,
10161            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10162            offset: usize,
10163            _depth: fidl::encoding::Depth,
10164        ) -> fidl::Result<()> {
10165            encoder.debug_check_bounds::<DictionaryKeysIteratorGetNextResponse>(offset);
10166            // Delegate to tuple encoding.
10167            fidl::encoding::Encode::<DictionaryKeysIteratorGetNextResponse, fdomain_client::fidl::FDomainResourceDialect>::encode(
10168                (
10169                    <fidl::encoding::Vector<fidl::encoding::BoundedString<255>, 128> as fidl::encoding::ValueTypeMarker>::borrow(&self.keys),
10170                ),
10171                encoder, offset, _depth
10172            )
10173        }
10174    }
10175    unsafe impl<
10176        T0: fidl::encoding::Encode<
10177                fidl::encoding::Vector<fidl::encoding::BoundedString<255>, 128>,
10178                fdomain_client::fidl::FDomainResourceDialect,
10179            >,
10180    >
10181        fidl::encoding::Encode<
10182            DictionaryKeysIteratorGetNextResponse,
10183            fdomain_client::fidl::FDomainResourceDialect,
10184        > for (T0,)
10185    {
10186        #[inline]
10187        unsafe fn encode(
10188            self,
10189            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10190            offset: usize,
10191            depth: fidl::encoding::Depth,
10192        ) -> fidl::Result<()> {
10193            encoder.debug_check_bounds::<DictionaryKeysIteratorGetNextResponse>(offset);
10194            // Zero out padding regions. There's no need to apply masks
10195            // because the unmasked parts will be overwritten by fields.
10196            // Write the fields.
10197            self.0.encode(encoder, offset + 0, depth)?;
10198            Ok(())
10199        }
10200    }
10201
10202    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
10203        for DictionaryKeysIteratorGetNextResponse
10204    {
10205        #[inline(always)]
10206        fn new_empty() -> Self {
10207            Self {
10208                keys: fidl::new_empty!(
10209                    fidl::encoding::Vector<fidl::encoding::BoundedString<255>, 128>,
10210                    fdomain_client::fidl::FDomainResourceDialect
10211                ),
10212            }
10213        }
10214
10215        #[inline]
10216        unsafe fn decode(
10217            &mut self,
10218            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10219            offset: usize,
10220            _depth: fidl::encoding::Depth,
10221        ) -> fidl::Result<()> {
10222            decoder.debug_check_bounds::<Self>(offset);
10223            // Verify that padding bytes are zero.
10224            fidl::decode!(
10225                fidl::encoding::Vector<fidl::encoding::BoundedString<255>, 128>,
10226                fdomain_client::fidl::FDomainResourceDialect,
10227                &mut self.keys,
10228                decoder,
10229                offset + 0,
10230                _depth
10231            )?;
10232            Ok(())
10233        }
10234    }
10235
10236    impl fidl::encoding::ResourceTypeMarker for DictionaryOptionalItem {
10237        type Borrowed<'a> = &'a mut Self;
10238        fn take_or_borrow<'a>(
10239            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10240        ) -> Self::Borrowed<'a> {
10241            value
10242        }
10243    }
10244
10245    unsafe impl fidl::encoding::TypeMarker for DictionaryOptionalItem {
10246        type Owned = Self;
10247
10248        #[inline(always)]
10249        fn inline_align(_context: fidl::encoding::Context) -> usize {
10250            8
10251        }
10252
10253        #[inline(always)]
10254        fn inline_size(_context: fidl::encoding::Context) -> usize {
10255            24
10256        }
10257    }
10258
10259    unsafe impl
10260        fidl::encoding::Encode<DictionaryOptionalItem, fdomain_client::fidl::FDomainResourceDialect>
10261        for &mut DictionaryOptionalItem
10262    {
10263        #[inline]
10264        unsafe fn encode(
10265            self,
10266            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10267            offset: usize,
10268            _depth: fidl::encoding::Depth,
10269        ) -> fidl::Result<()> {
10270            encoder.debug_check_bounds::<DictionaryOptionalItem>(offset);
10271            // Delegate to tuple encoding.
10272            fidl::encoding::Encode::<DictionaryOptionalItem, fdomain_client::fidl::FDomainResourceDialect>::encode(
10273                (
10274                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(&self.key),
10275                    <fidl::encoding::Boxed<WrappedCapabilityId> as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
10276                ),
10277                encoder, offset, _depth
10278            )
10279        }
10280    }
10281    unsafe impl<
10282        T0: fidl::encoding::Encode<
10283                fidl::encoding::BoundedString<255>,
10284                fdomain_client::fidl::FDomainResourceDialect,
10285            >,
10286        T1: fidl::encoding::Encode<
10287                fidl::encoding::Boxed<WrappedCapabilityId>,
10288                fdomain_client::fidl::FDomainResourceDialect,
10289            >,
10290    >
10291        fidl::encoding::Encode<DictionaryOptionalItem, fdomain_client::fidl::FDomainResourceDialect>
10292        for (T0, T1)
10293    {
10294        #[inline]
10295        unsafe fn encode(
10296            self,
10297            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10298            offset: usize,
10299            depth: fidl::encoding::Depth,
10300        ) -> fidl::Result<()> {
10301            encoder.debug_check_bounds::<DictionaryOptionalItem>(offset);
10302            // Zero out padding regions. There's no need to apply masks
10303            // because the unmasked parts will be overwritten by fields.
10304            // Write the fields.
10305            self.0.encode(encoder, offset + 0, depth)?;
10306            self.1.encode(encoder, offset + 16, depth)?;
10307            Ok(())
10308        }
10309    }
10310
10311    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
10312        for DictionaryOptionalItem
10313    {
10314        #[inline(always)]
10315        fn new_empty() -> Self {
10316            Self {
10317                key: fidl::new_empty!(
10318                    fidl::encoding::BoundedString<255>,
10319                    fdomain_client::fidl::FDomainResourceDialect
10320                ),
10321                value: fidl::new_empty!(
10322                    fidl::encoding::Boxed<WrappedCapabilityId>,
10323                    fdomain_client::fidl::FDomainResourceDialect
10324                ),
10325            }
10326        }
10327
10328        #[inline]
10329        unsafe fn decode(
10330            &mut self,
10331            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10332            offset: usize,
10333            _depth: fidl::encoding::Depth,
10334        ) -> fidl::Result<()> {
10335            decoder.debug_check_bounds::<Self>(offset);
10336            // Verify that padding bytes are zero.
10337            fidl::decode!(
10338                fidl::encoding::BoundedString<255>,
10339                fdomain_client::fidl::FDomainResourceDialect,
10340                &mut self.key,
10341                decoder,
10342                offset + 0,
10343                _depth
10344            )?;
10345            fidl::decode!(
10346                fidl::encoding::Boxed<WrappedCapabilityId>,
10347                fdomain_client::fidl::FDomainResourceDialect,
10348                &mut self.value,
10349                decoder,
10350                offset + 16,
10351                _depth
10352            )?;
10353            Ok(())
10354        }
10355    }
10356
10357    impl fidl::encoding::ResourceTypeMarker for DictionaryRef {
10358        type Borrowed<'a> = &'a mut Self;
10359        fn take_or_borrow<'a>(
10360            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10361        ) -> Self::Borrowed<'a> {
10362            value
10363        }
10364    }
10365
10366    unsafe impl fidl::encoding::TypeMarker for DictionaryRef {
10367        type Owned = Self;
10368
10369        #[inline(always)]
10370        fn inline_align(_context: fidl::encoding::Context) -> usize {
10371            4
10372        }
10373
10374        #[inline(always)]
10375        fn inline_size(_context: fidl::encoding::Context) -> usize {
10376            4
10377        }
10378    }
10379
10380    unsafe impl fidl::encoding::Encode<DictionaryRef, fdomain_client::fidl::FDomainResourceDialect>
10381        for &mut DictionaryRef
10382    {
10383        #[inline]
10384        unsafe fn encode(
10385            self,
10386            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10387            offset: usize,
10388            _depth: fidl::encoding::Depth,
10389        ) -> fidl::Result<()> {
10390            encoder.debug_check_bounds::<DictionaryRef>(offset);
10391            // Delegate to tuple encoding.
10392            fidl::encoding::Encode::<DictionaryRef, fdomain_client::fidl::FDomainResourceDialect>::encode(
10393                (
10394                    <fidl::encoding::HandleType<fdomain_client::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.token),
10395                ),
10396                encoder, offset, _depth
10397            )
10398        }
10399    }
10400    unsafe impl<
10401        T0: fidl::encoding::Encode<
10402                fidl::encoding::HandleType<
10403                    fdomain_client::EventPair,
10404                    { fidl::ObjectType::EVENTPAIR.into_raw() },
10405                    2147483648,
10406                >,
10407                fdomain_client::fidl::FDomainResourceDialect,
10408            >,
10409    > fidl::encoding::Encode<DictionaryRef, fdomain_client::fidl::FDomainResourceDialect> for (T0,)
10410    {
10411        #[inline]
10412        unsafe fn encode(
10413            self,
10414            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10415            offset: usize,
10416            depth: fidl::encoding::Depth,
10417        ) -> fidl::Result<()> {
10418            encoder.debug_check_bounds::<DictionaryRef>(offset);
10419            // Zero out padding regions. There's no need to apply masks
10420            // because the unmasked parts will be overwritten by fields.
10421            // Write the fields.
10422            self.0.encode(encoder, offset + 0, depth)?;
10423            Ok(())
10424        }
10425    }
10426
10427    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect> for DictionaryRef {
10428        #[inline(always)]
10429        fn new_empty() -> Self {
10430            Self {
10431                token: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
10432            }
10433        }
10434
10435        #[inline]
10436        unsafe fn decode(
10437            &mut self,
10438            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10439            offset: usize,
10440            _depth: fidl::encoding::Depth,
10441        ) -> fidl::Result<()> {
10442            decoder.debug_check_bounds::<Self>(offset);
10443            // Verify that padding bytes are zero.
10444            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)?;
10445            Ok(())
10446        }
10447    }
10448
10449    impl fidl::encoding::ResourceTypeMarker for DirConnector {
10450        type Borrowed<'a> = &'a mut Self;
10451        fn take_or_borrow<'a>(
10452            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10453        ) -> Self::Borrowed<'a> {
10454            value
10455        }
10456    }
10457
10458    unsafe impl fidl::encoding::TypeMarker for DirConnector {
10459        type Owned = Self;
10460
10461        #[inline(always)]
10462        fn inline_align(_context: fidl::encoding::Context) -> usize {
10463            4
10464        }
10465
10466        #[inline(always)]
10467        fn inline_size(_context: fidl::encoding::Context) -> usize {
10468            4
10469        }
10470    }
10471
10472    unsafe impl fidl::encoding::Encode<DirConnector, fdomain_client::fidl::FDomainResourceDialect>
10473        for &mut DirConnector
10474    {
10475        #[inline]
10476        unsafe fn encode(
10477            self,
10478            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10479            offset: usize,
10480            _depth: fidl::encoding::Depth,
10481        ) -> fidl::Result<()> {
10482            encoder.debug_check_bounds::<DirConnector>(offset);
10483            // Delegate to tuple encoding.
10484            fidl::encoding::Encode::<DirConnector, fdomain_client::fidl::FDomainResourceDialect>::encode(
10485                (
10486                    <fidl::encoding::HandleType<fdomain_client::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.token),
10487                ),
10488                encoder, offset, _depth
10489            )
10490        }
10491    }
10492    unsafe impl<
10493        T0: fidl::encoding::Encode<
10494                fidl::encoding::HandleType<
10495                    fdomain_client::EventPair,
10496                    { fidl::ObjectType::EVENTPAIR.into_raw() },
10497                    2147483648,
10498                >,
10499                fdomain_client::fidl::FDomainResourceDialect,
10500            >,
10501    > fidl::encoding::Encode<DirConnector, fdomain_client::fidl::FDomainResourceDialect> for (T0,)
10502    {
10503        #[inline]
10504        unsafe fn encode(
10505            self,
10506            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10507            offset: usize,
10508            depth: fidl::encoding::Depth,
10509        ) -> fidl::Result<()> {
10510            encoder.debug_check_bounds::<DirConnector>(offset);
10511            // Zero out padding regions. There's no need to apply masks
10512            // because the unmasked parts will be overwritten by fields.
10513            // Write the fields.
10514            self.0.encode(encoder, offset + 0, depth)?;
10515            Ok(())
10516        }
10517    }
10518
10519    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect> for DirConnector {
10520        #[inline(always)]
10521        fn new_empty() -> Self {
10522            Self {
10523                token: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
10524            }
10525        }
10526
10527        #[inline]
10528        unsafe fn decode(
10529            &mut self,
10530            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10531            offset: usize,
10532            _depth: fidl::encoding::Depth,
10533        ) -> fidl::Result<()> {
10534            decoder.debug_check_bounds::<Self>(offset);
10535            // Verify that padding bytes are zero.
10536            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)?;
10537            Ok(())
10538        }
10539    }
10540
10541    impl fidl::encoding::ResourceTypeMarker for DirEntry {
10542        type Borrowed<'a> = &'a mut Self;
10543        fn take_or_borrow<'a>(
10544            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10545        ) -> Self::Borrowed<'a> {
10546            value
10547        }
10548    }
10549
10550    unsafe impl fidl::encoding::TypeMarker for DirEntry {
10551        type Owned = Self;
10552
10553        #[inline(always)]
10554        fn inline_align(_context: fidl::encoding::Context) -> usize {
10555            4
10556        }
10557
10558        #[inline(always)]
10559        fn inline_size(_context: fidl::encoding::Context) -> usize {
10560            4
10561        }
10562    }
10563
10564    unsafe impl fidl::encoding::Encode<DirEntry, fdomain_client::fidl::FDomainResourceDialect>
10565        for &mut DirEntry
10566    {
10567        #[inline]
10568        unsafe fn encode(
10569            self,
10570            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10571            offset: usize,
10572            _depth: fidl::encoding::Depth,
10573        ) -> fidl::Result<()> {
10574            encoder.debug_check_bounds::<DirEntry>(offset);
10575            // Delegate to tuple encoding.
10576            fidl::encoding::Encode::<DirEntry, fdomain_client::fidl::FDomainResourceDialect>::encode(
10577                (<fidl::encoding::HandleType<
10578                    fdomain_client::EventPair,
10579                    { fidl::ObjectType::EVENTPAIR.into_raw() },
10580                    2147483648,
10581                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10582                    &mut self.token
10583                ),),
10584                encoder,
10585                offset,
10586                _depth,
10587            )
10588        }
10589    }
10590    unsafe impl<
10591        T0: fidl::encoding::Encode<
10592                fidl::encoding::HandleType<
10593                    fdomain_client::EventPair,
10594                    { fidl::ObjectType::EVENTPAIR.into_raw() },
10595                    2147483648,
10596                >,
10597                fdomain_client::fidl::FDomainResourceDialect,
10598            >,
10599    > fidl::encoding::Encode<DirEntry, fdomain_client::fidl::FDomainResourceDialect> for (T0,)
10600    {
10601        #[inline]
10602        unsafe fn encode(
10603            self,
10604            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10605            offset: usize,
10606            depth: fidl::encoding::Depth,
10607        ) -> fidl::Result<()> {
10608            encoder.debug_check_bounds::<DirEntry>(offset);
10609            // Zero out padding regions. There's no need to apply masks
10610            // because the unmasked parts will be overwritten by fields.
10611            // Write the fields.
10612            self.0.encode(encoder, offset + 0, depth)?;
10613            Ok(())
10614        }
10615    }
10616
10617    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect> for DirEntry {
10618        #[inline(always)]
10619        fn new_empty() -> Self {
10620            Self {
10621                token: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
10622            }
10623        }
10624
10625        #[inline]
10626        unsafe fn decode(
10627            &mut self,
10628            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10629            offset: usize,
10630            _depth: fidl::encoding::Depth,
10631        ) -> fidl::Result<()> {
10632            decoder.debug_check_bounds::<Self>(offset);
10633            // Verify that padding bytes are zero.
10634            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)?;
10635            Ok(())
10636        }
10637    }
10638
10639    impl fidl::encoding::ResourceTypeMarker for InstanceToken {
10640        type Borrowed<'a> = &'a mut Self;
10641        fn take_or_borrow<'a>(
10642            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10643        ) -> Self::Borrowed<'a> {
10644            value
10645        }
10646    }
10647
10648    unsafe impl fidl::encoding::TypeMarker for InstanceToken {
10649        type Owned = Self;
10650
10651        #[inline(always)]
10652        fn inline_align(_context: fidl::encoding::Context) -> usize {
10653            4
10654        }
10655
10656        #[inline(always)]
10657        fn inline_size(_context: fidl::encoding::Context) -> usize {
10658            4
10659        }
10660    }
10661
10662    unsafe impl fidl::encoding::Encode<InstanceToken, fdomain_client::fidl::FDomainResourceDialect>
10663        for &mut InstanceToken
10664    {
10665        #[inline]
10666        unsafe fn encode(
10667            self,
10668            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10669            offset: usize,
10670            _depth: fidl::encoding::Depth,
10671        ) -> fidl::Result<()> {
10672            encoder.debug_check_bounds::<InstanceToken>(offset);
10673            // Delegate to tuple encoding.
10674            fidl::encoding::Encode::<InstanceToken, fdomain_client::fidl::FDomainResourceDialect>::encode(
10675                (
10676                    <fidl::encoding::HandleType<fdomain_client::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.token),
10677                ),
10678                encoder, offset, _depth
10679            )
10680        }
10681    }
10682    unsafe impl<
10683        T0: fidl::encoding::Encode<
10684                fidl::encoding::HandleType<
10685                    fdomain_client::EventPair,
10686                    { fidl::ObjectType::EVENTPAIR.into_raw() },
10687                    2147483648,
10688                >,
10689                fdomain_client::fidl::FDomainResourceDialect,
10690            >,
10691    > fidl::encoding::Encode<InstanceToken, fdomain_client::fidl::FDomainResourceDialect> for (T0,)
10692    {
10693        #[inline]
10694        unsafe fn encode(
10695            self,
10696            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10697            offset: usize,
10698            depth: fidl::encoding::Depth,
10699        ) -> fidl::Result<()> {
10700            encoder.debug_check_bounds::<InstanceToken>(offset);
10701            // Zero out padding regions. There's no need to apply masks
10702            // because the unmasked parts will be overwritten by fields.
10703            // Write the fields.
10704            self.0.encode(encoder, offset + 0, depth)?;
10705            Ok(())
10706        }
10707    }
10708
10709    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect> for InstanceToken {
10710        #[inline(always)]
10711        fn new_empty() -> Self {
10712            Self {
10713                token: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
10714            }
10715        }
10716
10717        #[inline]
10718        unsafe fn decode(
10719            &mut self,
10720            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10721            offset: usize,
10722            _depth: fidl::encoding::Depth,
10723        ) -> fidl::Result<()> {
10724            decoder.debug_check_bounds::<Self>(offset);
10725            // Verify that padding bytes are zero.
10726            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)?;
10727            Ok(())
10728        }
10729    }
10730
10731    impl fidl::encoding::ResourceTypeMarker for ProtocolPayload {
10732        type Borrowed<'a> = &'a mut Self;
10733        fn take_or_borrow<'a>(
10734            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10735        ) -> Self::Borrowed<'a> {
10736            value
10737        }
10738    }
10739
10740    unsafe impl fidl::encoding::TypeMarker for ProtocolPayload {
10741        type Owned = Self;
10742
10743        #[inline(always)]
10744        fn inline_align(_context: fidl::encoding::Context) -> usize {
10745            4
10746        }
10747
10748        #[inline(always)]
10749        fn inline_size(_context: fidl::encoding::Context) -> usize {
10750            4
10751        }
10752    }
10753
10754    unsafe impl
10755        fidl::encoding::Encode<ProtocolPayload, fdomain_client::fidl::FDomainResourceDialect>
10756        for &mut ProtocolPayload
10757    {
10758        #[inline]
10759        unsafe fn encode(
10760            self,
10761            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10762            offset: usize,
10763            _depth: fidl::encoding::Depth,
10764        ) -> fidl::Result<()> {
10765            encoder.debug_check_bounds::<ProtocolPayload>(offset);
10766            // Delegate to tuple encoding.
10767            fidl::encoding::Encode::<ProtocolPayload, fdomain_client::fidl::FDomainResourceDialect>::encode(
10768                (
10769                    <fidl::encoding::HandleType<fdomain_client::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.channel),
10770                ),
10771                encoder, offset, _depth
10772            )
10773        }
10774    }
10775    unsafe impl<
10776        T0: fidl::encoding::Encode<
10777                fidl::encoding::HandleType<
10778                    fdomain_client::Channel,
10779                    { fidl::ObjectType::CHANNEL.into_raw() },
10780                    2147483648,
10781                >,
10782                fdomain_client::fidl::FDomainResourceDialect,
10783            >,
10784    > fidl::encoding::Encode<ProtocolPayload, fdomain_client::fidl::FDomainResourceDialect>
10785        for (T0,)
10786    {
10787        #[inline]
10788        unsafe fn encode(
10789            self,
10790            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10791            offset: usize,
10792            depth: fidl::encoding::Depth,
10793        ) -> fidl::Result<()> {
10794            encoder.debug_check_bounds::<ProtocolPayload>(offset);
10795            // Zero out padding regions. There's no need to apply masks
10796            // because the unmasked parts will be overwritten by fields.
10797            // Write the fields.
10798            self.0.encode(encoder, offset + 0, depth)?;
10799            Ok(())
10800        }
10801    }
10802
10803    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
10804        for ProtocolPayload
10805    {
10806        #[inline(always)]
10807        fn new_empty() -> Self {
10808            Self {
10809                channel: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
10810            }
10811        }
10812
10813        #[inline]
10814        unsafe fn decode(
10815            &mut self,
10816            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10817            offset: usize,
10818            _depth: fidl::encoding::Depth,
10819        ) -> fidl::Result<()> {
10820            decoder.debug_check_bounds::<Self>(offset);
10821            // Verify that padding bytes are zero.
10822            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)?;
10823            Ok(())
10824        }
10825    }
10826
10827    impl CapabilityStoreDirConnectorOpenRequest {
10828        #[inline(always)]
10829        fn max_ordinal_present(&self) -> u64 {
10830            if let Some(_) = self.path {
10831                return 4;
10832            }
10833            if let Some(_) = self.flags {
10834                return 3;
10835            }
10836            if let Some(_) = self.server_end {
10837                return 2;
10838            }
10839            if let Some(_) = self.id {
10840                return 1;
10841            }
10842            0
10843        }
10844    }
10845
10846    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDirConnectorOpenRequest {
10847        type Borrowed<'a> = &'a mut Self;
10848        fn take_or_borrow<'a>(
10849            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10850        ) -> Self::Borrowed<'a> {
10851            value
10852        }
10853    }
10854
10855    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDirConnectorOpenRequest {
10856        type Owned = Self;
10857
10858        #[inline(always)]
10859        fn inline_align(_context: fidl::encoding::Context) -> usize {
10860            8
10861        }
10862
10863        #[inline(always)]
10864        fn inline_size(_context: fidl::encoding::Context) -> usize {
10865            16
10866        }
10867    }
10868
10869    unsafe impl
10870        fidl::encoding::Encode<
10871            CapabilityStoreDirConnectorOpenRequest,
10872            fdomain_client::fidl::FDomainResourceDialect,
10873        > for &mut CapabilityStoreDirConnectorOpenRequest
10874    {
10875        unsafe fn encode(
10876            self,
10877            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10878            offset: usize,
10879            mut depth: fidl::encoding::Depth,
10880        ) -> fidl::Result<()> {
10881            encoder.debug_check_bounds::<CapabilityStoreDirConnectorOpenRequest>(offset);
10882            // Vector header
10883            let max_ordinal: u64 = self.max_ordinal_present();
10884            encoder.write_num(max_ordinal, offset);
10885            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
10886            // Calling encoder.out_of_line_offset(0) is not allowed.
10887            if max_ordinal == 0 {
10888                return Ok(());
10889            }
10890            depth.increment()?;
10891            let envelope_size = 8;
10892            let bytes_len = max_ordinal as usize * envelope_size;
10893            #[allow(unused_variables)]
10894            let offset = encoder.out_of_line_offset(bytes_len);
10895            let mut _prev_end_offset: usize = 0;
10896            if 1 > max_ordinal {
10897                return Ok(());
10898            }
10899
10900            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10901            // are envelope_size bytes.
10902            let cur_offset: usize = (1 - 1) * envelope_size;
10903
10904            // Zero reserved fields.
10905            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10906
10907            // Safety:
10908            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10909            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10910            //   envelope_size bytes, there is always sufficient room.
10911            fidl::encoding::encode_in_envelope_optional::<
10912                u64,
10913                fdomain_client::fidl::FDomainResourceDialect,
10914            >(
10915                self.id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
10916                encoder,
10917                offset + cur_offset,
10918                depth,
10919            )?;
10920
10921            _prev_end_offset = cur_offset + envelope_size;
10922            if 2 > max_ordinal {
10923                return Ok(());
10924            }
10925
10926            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10927            // are envelope_size bytes.
10928            let cur_offset: usize = (2 - 1) * envelope_size;
10929
10930            // Zero reserved fields.
10931            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10932
10933            // Safety:
10934            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10935            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10936            //   envelope_size bytes, there is always sufficient room.
10937            fidl::encoding::encode_in_envelope_optional::<
10938                fidl::encoding::Endpoint<
10939                    fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
10940                >,
10941                fdomain_client::fidl::FDomainResourceDialect,
10942            >(
10943                self.server_end.as_mut().map(
10944                    <fidl::encoding::Endpoint<
10945                        fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
10946                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
10947                ),
10948                encoder,
10949                offset + cur_offset,
10950                depth,
10951            )?;
10952
10953            _prev_end_offset = cur_offset + envelope_size;
10954            if 3 > max_ordinal {
10955                return Ok(());
10956            }
10957
10958            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10959            // are envelope_size bytes.
10960            let cur_offset: usize = (3 - 1) * envelope_size;
10961
10962            // Zero reserved fields.
10963            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10964
10965            // Safety:
10966            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10967            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10968            //   envelope_size bytes, there is always sufficient room.
10969            fidl::encoding::encode_in_envelope_optional::<
10970                fdomain_fuchsia_io::Flags,
10971                fdomain_client::fidl::FDomainResourceDialect,
10972            >(
10973                self.flags
10974                    .as_ref()
10975                    .map(<fdomain_fuchsia_io::Flags as fidl::encoding::ValueTypeMarker>::borrow),
10976                encoder,
10977                offset + cur_offset,
10978                depth,
10979            )?;
10980
10981            _prev_end_offset = cur_offset + envelope_size;
10982            if 4 > max_ordinal {
10983                return Ok(());
10984            }
10985
10986            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10987            // are envelope_size bytes.
10988            let cur_offset: usize = (4 - 1) * envelope_size;
10989
10990            // Zero reserved fields.
10991            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10992
10993            // Safety:
10994            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10995            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10996            //   envelope_size bytes, there is always sufficient room.
10997            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<4095>, fdomain_client::fidl::FDomainResourceDialect>(
10998            self.path.as_ref().map(<fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow),
10999            encoder, offset + cur_offset, depth
11000        )?;
11001
11002            _prev_end_offset = cur_offset + envelope_size;
11003
11004            Ok(())
11005        }
11006    }
11007
11008    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
11009        for CapabilityStoreDirConnectorOpenRequest
11010    {
11011        #[inline(always)]
11012        fn new_empty() -> Self {
11013            Self::default()
11014        }
11015
11016        unsafe fn decode(
11017            &mut self,
11018            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
11019            offset: usize,
11020            mut depth: fidl::encoding::Depth,
11021        ) -> fidl::Result<()> {
11022            decoder.debug_check_bounds::<Self>(offset);
11023            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
11024                None => return Err(fidl::Error::NotNullable),
11025                Some(len) => len,
11026            };
11027            // Calling decoder.out_of_line_offset(0) is not allowed.
11028            if len == 0 {
11029                return Ok(());
11030            };
11031            depth.increment()?;
11032            let envelope_size = 8;
11033            let bytes_len = len * envelope_size;
11034            let offset = decoder.out_of_line_offset(bytes_len)?;
11035            // Decode the envelope for each type.
11036            let mut _next_ordinal_to_read = 0;
11037            let mut next_offset = offset;
11038            let end_offset = offset + bytes_len;
11039            _next_ordinal_to_read += 1;
11040            if next_offset >= end_offset {
11041                return Ok(());
11042            }
11043
11044            // Decode unknown envelopes for gaps in ordinals.
11045            while _next_ordinal_to_read < 1 {
11046                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11047                _next_ordinal_to_read += 1;
11048                next_offset += envelope_size;
11049            }
11050
11051            let next_out_of_line = decoder.next_out_of_line();
11052            let handles_before = decoder.remaining_handles();
11053            if let Some((inlined, num_bytes, num_handles)) =
11054                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11055            {
11056                let member_inline_size =
11057                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11058                if inlined != (member_inline_size <= 4) {
11059                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11060                }
11061                let inner_offset;
11062                let mut inner_depth = depth.clone();
11063                if inlined {
11064                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11065                    inner_offset = next_offset;
11066                } else {
11067                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11068                    inner_depth.increment()?;
11069                }
11070                let val_ref = self.id.get_or_insert_with(|| {
11071                    fidl::new_empty!(u64, fdomain_client::fidl::FDomainResourceDialect)
11072                });
11073                fidl::decode!(
11074                    u64,
11075                    fdomain_client::fidl::FDomainResourceDialect,
11076                    val_ref,
11077                    decoder,
11078                    inner_offset,
11079                    inner_depth
11080                )?;
11081                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11082                {
11083                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11084                }
11085                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11086                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11087                }
11088            }
11089
11090            next_offset += envelope_size;
11091            _next_ordinal_to_read += 1;
11092            if next_offset >= end_offset {
11093                return Ok(());
11094            }
11095
11096            // Decode unknown envelopes for gaps in ordinals.
11097            while _next_ordinal_to_read < 2 {
11098                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11099                _next_ordinal_to_read += 1;
11100                next_offset += envelope_size;
11101            }
11102
11103            let next_out_of_line = decoder.next_out_of_line();
11104            let handles_before = decoder.remaining_handles();
11105            if let Some((inlined, num_bytes, num_handles)) =
11106                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11107            {
11108                let member_inline_size = <fidl::encoding::Endpoint<
11109                    fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
11110                > as fidl::encoding::TypeMarker>::inline_size(
11111                    decoder.context
11112                );
11113                if inlined != (member_inline_size <= 4) {
11114                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11115                }
11116                let inner_offset;
11117                let mut inner_depth = depth.clone();
11118                if inlined {
11119                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11120                    inner_offset = next_offset;
11121                } else {
11122                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11123                    inner_depth.increment()?;
11124                }
11125                let val_ref = self.server_end.get_or_insert_with(|| {
11126                    fidl::new_empty!(
11127                        fidl::encoding::Endpoint<
11128                            fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
11129                        >,
11130                        fdomain_client::fidl::FDomainResourceDialect
11131                    )
11132                });
11133                fidl::decode!(
11134                    fidl::encoding::Endpoint<
11135                        fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
11136                    >,
11137                    fdomain_client::fidl::FDomainResourceDialect,
11138                    val_ref,
11139                    decoder,
11140                    inner_offset,
11141                    inner_depth
11142                )?;
11143                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11144                {
11145                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11146                }
11147                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11148                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11149                }
11150            }
11151
11152            next_offset += envelope_size;
11153            _next_ordinal_to_read += 1;
11154            if next_offset >= end_offset {
11155                return Ok(());
11156            }
11157
11158            // Decode unknown envelopes for gaps in ordinals.
11159            while _next_ordinal_to_read < 3 {
11160                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11161                _next_ordinal_to_read += 1;
11162                next_offset += envelope_size;
11163            }
11164
11165            let next_out_of_line = decoder.next_out_of_line();
11166            let handles_before = decoder.remaining_handles();
11167            if let Some((inlined, num_bytes, num_handles)) =
11168                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11169            {
11170                let member_inline_size =
11171                    <fdomain_fuchsia_io::Flags as fidl::encoding::TypeMarker>::inline_size(
11172                        decoder.context,
11173                    );
11174                if inlined != (member_inline_size <= 4) {
11175                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11176                }
11177                let inner_offset;
11178                let mut inner_depth = depth.clone();
11179                if inlined {
11180                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11181                    inner_offset = next_offset;
11182                } else {
11183                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11184                    inner_depth.increment()?;
11185                }
11186                let val_ref = self.flags.get_or_insert_with(|| {
11187                    fidl::new_empty!(
11188                        fdomain_fuchsia_io::Flags,
11189                        fdomain_client::fidl::FDomainResourceDialect
11190                    )
11191                });
11192                fidl::decode!(
11193                    fdomain_fuchsia_io::Flags,
11194                    fdomain_client::fidl::FDomainResourceDialect,
11195                    val_ref,
11196                    decoder,
11197                    inner_offset,
11198                    inner_depth
11199                )?;
11200                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11201                {
11202                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11203                }
11204                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11205                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11206                }
11207            }
11208
11209            next_offset += envelope_size;
11210            _next_ordinal_to_read += 1;
11211            if next_offset >= end_offset {
11212                return Ok(());
11213            }
11214
11215            // Decode unknown envelopes for gaps in ordinals.
11216            while _next_ordinal_to_read < 4 {
11217                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11218                _next_ordinal_to_read += 1;
11219                next_offset += envelope_size;
11220            }
11221
11222            let next_out_of_line = decoder.next_out_of_line();
11223            let handles_before = decoder.remaining_handles();
11224            if let Some((inlined, num_bytes, num_handles)) =
11225                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11226            {
11227                let member_inline_size = <fidl::encoding::BoundedString<4095> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11228                if inlined != (member_inline_size <= 4) {
11229                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11230                }
11231                let inner_offset;
11232                let mut inner_depth = depth.clone();
11233                if inlined {
11234                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11235                    inner_offset = next_offset;
11236                } else {
11237                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11238                    inner_depth.increment()?;
11239                }
11240                let val_ref = self.path.get_or_insert_with(|| {
11241                    fidl::new_empty!(
11242                        fidl::encoding::BoundedString<4095>,
11243                        fdomain_client::fidl::FDomainResourceDialect
11244                    )
11245                });
11246                fidl::decode!(
11247                    fidl::encoding::BoundedString<4095>,
11248                    fdomain_client::fidl::FDomainResourceDialect,
11249                    val_ref,
11250                    decoder,
11251                    inner_offset,
11252                    inner_depth
11253                )?;
11254                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11255                {
11256                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11257                }
11258                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11259                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11260                }
11261            }
11262
11263            next_offset += envelope_size;
11264
11265            // Decode the remaining unknown envelopes.
11266            while next_offset < end_offset {
11267                _next_ordinal_to_read += 1;
11268                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11269                next_offset += envelope_size;
11270            }
11271
11272            Ok(())
11273        }
11274    }
11275
11276    impl DirReceiverReceiveRequest {
11277        #[inline(always)]
11278        fn max_ordinal_present(&self) -> u64 {
11279            if let Some(_) = self.subdir {
11280                return 3;
11281            }
11282            if let Some(_) = self.flags {
11283                return 2;
11284            }
11285            if let Some(_) = self.channel {
11286                return 1;
11287            }
11288            0
11289        }
11290    }
11291
11292    impl fidl::encoding::ResourceTypeMarker for DirReceiverReceiveRequest {
11293        type Borrowed<'a> = &'a mut Self;
11294        fn take_or_borrow<'a>(
11295            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11296        ) -> Self::Borrowed<'a> {
11297            value
11298        }
11299    }
11300
11301    unsafe impl fidl::encoding::TypeMarker for DirReceiverReceiveRequest {
11302        type Owned = Self;
11303
11304        #[inline(always)]
11305        fn inline_align(_context: fidl::encoding::Context) -> usize {
11306            8
11307        }
11308
11309        #[inline(always)]
11310        fn inline_size(_context: fidl::encoding::Context) -> usize {
11311            16
11312        }
11313    }
11314
11315    unsafe impl
11316        fidl::encoding::Encode<
11317            DirReceiverReceiveRequest,
11318            fdomain_client::fidl::FDomainResourceDialect,
11319        > for &mut DirReceiverReceiveRequest
11320    {
11321        unsafe fn encode(
11322            self,
11323            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
11324            offset: usize,
11325            mut depth: fidl::encoding::Depth,
11326        ) -> fidl::Result<()> {
11327            encoder.debug_check_bounds::<DirReceiverReceiveRequest>(offset);
11328            // Vector header
11329            let max_ordinal: u64 = self.max_ordinal_present();
11330            encoder.write_num(max_ordinal, offset);
11331            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
11332            // Calling encoder.out_of_line_offset(0) is not allowed.
11333            if max_ordinal == 0 {
11334                return Ok(());
11335            }
11336            depth.increment()?;
11337            let envelope_size = 8;
11338            let bytes_len = max_ordinal as usize * envelope_size;
11339            #[allow(unused_variables)]
11340            let offset = encoder.out_of_line_offset(bytes_len);
11341            let mut _prev_end_offset: usize = 0;
11342            if 1 > max_ordinal {
11343                return Ok(());
11344            }
11345
11346            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11347            // are envelope_size bytes.
11348            let cur_offset: usize = (1 - 1) * envelope_size;
11349
11350            // Zero reserved fields.
11351            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11352
11353            // Safety:
11354            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11355            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11356            //   envelope_size bytes, there is always sufficient room.
11357            fidl::encoding::encode_in_envelope_optional::<
11358                fidl::encoding::HandleType<
11359                    fdomain_client::Channel,
11360                    { fidl::ObjectType::CHANNEL.into_raw() },
11361                    2147483648,
11362                >,
11363                fdomain_client::fidl::FDomainResourceDialect,
11364            >(
11365                self.channel.as_mut().map(
11366                    <fidl::encoding::HandleType<
11367                        fdomain_client::Channel,
11368                        { fidl::ObjectType::CHANNEL.into_raw() },
11369                        2147483648,
11370                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
11371                ),
11372                encoder,
11373                offset + cur_offset,
11374                depth,
11375            )?;
11376
11377            _prev_end_offset = cur_offset + envelope_size;
11378            if 2 > max_ordinal {
11379                return Ok(());
11380            }
11381
11382            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11383            // are envelope_size bytes.
11384            let cur_offset: usize = (2 - 1) * envelope_size;
11385
11386            // Zero reserved fields.
11387            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11388
11389            // Safety:
11390            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11391            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11392            //   envelope_size bytes, there is always sufficient room.
11393            fidl::encoding::encode_in_envelope_optional::<
11394                fdomain_fuchsia_io::Flags,
11395                fdomain_client::fidl::FDomainResourceDialect,
11396            >(
11397                self.flags
11398                    .as_ref()
11399                    .map(<fdomain_fuchsia_io::Flags as fidl::encoding::ValueTypeMarker>::borrow),
11400                encoder,
11401                offset + cur_offset,
11402                depth,
11403            )?;
11404
11405            _prev_end_offset = cur_offset + envelope_size;
11406            if 3 > max_ordinal {
11407                return Ok(());
11408            }
11409
11410            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11411            // are envelope_size bytes.
11412            let cur_offset: usize = (3 - 1) * envelope_size;
11413
11414            // Zero reserved fields.
11415            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11416
11417            // Safety:
11418            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11419            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11420            //   envelope_size bytes, there is always sufficient room.
11421            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<4095>, fdomain_client::fidl::FDomainResourceDialect>(
11422            self.subdir.as_ref().map(<fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow),
11423            encoder, offset + cur_offset, depth
11424        )?;
11425
11426            _prev_end_offset = cur_offset + envelope_size;
11427
11428            Ok(())
11429        }
11430    }
11431
11432    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
11433        for DirReceiverReceiveRequest
11434    {
11435        #[inline(always)]
11436        fn new_empty() -> Self {
11437            Self::default()
11438        }
11439
11440        unsafe fn decode(
11441            &mut self,
11442            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
11443            offset: usize,
11444            mut depth: fidl::encoding::Depth,
11445        ) -> fidl::Result<()> {
11446            decoder.debug_check_bounds::<Self>(offset);
11447            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
11448                None => return Err(fidl::Error::NotNullable),
11449                Some(len) => len,
11450            };
11451            // Calling decoder.out_of_line_offset(0) is not allowed.
11452            if len == 0 {
11453                return Ok(());
11454            };
11455            depth.increment()?;
11456            let envelope_size = 8;
11457            let bytes_len = len * envelope_size;
11458            let offset = decoder.out_of_line_offset(bytes_len)?;
11459            // Decode the envelope for each type.
11460            let mut _next_ordinal_to_read = 0;
11461            let mut next_offset = offset;
11462            let end_offset = offset + bytes_len;
11463            _next_ordinal_to_read += 1;
11464            if next_offset >= end_offset {
11465                return Ok(());
11466            }
11467
11468            // Decode unknown envelopes for gaps in ordinals.
11469            while _next_ordinal_to_read < 1 {
11470                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11471                _next_ordinal_to_read += 1;
11472                next_offset += envelope_size;
11473            }
11474
11475            let next_out_of_line = decoder.next_out_of_line();
11476            let handles_before = decoder.remaining_handles();
11477            if let Some((inlined, num_bytes, num_handles)) =
11478                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11479            {
11480                let member_inline_size = <fidl::encoding::HandleType<
11481                    fdomain_client::Channel,
11482                    { fidl::ObjectType::CHANNEL.into_raw() },
11483                    2147483648,
11484                > as fidl::encoding::TypeMarker>::inline_size(
11485                    decoder.context
11486                );
11487                if inlined != (member_inline_size <= 4) {
11488                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11489                }
11490                let inner_offset;
11491                let mut inner_depth = depth.clone();
11492                if inlined {
11493                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11494                    inner_offset = next_offset;
11495                } else {
11496                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11497                    inner_depth.increment()?;
11498                }
11499                let val_ref =
11500                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));
11501                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)?;
11502                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11503                {
11504                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11505                }
11506                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11507                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11508                }
11509            }
11510
11511            next_offset += envelope_size;
11512            _next_ordinal_to_read += 1;
11513            if next_offset >= end_offset {
11514                return Ok(());
11515            }
11516
11517            // Decode unknown envelopes for gaps in ordinals.
11518            while _next_ordinal_to_read < 2 {
11519                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11520                _next_ordinal_to_read += 1;
11521                next_offset += envelope_size;
11522            }
11523
11524            let next_out_of_line = decoder.next_out_of_line();
11525            let handles_before = decoder.remaining_handles();
11526            if let Some((inlined, num_bytes, num_handles)) =
11527                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11528            {
11529                let member_inline_size =
11530                    <fdomain_fuchsia_io::Flags as fidl::encoding::TypeMarker>::inline_size(
11531                        decoder.context,
11532                    );
11533                if inlined != (member_inline_size <= 4) {
11534                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11535                }
11536                let inner_offset;
11537                let mut inner_depth = depth.clone();
11538                if inlined {
11539                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11540                    inner_offset = next_offset;
11541                } else {
11542                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11543                    inner_depth.increment()?;
11544                }
11545                let val_ref = self.flags.get_or_insert_with(|| {
11546                    fidl::new_empty!(
11547                        fdomain_fuchsia_io::Flags,
11548                        fdomain_client::fidl::FDomainResourceDialect
11549                    )
11550                });
11551                fidl::decode!(
11552                    fdomain_fuchsia_io::Flags,
11553                    fdomain_client::fidl::FDomainResourceDialect,
11554                    val_ref,
11555                    decoder,
11556                    inner_offset,
11557                    inner_depth
11558                )?;
11559                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11560                {
11561                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11562                }
11563                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11564                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11565                }
11566            }
11567
11568            next_offset += envelope_size;
11569            _next_ordinal_to_read += 1;
11570            if next_offset >= end_offset {
11571                return Ok(());
11572            }
11573
11574            // Decode unknown envelopes for gaps in ordinals.
11575            while _next_ordinal_to_read < 3 {
11576                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11577                _next_ordinal_to_read += 1;
11578                next_offset += envelope_size;
11579            }
11580
11581            let next_out_of_line = decoder.next_out_of_line();
11582            let handles_before = decoder.remaining_handles();
11583            if let Some((inlined, num_bytes, num_handles)) =
11584                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11585            {
11586                let member_inline_size = <fidl::encoding::BoundedString<4095> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11587                if inlined != (member_inline_size <= 4) {
11588                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11589                }
11590                let inner_offset;
11591                let mut inner_depth = depth.clone();
11592                if inlined {
11593                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11594                    inner_offset = next_offset;
11595                } else {
11596                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11597                    inner_depth.increment()?;
11598                }
11599                let val_ref = self.subdir.get_or_insert_with(|| {
11600                    fidl::new_empty!(
11601                        fidl::encoding::BoundedString<4095>,
11602                        fdomain_client::fidl::FDomainResourceDialect
11603                    )
11604                });
11605                fidl::decode!(
11606                    fidl::encoding::BoundedString<4095>,
11607                    fdomain_client::fidl::FDomainResourceDialect,
11608                    val_ref,
11609                    decoder,
11610                    inner_offset,
11611                    inner_depth
11612                )?;
11613                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11614                {
11615                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11616                }
11617                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11618                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11619                }
11620            }
11621
11622            next_offset += envelope_size;
11623
11624            // Decode the remaining unknown envelopes.
11625            while next_offset < end_offset {
11626                _next_ordinal_to_read += 1;
11627                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11628                next_offset += envelope_size;
11629            }
11630
11631            Ok(())
11632        }
11633    }
11634
11635    impl RouteRequest {
11636        #[inline(always)]
11637        fn max_ordinal_present(&self) -> u64 {
11638            if let Some(_) = self.metadata {
11639                return 2;
11640            }
11641            if let Some(_) = self.requesting {
11642                return 1;
11643            }
11644            0
11645        }
11646    }
11647
11648    impl fidl::encoding::ResourceTypeMarker for RouteRequest {
11649        type Borrowed<'a> = &'a mut Self;
11650        fn take_or_borrow<'a>(
11651            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11652        ) -> Self::Borrowed<'a> {
11653            value
11654        }
11655    }
11656
11657    unsafe impl fidl::encoding::TypeMarker for RouteRequest {
11658        type Owned = Self;
11659
11660        #[inline(always)]
11661        fn inline_align(_context: fidl::encoding::Context) -> usize {
11662            8
11663        }
11664
11665        #[inline(always)]
11666        fn inline_size(_context: fidl::encoding::Context) -> usize {
11667            16
11668        }
11669    }
11670
11671    unsafe impl fidl::encoding::Encode<RouteRequest, fdomain_client::fidl::FDomainResourceDialect>
11672        for &mut RouteRequest
11673    {
11674        unsafe fn encode(
11675            self,
11676            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
11677            offset: usize,
11678            mut depth: fidl::encoding::Depth,
11679        ) -> fidl::Result<()> {
11680            encoder.debug_check_bounds::<RouteRequest>(offset);
11681            // Vector header
11682            let max_ordinal: u64 = self.max_ordinal_present();
11683            encoder.write_num(max_ordinal, offset);
11684            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
11685            // Calling encoder.out_of_line_offset(0) is not allowed.
11686            if max_ordinal == 0 {
11687                return Ok(());
11688            }
11689            depth.increment()?;
11690            let envelope_size = 8;
11691            let bytes_len = max_ordinal as usize * envelope_size;
11692            #[allow(unused_variables)]
11693            let offset = encoder.out_of_line_offset(bytes_len);
11694            let mut _prev_end_offset: usize = 0;
11695            if 1 > max_ordinal {
11696                return Ok(());
11697            }
11698
11699            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11700            // are envelope_size bytes.
11701            let cur_offset: usize = (1 - 1) * envelope_size;
11702
11703            // Zero reserved fields.
11704            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11705
11706            // Safety:
11707            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11708            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11709            //   envelope_size bytes, there is always sufficient room.
11710            fidl::encoding::encode_in_envelope_optional::<
11711                InstanceToken,
11712                fdomain_client::fidl::FDomainResourceDialect,
11713            >(
11714                self.requesting
11715                    .as_mut()
11716                    .map(<InstanceToken as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
11717                encoder,
11718                offset + cur_offset,
11719                depth,
11720            )?;
11721
11722            _prev_end_offset = cur_offset + envelope_size;
11723            if 2 > max_ordinal {
11724                return Ok(());
11725            }
11726
11727            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11728            // are envelope_size bytes.
11729            let cur_offset: usize = (2 - 1) * envelope_size;
11730
11731            // Zero reserved fields.
11732            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11733
11734            // Safety:
11735            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11736            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11737            //   envelope_size bytes, there is always sufficient room.
11738            fidl::encoding::encode_in_envelope_optional::<
11739                DictionaryRef,
11740                fdomain_client::fidl::FDomainResourceDialect,
11741            >(
11742                self.metadata
11743                    .as_mut()
11744                    .map(<DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
11745                encoder,
11746                offset + cur_offset,
11747                depth,
11748            )?;
11749
11750            _prev_end_offset = cur_offset + envelope_size;
11751
11752            Ok(())
11753        }
11754    }
11755
11756    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect> for RouteRequest {
11757        #[inline(always)]
11758        fn new_empty() -> Self {
11759            Self::default()
11760        }
11761
11762        unsafe fn decode(
11763            &mut self,
11764            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
11765            offset: usize,
11766            mut depth: fidl::encoding::Depth,
11767        ) -> fidl::Result<()> {
11768            decoder.debug_check_bounds::<Self>(offset);
11769            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
11770                None => return Err(fidl::Error::NotNullable),
11771                Some(len) => len,
11772            };
11773            // Calling decoder.out_of_line_offset(0) is not allowed.
11774            if len == 0 {
11775                return Ok(());
11776            };
11777            depth.increment()?;
11778            let envelope_size = 8;
11779            let bytes_len = len * envelope_size;
11780            let offset = decoder.out_of_line_offset(bytes_len)?;
11781            // Decode the envelope for each type.
11782            let mut _next_ordinal_to_read = 0;
11783            let mut next_offset = offset;
11784            let end_offset = offset + bytes_len;
11785            _next_ordinal_to_read += 1;
11786            if next_offset >= end_offset {
11787                return Ok(());
11788            }
11789
11790            // Decode unknown envelopes for gaps in ordinals.
11791            while _next_ordinal_to_read < 1 {
11792                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11793                _next_ordinal_to_read += 1;
11794                next_offset += envelope_size;
11795            }
11796
11797            let next_out_of_line = decoder.next_out_of_line();
11798            let handles_before = decoder.remaining_handles();
11799            if let Some((inlined, num_bytes, num_handles)) =
11800                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11801            {
11802                let member_inline_size =
11803                    <InstanceToken as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11804                if inlined != (member_inline_size <= 4) {
11805                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11806                }
11807                let inner_offset;
11808                let mut inner_depth = depth.clone();
11809                if inlined {
11810                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11811                    inner_offset = next_offset;
11812                } else {
11813                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11814                    inner_depth.increment()?;
11815                }
11816                let val_ref = self.requesting.get_or_insert_with(|| {
11817                    fidl::new_empty!(InstanceToken, fdomain_client::fidl::FDomainResourceDialect)
11818                });
11819                fidl::decode!(
11820                    InstanceToken,
11821                    fdomain_client::fidl::FDomainResourceDialect,
11822                    val_ref,
11823                    decoder,
11824                    inner_offset,
11825                    inner_depth
11826                )?;
11827                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11828                {
11829                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11830                }
11831                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11832                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11833                }
11834            }
11835
11836            next_offset += envelope_size;
11837            _next_ordinal_to_read += 1;
11838            if next_offset >= end_offset {
11839                return Ok(());
11840            }
11841
11842            // Decode unknown envelopes for gaps in ordinals.
11843            while _next_ordinal_to_read < 2 {
11844                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11845                _next_ordinal_to_read += 1;
11846                next_offset += envelope_size;
11847            }
11848
11849            let next_out_of_line = decoder.next_out_of_line();
11850            let handles_before = decoder.remaining_handles();
11851            if let Some((inlined, num_bytes, num_handles)) =
11852                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11853            {
11854                let member_inline_size =
11855                    <DictionaryRef as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11856                if inlined != (member_inline_size <= 4) {
11857                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11858                }
11859                let inner_offset;
11860                let mut inner_depth = depth.clone();
11861                if inlined {
11862                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11863                    inner_offset = next_offset;
11864                } else {
11865                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11866                    inner_depth.increment()?;
11867                }
11868                let val_ref = self.metadata.get_or_insert_with(|| {
11869                    fidl::new_empty!(DictionaryRef, fdomain_client::fidl::FDomainResourceDialect)
11870                });
11871                fidl::decode!(
11872                    DictionaryRef,
11873                    fdomain_client::fidl::FDomainResourceDialect,
11874                    val_ref,
11875                    decoder,
11876                    inner_offset,
11877                    inner_depth
11878                )?;
11879                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11880                {
11881                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11882                }
11883                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11884                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11885                }
11886            }
11887
11888            next_offset += envelope_size;
11889
11890            // Decode the remaining unknown envelopes.
11891            while next_offset < end_offset {
11892                _next_ordinal_to_read += 1;
11893                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11894                next_offset += envelope_size;
11895            }
11896
11897            Ok(())
11898        }
11899    }
11900
11901    impl fidl::encoding::ResourceTypeMarker for Capability {
11902        type Borrowed<'a> = &'a mut Self;
11903        fn take_or_borrow<'a>(
11904            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11905        ) -> Self::Borrowed<'a> {
11906            value
11907        }
11908    }
11909
11910    unsafe impl fidl::encoding::TypeMarker for Capability {
11911        type Owned = Self;
11912
11913        #[inline(always)]
11914        fn inline_align(_context: fidl::encoding::Context) -> usize {
11915            8
11916        }
11917
11918        #[inline(always)]
11919        fn inline_size(_context: fidl::encoding::Context) -> usize {
11920            16
11921        }
11922    }
11923
11924    unsafe impl fidl::encoding::Encode<Capability, fdomain_client::fidl::FDomainResourceDialect>
11925        for &mut Capability
11926    {
11927        #[inline]
11928        unsafe fn encode(
11929            self,
11930            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
11931            offset: usize,
11932            _depth: fidl::encoding::Depth,
11933        ) -> fidl::Result<()> {
11934            encoder.debug_check_bounds::<Capability>(offset);
11935            encoder.write_num::<u64>(self.ordinal(), offset);
11936            match self {
11937            Capability::Unit(ref val) => {
11938                fidl::encoding::encode_in_envelope::<Unit, fdomain_client::fidl::FDomainResourceDialect>(
11939                    <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
11940                    encoder, offset + 8, _depth
11941                )
11942            }
11943            Capability::Handle(ref mut val) => {
11944                fidl::encoding::encode_in_envelope::<fidl::encoding::HandleType<fdomain_client::NullableHandle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect>(
11945                    <fidl::encoding::HandleType<fdomain_client::NullableHandle, { fidl::ObjectType::NONE.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
11946                    encoder, offset + 8, _depth
11947                )
11948            }
11949            Capability::Data(ref val) => {
11950                fidl::encoding::encode_in_envelope::<Data, fdomain_client::fidl::FDomainResourceDialect>(
11951                    <Data as fidl::encoding::ValueTypeMarker>::borrow(val),
11952                    encoder, offset + 8, _depth
11953                )
11954            }
11955            Capability::Dictionary(ref mut val) => {
11956                fidl::encoding::encode_in_envelope::<DictionaryRef, fdomain_client::fidl::FDomainResourceDialect>(
11957                    <DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
11958                    encoder, offset + 8, _depth
11959                )
11960            }
11961            Capability::Connector(ref mut val) => {
11962                fidl::encoding::encode_in_envelope::<Connector, fdomain_client::fidl::FDomainResourceDialect>(
11963                    <Connector as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
11964                    encoder, offset + 8, _depth
11965                )
11966            }
11967            Capability::DirConnector(ref mut val) => {
11968                fidl::encoding::encode_in_envelope::<DirConnector, fdomain_client::fidl::FDomainResourceDialect>(
11969                    <DirConnector as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
11970                    encoder, offset + 8, _depth
11971                )
11972            }
11973            Capability::Directory(ref mut val) => {
11974                fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<fdomain_fuchsia_io::DirectoryMarker>>, fdomain_client::fidl::FDomainResourceDialect>(
11975                    <fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<fdomain_fuchsia_io::DirectoryMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
11976                    encoder, offset + 8, _depth
11977                )
11978            }
11979            Capability::DirEntry(ref mut val) => {
11980                fidl::encoding::encode_in_envelope::<DirEntry, fdomain_client::fidl::FDomainResourceDialect>(
11981                    <DirEntry as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
11982                    encoder, offset + 8, _depth
11983                )
11984            }
11985            Capability::ConnectorRouter(ref mut val) => {
11986                fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<ConnectorRouterMarker>>, fdomain_client::fidl::FDomainResourceDialect>(
11987                    <fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<ConnectorRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
11988                    encoder, offset + 8, _depth
11989                )
11990            }
11991            Capability::DictionaryRouter(ref mut val) => {
11992                fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<DictionaryRouterMarker>>, fdomain_client::fidl::FDomainResourceDialect>(
11993                    <fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<DictionaryRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
11994                    encoder, offset + 8, _depth
11995                )
11996            }
11997            Capability::DirEntryRouter(ref mut val) => {
11998                fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<DirEntryRouterMarker>>, fdomain_client::fidl::FDomainResourceDialect>(
11999                    <fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<DirEntryRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
12000                    encoder, offset + 8, _depth
12001                )
12002            }
12003            Capability::DataRouter(ref mut val) => {
12004                fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<DataRouterMarker>>, fdomain_client::fidl::FDomainResourceDialect>(
12005                    <fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<DataRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
12006                    encoder, offset + 8, _depth
12007                )
12008            }
12009            Capability::DirConnectorRouter(ref mut val) => {
12010                fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<DirConnectorRouterMarker>>, fdomain_client::fidl::FDomainResourceDialect>(
12011                    <fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<DirConnectorRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
12012                    encoder, offset + 8, _depth
12013                )
12014            }
12015            Capability::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
12016        }
12017        }
12018    }
12019
12020    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect> for Capability {
12021        #[inline(always)]
12022        fn new_empty() -> Self {
12023            Self::__SourceBreaking { unknown_ordinal: 0 }
12024        }
12025
12026        #[inline]
12027        unsafe fn decode(
12028            &mut self,
12029            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
12030            offset: usize,
12031            mut depth: fidl::encoding::Depth,
12032        ) -> fidl::Result<()> {
12033            decoder.debug_check_bounds::<Self>(offset);
12034            #[allow(unused_variables)]
12035            let next_out_of_line = decoder.next_out_of_line();
12036            let handles_before = decoder.remaining_handles();
12037            let (ordinal, inlined, num_bytes, num_handles) =
12038                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
12039
12040            let member_inline_size =
12041                match ordinal {
12042                    1 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12043                    2 => <fidl::encoding::HandleType<
12044                        fdomain_client::NullableHandle,
12045                        { fidl::ObjectType::NONE.into_raw() },
12046                        2147483648,
12047                    > as fidl::encoding::TypeMarker>::inline_size(
12048                        decoder.context
12049                    ),
12050                    3 => <Data as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12051                    4 => {
12052                        <DictionaryRef as fidl::encoding::TypeMarker>::inline_size(decoder.context)
12053                    }
12054                    5 => <Connector as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12055                    6 => <DirConnector as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12056                    7 => <fidl::encoding::Endpoint<
12057                        fdomain_client::fidl::ClientEnd<fdomain_fuchsia_io::DirectoryMarker>,
12058                    > as fidl::encoding::TypeMarker>::inline_size(
12059                        decoder.context
12060                    ),
12061                    8 => <DirEntry as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12062                    9 => <fidl::encoding::Endpoint<
12063                        fdomain_client::fidl::ClientEnd<ConnectorRouterMarker>,
12064                    > as fidl::encoding::TypeMarker>::inline_size(
12065                        decoder.context
12066                    ),
12067                    10 => <fidl::encoding::Endpoint<
12068                        fdomain_client::fidl::ClientEnd<DictionaryRouterMarker>,
12069                    > as fidl::encoding::TypeMarker>::inline_size(
12070                        decoder.context
12071                    ),
12072                    11 => <fidl::encoding::Endpoint<
12073                        fdomain_client::fidl::ClientEnd<DirEntryRouterMarker>,
12074                    > as fidl::encoding::TypeMarker>::inline_size(
12075                        decoder.context
12076                    ),
12077                    12 => <fidl::encoding::Endpoint<
12078                        fdomain_client::fidl::ClientEnd<DataRouterMarker>,
12079                    > as fidl::encoding::TypeMarker>::inline_size(
12080                        decoder.context
12081                    ),
12082                    13 => <fidl::encoding::Endpoint<
12083                        fdomain_client::fidl::ClientEnd<DirConnectorRouterMarker>,
12084                    > as fidl::encoding::TypeMarker>::inline_size(
12085                        decoder.context
12086                    ),
12087                    0 => return Err(fidl::Error::UnknownUnionTag),
12088                    _ => num_bytes as usize,
12089                };
12090
12091            if inlined != (member_inline_size <= 4) {
12092                return Err(fidl::Error::InvalidInlineBitInEnvelope);
12093            }
12094            let _inner_offset;
12095            if inlined {
12096                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
12097                _inner_offset = offset + 8;
12098            } else {
12099                depth.increment()?;
12100                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12101            }
12102            match ordinal {
12103                1 => {
12104                    #[allow(irrefutable_let_patterns)]
12105                    if let Capability::Unit(_) = self {
12106                        // Do nothing, read the value into the object
12107                    } else {
12108                        // Initialize `self` to the right variant
12109                        *self = Capability::Unit(fidl::new_empty!(
12110                            Unit,
12111                            fdomain_client::fidl::FDomainResourceDialect
12112                        ));
12113                    }
12114                    #[allow(irrefutable_let_patterns)]
12115                    if let Capability::Unit(ref mut val) = self {
12116                        fidl::decode!(
12117                            Unit,
12118                            fdomain_client::fidl::FDomainResourceDialect,
12119                            val,
12120                            decoder,
12121                            _inner_offset,
12122                            depth
12123                        )?;
12124                    } else {
12125                        unreachable!()
12126                    }
12127                }
12128                2 => {
12129                    #[allow(irrefutable_let_patterns)]
12130                    if let Capability::Handle(_) = self {
12131                        // Do nothing, read the value into the object
12132                    } else {
12133                        // Initialize `self` to the right variant
12134                        *self = Capability::Handle(
12135                            fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::NullableHandle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
12136                        );
12137                    }
12138                    #[allow(irrefutable_let_patterns)]
12139                    if let Capability::Handle(ref mut val) = self {
12140                        fidl::decode!(fidl::encoding::HandleType<fdomain_client::NullableHandle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect, val, decoder, _inner_offset, depth)?;
12141                    } else {
12142                        unreachable!()
12143                    }
12144                }
12145                3 => {
12146                    #[allow(irrefutable_let_patterns)]
12147                    if let Capability::Data(_) = self {
12148                        // Do nothing, read the value into the object
12149                    } else {
12150                        // Initialize `self` to the right variant
12151                        *self = Capability::Data(fidl::new_empty!(
12152                            Data,
12153                            fdomain_client::fidl::FDomainResourceDialect
12154                        ));
12155                    }
12156                    #[allow(irrefutable_let_patterns)]
12157                    if let Capability::Data(ref mut val) = self {
12158                        fidl::decode!(
12159                            Data,
12160                            fdomain_client::fidl::FDomainResourceDialect,
12161                            val,
12162                            decoder,
12163                            _inner_offset,
12164                            depth
12165                        )?;
12166                    } else {
12167                        unreachable!()
12168                    }
12169                }
12170                4 => {
12171                    #[allow(irrefutable_let_patterns)]
12172                    if let Capability::Dictionary(_) = self {
12173                        // Do nothing, read the value into the object
12174                    } else {
12175                        // Initialize `self` to the right variant
12176                        *self = Capability::Dictionary(fidl::new_empty!(
12177                            DictionaryRef,
12178                            fdomain_client::fidl::FDomainResourceDialect
12179                        ));
12180                    }
12181                    #[allow(irrefutable_let_patterns)]
12182                    if let Capability::Dictionary(ref mut val) = self {
12183                        fidl::decode!(
12184                            DictionaryRef,
12185                            fdomain_client::fidl::FDomainResourceDialect,
12186                            val,
12187                            decoder,
12188                            _inner_offset,
12189                            depth
12190                        )?;
12191                    } else {
12192                        unreachable!()
12193                    }
12194                }
12195                5 => {
12196                    #[allow(irrefutable_let_patterns)]
12197                    if let Capability::Connector(_) = self {
12198                        // Do nothing, read the value into the object
12199                    } else {
12200                        // Initialize `self` to the right variant
12201                        *self = Capability::Connector(fidl::new_empty!(
12202                            Connector,
12203                            fdomain_client::fidl::FDomainResourceDialect
12204                        ));
12205                    }
12206                    #[allow(irrefutable_let_patterns)]
12207                    if let Capability::Connector(ref mut val) = self {
12208                        fidl::decode!(
12209                            Connector,
12210                            fdomain_client::fidl::FDomainResourceDialect,
12211                            val,
12212                            decoder,
12213                            _inner_offset,
12214                            depth
12215                        )?;
12216                    } else {
12217                        unreachable!()
12218                    }
12219                }
12220                6 => {
12221                    #[allow(irrefutable_let_patterns)]
12222                    if let Capability::DirConnector(_) = self {
12223                        // Do nothing, read the value into the object
12224                    } else {
12225                        // Initialize `self` to the right variant
12226                        *self = Capability::DirConnector(fidl::new_empty!(
12227                            DirConnector,
12228                            fdomain_client::fidl::FDomainResourceDialect
12229                        ));
12230                    }
12231                    #[allow(irrefutable_let_patterns)]
12232                    if let Capability::DirConnector(ref mut val) = self {
12233                        fidl::decode!(
12234                            DirConnector,
12235                            fdomain_client::fidl::FDomainResourceDialect,
12236                            val,
12237                            decoder,
12238                            _inner_offset,
12239                            depth
12240                        )?;
12241                    } else {
12242                        unreachable!()
12243                    }
12244                }
12245                7 => {
12246                    #[allow(irrefutable_let_patterns)]
12247                    if let Capability::Directory(_) = self {
12248                        // Do nothing, read the value into the object
12249                    } else {
12250                        // Initialize `self` to the right variant
12251                        *self = Capability::Directory(fidl::new_empty!(
12252                            fidl::encoding::Endpoint<
12253                                fdomain_client::fidl::ClientEnd<
12254                                    fdomain_fuchsia_io::DirectoryMarker,
12255                                >,
12256                            >,
12257                            fdomain_client::fidl::FDomainResourceDialect
12258                        ));
12259                    }
12260                    #[allow(irrefutable_let_patterns)]
12261                    if let Capability::Directory(ref mut val) = self {
12262                        fidl::decode!(
12263                            fidl::encoding::Endpoint<
12264                                fdomain_client::fidl::ClientEnd<
12265                                    fdomain_fuchsia_io::DirectoryMarker,
12266                                >,
12267                            >,
12268                            fdomain_client::fidl::FDomainResourceDialect,
12269                            val,
12270                            decoder,
12271                            _inner_offset,
12272                            depth
12273                        )?;
12274                    } else {
12275                        unreachable!()
12276                    }
12277                }
12278                8 => {
12279                    #[allow(irrefutable_let_patterns)]
12280                    if let Capability::DirEntry(_) = self {
12281                        // Do nothing, read the value into the object
12282                    } else {
12283                        // Initialize `self` to the right variant
12284                        *self = Capability::DirEntry(fidl::new_empty!(
12285                            DirEntry,
12286                            fdomain_client::fidl::FDomainResourceDialect
12287                        ));
12288                    }
12289                    #[allow(irrefutable_let_patterns)]
12290                    if let Capability::DirEntry(ref mut val) = self {
12291                        fidl::decode!(
12292                            DirEntry,
12293                            fdomain_client::fidl::FDomainResourceDialect,
12294                            val,
12295                            decoder,
12296                            _inner_offset,
12297                            depth
12298                        )?;
12299                    } else {
12300                        unreachable!()
12301                    }
12302                }
12303                9 => {
12304                    #[allow(irrefutable_let_patterns)]
12305                    if let Capability::ConnectorRouter(_) = self {
12306                        // Do nothing, read the value into the object
12307                    } else {
12308                        // Initialize `self` to the right variant
12309                        *self = Capability::ConnectorRouter(fidl::new_empty!(
12310                            fidl::encoding::Endpoint<
12311                                fdomain_client::fidl::ClientEnd<ConnectorRouterMarker>,
12312                            >,
12313                            fdomain_client::fidl::FDomainResourceDialect
12314                        ));
12315                    }
12316                    #[allow(irrefutable_let_patterns)]
12317                    if let Capability::ConnectorRouter(ref mut val) = self {
12318                        fidl::decode!(
12319                            fidl::encoding::Endpoint<
12320                                fdomain_client::fidl::ClientEnd<ConnectorRouterMarker>,
12321                            >,
12322                            fdomain_client::fidl::FDomainResourceDialect,
12323                            val,
12324                            decoder,
12325                            _inner_offset,
12326                            depth
12327                        )?;
12328                    } else {
12329                        unreachable!()
12330                    }
12331                }
12332                10 => {
12333                    #[allow(irrefutable_let_patterns)]
12334                    if let Capability::DictionaryRouter(_) = self {
12335                        // Do nothing, read the value into the object
12336                    } else {
12337                        // Initialize `self` to the right variant
12338                        *self = Capability::DictionaryRouter(fidl::new_empty!(
12339                            fidl::encoding::Endpoint<
12340                                fdomain_client::fidl::ClientEnd<DictionaryRouterMarker>,
12341                            >,
12342                            fdomain_client::fidl::FDomainResourceDialect
12343                        ));
12344                    }
12345                    #[allow(irrefutable_let_patterns)]
12346                    if let Capability::DictionaryRouter(ref mut val) = self {
12347                        fidl::decode!(
12348                            fidl::encoding::Endpoint<
12349                                fdomain_client::fidl::ClientEnd<DictionaryRouterMarker>,
12350                            >,
12351                            fdomain_client::fidl::FDomainResourceDialect,
12352                            val,
12353                            decoder,
12354                            _inner_offset,
12355                            depth
12356                        )?;
12357                    } else {
12358                        unreachable!()
12359                    }
12360                }
12361                11 => {
12362                    #[allow(irrefutable_let_patterns)]
12363                    if let Capability::DirEntryRouter(_) = self {
12364                        // Do nothing, read the value into the object
12365                    } else {
12366                        // Initialize `self` to the right variant
12367                        *self = Capability::DirEntryRouter(fidl::new_empty!(
12368                            fidl::encoding::Endpoint<
12369                                fdomain_client::fidl::ClientEnd<DirEntryRouterMarker>,
12370                            >,
12371                            fdomain_client::fidl::FDomainResourceDialect
12372                        ));
12373                    }
12374                    #[allow(irrefutable_let_patterns)]
12375                    if let Capability::DirEntryRouter(ref mut val) = self {
12376                        fidl::decode!(
12377                            fidl::encoding::Endpoint<
12378                                fdomain_client::fidl::ClientEnd<DirEntryRouterMarker>,
12379                            >,
12380                            fdomain_client::fidl::FDomainResourceDialect,
12381                            val,
12382                            decoder,
12383                            _inner_offset,
12384                            depth
12385                        )?;
12386                    } else {
12387                        unreachable!()
12388                    }
12389                }
12390                12 => {
12391                    #[allow(irrefutable_let_patterns)]
12392                    if let Capability::DataRouter(_) = self {
12393                        // Do nothing, read the value into the object
12394                    } else {
12395                        // Initialize `self` to the right variant
12396                        *self = Capability::DataRouter(fidl::new_empty!(
12397                            fidl::encoding::Endpoint<
12398                                fdomain_client::fidl::ClientEnd<DataRouterMarker>,
12399                            >,
12400                            fdomain_client::fidl::FDomainResourceDialect
12401                        ));
12402                    }
12403                    #[allow(irrefutable_let_patterns)]
12404                    if let Capability::DataRouter(ref mut val) = self {
12405                        fidl::decode!(
12406                            fidl::encoding::Endpoint<
12407                                fdomain_client::fidl::ClientEnd<DataRouterMarker>,
12408                            >,
12409                            fdomain_client::fidl::FDomainResourceDialect,
12410                            val,
12411                            decoder,
12412                            _inner_offset,
12413                            depth
12414                        )?;
12415                    } else {
12416                        unreachable!()
12417                    }
12418                }
12419                13 => {
12420                    #[allow(irrefutable_let_patterns)]
12421                    if let Capability::DirConnectorRouter(_) = self {
12422                        // Do nothing, read the value into the object
12423                    } else {
12424                        // Initialize `self` to the right variant
12425                        *self = Capability::DirConnectorRouter(fidl::new_empty!(
12426                            fidl::encoding::Endpoint<
12427                                fdomain_client::fidl::ClientEnd<DirConnectorRouterMarker>,
12428                            >,
12429                            fdomain_client::fidl::FDomainResourceDialect
12430                        ));
12431                    }
12432                    #[allow(irrefutable_let_patterns)]
12433                    if let Capability::DirConnectorRouter(ref mut val) = self {
12434                        fidl::decode!(
12435                            fidl::encoding::Endpoint<
12436                                fdomain_client::fidl::ClientEnd<DirConnectorRouterMarker>,
12437                            >,
12438                            fdomain_client::fidl::FDomainResourceDialect,
12439                            val,
12440                            decoder,
12441                            _inner_offset,
12442                            depth
12443                        )?;
12444                    } else {
12445                        unreachable!()
12446                    }
12447                }
12448                #[allow(deprecated)]
12449                ordinal => {
12450                    for _ in 0..num_handles {
12451                        decoder.drop_next_handle()?;
12452                    }
12453                    *self = Capability::__SourceBreaking { unknown_ordinal: ordinal };
12454                }
12455            }
12456            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
12457                return Err(fidl::Error::InvalidNumBytesInEnvelope);
12458            }
12459            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12460                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12461            }
12462            Ok(())
12463        }
12464    }
12465
12466    impl fidl::encoding::ResourceTypeMarker for ConnectorRouterRouteResponse {
12467        type Borrowed<'a> = &'a mut Self;
12468        fn take_or_borrow<'a>(
12469            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12470        ) -> Self::Borrowed<'a> {
12471            value
12472        }
12473    }
12474
12475    unsafe impl fidl::encoding::TypeMarker for ConnectorRouterRouteResponse {
12476        type Owned = Self;
12477
12478        #[inline(always)]
12479        fn inline_align(_context: fidl::encoding::Context) -> usize {
12480            8
12481        }
12482
12483        #[inline(always)]
12484        fn inline_size(_context: fidl::encoding::Context) -> usize {
12485            16
12486        }
12487    }
12488
12489    unsafe impl
12490        fidl::encoding::Encode<
12491            ConnectorRouterRouteResponse,
12492            fdomain_client::fidl::FDomainResourceDialect,
12493        > for &mut ConnectorRouterRouteResponse
12494    {
12495        #[inline]
12496        unsafe fn encode(
12497            self,
12498            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
12499            offset: usize,
12500            _depth: fidl::encoding::Depth,
12501        ) -> fidl::Result<()> {
12502            encoder.debug_check_bounds::<ConnectorRouterRouteResponse>(offset);
12503            encoder.write_num::<u64>(self.ordinal(), offset);
12504            match self {
12505                ConnectorRouterRouteResponse::Connector(ref mut val) => {
12506                    fidl::encoding::encode_in_envelope::<
12507                        Connector,
12508                        fdomain_client::fidl::FDomainResourceDialect,
12509                    >(
12510                        <Connector as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
12511                        encoder,
12512                        offset + 8,
12513                        _depth,
12514                    )
12515                }
12516                ConnectorRouterRouteResponse::Unavailable(ref val) => {
12517                    fidl::encoding::encode_in_envelope::<
12518                        Unit,
12519                        fdomain_client::fidl::FDomainResourceDialect,
12520                    >(
12521                        <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
12522                        encoder,
12523                        offset + 8,
12524                        _depth,
12525                    )
12526                }
12527            }
12528        }
12529    }
12530
12531    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
12532        for ConnectorRouterRouteResponse
12533    {
12534        #[inline(always)]
12535        fn new_empty() -> Self {
12536            Self::Connector(fidl::new_empty!(
12537                Connector,
12538                fdomain_client::fidl::FDomainResourceDialect
12539            ))
12540        }
12541
12542        #[inline]
12543        unsafe fn decode(
12544            &mut self,
12545            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
12546            offset: usize,
12547            mut depth: fidl::encoding::Depth,
12548        ) -> fidl::Result<()> {
12549            decoder.debug_check_bounds::<Self>(offset);
12550            #[allow(unused_variables)]
12551            let next_out_of_line = decoder.next_out_of_line();
12552            let handles_before = decoder.remaining_handles();
12553            let (ordinal, inlined, num_bytes, num_handles) =
12554                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
12555
12556            let member_inline_size = match ordinal {
12557                1 => <Connector as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12558                2 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12559                _ => return Err(fidl::Error::UnknownUnionTag),
12560            };
12561
12562            if inlined != (member_inline_size <= 4) {
12563                return Err(fidl::Error::InvalidInlineBitInEnvelope);
12564            }
12565            let _inner_offset;
12566            if inlined {
12567                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
12568                _inner_offset = offset + 8;
12569            } else {
12570                depth.increment()?;
12571                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12572            }
12573            match ordinal {
12574                1 => {
12575                    #[allow(irrefutable_let_patterns)]
12576                    if let ConnectorRouterRouteResponse::Connector(_) = self {
12577                        // Do nothing, read the value into the object
12578                    } else {
12579                        // Initialize `self` to the right variant
12580                        *self = ConnectorRouterRouteResponse::Connector(fidl::new_empty!(
12581                            Connector,
12582                            fdomain_client::fidl::FDomainResourceDialect
12583                        ));
12584                    }
12585                    #[allow(irrefutable_let_patterns)]
12586                    if let ConnectorRouterRouteResponse::Connector(ref mut val) = self {
12587                        fidl::decode!(
12588                            Connector,
12589                            fdomain_client::fidl::FDomainResourceDialect,
12590                            val,
12591                            decoder,
12592                            _inner_offset,
12593                            depth
12594                        )?;
12595                    } else {
12596                        unreachable!()
12597                    }
12598                }
12599                2 => {
12600                    #[allow(irrefutable_let_patterns)]
12601                    if let ConnectorRouterRouteResponse::Unavailable(_) = self {
12602                        // Do nothing, read the value into the object
12603                    } else {
12604                        // Initialize `self` to the right variant
12605                        *self = ConnectorRouterRouteResponse::Unavailable(fidl::new_empty!(
12606                            Unit,
12607                            fdomain_client::fidl::FDomainResourceDialect
12608                        ));
12609                    }
12610                    #[allow(irrefutable_let_patterns)]
12611                    if let ConnectorRouterRouteResponse::Unavailable(ref mut val) = self {
12612                        fidl::decode!(
12613                            Unit,
12614                            fdomain_client::fidl::FDomainResourceDialect,
12615                            val,
12616                            decoder,
12617                            _inner_offset,
12618                            depth
12619                        )?;
12620                    } else {
12621                        unreachable!()
12622                    }
12623                }
12624                ordinal => panic!("unexpected ordinal {:?}", ordinal),
12625            }
12626            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
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            Ok(())
12633        }
12634    }
12635
12636    impl fidl::encoding::ResourceTypeMarker for DataRouterRouteResponse {
12637        type Borrowed<'a> = &'a mut Self;
12638        fn take_or_borrow<'a>(
12639            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12640        ) -> Self::Borrowed<'a> {
12641            value
12642        }
12643    }
12644
12645    unsafe impl fidl::encoding::TypeMarker for DataRouterRouteResponse {
12646        type Owned = Self;
12647
12648        #[inline(always)]
12649        fn inline_align(_context: fidl::encoding::Context) -> usize {
12650            8
12651        }
12652
12653        #[inline(always)]
12654        fn inline_size(_context: fidl::encoding::Context) -> usize {
12655            16
12656        }
12657    }
12658
12659    unsafe impl
12660        fidl::encoding::Encode<
12661            DataRouterRouteResponse,
12662            fdomain_client::fidl::FDomainResourceDialect,
12663        > for &mut DataRouterRouteResponse
12664    {
12665        #[inline]
12666        unsafe fn encode(
12667            self,
12668            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
12669            offset: usize,
12670            _depth: fidl::encoding::Depth,
12671        ) -> fidl::Result<()> {
12672            encoder.debug_check_bounds::<DataRouterRouteResponse>(offset);
12673            encoder.write_num::<u64>(self.ordinal(), offset);
12674            match self {
12675                DataRouterRouteResponse::Data(ref val) => fidl::encoding::encode_in_envelope::<
12676                    Data,
12677                    fdomain_client::fidl::FDomainResourceDialect,
12678                >(
12679                    <Data as fidl::encoding::ValueTypeMarker>::borrow(val),
12680                    encoder,
12681                    offset + 8,
12682                    _depth,
12683                ),
12684                DataRouterRouteResponse::Unavailable(ref val) => {
12685                    fidl::encoding::encode_in_envelope::<
12686                        Unit,
12687                        fdomain_client::fidl::FDomainResourceDialect,
12688                    >(
12689                        <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
12690                        encoder,
12691                        offset + 8,
12692                        _depth,
12693                    )
12694                }
12695            }
12696        }
12697    }
12698
12699    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
12700        for DataRouterRouteResponse
12701    {
12702        #[inline(always)]
12703        fn new_empty() -> Self {
12704            Self::Data(fidl::new_empty!(Data, fdomain_client::fidl::FDomainResourceDialect))
12705        }
12706
12707        #[inline]
12708        unsafe fn decode(
12709            &mut self,
12710            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
12711            offset: usize,
12712            mut depth: fidl::encoding::Depth,
12713        ) -> fidl::Result<()> {
12714            decoder.debug_check_bounds::<Self>(offset);
12715            #[allow(unused_variables)]
12716            let next_out_of_line = decoder.next_out_of_line();
12717            let handles_before = decoder.remaining_handles();
12718            let (ordinal, inlined, num_bytes, num_handles) =
12719                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
12720
12721            let member_inline_size = match ordinal {
12722                1 => <Data as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12723                2 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12724                _ => return Err(fidl::Error::UnknownUnionTag),
12725            };
12726
12727            if inlined != (member_inline_size <= 4) {
12728                return Err(fidl::Error::InvalidInlineBitInEnvelope);
12729            }
12730            let _inner_offset;
12731            if inlined {
12732                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
12733                _inner_offset = offset + 8;
12734            } else {
12735                depth.increment()?;
12736                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12737            }
12738            match ordinal {
12739                1 => {
12740                    #[allow(irrefutable_let_patterns)]
12741                    if let DataRouterRouteResponse::Data(_) = self {
12742                        // Do nothing, read the value into the object
12743                    } else {
12744                        // Initialize `self` to the right variant
12745                        *self = DataRouterRouteResponse::Data(fidl::new_empty!(
12746                            Data,
12747                            fdomain_client::fidl::FDomainResourceDialect
12748                        ));
12749                    }
12750                    #[allow(irrefutable_let_patterns)]
12751                    if let DataRouterRouteResponse::Data(ref mut val) = self {
12752                        fidl::decode!(
12753                            Data,
12754                            fdomain_client::fidl::FDomainResourceDialect,
12755                            val,
12756                            decoder,
12757                            _inner_offset,
12758                            depth
12759                        )?;
12760                    } else {
12761                        unreachable!()
12762                    }
12763                }
12764                2 => {
12765                    #[allow(irrefutable_let_patterns)]
12766                    if let DataRouterRouteResponse::Unavailable(_) = self {
12767                        // Do nothing, read the value into the object
12768                    } else {
12769                        // Initialize `self` to the right variant
12770                        *self = DataRouterRouteResponse::Unavailable(fidl::new_empty!(
12771                            Unit,
12772                            fdomain_client::fidl::FDomainResourceDialect
12773                        ));
12774                    }
12775                    #[allow(irrefutable_let_patterns)]
12776                    if let DataRouterRouteResponse::Unavailable(ref mut val) = self {
12777                        fidl::decode!(
12778                            Unit,
12779                            fdomain_client::fidl::FDomainResourceDialect,
12780                            val,
12781                            decoder,
12782                            _inner_offset,
12783                            depth
12784                        )?;
12785                    } else {
12786                        unreachable!()
12787                    }
12788                }
12789                ordinal => panic!("unexpected ordinal {:?}", ordinal),
12790            }
12791            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
12792                return Err(fidl::Error::InvalidNumBytesInEnvelope);
12793            }
12794            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12795                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12796            }
12797            Ok(())
12798        }
12799    }
12800
12801    impl fidl::encoding::ResourceTypeMarker for DictionaryRouterRouteResponse {
12802        type Borrowed<'a> = &'a mut Self;
12803        fn take_or_borrow<'a>(
12804            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12805        ) -> Self::Borrowed<'a> {
12806            value
12807        }
12808    }
12809
12810    unsafe impl fidl::encoding::TypeMarker for DictionaryRouterRouteResponse {
12811        type Owned = Self;
12812
12813        #[inline(always)]
12814        fn inline_align(_context: fidl::encoding::Context) -> usize {
12815            8
12816        }
12817
12818        #[inline(always)]
12819        fn inline_size(_context: fidl::encoding::Context) -> usize {
12820            16
12821        }
12822    }
12823
12824    unsafe impl
12825        fidl::encoding::Encode<
12826            DictionaryRouterRouteResponse,
12827            fdomain_client::fidl::FDomainResourceDialect,
12828        > for &mut DictionaryRouterRouteResponse
12829    {
12830        #[inline]
12831        unsafe fn encode(
12832            self,
12833            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
12834            offset: usize,
12835            _depth: fidl::encoding::Depth,
12836        ) -> fidl::Result<()> {
12837            encoder.debug_check_bounds::<DictionaryRouterRouteResponse>(offset);
12838            encoder.write_num::<u64>(self.ordinal(), offset);
12839            match self {
12840                DictionaryRouterRouteResponse::Dictionary(ref mut val) => {
12841                    fidl::encoding::encode_in_envelope::<
12842                        DictionaryRef,
12843                        fdomain_client::fidl::FDomainResourceDialect,
12844                    >(
12845                        <DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
12846                        encoder,
12847                        offset + 8,
12848                        _depth,
12849                    )
12850                }
12851                DictionaryRouterRouteResponse::Unavailable(ref val) => {
12852                    fidl::encoding::encode_in_envelope::<
12853                        Unit,
12854                        fdomain_client::fidl::FDomainResourceDialect,
12855                    >(
12856                        <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
12857                        encoder,
12858                        offset + 8,
12859                        _depth,
12860                    )
12861                }
12862            }
12863        }
12864    }
12865
12866    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
12867        for DictionaryRouterRouteResponse
12868    {
12869        #[inline(always)]
12870        fn new_empty() -> Self {
12871            Self::Dictionary(fidl::new_empty!(
12872                DictionaryRef,
12873                fdomain_client::fidl::FDomainResourceDialect
12874            ))
12875        }
12876
12877        #[inline]
12878        unsafe fn decode(
12879            &mut self,
12880            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
12881            offset: usize,
12882            mut depth: fidl::encoding::Depth,
12883        ) -> fidl::Result<()> {
12884            decoder.debug_check_bounds::<Self>(offset);
12885            #[allow(unused_variables)]
12886            let next_out_of_line = decoder.next_out_of_line();
12887            let handles_before = decoder.remaining_handles();
12888            let (ordinal, inlined, num_bytes, num_handles) =
12889                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
12890
12891            let member_inline_size = match ordinal {
12892                1 => <DictionaryRef as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12893                2 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12894                _ => return Err(fidl::Error::UnknownUnionTag),
12895            };
12896
12897            if inlined != (member_inline_size <= 4) {
12898                return Err(fidl::Error::InvalidInlineBitInEnvelope);
12899            }
12900            let _inner_offset;
12901            if inlined {
12902                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
12903                _inner_offset = offset + 8;
12904            } else {
12905                depth.increment()?;
12906                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12907            }
12908            match ordinal {
12909                1 => {
12910                    #[allow(irrefutable_let_patterns)]
12911                    if let DictionaryRouterRouteResponse::Dictionary(_) = self {
12912                        // Do nothing, read the value into the object
12913                    } else {
12914                        // Initialize `self` to the right variant
12915                        *self = DictionaryRouterRouteResponse::Dictionary(fidl::new_empty!(
12916                            DictionaryRef,
12917                            fdomain_client::fidl::FDomainResourceDialect
12918                        ));
12919                    }
12920                    #[allow(irrefutable_let_patterns)]
12921                    if let DictionaryRouterRouteResponse::Dictionary(ref mut val) = self {
12922                        fidl::decode!(
12923                            DictionaryRef,
12924                            fdomain_client::fidl::FDomainResourceDialect,
12925                            val,
12926                            decoder,
12927                            _inner_offset,
12928                            depth
12929                        )?;
12930                    } else {
12931                        unreachable!()
12932                    }
12933                }
12934                2 => {
12935                    #[allow(irrefutable_let_patterns)]
12936                    if let DictionaryRouterRouteResponse::Unavailable(_) = self {
12937                        // Do nothing, read the value into the object
12938                    } else {
12939                        // Initialize `self` to the right variant
12940                        *self = DictionaryRouterRouteResponse::Unavailable(fidl::new_empty!(
12941                            Unit,
12942                            fdomain_client::fidl::FDomainResourceDialect
12943                        ));
12944                    }
12945                    #[allow(irrefutable_let_patterns)]
12946                    if let DictionaryRouterRouteResponse::Unavailable(ref mut val) = self {
12947                        fidl::decode!(
12948                            Unit,
12949                            fdomain_client::fidl::FDomainResourceDialect,
12950                            val,
12951                            decoder,
12952                            _inner_offset,
12953                            depth
12954                        )?;
12955                    } else {
12956                        unreachable!()
12957                    }
12958                }
12959                ordinal => panic!("unexpected ordinal {:?}", ordinal),
12960            }
12961            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
12962                return Err(fidl::Error::InvalidNumBytesInEnvelope);
12963            }
12964            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12965                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12966            }
12967            Ok(())
12968        }
12969    }
12970
12971    impl fidl::encoding::ResourceTypeMarker for DirConnectorRouterRouteResponse {
12972        type Borrowed<'a> = &'a mut Self;
12973        fn take_or_borrow<'a>(
12974            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12975        ) -> Self::Borrowed<'a> {
12976            value
12977        }
12978    }
12979
12980    unsafe impl fidl::encoding::TypeMarker for DirConnectorRouterRouteResponse {
12981        type Owned = Self;
12982
12983        #[inline(always)]
12984        fn inline_align(_context: fidl::encoding::Context) -> usize {
12985            8
12986        }
12987
12988        #[inline(always)]
12989        fn inline_size(_context: fidl::encoding::Context) -> usize {
12990            16
12991        }
12992    }
12993
12994    unsafe impl
12995        fidl::encoding::Encode<
12996            DirConnectorRouterRouteResponse,
12997            fdomain_client::fidl::FDomainResourceDialect,
12998        > for &mut DirConnectorRouterRouteResponse
12999    {
13000        #[inline]
13001        unsafe fn encode(
13002            self,
13003            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
13004            offset: usize,
13005            _depth: fidl::encoding::Depth,
13006        ) -> fidl::Result<()> {
13007            encoder.debug_check_bounds::<DirConnectorRouterRouteResponse>(offset);
13008            encoder.write_num::<u64>(self.ordinal(), offset);
13009            match self {
13010                DirConnectorRouterRouteResponse::DirConnector(ref mut val) => {
13011                    fidl::encoding::encode_in_envelope::<
13012                        DirConnector,
13013                        fdomain_client::fidl::FDomainResourceDialect,
13014                    >(
13015                        <DirConnector as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
13016                        encoder,
13017                        offset + 8,
13018                        _depth,
13019                    )
13020                }
13021                DirConnectorRouterRouteResponse::Unavailable(ref val) => {
13022                    fidl::encoding::encode_in_envelope::<
13023                        Unit,
13024                        fdomain_client::fidl::FDomainResourceDialect,
13025                    >(
13026                        <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
13027                        encoder,
13028                        offset + 8,
13029                        _depth,
13030                    )
13031                }
13032            }
13033        }
13034    }
13035
13036    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
13037        for DirConnectorRouterRouteResponse
13038    {
13039        #[inline(always)]
13040        fn new_empty() -> Self {
13041            Self::DirConnector(fidl::new_empty!(
13042                DirConnector,
13043                fdomain_client::fidl::FDomainResourceDialect
13044            ))
13045        }
13046
13047        #[inline]
13048        unsafe fn decode(
13049            &mut self,
13050            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
13051            offset: usize,
13052            mut depth: fidl::encoding::Depth,
13053        ) -> fidl::Result<()> {
13054            decoder.debug_check_bounds::<Self>(offset);
13055            #[allow(unused_variables)]
13056            let next_out_of_line = decoder.next_out_of_line();
13057            let handles_before = decoder.remaining_handles();
13058            let (ordinal, inlined, num_bytes, num_handles) =
13059                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
13060
13061            let member_inline_size = match ordinal {
13062                1 => <DirConnector as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13063                2 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13064                _ => return Err(fidl::Error::UnknownUnionTag),
13065            };
13066
13067            if inlined != (member_inline_size <= 4) {
13068                return Err(fidl::Error::InvalidInlineBitInEnvelope);
13069            }
13070            let _inner_offset;
13071            if inlined {
13072                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
13073                _inner_offset = offset + 8;
13074            } else {
13075                depth.increment()?;
13076                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13077            }
13078            match ordinal {
13079                1 => {
13080                    #[allow(irrefutable_let_patterns)]
13081                    if let DirConnectorRouterRouteResponse::DirConnector(_) = self {
13082                        // Do nothing, read the value into the object
13083                    } else {
13084                        // Initialize `self` to the right variant
13085                        *self = DirConnectorRouterRouteResponse::DirConnector(fidl::new_empty!(
13086                            DirConnector,
13087                            fdomain_client::fidl::FDomainResourceDialect
13088                        ));
13089                    }
13090                    #[allow(irrefutable_let_patterns)]
13091                    if let DirConnectorRouterRouteResponse::DirConnector(ref mut val) = self {
13092                        fidl::decode!(
13093                            DirConnector,
13094                            fdomain_client::fidl::FDomainResourceDialect,
13095                            val,
13096                            decoder,
13097                            _inner_offset,
13098                            depth
13099                        )?;
13100                    } else {
13101                        unreachable!()
13102                    }
13103                }
13104                2 => {
13105                    #[allow(irrefutable_let_patterns)]
13106                    if let DirConnectorRouterRouteResponse::Unavailable(_) = self {
13107                        // Do nothing, read the value into the object
13108                    } else {
13109                        // Initialize `self` to the right variant
13110                        *self = DirConnectorRouterRouteResponse::Unavailable(fidl::new_empty!(
13111                            Unit,
13112                            fdomain_client::fidl::FDomainResourceDialect
13113                        ));
13114                    }
13115                    #[allow(irrefutable_let_patterns)]
13116                    if let DirConnectorRouterRouteResponse::Unavailable(ref mut val) = self {
13117                        fidl::decode!(
13118                            Unit,
13119                            fdomain_client::fidl::FDomainResourceDialect,
13120                            val,
13121                            decoder,
13122                            _inner_offset,
13123                            depth
13124                        )?;
13125                    } else {
13126                        unreachable!()
13127                    }
13128                }
13129                ordinal => panic!("unexpected ordinal {:?}", ordinal),
13130            }
13131            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
13132                return Err(fidl::Error::InvalidNumBytesInEnvelope);
13133            }
13134            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13135                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13136            }
13137            Ok(())
13138        }
13139    }
13140
13141    impl fidl::encoding::ResourceTypeMarker for DirEntryRouterRouteResponse {
13142        type Borrowed<'a> = &'a mut Self;
13143        fn take_or_borrow<'a>(
13144            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13145        ) -> Self::Borrowed<'a> {
13146            value
13147        }
13148    }
13149
13150    unsafe impl fidl::encoding::TypeMarker for DirEntryRouterRouteResponse {
13151        type Owned = Self;
13152
13153        #[inline(always)]
13154        fn inline_align(_context: fidl::encoding::Context) -> usize {
13155            8
13156        }
13157
13158        #[inline(always)]
13159        fn inline_size(_context: fidl::encoding::Context) -> usize {
13160            16
13161        }
13162    }
13163
13164    unsafe impl
13165        fidl::encoding::Encode<
13166            DirEntryRouterRouteResponse,
13167            fdomain_client::fidl::FDomainResourceDialect,
13168        > for &mut DirEntryRouterRouteResponse
13169    {
13170        #[inline]
13171        unsafe fn encode(
13172            self,
13173            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
13174            offset: usize,
13175            _depth: fidl::encoding::Depth,
13176        ) -> fidl::Result<()> {
13177            encoder.debug_check_bounds::<DirEntryRouterRouteResponse>(offset);
13178            encoder.write_num::<u64>(self.ordinal(), offset);
13179            match self {
13180                DirEntryRouterRouteResponse::DirEntry(ref mut val) => {
13181                    fidl::encoding::encode_in_envelope::<
13182                        DirEntry,
13183                        fdomain_client::fidl::FDomainResourceDialect,
13184                    >(
13185                        <DirEntry as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
13186                        encoder,
13187                        offset + 8,
13188                        _depth,
13189                    )
13190                }
13191                DirEntryRouterRouteResponse::Unavailable(ref val) => {
13192                    fidl::encoding::encode_in_envelope::<
13193                        Unit,
13194                        fdomain_client::fidl::FDomainResourceDialect,
13195                    >(
13196                        <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
13197                        encoder,
13198                        offset + 8,
13199                        _depth,
13200                    )
13201                }
13202            }
13203        }
13204    }
13205
13206    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
13207        for DirEntryRouterRouteResponse
13208    {
13209        #[inline(always)]
13210        fn new_empty() -> Self {
13211            Self::DirEntry(fidl::new_empty!(DirEntry, fdomain_client::fidl::FDomainResourceDialect))
13212        }
13213
13214        #[inline]
13215        unsafe fn decode(
13216            &mut self,
13217            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
13218            offset: usize,
13219            mut depth: fidl::encoding::Depth,
13220        ) -> fidl::Result<()> {
13221            decoder.debug_check_bounds::<Self>(offset);
13222            #[allow(unused_variables)]
13223            let next_out_of_line = decoder.next_out_of_line();
13224            let handles_before = decoder.remaining_handles();
13225            let (ordinal, inlined, num_bytes, num_handles) =
13226                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
13227
13228            let member_inline_size = match ordinal {
13229                1 => <DirEntry as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13230                2 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13231                _ => return Err(fidl::Error::UnknownUnionTag),
13232            };
13233
13234            if inlined != (member_inline_size <= 4) {
13235                return Err(fidl::Error::InvalidInlineBitInEnvelope);
13236            }
13237            let _inner_offset;
13238            if inlined {
13239                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
13240                _inner_offset = offset + 8;
13241            } else {
13242                depth.increment()?;
13243                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13244            }
13245            match ordinal {
13246                1 => {
13247                    #[allow(irrefutable_let_patterns)]
13248                    if let DirEntryRouterRouteResponse::DirEntry(_) = self {
13249                        // Do nothing, read the value into the object
13250                    } else {
13251                        // Initialize `self` to the right variant
13252                        *self = DirEntryRouterRouteResponse::DirEntry(fidl::new_empty!(
13253                            DirEntry,
13254                            fdomain_client::fidl::FDomainResourceDialect
13255                        ));
13256                    }
13257                    #[allow(irrefutable_let_patterns)]
13258                    if let DirEntryRouterRouteResponse::DirEntry(ref mut val) = self {
13259                        fidl::decode!(
13260                            DirEntry,
13261                            fdomain_client::fidl::FDomainResourceDialect,
13262                            val,
13263                            decoder,
13264                            _inner_offset,
13265                            depth
13266                        )?;
13267                    } else {
13268                        unreachable!()
13269                    }
13270                }
13271                2 => {
13272                    #[allow(irrefutable_let_patterns)]
13273                    if let DirEntryRouterRouteResponse::Unavailable(_) = self {
13274                        // Do nothing, read the value into the object
13275                    } else {
13276                        // Initialize `self` to the right variant
13277                        *self = DirEntryRouterRouteResponse::Unavailable(fidl::new_empty!(
13278                            Unit,
13279                            fdomain_client::fidl::FDomainResourceDialect
13280                        ));
13281                    }
13282                    #[allow(irrefutable_let_patterns)]
13283                    if let DirEntryRouterRouteResponse::Unavailable(ref mut val) = self {
13284                        fidl::decode!(
13285                            Unit,
13286                            fdomain_client::fidl::FDomainResourceDialect,
13287                            val,
13288                            decoder,
13289                            _inner_offset,
13290                            depth
13291                        )?;
13292                    } else {
13293                        unreachable!()
13294                    }
13295                }
13296                ordinal => panic!("unexpected ordinal {:?}", ordinal),
13297            }
13298            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
13299                return Err(fidl::Error::InvalidNumBytesInEnvelope);
13300            }
13301            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13302                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13303            }
13304            Ok(())
13305        }
13306    }
13307
13308    impl fidl::encoding::ResourceTypeMarker for DirectoryRouterRouteResponse {
13309        type Borrowed<'a> = &'a mut Self;
13310        fn take_or_borrow<'a>(
13311            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13312        ) -> Self::Borrowed<'a> {
13313            value
13314        }
13315    }
13316
13317    unsafe impl fidl::encoding::TypeMarker for DirectoryRouterRouteResponse {
13318        type Owned = Self;
13319
13320        #[inline(always)]
13321        fn inline_align(_context: fidl::encoding::Context) -> usize {
13322            8
13323        }
13324
13325        #[inline(always)]
13326        fn inline_size(_context: fidl::encoding::Context) -> usize {
13327            16
13328        }
13329    }
13330
13331    unsafe impl
13332        fidl::encoding::Encode<
13333            DirectoryRouterRouteResponse,
13334            fdomain_client::fidl::FDomainResourceDialect,
13335        > for &mut DirectoryRouterRouteResponse
13336    {
13337        #[inline]
13338        unsafe fn encode(
13339            self,
13340            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
13341            offset: usize,
13342            _depth: fidl::encoding::Depth,
13343        ) -> fidl::Result<()> {
13344            encoder.debug_check_bounds::<DirectoryRouterRouteResponse>(offset);
13345            encoder.write_num::<u64>(self.ordinal(), offset);
13346            match self {
13347                DirectoryRouterRouteResponse::Directory(ref mut val) => {
13348                    fidl::encoding::encode_in_envelope::<
13349                        fidl::encoding::Endpoint<
13350                            fdomain_client::fidl::ClientEnd<fdomain_fuchsia_io::DirectoryMarker>,
13351                        >,
13352                        fdomain_client::fidl::FDomainResourceDialect,
13353                    >(
13354                        <fidl::encoding::Endpoint<
13355                            fdomain_client::fidl::ClientEnd<fdomain_fuchsia_io::DirectoryMarker>,
13356                        > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
13357                            val
13358                        ),
13359                        encoder,
13360                        offset + 8,
13361                        _depth,
13362                    )
13363                }
13364                DirectoryRouterRouteResponse::Unavailable(ref val) => {
13365                    fidl::encoding::encode_in_envelope::<
13366                        Unit,
13367                        fdomain_client::fidl::FDomainResourceDialect,
13368                    >(
13369                        <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
13370                        encoder,
13371                        offset + 8,
13372                        _depth,
13373                    )
13374                }
13375            }
13376        }
13377    }
13378
13379    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
13380        for DirectoryRouterRouteResponse
13381    {
13382        #[inline(always)]
13383        fn new_empty() -> Self {
13384            Self::Directory(fidl::new_empty!(
13385                fidl::encoding::Endpoint<
13386                    fdomain_client::fidl::ClientEnd<fdomain_fuchsia_io::DirectoryMarker>,
13387                >,
13388                fdomain_client::fidl::FDomainResourceDialect
13389            ))
13390        }
13391
13392        #[inline]
13393        unsafe fn decode(
13394            &mut self,
13395            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
13396            offset: usize,
13397            mut depth: fidl::encoding::Depth,
13398        ) -> fidl::Result<()> {
13399            decoder.debug_check_bounds::<Self>(offset);
13400            #[allow(unused_variables)]
13401            let next_out_of_line = decoder.next_out_of_line();
13402            let handles_before = decoder.remaining_handles();
13403            let (ordinal, inlined, num_bytes, num_handles) =
13404                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
13405
13406            let member_inline_size = match ordinal {
13407                1 => <fidl::encoding::Endpoint<
13408                    fdomain_client::fidl::ClientEnd<fdomain_fuchsia_io::DirectoryMarker>,
13409                > as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13410                2 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13411                _ => return Err(fidl::Error::UnknownUnionTag),
13412            };
13413
13414            if inlined != (member_inline_size <= 4) {
13415                return Err(fidl::Error::InvalidInlineBitInEnvelope);
13416            }
13417            let _inner_offset;
13418            if inlined {
13419                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
13420                _inner_offset = offset + 8;
13421            } else {
13422                depth.increment()?;
13423                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13424            }
13425            match ordinal {
13426                1 => {
13427                    #[allow(irrefutable_let_patterns)]
13428                    if let DirectoryRouterRouteResponse::Directory(_) = self {
13429                        // Do nothing, read the value into the object
13430                    } else {
13431                        // Initialize `self` to the right variant
13432                        *self = DirectoryRouterRouteResponse::Directory(fidl::new_empty!(
13433                            fidl::encoding::Endpoint<
13434                                fdomain_client::fidl::ClientEnd<
13435                                    fdomain_fuchsia_io::DirectoryMarker,
13436                                >,
13437                            >,
13438                            fdomain_client::fidl::FDomainResourceDialect
13439                        ));
13440                    }
13441                    #[allow(irrefutable_let_patterns)]
13442                    if let DirectoryRouterRouteResponse::Directory(ref mut val) = self {
13443                        fidl::decode!(
13444                            fidl::encoding::Endpoint<
13445                                fdomain_client::fidl::ClientEnd<
13446                                    fdomain_fuchsia_io::DirectoryMarker,
13447                                >,
13448                            >,
13449                            fdomain_client::fidl::FDomainResourceDialect,
13450                            val,
13451                            decoder,
13452                            _inner_offset,
13453                            depth
13454                        )?;
13455                    } else {
13456                        unreachable!()
13457                    }
13458                }
13459                2 => {
13460                    #[allow(irrefutable_let_patterns)]
13461                    if let DirectoryRouterRouteResponse::Unavailable(_) = self {
13462                        // Do nothing, read the value into the object
13463                    } else {
13464                        // Initialize `self` to the right variant
13465                        *self = DirectoryRouterRouteResponse::Unavailable(fidl::new_empty!(
13466                            Unit,
13467                            fdomain_client::fidl::FDomainResourceDialect
13468                        ));
13469                    }
13470                    #[allow(irrefutable_let_patterns)]
13471                    if let DirectoryRouterRouteResponse::Unavailable(ref mut val) = self {
13472                        fidl::decode!(
13473                            Unit,
13474                            fdomain_client::fidl::FDomainResourceDialect,
13475                            val,
13476                            decoder,
13477                            _inner_offset,
13478                            depth
13479                        )?;
13480                    } else {
13481                        unreachable!()
13482                    }
13483                }
13484                ordinal => panic!("unexpected ordinal {:?}", ordinal),
13485            }
13486            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
13487                return Err(fidl::Error::InvalidNumBytesInEnvelope);
13488            }
13489            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13490                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13491            }
13492            Ok(())
13493        }
13494    }
13495}