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, Eq, Hash, Ord, PartialEq, PartialOrd)]
106pub struct CapabilityStoreDirConnectorOpenRequest {
107    pub id: u64,
108    pub server_end: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
109}
110
111impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
112    for CapabilityStoreDirConnectorOpenRequest
113{
114}
115
116#[derive(Debug, PartialEq)]
117pub struct CapabilityStoreImportRequest {
118    pub id: u64,
119    pub capability: Capability,
120}
121
122impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
123    for CapabilityStoreImportRequest
124{
125}
126
127#[derive(Debug, PartialEq)]
128pub struct CapabilityStoreExportResponse {
129    pub capability: Capability,
130}
131
132impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
133    for CapabilityStoreExportResponse
134{
135}
136
137#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
138pub struct Connector {
139    pub token: fdomain_client::EventPair,
140}
141
142impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for Connector {}
143
144#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
145pub struct DictionaryDrainIteratorGetNextResponse {
146    pub items: Vec<DictionaryItem>,
147    pub end_id: u64,
148}
149
150impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
151    for DictionaryDrainIteratorGetNextResponse
152{
153}
154
155#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
156pub struct DictionaryEnumerateIteratorGetNextResponse {
157    pub items: Vec<DictionaryOptionalItem>,
158    pub end_id: u64,
159}
160
161impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
162    for DictionaryEnumerateIteratorGetNextResponse
163{
164}
165
166#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
167pub struct DictionaryKeysIteratorGetNextResponse {
168    pub keys: Vec<String>,
169}
170
171impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
172    for DictionaryKeysIteratorGetNextResponse
173{
174}
175
176/// A key-value pair in a [`DictionaryRef`], where the value may be elided.
177/// This is useful for APIs that may wish to omit the value, for example if it could not be
178/// duplicated.
179#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
180pub struct DictionaryOptionalItem {
181    pub key: String,
182    pub value: Option<Box<WrappedCapabilityId>>,
183}
184
185impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for DictionaryOptionalItem {}
186
187#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
188pub struct DictionaryRef {
189    pub token: fdomain_client::EventPair,
190}
191
192impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for DictionaryRef {}
193
194#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
195pub struct DirConnector {
196    pub token: fdomain_client::EventPair,
197}
198
199impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for DirConnector {}
200
201#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
202pub struct DirEntry {
203    pub token: fdomain_client::EventPair,
204}
205
206impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for DirEntry {}
207
208#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
209pub struct DirReceiverReceiveRequest {
210    pub channel: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
211}
212
213impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for DirReceiverReceiveRequest {}
214
215/// Represents an instance in the component tree, either a component
216/// instance or component manager's instance.
217#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
218pub struct InstanceToken {
219    pub token: fdomain_client::EventPair,
220}
221
222impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for InstanceToken {}
223
224/// Contains a protocol open request.
225#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
226pub struct ProtocolPayload {
227    pub channel: fdomain_client::Channel,
228}
229
230impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for ProtocolPayload {}
231
232/// A request for a route.
233#[derive(Debug, Default, PartialEq)]
234pub struct RouteRequest {
235    /// The component that is requesting the capability. May be omitted for a default request
236    /// (see `*Router.Route`).
237    pub requesting: Option<InstanceToken>,
238    /// Metadata associated with this capability request. May be omitted for a default request
239    /// (see `*Router.Route`).
240    pub metadata: Option<DictionaryRef>,
241    #[doc(hidden)]
242    pub __source_breaking: fidl::marker::SourceBreaking,
243}
244
245impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for RouteRequest {}
246
247#[derive(Debug)]
248pub enum Capability {
249    Unit(Unit),
250    Handle(fdomain_client::Handle),
251    Data(Data),
252    Dictionary(DictionaryRef),
253    Connector(Connector),
254    DirConnector(DirConnector),
255    Directory(fdomain_client::fidl::ClientEnd<fdomain_fuchsia_io::DirectoryMarker>),
256    DirEntry(DirEntry),
257    ConnectorRouter(fdomain_client::fidl::ClientEnd<ConnectorRouterMarker>),
258    DictionaryRouter(fdomain_client::fidl::ClientEnd<DictionaryRouterMarker>),
259    DirEntryRouter(fdomain_client::fidl::ClientEnd<DirEntryRouterMarker>),
260    DataRouter(fdomain_client::fidl::ClientEnd<DataRouterMarker>),
261    DirConnectorRouter(fdomain_client::fidl::ClientEnd<DirConnectorRouterMarker>),
262    #[doc(hidden)]
263    __SourceBreaking {
264        unknown_ordinal: u64,
265    },
266}
267
268/// Pattern that matches an unknown `Capability` member.
269#[macro_export]
270macro_rules! CapabilityUnknown {
271    () => {
272        _
273    };
274}
275
276// Custom PartialEq so that unknown variants are not equal to themselves.
277impl PartialEq for Capability {
278    fn eq(&self, other: &Self) -> bool {
279        match (self, other) {
280            (Self::Unit(x), Self::Unit(y)) => *x == *y,
281            (Self::Handle(x), Self::Handle(y)) => *x == *y,
282            (Self::Data(x), Self::Data(y)) => *x == *y,
283            (Self::Dictionary(x), Self::Dictionary(y)) => *x == *y,
284            (Self::Connector(x), Self::Connector(y)) => *x == *y,
285            (Self::DirConnector(x), Self::DirConnector(y)) => *x == *y,
286            (Self::Directory(x), Self::Directory(y)) => *x == *y,
287            (Self::DirEntry(x), Self::DirEntry(y)) => *x == *y,
288            (Self::ConnectorRouter(x), Self::ConnectorRouter(y)) => *x == *y,
289            (Self::DictionaryRouter(x), Self::DictionaryRouter(y)) => *x == *y,
290            (Self::DirEntryRouter(x), Self::DirEntryRouter(y)) => *x == *y,
291            (Self::DataRouter(x), Self::DataRouter(y)) => *x == *y,
292            (Self::DirConnectorRouter(x), Self::DirConnectorRouter(y)) => *x == *y,
293            _ => false,
294        }
295    }
296}
297
298impl Capability {
299    #[inline]
300    pub fn ordinal(&self) -> u64 {
301        match *self {
302            Self::Unit(_) => 1,
303            Self::Handle(_) => 2,
304            Self::Data(_) => 3,
305            Self::Dictionary(_) => 4,
306            Self::Connector(_) => 5,
307            Self::DirConnector(_) => 6,
308            Self::Directory(_) => 7,
309            Self::DirEntry(_) => 8,
310            Self::ConnectorRouter(_) => 9,
311            Self::DictionaryRouter(_) => 10,
312            Self::DirEntryRouter(_) => 11,
313            Self::DataRouter(_) => 12,
314            Self::DirConnectorRouter(_) => 13,
315            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
316        }
317    }
318
319    #[inline]
320    pub fn unknown_variant_for_testing() -> Self {
321        Self::__SourceBreaking { unknown_ordinal: 0 }
322    }
323
324    #[inline]
325    pub fn is_unknown(&self) -> bool {
326        match self {
327            Self::__SourceBreaking { .. } => true,
328            _ => false,
329        }
330    }
331}
332
333impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for Capability {}
334
335#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
336pub enum ConnectorRouterRouteResponse {
337    Connector(Connector),
338    Unavailable(Unit),
339}
340
341impl ConnectorRouterRouteResponse {
342    #[inline]
343    pub fn ordinal(&self) -> u64 {
344        match *self {
345            Self::Connector(_) => 1,
346            Self::Unavailable(_) => 2,
347        }
348    }
349}
350
351impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
352    for ConnectorRouterRouteResponse
353{
354}
355
356#[derive(Debug, PartialEq)]
357pub enum DataRouterRouteResponse {
358    Data(Data),
359    Unavailable(Unit),
360}
361
362impl DataRouterRouteResponse {
363    #[inline]
364    pub fn ordinal(&self) -> u64 {
365        match *self {
366            Self::Data(_) => 1,
367            Self::Unavailable(_) => 2,
368        }
369    }
370}
371
372impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for DataRouterRouteResponse {}
373
374#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
375pub enum DictionaryRouterRouteResponse {
376    Dictionary(DictionaryRef),
377    Unavailable(Unit),
378}
379
380impl DictionaryRouterRouteResponse {
381    #[inline]
382    pub fn ordinal(&self) -> u64 {
383        match *self {
384            Self::Dictionary(_) => 1,
385            Self::Unavailable(_) => 2,
386        }
387    }
388}
389
390impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
391    for DictionaryRouterRouteResponse
392{
393}
394
395#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
396pub enum DirConnectorRouterRouteResponse {
397    DirConnector(DirConnector),
398    Unavailable(Unit),
399}
400
401impl DirConnectorRouterRouteResponse {
402    #[inline]
403    pub fn ordinal(&self) -> u64 {
404        match *self {
405            Self::DirConnector(_) => 1,
406            Self::Unavailable(_) => 2,
407        }
408    }
409}
410
411impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
412    for DirConnectorRouterRouteResponse
413{
414}
415
416#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
417pub enum DirEntryRouterRouteResponse {
418    DirEntry(DirEntry),
419    Unavailable(Unit),
420}
421
422impl DirEntryRouterRouteResponse {
423    #[inline]
424    pub fn ordinal(&self) -> u64 {
425        match *self {
426            Self::DirEntry(_) => 1,
427            Self::Unavailable(_) => 2,
428        }
429    }
430}
431
432impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
433    for DirEntryRouterRouteResponse
434{
435}
436
437#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
438pub enum DirectoryRouterRouteResponse {
439    Directory(fdomain_client::fidl::ClientEnd<fdomain_fuchsia_io::DirectoryMarker>),
440    Unavailable(Unit),
441}
442
443impl DirectoryRouterRouteResponse {
444    #[inline]
445    pub fn ordinal(&self) -> u64 {
446        match *self {
447            Self::Directory(_) => 1,
448            Self::Unavailable(_) => 2,
449        }
450    }
451}
452
453impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
454    for DirectoryRouterRouteResponse
455{
456}
457
458#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
459pub struct CapabilityStoreMarker;
460
461impl fdomain_client::fidl::ProtocolMarker for CapabilityStoreMarker {
462    type Proxy = CapabilityStoreProxy;
463    type RequestStream = CapabilityStoreRequestStream;
464
465    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.CapabilityStore";
466}
467impl fdomain_client::fidl::DiscoverableProtocolMarker for CapabilityStoreMarker {}
468pub type CapabilityStoreDuplicateResult = Result<(), CapabilityStoreError>;
469pub type CapabilityStoreDropResult = Result<(), CapabilityStoreError>;
470pub type CapabilityStoreExportResult = Result<Capability, CapabilityStoreError>;
471pub type CapabilityStoreImportResult = Result<(), CapabilityStoreError>;
472pub type CapabilityStoreConnectorCreateResult = Result<(), CapabilityStoreError>;
473pub type CapabilityStoreConnectorOpenResult = Result<(), CapabilityStoreError>;
474pub type CapabilityStoreDirConnectorCreateResult = Result<(), CapabilityStoreError>;
475pub type CapabilityStoreDirConnectorOpenResult = Result<(), CapabilityStoreError>;
476pub type CapabilityStoreDictionaryCreateResult = Result<(), CapabilityStoreError>;
477pub type CapabilityStoreDictionaryLegacyImportResult = Result<(), CapabilityStoreError>;
478pub type CapabilityStoreDictionaryLegacyExportResult = Result<(), CapabilityStoreError>;
479pub type CapabilityStoreDictionaryInsertResult = Result<(), CapabilityStoreError>;
480pub type CapabilityStoreDictionaryGetResult = Result<(), CapabilityStoreError>;
481pub type CapabilityStoreDictionaryRemoveResult = Result<(), CapabilityStoreError>;
482pub type CapabilityStoreDictionaryCopyResult = Result<(), CapabilityStoreError>;
483pub type CapabilityStoreDictionaryKeysResult = Result<(), CapabilityStoreError>;
484pub type CapabilityStoreDictionaryEnumerateResult = Result<(), CapabilityStoreError>;
485pub type CapabilityStoreDictionaryDrainResult = Result<(), CapabilityStoreError>;
486
487pub trait CapabilityStoreProxyInterface: Send + Sync {
488    type DuplicateResponseFut: std::future::Future<Output = Result<CapabilityStoreDuplicateResult, fidl::Error>>
489        + Send;
490    fn r#duplicate(&self, id: u64, dest_id: u64) -> Self::DuplicateResponseFut;
491    type DropResponseFut: std::future::Future<Output = Result<CapabilityStoreDropResult, fidl::Error>>
492        + Send;
493    fn r#drop(&self, id: u64) -> Self::DropResponseFut;
494    type ExportResponseFut: std::future::Future<Output = Result<CapabilityStoreExportResult, fidl::Error>>
495        + Send;
496    fn r#export(&self, id: u64) -> Self::ExportResponseFut;
497    type ImportResponseFut: std::future::Future<Output = Result<CapabilityStoreImportResult, fidl::Error>>
498        + Send;
499    fn r#import(&self, id: u64, capability: Capability) -> Self::ImportResponseFut;
500    type ConnectorCreateResponseFut: std::future::Future<Output = Result<CapabilityStoreConnectorCreateResult, fidl::Error>>
501        + Send;
502    fn r#connector_create(
503        &self,
504        id: u64,
505        receiver: fdomain_client::fidl::ClientEnd<ReceiverMarker>,
506    ) -> Self::ConnectorCreateResponseFut;
507    type ConnectorOpenResponseFut: std::future::Future<Output = Result<CapabilityStoreConnectorOpenResult, fidl::Error>>
508        + Send;
509    fn r#connector_open(
510        &self,
511        id: u64,
512        server_end: fdomain_client::Channel,
513    ) -> Self::ConnectorOpenResponseFut;
514    type DirConnectorCreateResponseFut: std::future::Future<Output = Result<CapabilityStoreDirConnectorCreateResult, fidl::Error>>
515        + Send;
516    fn r#dir_connector_create(
517        &self,
518        id: u64,
519        receiver: fdomain_client::fidl::ClientEnd<DirReceiverMarker>,
520    ) -> Self::DirConnectorCreateResponseFut;
521    type DirConnectorOpenResponseFut: std::future::Future<Output = Result<CapabilityStoreDirConnectorOpenResult, fidl::Error>>
522        + Send;
523    fn r#dir_connector_open(
524        &self,
525        id: u64,
526        server_end: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
527    ) -> Self::DirConnectorOpenResponseFut;
528    type DictionaryCreateResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryCreateResult, fidl::Error>>
529        + Send;
530    fn r#dictionary_create(&self, id: u64) -> Self::DictionaryCreateResponseFut;
531    type DictionaryLegacyImportResponseFut: std::future::Future<
532            Output = Result<CapabilityStoreDictionaryLegacyImportResult, fidl::Error>,
533        > + Send;
534    fn r#dictionary_legacy_import(
535        &self,
536        id: u64,
537        client_end: fdomain_client::Channel,
538    ) -> Self::DictionaryLegacyImportResponseFut;
539    type DictionaryLegacyExportResponseFut: std::future::Future<
540            Output = Result<CapabilityStoreDictionaryLegacyExportResult, fidl::Error>,
541        > + Send;
542    fn r#dictionary_legacy_export(
543        &self,
544        id: u64,
545        server_end: fdomain_client::Channel,
546    ) -> Self::DictionaryLegacyExportResponseFut;
547    type DictionaryInsertResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryInsertResult, fidl::Error>>
548        + Send;
549    fn r#dictionary_insert(
550        &self,
551        id: u64,
552        item: &DictionaryItem,
553    ) -> Self::DictionaryInsertResponseFut;
554    type DictionaryGetResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryGetResult, fidl::Error>>
555        + Send;
556    fn r#dictionary_get(&self, id: u64, key: &str, dest_id: u64) -> Self::DictionaryGetResponseFut;
557    type DictionaryRemoveResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryRemoveResult, fidl::Error>>
558        + Send;
559    fn r#dictionary_remove(
560        &self,
561        id: u64,
562        key: &str,
563        dest_id: Option<&WrappedCapabilityId>,
564    ) -> Self::DictionaryRemoveResponseFut;
565    type DictionaryCopyResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryCopyResult, fidl::Error>>
566        + Send;
567    fn r#dictionary_copy(&self, id: u64, dest_id: u64) -> Self::DictionaryCopyResponseFut;
568    type DictionaryKeysResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryKeysResult, fidl::Error>>
569        + Send;
570    fn r#dictionary_keys(
571        &self,
572        id: u64,
573        iterator: fdomain_client::fidl::ServerEnd<DictionaryKeysIteratorMarker>,
574    ) -> Self::DictionaryKeysResponseFut;
575    type DictionaryEnumerateResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryEnumerateResult, fidl::Error>>
576        + Send;
577    fn r#dictionary_enumerate(
578        &self,
579        id: u64,
580        iterator: fdomain_client::fidl::ServerEnd<DictionaryEnumerateIteratorMarker>,
581    ) -> Self::DictionaryEnumerateResponseFut;
582    type DictionaryDrainResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryDrainResult, fidl::Error>>
583        + Send;
584    fn r#dictionary_drain(
585        &self,
586        id: u64,
587        iterator: Option<fdomain_client::fidl::ServerEnd<DictionaryDrainIteratorMarker>>,
588    ) -> Self::DictionaryDrainResponseFut;
589}
590
591#[derive(Debug, Clone)]
592pub struct CapabilityStoreProxy {
593    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
594}
595
596impl fdomain_client::fidl::Proxy for CapabilityStoreProxy {
597    type Protocol = CapabilityStoreMarker;
598
599    fn from_channel(inner: fdomain_client::Channel) -> Self {
600        Self::new(inner)
601    }
602
603    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
604        self.client.into_channel().map_err(|client| Self { client })
605    }
606
607    fn as_channel(&self) -> &fdomain_client::Channel {
608        self.client.as_channel()
609    }
610}
611
612impl CapabilityStoreProxy {
613    /// Create a new Proxy for fuchsia.component.sandbox/CapabilityStore.
614    pub fn new(channel: fdomain_client::Channel) -> Self {
615        let protocol_name =
616            <CapabilityStoreMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
617        Self { client: fidl::client::Client::new(channel, protocol_name) }
618    }
619
620    /// Get a Stream of events from the remote end of the protocol.
621    ///
622    /// # Panics
623    ///
624    /// Panics if the event stream was already taken.
625    pub fn take_event_stream(&self) -> CapabilityStoreEventStream {
626        CapabilityStoreEventStream { event_receiver: self.client.take_event_receiver() }
627    }
628
629    /// Duplicates the capability with `id` to `dest_id`.
630    ///
631    /// Errors:
632    ///
633    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
634    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
635    /// - `NOT_DUPLICATABLE` if `id` could not be duplicated.
636    pub fn r#duplicate(
637        &self,
638        mut id: u64,
639        mut dest_id: u64,
640    ) -> fidl::client::QueryResponseFut<
641        CapabilityStoreDuplicateResult,
642        fdomain_client::fidl::FDomainResourceDialect,
643    > {
644        CapabilityStoreProxyInterface::r#duplicate(self, id, dest_id)
645    }
646
647    /// Drops the capability with `id` from this [`CapabilityStore`].
648    ///
649    /// Errors:
650    ///
651    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
652    pub fn r#drop(
653        &self,
654        mut id: u64,
655    ) -> fidl::client::QueryResponseFut<
656        CapabilityStoreDropResult,
657        fdomain_client::fidl::FDomainResourceDialect,
658    > {
659        CapabilityStoreProxyInterface::r#drop(self, id)
660    }
661
662    /// Exports the capability with the client-assigned identifier `id` to
663    /// `capability`. This operation removes the capability from the store. If
664    /// this is not desired, [Duplicate] the capability first.
665    ///
666    /// Errors:
667    ///
668    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
669    pub fn r#export(
670        &self,
671        mut id: u64,
672    ) -> fidl::client::QueryResponseFut<
673        CapabilityStoreExportResult,
674        fdomain_client::fidl::FDomainResourceDialect,
675    > {
676        CapabilityStoreProxyInterface::r#export(self, id)
677    }
678
679    /// Imports `capability` into this store with the client-assigned `id`.
680    ///
681    /// Errors:
682    ///
683    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
684    /// - `BAD_CAPABILITY` if `capability` was not a valid [Capability].
685    pub fn r#import(
686        &self,
687        mut id: u64,
688        mut capability: Capability,
689    ) -> fidl::client::QueryResponseFut<
690        CapabilityStoreImportResult,
691        fdomain_client::fidl::FDomainResourceDialect,
692    > {
693        CapabilityStoreProxyInterface::r#import(self, id, capability)
694    }
695
696    /// Creates a [Connector] from a [Receiver]. Incoming connections to the [Connector] will be
697    /// dispatched to this [Receiver].
698    ///
699    /// Errors:
700    ///
701    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
702    pub fn r#connector_create(
703        &self,
704        mut id: u64,
705        mut receiver: fdomain_client::fidl::ClientEnd<ReceiverMarker>,
706    ) -> fidl::client::QueryResponseFut<
707        CapabilityStoreConnectorCreateResult,
708        fdomain_client::fidl::FDomainResourceDialect,
709    > {
710        CapabilityStoreProxyInterface::r#connector_create(self, id, receiver)
711    }
712
713    /// Open a connection from the provided [Connector] capability that will be dispatched to
714    /// the [Receiver] on the other end.
715    ///
716    /// If there is an error, it will be reported as a zx.Status epitaph on `server_end`.
717    ///
718    /// Errors:
719    ///
720    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
721    /// - `WRONG_TYPE` if `id` was not a connector capability.
722    pub fn r#connector_open(
723        &self,
724        mut id: u64,
725        mut server_end: fdomain_client::Channel,
726    ) -> fidl::client::QueryResponseFut<
727        CapabilityStoreConnectorOpenResult,
728        fdomain_client::fidl::FDomainResourceDialect,
729    > {
730        CapabilityStoreProxyInterface::r#connector_open(self, id, server_end)
731    }
732
733    /// Creates a [DirConnector] from a [DirReceiver]. Incoming connections to the [DirConnector]
734    /// will be dispatched to this [DirReceiver].
735    ///
736    /// Errors:
737    ///
738    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
739    pub fn r#dir_connector_create(
740        &self,
741        mut id: u64,
742        mut receiver: fdomain_client::fidl::ClientEnd<DirReceiverMarker>,
743    ) -> fidl::client::QueryResponseFut<
744        CapabilityStoreDirConnectorCreateResult,
745        fdomain_client::fidl::FDomainResourceDialect,
746    > {
747        CapabilityStoreProxyInterface::r#dir_connector_create(self, id, receiver)
748    }
749
750    /// Open a connection from the provided [DirConnector] capability that will be dispatched to
751    /// the [DirReceiver] on the other end.
752    ///
753    /// This method does not take `Open`/`Open3` parameters such as `flags` or `path`.
754    /// Clients that wish to specify these can get an initial connection from this method
755    /// and call `fuchsia.io/Directory.Open` on it. See the [DirReceiver] documentation for
756    /// more information about the expectations of the server side.
757    ///
758    /// If there was an error making the connection, it will be reported as a zx.Status
759    /// epitaph on `server_end`.
760    ///
761    /// Errors:
762    ///
763    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
764    /// - `WRONG_TYPE` if `id` was not a connector capability.
765    pub fn r#dir_connector_open(
766        &self,
767        mut id: u64,
768        mut server_end: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
769    ) -> fidl::client::QueryResponseFut<
770        CapabilityStoreDirConnectorOpenResult,
771        fdomain_client::fidl::FDomainResourceDialect,
772    > {
773        CapabilityStoreProxyInterface::r#dir_connector_open(self, id, server_end)
774    }
775
776    /// Creates a new empty dictionary in this [`CapabilityStore`] with client-assigned `id`.
777    ///
778    /// Errors:
779    ///
780    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
781    pub fn r#dictionary_create(
782        &self,
783        mut id: u64,
784    ) -> fidl::client::QueryResponseFut<
785        CapabilityStoreDictionaryCreateResult,
786        fdomain_client::fidl::FDomainResourceDialect,
787    > {
788        CapabilityStoreProxyInterface::r#dictionary_create(self, id)
789    }
790
791    /// Imports a dictionary in the form of a channel.
792    ///
793    /// This is a legacy API to support backward compatibility with APIs that take a [Dictionary]
794    /// channel.
795    ///
796    /// Errors:
797    ///
798    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
799    /// - `BAD_CAPABILITY` if `client_end` was not a valid dictionary channel.
800    pub fn r#dictionary_legacy_import(
801        &self,
802        mut id: u64,
803        mut client_end: fdomain_client::Channel,
804    ) -> fidl::client::QueryResponseFut<
805        CapabilityStoreDictionaryLegacyImportResult,
806        fdomain_client::fidl::FDomainResourceDialect,
807    > {
808        CapabilityStoreProxyInterface::r#dictionary_legacy_import(self, id, client_end)
809    }
810
811    /// Binds a channel to the dictionary with `id`. The channel can
812    /// be re-imported into a [CapabilityStore] with [DictionaryImportLegacy].
813    ///
814    /// This is a legacy API to support backward compatibility with APIs that take a [Dictionary]
815    /// channel.
816    ///
817    /// Errors:
818    ///
819    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
820    pub fn r#dictionary_legacy_export(
821        &self,
822        mut id: u64,
823        mut server_end: fdomain_client::Channel,
824    ) -> fidl::client::QueryResponseFut<
825        CapabilityStoreDictionaryLegacyExportResult,
826        fdomain_client::fidl::FDomainResourceDialect,
827    > {
828        CapabilityStoreProxyInterface::r#dictionary_legacy_export(self, id, server_end)
829    }
830
831    /// Inserts `item` into the dictionary with `id`. `item.value` is moved into the dictionary and
832    /// its id is released if this call succeeds.
833    ///
834    /// Errors:
835    ///
836    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
837    /// - `WRONG_TYPE` if `id` was not a dictionary.
838    /// - `INVALID_KEY` if `item.key` was invalid.
839    /// - `ITEM_ALREADY_EXISTS` if the dictionary already contains an item with `item.key`.
840    pub fn r#dictionary_insert(
841        &self,
842        mut id: u64,
843        mut item: &DictionaryItem,
844    ) -> fidl::client::QueryResponseFut<
845        CapabilityStoreDictionaryInsertResult,
846        fdomain_client::fidl::FDomainResourceDialect,
847    > {
848        CapabilityStoreProxyInterface::r#dictionary_insert(self, id, item)
849    }
850
851    /// Get a duplicate of a capability from the dictionary with `id`, which is
852    /// loaded into `dest_id`.
853    ///
854    /// Errors:
855    ///
856    /// - `ID_NOT_FOUND` if `id` was not a recognized capability id in this store.
857    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
858    /// - `WRONG_TYPE` if `id` was not a dictionary.
859    /// - `INVALID_KEY` if `item.key` was invalid.
860    /// - `ITEM_NOT_FOUND` if the dictionary does not contain `key`.
861    /// - `NOT_DUPLICATABLE` if the capability could not be duplicated.
862    pub fn r#dictionary_get(
863        &self,
864        mut id: u64,
865        mut key: &str,
866        mut dest_id: u64,
867    ) -> fidl::client::QueryResponseFut<
868        CapabilityStoreDictionaryGetResult,
869        fdomain_client::fidl::FDomainResourceDialect,
870    > {
871        CapabilityStoreProxyInterface::r#dictionary_get(self, id, key, dest_id)
872    }
873
874    /// Removes a key from the dictionary with `id`. If `dest_id` is present, loads the value
875    /// into it, otherwise discards the value.
876    ///
877    /// Errors:
878    ///
879    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
880    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
881    /// - `WRONG_TYPE` if `id` was not a dictionary.
882    /// - `INVALID_KEY` if `key` was invalid.
883    /// - `ITEM_NOT_FOUND` if the dictionary does not contain the key.
884    pub fn r#dictionary_remove(
885        &self,
886        mut id: u64,
887        mut key: &str,
888        mut dest_id: Option<&WrappedCapabilityId>,
889    ) -> fidl::client::QueryResponseFut<
890        CapabilityStoreDictionaryRemoveResult,
891        fdomain_client::fidl::FDomainResourceDialect,
892    > {
893        CapabilityStoreProxyInterface::r#dictionary_remove(self, id, key, dest_id)
894    }
895
896    /// Create a new dictionary that contains a duplicate of all the entries in
897    /// the dictionary with `id`, assigning `dest_id` to the new dictionary.
898    /// The runtime of this method is linear in the number of top-level entries
899    /// in the dictionary.
900    ///
901    /// For example, if the dictionary contains nested dictionaries, the newly
902    /// created dictionary will contain references to those same nested
903    /// dictionaries because the entries are duplicated rather than deep-copied.
904    ///
905    /// Errors:
906    ///
907    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
908    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
909    /// - `WRONG_TYPE` if `id` was not a dictionary.
910    /// - `NOT_DUPLICATABLE` if one of the capabilities in `id` could not be duplicated.
911    pub fn r#dictionary_copy(
912        &self,
913        mut id: u64,
914        mut dest_id: u64,
915    ) -> fidl::client::QueryResponseFut<
916        CapabilityStoreDictionaryCopyResult,
917        fdomain_client::fidl::FDomainResourceDialect,
918    > {
919        CapabilityStoreProxyInterface::r#dictionary_copy(self, id, dest_id)
920    }
921
922    /// Enumerates the keys in the dictionary with `id`.
923    ///
924    /// Errors:
925    ///
926    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
927    /// - `WRONG_TYPE` if `id` was not a dictionary.
928    pub fn r#dictionary_keys(
929        &self,
930        mut id: u64,
931        mut iterator: fdomain_client::fidl::ServerEnd<DictionaryKeysIteratorMarker>,
932    ) -> fidl::client::QueryResponseFut<
933        CapabilityStoreDictionaryKeysResult,
934        fdomain_client::fidl::FDomainResourceDialect,
935    > {
936        CapabilityStoreProxyInterface::r#dictionary_keys(self, id, iterator)
937    }
938
939    /// Enumerates the items (keys and values) in the dictionary with `id`.
940    ///
941    /// Creates a duplicate of each value (capability). If a value could not be duplicated,
942    /// the value will be null.
943    ///
944    /// Errors:
945    ///
946    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
947    /// - `WRONG_TYPE` if `id` was not a dictionary.
948    pub fn r#dictionary_enumerate(
949        &self,
950        mut id: u64,
951        mut iterator: fdomain_client::fidl::ServerEnd<DictionaryEnumerateIteratorMarker>,
952    ) -> fidl::client::QueryResponseFut<
953        CapabilityStoreDictionaryEnumerateResult,
954        fdomain_client::fidl::FDomainResourceDialect,
955    > {
956        CapabilityStoreProxyInterface::r#dictionary_enumerate(self, id, iterator)
957    }
958
959    /// Removes all the entries in this dictionary, returning them in `contents` if provided.
960    /// If `contents` is not provided, all the items are discarded without enumerating them.
961    ///
962    /// Errors:
963    ///
964    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
965    /// - `WRONG_TYPE` if `id` was not a dictionary.
966    pub fn r#dictionary_drain(
967        &self,
968        mut id: u64,
969        mut iterator: Option<fdomain_client::fidl::ServerEnd<DictionaryDrainIteratorMarker>>,
970    ) -> fidl::client::QueryResponseFut<
971        CapabilityStoreDictionaryDrainResult,
972        fdomain_client::fidl::FDomainResourceDialect,
973    > {
974        CapabilityStoreProxyInterface::r#dictionary_drain(self, id, iterator)
975    }
976}
977
978impl CapabilityStoreProxyInterface for CapabilityStoreProxy {
979    type DuplicateResponseFut = fidl::client::QueryResponseFut<
980        CapabilityStoreDuplicateResult,
981        fdomain_client::fidl::FDomainResourceDialect,
982    >;
983    fn r#duplicate(&self, mut id: u64, mut dest_id: u64) -> Self::DuplicateResponseFut {
984        fn _decode(
985            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
986        ) -> Result<CapabilityStoreDuplicateResult, fidl::Error> {
987            let _response = fidl::client::decode_transaction_body::<
988                fidl::encoding::FlexibleResultType<
989                    fidl::encoding::EmptyStruct,
990                    CapabilityStoreError,
991                >,
992                fdomain_client::fidl::FDomainResourceDialect,
993                0x5d5d35d9c20a2184,
994            >(_buf?)?
995            .into_result_fdomain::<CapabilityStoreMarker>("duplicate")?;
996            Ok(_response.map(|x| x))
997        }
998        self.client.send_query_and_decode::<
999            CapabilityStoreDuplicateRequest,
1000            CapabilityStoreDuplicateResult,
1001        >(
1002            (id, dest_id,),
1003            0x5d5d35d9c20a2184,
1004            fidl::encoding::DynamicFlags::FLEXIBLE,
1005            _decode,
1006        )
1007    }
1008
1009    type DropResponseFut = fidl::client::QueryResponseFut<
1010        CapabilityStoreDropResult,
1011        fdomain_client::fidl::FDomainResourceDialect,
1012    >;
1013    fn r#drop(&self, mut id: u64) -> Self::DropResponseFut {
1014        fn _decode(
1015            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1016        ) -> Result<CapabilityStoreDropResult, fidl::Error> {
1017            let _response = fidl::client::decode_transaction_body::<
1018                fidl::encoding::FlexibleResultType<
1019                    fidl::encoding::EmptyStruct,
1020                    CapabilityStoreError,
1021                >,
1022                fdomain_client::fidl::FDomainResourceDialect,
1023                0xa745c0990fc2559,
1024            >(_buf?)?
1025            .into_result_fdomain::<CapabilityStoreMarker>("drop")?;
1026            Ok(_response.map(|x| x))
1027        }
1028        self.client.send_query_and_decode::<CapabilityStoreDropRequest, CapabilityStoreDropResult>(
1029            (id,),
1030            0xa745c0990fc2559,
1031            fidl::encoding::DynamicFlags::FLEXIBLE,
1032            _decode,
1033        )
1034    }
1035
1036    type ExportResponseFut = fidl::client::QueryResponseFut<
1037        CapabilityStoreExportResult,
1038        fdomain_client::fidl::FDomainResourceDialect,
1039    >;
1040    fn r#export(&self, mut id: u64) -> Self::ExportResponseFut {
1041        fn _decode(
1042            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1043        ) -> Result<CapabilityStoreExportResult, fidl::Error> {
1044            let _response = fidl::client::decode_transaction_body::<
1045                fidl::encoding::FlexibleResultType<
1046                    CapabilityStoreExportResponse,
1047                    CapabilityStoreError,
1048                >,
1049                fdomain_client::fidl::FDomainResourceDialect,
1050                0x3237a8f4748faff,
1051            >(_buf?)?
1052            .into_result_fdomain::<CapabilityStoreMarker>("export")?;
1053            Ok(_response.map(|x| x.capability))
1054        }
1055        self.client
1056            .send_query_and_decode::<CapabilityStoreExportRequest, CapabilityStoreExportResult>(
1057                (id,),
1058                0x3237a8f4748faff,
1059                fidl::encoding::DynamicFlags::FLEXIBLE,
1060                _decode,
1061            )
1062    }
1063
1064    type ImportResponseFut = fidl::client::QueryResponseFut<
1065        CapabilityStoreImportResult,
1066        fdomain_client::fidl::FDomainResourceDialect,
1067    >;
1068    fn r#import(&self, mut id: u64, mut capability: Capability) -> Self::ImportResponseFut {
1069        fn _decode(
1070            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1071        ) -> Result<CapabilityStoreImportResult, fidl::Error> {
1072            let _response = fidl::client::decode_transaction_body::<
1073                fidl::encoding::FlexibleResultType<
1074                    fidl::encoding::EmptyStruct,
1075                    CapabilityStoreError,
1076                >,
1077                fdomain_client::fidl::FDomainResourceDialect,
1078                0x1f96157a29f4539b,
1079            >(_buf?)?
1080            .into_result_fdomain::<CapabilityStoreMarker>("import")?;
1081            Ok(_response.map(|x| x))
1082        }
1083        self.client
1084            .send_query_and_decode::<CapabilityStoreImportRequest, CapabilityStoreImportResult>(
1085                (id, &mut capability),
1086                0x1f96157a29f4539b,
1087                fidl::encoding::DynamicFlags::FLEXIBLE,
1088                _decode,
1089            )
1090    }
1091
1092    type ConnectorCreateResponseFut = fidl::client::QueryResponseFut<
1093        CapabilityStoreConnectorCreateResult,
1094        fdomain_client::fidl::FDomainResourceDialect,
1095    >;
1096    fn r#connector_create(
1097        &self,
1098        mut id: u64,
1099        mut receiver: fdomain_client::fidl::ClientEnd<ReceiverMarker>,
1100    ) -> Self::ConnectorCreateResponseFut {
1101        fn _decode(
1102            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1103        ) -> Result<CapabilityStoreConnectorCreateResult, fidl::Error> {
1104            let _response = fidl::client::decode_transaction_body::<
1105                fidl::encoding::FlexibleResultType<
1106                    fidl::encoding::EmptyStruct,
1107                    CapabilityStoreError,
1108                >,
1109                fdomain_client::fidl::FDomainResourceDialect,
1110                0x29592c5d63e91c25,
1111            >(_buf?)?
1112            .into_result_fdomain::<CapabilityStoreMarker>("connector_create")?;
1113            Ok(_response.map(|x| x))
1114        }
1115        self.client.send_query_and_decode::<
1116            CapabilityStoreConnectorCreateRequest,
1117            CapabilityStoreConnectorCreateResult,
1118        >(
1119            (id, receiver,),
1120            0x29592c5d63e91c25,
1121            fidl::encoding::DynamicFlags::FLEXIBLE,
1122            _decode,
1123        )
1124    }
1125
1126    type ConnectorOpenResponseFut = fidl::client::QueryResponseFut<
1127        CapabilityStoreConnectorOpenResult,
1128        fdomain_client::fidl::FDomainResourceDialect,
1129    >;
1130    fn r#connector_open(
1131        &self,
1132        mut id: u64,
1133        mut server_end: fdomain_client::Channel,
1134    ) -> Self::ConnectorOpenResponseFut {
1135        fn _decode(
1136            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1137        ) -> Result<CapabilityStoreConnectorOpenResult, fidl::Error> {
1138            let _response = fidl::client::decode_transaction_body::<
1139                fidl::encoding::FlexibleResultType<
1140                    fidl::encoding::EmptyStruct,
1141                    CapabilityStoreError,
1142                >,
1143                fdomain_client::fidl::FDomainResourceDialect,
1144                0x537e69ab40563b9f,
1145            >(_buf?)?
1146            .into_result_fdomain::<CapabilityStoreMarker>("connector_open")?;
1147            Ok(_response.map(|x| x))
1148        }
1149        self.client.send_query_and_decode::<
1150            CapabilityStoreConnectorOpenRequest,
1151            CapabilityStoreConnectorOpenResult,
1152        >(
1153            (id, server_end,),
1154            0x537e69ab40563b9f,
1155            fidl::encoding::DynamicFlags::FLEXIBLE,
1156            _decode,
1157        )
1158    }
1159
1160    type DirConnectorCreateResponseFut = fidl::client::QueryResponseFut<
1161        CapabilityStoreDirConnectorCreateResult,
1162        fdomain_client::fidl::FDomainResourceDialect,
1163    >;
1164    fn r#dir_connector_create(
1165        &self,
1166        mut id: u64,
1167        mut receiver: fdomain_client::fidl::ClientEnd<DirReceiverMarker>,
1168    ) -> Self::DirConnectorCreateResponseFut {
1169        fn _decode(
1170            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1171        ) -> Result<CapabilityStoreDirConnectorCreateResult, fidl::Error> {
1172            let _response = fidl::client::decode_transaction_body::<
1173                fidl::encoding::FlexibleResultType<
1174                    fidl::encoding::EmptyStruct,
1175                    CapabilityStoreError,
1176                >,
1177                fdomain_client::fidl::FDomainResourceDialect,
1178                0x186138a11ccf19bb,
1179            >(_buf?)?
1180            .into_result_fdomain::<CapabilityStoreMarker>("dir_connector_create")?;
1181            Ok(_response.map(|x| x))
1182        }
1183        self.client.send_query_and_decode::<
1184            CapabilityStoreDirConnectorCreateRequest,
1185            CapabilityStoreDirConnectorCreateResult,
1186        >(
1187            (id, receiver,),
1188            0x186138a11ccf19bb,
1189            fidl::encoding::DynamicFlags::FLEXIBLE,
1190            _decode,
1191        )
1192    }
1193
1194    type DirConnectorOpenResponseFut = fidl::client::QueryResponseFut<
1195        CapabilityStoreDirConnectorOpenResult,
1196        fdomain_client::fidl::FDomainResourceDialect,
1197    >;
1198    fn r#dir_connector_open(
1199        &self,
1200        mut id: u64,
1201        mut server_end: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
1202    ) -> Self::DirConnectorOpenResponseFut {
1203        fn _decode(
1204            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1205        ) -> Result<CapabilityStoreDirConnectorOpenResult, fidl::Error> {
1206            let _response = fidl::client::decode_transaction_body::<
1207                fidl::encoding::FlexibleResultType<
1208                    fidl::encoding::EmptyStruct,
1209                    CapabilityStoreError,
1210                >,
1211                fdomain_client::fidl::FDomainResourceDialect,
1212                0x5650d3d6a3a13901,
1213            >(_buf?)?
1214            .into_result_fdomain::<CapabilityStoreMarker>("dir_connector_open")?;
1215            Ok(_response.map(|x| x))
1216        }
1217        self.client.send_query_and_decode::<
1218            CapabilityStoreDirConnectorOpenRequest,
1219            CapabilityStoreDirConnectorOpenResult,
1220        >(
1221            (id, server_end,),
1222            0x5650d3d6a3a13901,
1223            fidl::encoding::DynamicFlags::FLEXIBLE,
1224            _decode,
1225        )
1226    }
1227
1228    type DictionaryCreateResponseFut = fidl::client::QueryResponseFut<
1229        CapabilityStoreDictionaryCreateResult,
1230        fdomain_client::fidl::FDomainResourceDialect,
1231    >;
1232    fn r#dictionary_create(&self, mut id: u64) -> Self::DictionaryCreateResponseFut {
1233        fn _decode(
1234            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1235        ) -> Result<CapabilityStoreDictionaryCreateResult, fidl::Error> {
1236            let _response = fidl::client::decode_transaction_body::<
1237                fidl::encoding::FlexibleResultType<
1238                    fidl::encoding::EmptyStruct,
1239                    CapabilityStoreError,
1240                >,
1241                fdomain_client::fidl::FDomainResourceDialect,
1242                0x6997c8dfc63de093,
1243            >(_buf?)?
1244            .into_result_fdomain::<CapabilityStoreMarker>("dictionary_create")?;
1245            Ok(_response.map(|x| x))
1246        }
1247        self.client.send_query_and_decode::<
1248            CapabilityStoreDictionaryCreateRequest,
1249            CapabilityStoreDictionaryCreateResult,
1250        >(
1251            (id,),
1252            0x6997c8dfc63de093,
1253            fidl::encoding::DynamicFlags::FLEXIBLE,
1254            _decode,
1255        )
1256    }
1257
1258    type DictionaryLegacyImportResponseFut = fidl::client::QueryResponseFut<
1259        CapabilityStoreDictionaryLegacyImportResult,
1260        fdomain_client::fidl::FDomainResourceDialect,
1261    >;
1262    fn r#dictionary_legacy_import(
1263        &self,
1264        mut id: u64,
1265        mut client_end: fdomain_client::Channel,
1266    ) -> Self::DictionaryLegacyImportResponseFut {
1267        fn _decode(
1268            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1269        ) -> Result<CapabilityStoreDictionaryLegacyImportResult, fidl::Error> {
1270            let _response = fidl::client::decode_transaction_body::<
1271                fidl::encoding::FlexibleResultType<
1272                    fidl::encoding::EmptyStruct,
1273                    CapabilityStoreError,
1274                >,
1275                fdomain_client::fidl::FDomainResourceDialect,
1276                0x72fd686c37b6025f,
1277            >(_buf?)?
1278            .into_result_fdomain::<CapabilityStoreMarker>("dictionary_legacy_import")?;
1279            Ok(_response.map(|x| x))
1280        }
1281        self.client.send_query_and_decode::<
1282            CapabilityStoreDictionaryLegacyImportRequest,
1283            CapabilityStoreDictionaryLegacyImportResult,
1284        >(
1285            (id, client_end,),
1286            0x72fd686c37b6025f,
1287            fidl::encoding::DynamicFlags::FLEXIBLE,
1288            _decode,
1289        )
1290    }
1291
1292    type DictionaryLegacyExportResponseFut = fidl::client::QueryResponseFut<
1293        CapabilityStoreDictionaryLegacyExportResult,
1294        fdomain_client::fidl::FDomainResourceDialect,
1295    >;
1296    fn r#dictionary_legacy_export(
1297        &self,
1298        mut id: u64,
1299        mut server_end: fdomain_client::Channel,
1300    ) -> Self::DictionaryLegacyExportResponseFut {
1301        fn _decode(
1302            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1303        ) -> Result<CapabilityStoreDictionaryLegacyExportResult, fidl::Error> {
1304            let _response = fidl::client::decode_transaction_body::<
1305                fidl::encoding::FlexibleResultType<
1306                    fidl::encoding::EmptyStruct,
1307                    CapabilityStoreError,
1308                >,
1309                fdomain_client::fidl::FDomainResourceDialect,
1310                0x407e15cc4bde5dcd,
1311            >(_buf?)?
1312            .into_result_fdomain::<CapabilityStoreMarker>("dictionary_legacy_export")?;
1313            Ok(_response.map(|x| x))
1314        }
1315        self.client.send_query_and_decode::<
1316            CapabilityStoreDictionaryLegacyExportRequest,
1317            CapabilityStoreDictionaryLegacyExportResult,
1318        >(
1319            (id, server_end,),
1320            0x407e15cc4bde5dcd,
1321            fidl::encoding::DynamicFlags::FLEXIBLE,
1322            _decode,
1323        )
1324    }
1325
1326    type DictionaryInsertResponseFut = fidl::client::QueryResponseFut<
1327        CapabilityStoreDictionaryInsertResult,
1328        fdomain_client::fidl::FDomainResourceDialect,
1329    >;
1330    fn r#dictionary_insert(
1331        &self,
1332        mut id: u64,
1333        mut item: &DictionaryItem,
1334    ) -> Self::DictionaryInsertResponseFut {
1335        fn _decode(
1336            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1337        ) -> Result<CapabilityStoreDictionaryInsertResult, fidl::Error> {
1338            let _response = fidl::client::decode_transaction_body::<
1339                fidl::encoding::FlexibleResultType<
1340                    fidl::encoding::EmptyStruct,
1341                    CapabilityStoreError,
1342                >,
1343                fdomain_client::fidl::FDomainResourceDialect,
1344                0x7702183689d44c27,
1345            >(_buf?)?
1346            .into_result_fdomain::<CapabilityStoreMarker>("dictionary_insert")?;
1347            Ok(_response.map(|x| x))
1348        }
1349        self.client.send_query_and_decode::<
1350            CapabilityStoreDictionaryInsertRequest,
1351            CapabilityStoreDictionaryInsertResult,
1352        >(
1353            (id, item,),
1354            0x7702183689d44c27,
1355            fidl::encoding::DynamicFlags::FLEXIBLE,
1356            _decode,
1357        )
1358    }
1359
1360    type DictionaryGetResponseFut = fidl::client::QueryResponseFut<
1361        CapabilityStoreDictionaryGetResult,
1362        fdomain_client::fidl::FDomainResourceDialect,
1363    >;
1364    fn r#dictionary_get(
1365        &self,
1366        mut id: u64,
1367        mut key: &str,
1368        mut dest_id: u64,
1369    ) -> Self::DictionaryGetResponseFut {
1370        fn _decode(
1371            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1372        ) -> Result<CapabilityStoreDictionaryGetResult, fidl::Error> {
1373            let _response = fidl::client::decode_transaction_body::<
1374                fidl::encoding::FlexibleResultType<
1375                    fidl::encoding::EmptyStruct,
1376                    CapabilityStoreError,
1377                >,
1378                fdomain_client::fidl::FDomainResourceDialect,
1379                0x4d9e27538284add2,
1380            >(_buf?)?
1381            .into_result_fdomain::<CapabilityStoreMarker>("dictionary_get")?;
1382            Ok(_response.map(|x| x))
1383        }
1384        self.client.send_query_and_decode::<
1385            CapabilityStoreDictionaryGetRequest,
1386            CapabilityStoreDictionaryGetResult,
1387        >(
1388            (id, key, dest_id,),
1389            0x4d9e27538284add2,
1390            fidl::encoding::DynamicFlags::FLEXIBLE,
1391            _decode,
1392        )
1393    }
1394
1395    type DictionaryRemoveResponseFut = fidl::client::QueryResponseFut<
1396        CapabilityStoreDictionaryRemoveResult,
1397        fdomain_client::fidl::FDomainResourceDialect,
1398    >;
1399    fn r#dictionary_remove(
1400        &self,
1401        mut id: u64,
1402        mut key: &str,
1403        mut dest_id: Option<&WrappedCapabilityId>,
1404    ) -> Self::DictionaryRemoveResponseFut {
1405        fn _decode(
1406            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1407        ) -> Result<CapabilityStoreDictionaryRemoveResult, fidl::Error> {
1408            let _response = fidl::client::decode_transaction_body::<
1409                fidl::encoding::FlexibleResultType<
1410                    fidl::encoding::EmptyStruct,
1411                    CapabilityStoreError,
1412                >,
1413                fdomain_client::fidl::FDomainResourceDialect,
1414                0x4c5c025ab05d4f3,
1415            >(_buf?)?
1416            .into_result_fdomain::<CapabilityStoreMarker>("dictionary_remove")?;
1417            Ok(_response.map(|x| x))
1418        }
1419        self.client.send_query_and_decode::<
1420            CapabilityStoreDictionaryRemoveRequest,
1421            CapabilityStoreDictionaryRemoveResult,
1422        >(
1423            (id, key, dest_id,),
1424            0x4c5c025ab05d4f3,
1425            fidl::encoding::DynamicFlags::FLEXIBLE,
1426            _decode,
1427        )
1428    }
1429
1430    type DictionaryCopyResponseFut = fidl::client::QueryResponseFut<
1431        CapabilityStoreDictionaryCopyResult,
1432        fdomain_client::fidl::FDomainResourceDialect,
1433    >;
1434    fn r#dictionary_copy(&self, mut id: u64, mut dest_id: u64) -> Self::DictionaryCopyResponseFut {
1435        fn _decode(
1436            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1437        ) -> Result<CapabilityStoreDictionaryCopyResult, fidl::Error> {
1438            let _response = fidl::client::decode_transaction_body::<
1439                fidl::encoding::FlexibleResultType<
1440                    fidl::encoding::EmptyStruct,
1441                    CapabilityStoreError,
1442                >,
1443                fdomain_client::fidl::FDomainResourceDialect,
1444                0x3733ecdf4ea1b44f,
1445            >(_buf?)?
1446            .into_result_fdomain::<CapabilityStoreMarker>("dictionary_copy")?;
1447            Ok(_response.map(|x| x))
1448        }
1449        self.client.send_query_and_decode::<
1450            CapabilityStoreDictionaryCopyRequest,
1451            CapabilityStoreDictionaryCopyResult,
1452        >(
1453            (id, dest_id,),
1454            0x3733ecdf4ea1b44f,
1455            fidl::encoding::DynamicFlags::FLEXIBLE,
1456            _decode,
1457        )
1458    }
1459
1460    type DictionaryKeysResponseFut = fidl::client::QueryResponseFut<
1461        CapabilityStoreDictionaryKeysResult,
1462        fdomain_client::fidl::FDomainResourceDialect,
1463    >;
1464    fn r#dictionary_keys(
1465        &self,
1466        mut id: u64,
1467        mut iterator: fdomain_client::fidl::ServerEnd<DictionaryKeysIteratorMarker>,
1468    ) -> Self::DictionaryKeysResponseFut {
1469        fn _decode(
1470            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1471        ) -> Result<CapabilityStoreDictionaryKeysResult, fidl::Error> {
1472            let _response = fidl::client::decode_transaction_body::<
1473                fidl::encoding::FlexibleResultType<
1474                    fidl::encoding::EmptyStruct,
1475                    CapabilityStoreError,
1476                >,
1477                fdomain_client::fidl::FDomainResourceDialect,
1478                0x84b05577ceaec9e,
1479            >(_buf?)?
1480            .into_result_fdomain::<CapabilityStoreMarker>("dictionary_keys")?;
1481            Ok(_response.map(|x| x))
1482        }
1483        self.client.send_query_and_decode::<
1484            CapabilityStoreDictionaryKeysRequest,
1485            CapabilityStoreDictionaryKeysResult,
1486        >(
1487            (id, iterator,),
1488            0x84b05577ceaec9e,
1489            fidl::encoding::DynamicFlags::FLEXIBLE,
1490            _decode,
1491        )
1492    }
1493
1494    type DictionaryEnumerateResponseFut = fidl::client::QueryResponseFut<
1495        CapabilityStoreDictionaryEnumerateResult,
1496        fdomain_client::fidl::FDomainResourceDialect,
1497    >;
1498    fn r#dictionary_enumerate(
1499        &self,
1500        mut id: u64,
1501        mut iterator: fdomain_client::fidl::ServerEnd<DictionaryEnumerateIteratorMarker>,
1502    ) -> Self::DictionaryEnumerateResponseFut {
1503        fn _decode(
1504            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1505        ) -> Result<CapabilityStoreDictionaryEnumerateResult, fidl::Error> {
1506            let _response = fidl::client::decode_transaction_body::<
1507                fidl::encoding::FlexibleResultType<
1508                    fidl::encoding::EmptyStruct,
1509                    CapabilityStoreError,
1510                >,
1511                fdomain_client::fidl::FDomainResourceDialect,
1512                0xd6279b6ced04641,
1513            >(_buf?)?
1514            .into_result_fdomain::<CapabilityStoreMarker>("dictionary_enumerate")?;
1515            Ok(_response.map(|x| x))
1516        }
1517        self.client.send_query_and_decode::<
1518            CapabilityStoreDictionaryEnumerateRequest,
1519            CapabilityStoreDictionaryEnumerateResult,
1520        >(
1521            (id, iterator,),
1522            0xd6279b6ced04641,
1523            fidl::encoding::DynamicFlags::FLEXIBLE,
1524            _decode,
1525        )
1526    }
1527
1528    type DictionaryDrainResponseFut = fidl::client::QueryResponseFut<
1529        CapabilityStoreDictionaryDrainResult,
1530        fdomain_client::fidl::FDomainResourceDialect,
1531    >;
1532    fn r#dictionary_drain(
1533        &self,
1534        mut id: u64,
1535        mut iterator: Option<fdomain_client::fidl::ServerEnd<DictionaryDrainIteratorMarker>>,
1536    ) -> Self::DictionaryDrainResponseFut {
1537        fn _decode(
1538            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1539        ) -> Result<CapabilityStoreDictionaryDrainResult, fidl::Error> {
1540            let _response = fidl::client::decode_transaction_body::<
1541                fidl::encoding::FlexibleResultType<
1542                    fidl::encoding::EmptyStruct,
1543                    CapabilityStoreError,
1544                >,
1545                fdomain_client::fidl::FDomainResourceDialect,
1546                0x28a3a3f84d928cd8,
1547            >(_buf?)?
1548            .into_result_fdomain::<CapabilityStoreMarker>("dictionary_drain")?;
1549            Ok(_response.map(|x| x))
1550        }
1551        self.client.send_query_and_decode::<
1552            CapabilityStoreDictionaryDrainRequest,
1553            CapabilityStoreDictionaryDrainResult,
1554        >(
1555            (id, iterator,),
1556            0x28a3a3f84d928cd8,
1557            fidl::encoding::DynamicFlags::FLEXIBLE,
1558            _decode,
1559        )
1560    }
1561}
1562
1563pub struct CapabilityStoreEventStream {
1564    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
1565}
1566
1567impl std::marker::Unpin for CapabilityStoreEventStream {}
1568
1569impl futures::stream::FusedStream for CapabilityStoreEventStream {
1570    fn is_terminated(&self) -> bool {
1571        self.event_receiver.is_terminated()
1572    }
1573}
1574
1575impl futures::Stream for CapabilityStoreEventStream {
1576    type Item = Result<CapabilityStoreEvent, fidl::Error>;
1577
1578    fn poll_next(
1579        mut self: std::pin::Pin<&mut Self>,
1580        cx: &mut std::task::Context<'_>,
1581    ) -> std::task::Poll<Option<Self::Item>> {
1582        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1583            &mut self.event_receiver,
1584            cx
1585        )?) {
1586            Some(buf) => std::task::Poll::Ready(Some(CapabilityStoreEvent::decode(buf))),
1587            None => std::task::Poll::Ready(None),
1588        }
1589    }
1590}
1591
1592#[derive(Debug)]
1593pub enum CapabilityStoreEvent {
1594    #[non_exhaustive]
1595    _UnknownEvent {
1596        /// Ordinal of the event that was sent.
1597        ordinal: u64,
1598    },
1599}
1600
1601impl CapabilityStoreEvent {
1602    /// Decodes a message buffer as a [`CapabilityStoreEvent`].
1603    fn decode(
1604        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1605    ) -> Result<CapabilityStoreEvent, fidl::Error> {
1606        let (bytes, _handles) = buf.split_mut();
1607        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1608        debug_assert_eq!(tx_header.tx_id, 0);
1609        match tx_header.ordinal {
1610            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
1611                Ok(CapabilityStoreEvent::_UnknownEvent { ordinal: tx_header.ordinal })
1612            }
1613            _ => Err(fidl::Error::UnknownOrdinal {
1614                ordinal: tx_header.ordinal,
1615                protocol_name:
1616                    <CapabilityStoreMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
1617            }),
1618        }
1619    }
1620}
1621
1622/// A Stream of incoming requests for fuchsia.component.sandbox/CapabilityStore.
1623pub struct CapabilityStoreRequestStream {
1624    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
1625    is_terminated: bool,
1626}
1627
1628impl std::marker::Unpin for CapabilityStoreRequestStream {}
1629
1630impl futures::stream::FusedStream for CapabilityStoreRequestStream {
1631    fn is_terminated(&self) -> bool {
1632        self.is_terminated
1633    }
1634}
1635
1636impl fdomain_client::fidl::RequestStream for CapabilityStoreRequestStream {
1637    type Protocol = CapabilityStoreMarker;
1638    type ControlHandle = CapabilityStoreControlHandle;
1639
1640    fn from_channel(channel: fdomain_client::Channel) -> Self {
1641        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1642    }
1643
1644    fn control_handle(&self) -> Self::ControlHandle {
1645        CapabilityStoreControlHandle { inner: self.inner.clone() }
1646    }
1647
1648    fn into_inner(
1649        self,
1650    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
1651    {
1652        (self.inner, self.is_terminated)
1653    }
1654
1655    fn from_inner(
1656        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
1657        is_terminated: bool,
1658    ) -> Self {
1659        Self { inner, is_terminated }
1660    }
1661}
1662
1663impl futures::Stream for CapabilityStoreRequestStream {
1664    type Item = Result<CapabilityStoreRequest, fidl::Error>;
1665
1666    fn poll_next(
1667        mut self: std::pin::Pin<&mut Self>,
1668        cx: &mut std::task::Context<'_>,
1669    ) -> std::task::Poll<Option<Self::Item>> {
1670        let this = &mut *self;
1671        if this.inner.check_shutdown(cx) {
1672            this.is_terminated = true;
1673            return std::task::Poll::Ready(None);
1674        }
1675        if this.is_terminated {
1676            panic!("polled CapabilityStoreRequestStream after completion");
1677        }
1678        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
1679            |bytes, handles| {
1680                match this.inner.channel().read_etc(cx, bytes, handles) {
1681                    std::task::Poll::Ready(Ok(())) => {}
1682                    std::task::Poll::Pending => return std::task::Poll::Pending,
1683                    std::task::Poll::Ready(Err(None)) => {
1684                        this.is_terminated = true;
1685                        return std::task::Poll::Ready(None);
1686                    }
1687                    std::task::Poll::Ready(Err(Some(e))) => {
1688                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1689                            e.into(),
1690                        ))))
1691                    }
1692                }
1693
1694                // A message has been received from the channel
1695                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1696
1697                std::task::Poll::Ready(Some(match header.ordinal {
1698                0x5d5d35d9c20a2184 => {
1699                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1700                    let mut req = fidl::new_empty!(CapabilityStoreDuplicateRequest, fdomain_client::fidl::FDomainResourceDialect);
1701                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<CapabilityStoreDuplicateRequest>(&header, _body_bytes, handles, &mut req)?;
1702                    let control_handle = CapabilityStoreControlHandle {
1703                        inner: this.inner.clone(),
1704                    };
1705                    Ok(CapabilityStoreRequest::Duplicate {id: req.id,
1706dest_id: req.dest_id,
1707
1708                        responder: CapabilityStoreDuplicateResponder {
1709                            control_handle: std::mem::ManuallyDrop::new(control_handle),
1710                            tx_id: header.tx_id,
1711                        },
1712                    })
1713                }
1714                0xa745c0990fc2559 => {
1715                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1716                    let mut req = fidl::new_empty!(CapabilityStoreDropRequest, fdomain_client::fidl::FDomainResourceDialect);
1717                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<CapabilityStoreDropRequest>(&header, _body_bytes, handles, &mut req)?;
1718                    let control_handle = CapabilityStoreControlHandle {
1719                        inner: this.inner.clone(),
1720                    };
1721                    Ok(CapabilityStoreRequest::Drop {id: req.id,
1722
1723                        responder: CapabilityStoreDropResponder {
1724                            control_handle: std::mem::ManuallyDrop::new(control_handle),
1725                            tx_id: header.tx_id,
1726                        },
1727                    })
1728                }
1729                0x3237a8f4748faff => {
1730                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1731                    let mut req = fidl::new_empty!(CapabilityStoreExportRequest, fdomain_client::fidl::FDomainResourceDialect);
1732                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<CapabilityStoreExportRequest>(&header, _body_bytes, handles, &mut req)?;
1733                    let control_handle = CapabilityStoreControlHandle {
1734                        inner: this.inner.clone(),
1735                    };
1736                    Ok(CapabilityStoreRequest::Export {id: req.id,
1737
1738                        responder: CapabilityStoreExportResponder {
1739                            control_handle: std::mem::ManuallyDrop::new(control_handle),
1740                            tx_id: header.tx_id,
1741                        },
1742                    })
1743                }
1744                0x1f96157a29f4539b => {
1745                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1746                    let mut req = fidl::new_empty!(CapabilityStoreImportRequest, fdomain_client::fidl::FDomainResourceDialect);
1747                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<CapabilityStoreImportRequest>(&header, _body_bytes, handles, &mut req)?;
1748                    let control_handle = CapabilityStoreControlHandle {
1749                        inner: this.inner.clone(),
1750                    };
1751                    Ok(CapabilityStoreRequest::Import {id: req.id,
1752capability: req.capability,
1753
1754                        responder: CapabilityStoreImportResponder {
1755                            control_handle: std::mem::ManuallyDrop::new(control_handle),
1756                            tx_id: header.tx_id,
1757                        },
1758                    })
1759                }
1760                0x29592c5d63e91c25 => {
1761                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1762                    let mut req = fidl::new_empty!(CapabilityStoreConnectorCreateRequest, fdomain_client::fidl::FDomainResourceDialect);
1763                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<CapabilityStoreConnectorCreateRequest>(&header, _body_bytes, handles, &mut req)?;
1764                    let control_handle = CapabilityStoreControlHandle {
1765                        inner: this.inner.clone(),
1766                    };
1767                    Ok(CapabilityStoreRequest::ConnectorCreate {id: req.id,
1768receiver: req.receiver,
1769
1770                        responder: CapabilityStoreConnectorCreateResponder {
1771                            control_handle: std::mem::ManuallyDrop::new(control_handle),
1772                            tx_id: header.tx_id,
1773                        },
1774                    })
1775                }
1776                0x537e69ab40563b9f => {
1777                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1778                    let mut req = fidl::new_empty!(CapabilityStoreConnectorOpenRequest, fdomain_client::fidl::FDomainResourceDialect);
1779                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<CapabilityStoreConnectorOpenRequest>(&header, _body_bytes, handles, &mut req)?;
1780                    let control_handle = CapabilityStoreControlHandle {
1781                        inner: this.inner.clone(),
1782                    };
1783                    Ok(CapabilityStoreRequest::ConnectorOpen {id: req.id,
1784server_end: req.server_end,
1785
1786                        responder: CapabilityStoreConnectorOpenResponder {
1787                            control_handle: std::mem::ManuallyDrop::new(control_handle),
1788                            tx_id: header.tx_id,
1789                        },
1790                    })
1791                }
1792                0x186138a11ccf19bb => {
1793                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1794                    let mut req = fidl::new_empty!(CapabilityStoreDirConnectorCreateRequest, fdomain_client::fidl::FDomainResourceDialect);
1795                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<CapabilityStoreDirConnectorCreateRequest>(&header, _body_bytes, handles, &mut req)?;
1796                    let control_handle = CapabilityStoreControlHandle {
1797                        inner: this.inner.clone(),
1798                    };
1799                    Ok(CapabilityStoreRequest::DirConnectorCreate {id: req.id,
1800receiver: req.receiver,
1801
1802                        responder: CapabilityStoreDirConnectorCreateResponder {
1803                            control_handle: std::mem::ManuallyDrop::new(control_handle),
1804                            tx_id: header.tx_id,
1805                        },
1806                    })
1807                }
1808                0x5650d3d6a3a13901 => {
1809                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1810                    let mut req = fidl::new_empty!(CapabilityStoreDirConnectorOpenRequest, fdomain_client::fidl::FDomainResourceDialect);
1811                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<CapabilityStoreDirConnectorOpenRequest>(&header, _body_bytes, handles, &mut req)?;
1812                    let control_handle = CapabilityStoreControlHandle {
1813                        inner: this.inner.clone(),
1814                    };
1815                    Ok(CapabilityStoreRequest::DirConnectorOpen {id: req.id,
1816server_end: req.server_end,
1817
1818                        responder: CapabilityStoreDirConnectorOpenResponder {
1819                            control_handle: std::mem::ManuallyDrop::new(control_handle),
1820                            tx_id: header.tx_id,
1821                        },
1822                    })
1823                }
1824                0x6997c8dfc63de093 => {
1825                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1826                    let mut req = fidl::new_empty!(CapabilityStoreDictionaryCreateRequest, fdomain_client::fidl::FDomainResourceDialect);
1827                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<CapabilityStoreDictionaryCreateRequest>(&header, _body_bytes, handles, &mut req)?;
1828                    let control_handle = CapabilityStoreControlHandle {
1829                        inner: this.inner.clone(),
1830                    };
1831                    Ok(CapabilityStoreRequest::DictionaryCreate {id: req.id,
1832
1833                        responder: CapabilityStoreDictionaryCreateResponder {
1834                            control_handle: std::mem::ManuallyDrop::new(control_handle),
1835                            tx_id: header.tx_id,
1836                        },
1837                    })
1838                }
1839                0x72fd686c37b6025f => {
1840                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1841                    let mut req = fidl::new_empty!(CapabilityStoreDictionaryLegacyImportRequest, fdomain_client::fidl::FDomainResourceDialect);
1842                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<CapabilityStoreDictionaryLegacyImportRequest>(&header, _body_bytes, handles, &mut req)?;
1843                    let control_handle = CapabilityStoreControlHandle {
1844                        inner: this.inner.clone(),
1845                    };
1846                    Ok(CapabilityStoreRequest::DictionaryLegacyImport {id: req.id,
1847client_end: req.client_end,
1848
1849                        responder: CapabilityStoreDictionaryLegacyImportResponder {
1850                            control_handle: std::mem::ManuallyDrop::new(control_handle),
1851                            tx_id: header.tx_id,
1852                        },
1853                    })
1854                }
1855                0x407e15cc4bde5dcd => {
1856                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1857                    let mut req = fidl::new_empty!(CapabilityStoreDictionaryLegacyExportRequest, fdomain_client::fidl::FDomainResourceDialect);
1858                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<CapabilityStoreDictionaryLegacyExportRequest>(&header, _body_bytes, handles, &mut req)?;
1859                    let control_handle = CapabilityStoreControlHandle {
1860                        inner: this.inner.clone(),
1861                    };
1862                    Ok(CapabilityStoreRequest::DictionaryLegacyExport {id: req.id,
1863server_end: req.server_end,
1864
1865                        responder: CapabilityStoreDictionaryLegacyExportResponder {
1866                            control_handle: std::mem::ManuallyDrop::new(control_handle),
1867                            tx_id: header.tx_id,
1868                        },
1869                    })
1870                }
1871                0x7702183689d44c27 => {
1872                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1873                    let mut req = fidl::new_empty!(CapabilityStoreDictionaryInsertRequest, fdomain_client::fidl::FDomainResourceDialect);
1874                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<CapabilityStoreDictionaryInsertRequest>(&header, _body_bytes, handles, &mut req)?;
1875                    let control_handle = CapabilityStoreControlHandle {
1876                        inner: this.inner.clone(),
1877                    };
1878                    Ok(CapabilityStoreRequest::DictionaryInsert {id: req.id,
1879item: req.item,
1880
1881                        responder: CapabilityStoreDictionaryInsertResponder {
1882                            control_handle: std::mem::ManuallyDrop::new(control_handle),
1883                            tx_id: header.tx_id,
1884                        },
1885                    })
1886                }
1887                0x4d9e27538284add2 => {
1888                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1889                    let mut req = fidl::new_empty!(CapabilityStoreDictionaryGetRequest, fdomain_client::fidl::FDomainResourceDialect);
1890                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<CapabilityStoreDictionaryGetRequest>(&header, _body_bytes, handles, &mut req)?;
1891                    let control_handle = CapabilityStoreControlHandle {
1892                        inner: this.inner.clone(),
1893                    };
1894                    Ok(CapabilityStoreRequest::DictionaryGet {id: req.id,
1895key: req.key,
1896dest_id: req.dest_id,
1897
1898                        responder: CapabilityStoreDictionaryGetResponder {
1899                            control_handle: std::mem::ManuallyDrop::new(control_handle),
1900                            tx_id: header.tx_id,
1901                        },
1902                    })
1903                }
1904                0x4c5c025ab05d4f3 => {
1905                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1906                    let mut req = fidl::new_empty!(CapabilityStoreDictionaryRemoveRequest, fdomain_client::fidl::FDomainResourceDialect);
1907                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<CapabilityStoreDictionaryRemoveRequest>(&header, _body_bytes, handles, &mut req)?;
1908                    let control_handle = CapabilityStoreControlHandle {
1909                        inner: this.inner.clone(),
1910                    };
1911                    Ok(CapabilityStoreRequest::DictionaryRemove {id: req.id,
1912key: req.key,
1913dest_id: req.dest_id,
1914
1915                        responder: CapabilityStoreDictionaryRemoveResponder {
1916                            control_handle: std::mem::ManuallyDrop::new(control_handle),
1917                            tx_id: header.tx_id,
1918                        },
1919                    })
1920                }
1921                0x3733ecdf4ea1b44f => {
1922                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1923                    let mut req = fidl::new_empty!(CapabilityStoreDictionaryCopyRequest, fdomain_client::fidl::FDomainResourceDialect);
1924                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<CapabilityStoreDictionaryCopyRequest>(&header, _body_bytes, handles, &mut req)?;
1925                    let control_handle = CapabilityStoreControlHandle {
1926                        inner: this.inner.clone(),
1927                    };
1928                    Ok(CapabilityStoreRequest::DictionaryCopy {id: req.id,
1929dest_id: req.dest_id,
1930
1931                        responder: CapabilityStoreDictionaryCopyResponder {
1932                            control_handle: std::mem::ManuallyDrop::new(control_handle),
1933                            tx_id: header.tx_id,
1934                        },
1935                    })
1936                }
1937                0x84b05577ceaec9e => {
1938                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1939                    let mut req = fidl::new_empty!(CapabilityStoreDictionaryKeysRequest, fdomain_client::fidl::FDomainResourceDialect);
1940                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<CapabilityStoreDictionaryKeysRequest>(&header, _body_bytes, handles, &mut req)?;
1941                    let control_handle = CapabilityStoreControlHandle {
1942                        inner: this.inner.clone(),
1943                    };
1944                    Ok(CapabilityStoreRequest::DictionaryKeys {id: req.id,
1945iterator: req.iterator,
1946
1947                        responder: CapabilityStoreDictionaryKeysResponder {
1948                            control_handle: std::mem::ManuallyDrop::new(control_handle),
1949                            tx_id: header.tx_id,
1950                        },
1951                    })
1952                }
1953                0xd6279b6ced04641 => {
1954                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1955                    let mut req = fidl::new_empty!(CapabilityStoreDictionaryEnumerateRequest, fdomain_client::fidl::FDomainResourceDialect);
1956                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<CapabilityStoreDictionaryEnumerateRequest>(&header, _body_bytes, handles, &mut req)?;
1957                    let control_handle = CapabilityStoreControlHandle {
1958                        inner: this.inner.clone(),
1959                    };
1960                    Ok(CapabilityStoreRequest::DictionaryEnumerate {id: req.id,
1961iterator: req.iterator,
1962
1963                        responder: CapabilityStoreDictionaryEnumerateResponder {
1964                            control_handle: std::mem::ManuallyDrop::new(control_handle),
1965                            tx_id: header.tx_id,
1966                        },
1967                    })
1968                }
1969                0x28a3a3f84d928cd8 => {
1970                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1971                    let mut req = fidl::new_empty!(CapabilityStoreDictionaryDrainRequest, fdomain_client::fidl::FDomainResourceDialect);
1972                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<CapabilityStoreDictionaryDrainRequest>(&header, _body_bytes, handles, &mut req)?;
1973                    let control_handle = CapabilityStoreControlHandle {
1974                        inner: this.inner.clone(),
1975                    };
1976                    Ok(CapabilityStoreRequest::DictionaryDrain {id: req.id,
1977iterator: req.iterator,
1978
1979                        responder: CapabilityStoreDictionaryDrainResponder {
1980                            control_handle: std::mem::ManuallyDrop::new(control_handle),
1981                            tx_id: header.tx_id,
1982                        },
1983                    })
1984                }
1985                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
1986                    Ok(CapabilityStoreRequest::_UnknownMethod {
1987                        ordinal: header.ordinal,
1988                        control_handle: CapabilityStoreControlHandle { inner: this.inner.clone() },
1989                        method_type: fidl::MethodType::OneWay,
1990                    })
1991                }
1992                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
1993                    this.inner.send_framework_err(
1994                        fidl::encoding::FrameworkErr::UnknownMethod,
1995                        header.tx_id,
1996                        header.ordinal,
1997                        header.dynamic_flags(),
1998                        (bytes, handles),
1999                    )?;
2000                    Ok(CapabilityStoreRequest::_UnknownMethod {
2001                        ordinal: header.ordinal,
2002                        control_handle: CapabilityStoreControlHandle { inner: this.inner.clone() },
2003                        method_type: fidl::MethodType::TwoWay,
2004                    })
2005                }
2006                _ => Err(fidl::Error::UnknownOrdinal {
2007                    ordinal: header.ordinal,
2008                    protocol_name: <CapabilityStoreMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
2009                }),
2010            }))
2011            },
2012        )
2013    }
2014}
2015
2016/// Protocol that represents the concept of a "capability store", a repository
2017/// for [Capability]s that are held by the component framework runtime.
2018///
2019/// [CapabilityStore] serves as the main bridge between the component runtime and clients
2020/// that enables them to operate on and exchange [Capability]s. A [CapabilityStore] instance
2021/// contains a set of [Capability]s, each of which has a [CapabilityId] assigned by the client.
2022///
2023/// Normally, a program would not exchange a [CapabilityStore] or [CapabilityId] with other
2024/// programs -- a [CapabilityStore] connection and its enclosed capabilities are intended to
2025/// be "local" to a program. Instead, if a program wishes to exchange a [Capability] with other
2026/// programs, it should [Export] the [Capability] out of the store, send the [Capability] to the
2027/// target program, which can then [Import] the capability into its own store.
2028///
2029/// [CapabilityStore] is also used to manage capability lifetimes. The lifetime of a capability is
2030/// scoped to the [CapabilityStore] in which it resides; i.e. to drop the [CapabilityStore]
2031/// connections to release the capabilities instead it. In addition, [CapabilityStore] supports a
2032/// [Drop] API to drop an individual [Capability] reference. (Note that it is possible for a
2033/// some capabilities, like [DictionaryRef], to have multiple references, in which case all of
2034/// the references must be dropped for the underlying resource to be released.)
2035///
2036/// A note about semantics: the [CapabilityStore] APIs do not return [CapabilityId]s, because
2037/// [CapabilityId]s are assigned by the client. Instead, when a method would semantically return
2038/// a capability, this is expressed by taking the destination [CapabilityId] as an output parameter.
2039#[derive(Debug)]
2040pub enum CapabilityStoreRequest {
2041    /// Duplicates the capability with `id` to `dest_id`.
2042    ///
2043    /// Errors:
2044    ///
2045    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2046    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
2047    /// - `NOT_DUPLICATABLE` if `id` could not be duplicated.
2048    Duplicate { id: u64, dest_id: u64, responder: CapabilityStoreDuplicateResponder },
2049    /// Drops the capability with `id` from this [`CapabilityStore`].
2050    ///
2051    /// Errors:
2052    ///
2053    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2054    Drop { id: u64, responder: CapabilityStoreDropResponder },
2055    /// Exports the capability with the client-assigned identifier `id` to
2056    /// `capability`. This operation removes the capability from the store. If
2057    /// this is not desired, [Duplicate] the capability first.
2058    ///
2059    /// Errors:
2060    ///
2061    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2062    Export { id: u64, responder: CapabilityStoreExportResponder },
2063    /// Imports `capability` into this store with the client-assigned `id`.
2064    ///
2065    /// Errors:
2066    ///
2067    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
2068    /// - `BAD_CAPABILITY` if `capability` was not a valid [Capability].
2069    Import { id: u64, capability: Capability, responder: CapabilityStoreImportResponder },
2070    /// Creates a [Connector] from a [Receiver]. Incoming connections to the [Connector] will be
2071    /// dispatched to this [Receiver].
2072    ///
2073    /// Errors:
2074    ///
2075    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
2076    ConnectorCreate {
2077        id: u64,
2078        receiver: fdomain_client::fidl::ClientEnd<ReceiverMarker>,
2079        responder: CapabilityStoreConnectorCreateResponder,
2080    },
2081    /// Open a connection from the provided [Connector] capability that will be dispatched to
2082    /// the [Receiver] on the other end.
2083    ///
2084    /// If there is an error, it will be reported as a zx.Status epitaph on `server_end`.
2085    ///
2086    /// Errors:
2087    ///
2088    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2089    /// - `WRONG_TYPE` if `id` was not a connector capability.
2090    ConnectorOpen {
2091        id: u64,
2092        server_end: fdomain_client::Channel,
2093        responder: CapabilityStoreConnectorOpenResponder,
2094    },
2095    /// Creates a [DirConnector] from a [DirReceiver]. Incoming connections to the [DirConnector]
2096    /// will be dispatched to this [DirReceiver].
2097    ///
2098    /// Errors:
2099    ///
2100    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
2101    DirConnectorCreate {
2102        id: u64,
2103        receiver: fdomain_client::fidl::ClientEnd<DirReceiverMarker>,
2104        responder: CapabilityStoreDirConnectorCreateResponder,
2105    },
2106    /// Open a connection from the provided [DirConnector] capability that will be dispatched to
2107    /// the [DirReceiver] on the other end.
2108    ///
2109    /// This method does not take `Open`/`Open3` parameters such as `flags` or `path`.
2110    /// Clients that wish to specify these can get an initial connection from this method
2111    /// and call `fuchsia.io/Directory.Open` on it. See the [DirReceiver] documentation for
2112    /// more information about the expectations of the server side.
2113    ///
2114    /// If there was an error making the connection, it will be reported as a zx.Status
2115    /// epitaph on `server_end`.
2116    ///
2117    /// Errors:
2118    ///
2119    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2120    /// - `WRONG_TYPE` if `id` was not a connector capability.
2121    DirConnectorOpen {
2122        id: u64,
2123        server_end: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
2124        responder: CapabilityStoreDirConnectorOpenResponder,
2125    },
2126    /// Creates a new empty dictionary in this [`CapabilityStore`] with client-assigned `id`.
2127    ///
2128    /// Errors:
2129    ///
2130    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
2131    DictionaryCreate { id: u64, responder: CapabilityStoreDictionaryCreateResponder },
2132    /// Imports a dictionary in the form of a channel.
2133    ///
2134    /// This is a legacy API to support backward compatibility with APIs that take a [Dictionary]
2135    /// channel.
2136    ///
2137    /// Errors:
2138    ///
2139    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
2140    /// - `BAD_CAPABILITY` if `client_end` was not a valid dictionary channel.
2141    DictionaryLegacyImport {
2142        id: u64,
2143        client_end: fdomain_client::Channel,
2144        responder: CapabilityStoreDictionaryLegacyImportResponder,
2145    },
2146    /// Binds a channel to the dictionary with `id`. The channel can
2147    /// be re-imported into a [CapabilityStore] with [DictionaryImportLegacy].
2148    ///
2149    /// This is a legacy API to support backward compatibility with APIs that take a [Dictionary]
2150    /// channel.
2151    ///
2152    /// Errors:
2153    ///
2154    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2155    DictionaryLegacyExport {
2156        id: u64,
2157        server_end: fdomain_client::Channel,
2158        responder: CapabilityStoreDictionaryLegacyExportResponder,
2159    },
2160    /// Inserts `item` into the dictionary with `id`. `item.value` is moved into the dictionary and
2161    /// its id is released if this call succeeds.
2162    ///
2163    /// Errors:
2164    ///
2165    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2166    /// - `WRONG_TYPE` if `id` was not a dictionary.
2167    /// - `INVALID_KEY` if `item.key` was invalid.
2168    /// - `ITEM_ALREADY_EXISTS` if the dictionary already contains an item with `item.key`.
2169    DictionaryInsert {
2170        id: u64,
2171        item: DictionaryItem,
2172        responder: CapabilityStoreDictionaryInsertResponder,
2173    },
2174    /// Get a duplicate of a capability from the dictionary with `id`, which is
2175    /// loaded into `dest_id`.
2176    ///
2177    /// Errors:
2178    ///
2179    /// - `ID_NOT_FOUND` if `id` was not a recognized capability id in this store.
2180    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
2181    /// - `WRONG_TYPE` if `id` was not a dictionary.
2182    /// - `INVALID_KEY` if `item.key` was invalid.
2183    /// - `ITEM_NOT_FOUND` if the dictionary does not contain `key`.
2184    /// - `NOT_DUPLICATABLE` if the capability could not be duplicated.
2185    DictionaryGet {
2186        id: u64,
2187        key: String,
2188        dest_id: u64,
2189        responder: CapabilityStoreDictionaryGetResponder,
2190    },
2191    /// Removes a key from the dictionary with `id`. If `dest_id` is present, loads the value
2192    /// into it, otherwise discards the value.
2193    ///
2194    /// Errors:
2195    ///
2196    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2197    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
2198    /// - `WRONG_TYPE` if `id` was not a dictionary.
2199    /// - `INVALID_KEY` if `key` was invalid.
2200    /// - `ITEM_NOT_FOUND` if the dictionary does not contain the key.
2201    DictionaryRemove {
2202        id: u64,
2203        key: String,
2204        dest_id: Option<Box<WrappedCapabilityId>>,
2205        responder: CapabilityStoreDictionaryRemoveResponder,
2206    },
2207    /// Create a new dictionary that contains a duplicate of all the entries in
2208    /// the dictionary with `id`, assigning `dest_id` to the new dictionary.
2209    /// The runtime of this method is linear in the number of top-level entries
2210    /// in the dictionary.
2211    ///
2212    /// For example, if the dictionary contains nested dictionaries, the newly
2213    /// created dictionary will contain references to those same nested
2214    /// dictionaries because the entries are duplicated rather than deep-copied.
2215    ///
2216    /// Errors:
2217    ///
2218    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2219    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
2220    /// - `WRONG_TYPE` if `id` was not a dictionary.
2221    /// - `NOT_DUPLICATABLE` if one of the capabilities in `id` could not be duplicated.
2222    DictionaryCopy { id: u64, dest_id: u64, responder: CapabilityStoreDictionaryCopyResponder },
2223    /// Enumerates the keys in the dictionary with `id`.
2224    ///
2225    /// Errors:
2226    ///
2227    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2228    /// - `WRONG_TYPE` if `id` was not a dictionary.
2229    DictionaryKeys {
2230        id: u64,
2231        iterator: fdomain_client::fidl::ServerEnd<DictionaryKeysIteratorMarker>,
2232        responder: CapabilityStoreDictionaryKeysResponder,
2233    },
2234    /// Enumerates the items (keys and values) in the dictionary with `id`.
2235    ///
2236    /// Creates a duplicate of each value (capability). If a value could not be duplicated,
2237    /// the value will be null.
2238    ///
2239    /// Errors:
2240    ///
2241    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2242    /// - `WRONG_TYPE` if `id` was not a dictionary.
2243    DictionaryEnumerate {
2244        id: u64,
2245        iterator: fdomain_client::fidl::ServerEnd<DictionaryEnumerateIteratorMarker>,
2246        responder: CapabilityStoreDictionaryEnumerateResponder,
2247    },
2248    /// Removes all the entries in this dictionary, returning them in `contents` if provided.
2249    /// If `contents` is not provided, all the items are discarded without enumerating them.
2250    ///
2251    /// Errors:
2252    ///
2253    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2254    /// - `WRONG_TYPE` if `id` was not a dictionary.
2255    DictionaryDrain {
2256        id: u64,
2257        iterator: Option<fdomain_client::fidl::ServerEnd<DictionaryDrainIteratorMarker>>,
2258        responder: CapabilityStoreDictionaryDrainResponder,
2259    },
2260    /// An interaction was received which does not match any known method.
2261    #[non_exhaustive]
2262    _UnknownMethod {
2263        /// Ordinal of the method that was called.
2264        ordinal: u64,
2265        control_handle: CapabilityStoreControlHandle,
2266        method_type: fidl::MethodType,
2267    },
2268}
2269
2270impl CapabilityStoreRequest {
2271    #[allow(irrefutable_let_patterns)]
2272    pub fn into_duplicate(self) -> Option<(u64, u64, CapabilityStoreDuplicateResponder)> {
2273        if let CapabilityStoreRequest::Duplicate { id, dest_id, responder } = self {
2274            Some((id, dest_id, responder))
2275        } else {
2276            None
2277        }
2278    }
2279
2280    #[allow(irrefutable_let_patterns)]
2281    pub fn into_drop(self) -> Option<(u64, CapabilityStoreDropResponder)> {
2282        if let CapabilityStoreRequest::Drop { id, responder } = self {
2283            Some((id, responder))
2284        } else {
2285            None
2286        }
2287    }
2288
2289    #[allow(irrefutable_let_patterns)]
2290    pub fn into_export(self) -> Option<(u64, CapabilityStoreExportResponder)> {
2291        if let CapabilityStoreRequest::Export { id, responder } = self {
2292            Some((id, responder))
2293        } else {
2294            None
2295        }
2296    }
2297
2298    #[allow(irrefutable_let_patterns)]
2299    pub fn into_import(self) -> Option<(u64, Capability, CapabilityStoreImportResponder)> {
2300        if let CapabilityStoreRequest::Import { id, capability, responder } = self {
2301            Some((id, capability, responder))
2302        } else {
2303            None
2304        }
2305    }
2306
2307    #[allow(irrefutable_let_patterns)]
2308    pub fn into_connector_create(
2309        self,
2310    ) -> Option<(
2311        u64,
2312        fdomain_client::fidl::ClientEnd<ReceiverMarker>,
2313        CapabilityStoreConnectorCreateResponder,
2314    )> {
2315        if let CapabilityStoreRequest::ConnectorCreate { id, receiver, responder } = self {
2316            Some((id, receiver, responder))
2317        } else {
2318            None
2319        }
2320    }
2321
2322    #[allow(irrefutable_let_patterns)]
2323    pub fn into_connector_open(
2324        self,
2325    ) -> Option<(u64, fdomain_client::Channel, CapabilityStoreConnectorOpenResponder)> {
2326        if let CapabilityStoreRequest::ConnectorOpen { id, server_end, responder } = self {
2327            Some((id, server_end, responder))
2328        } else {
2329            None
2330        }
2331    }
2332
2333    #[allow(irrefutable_let_patterns)]
2334    pub fn into_dir_connector_create(
2335        self,
2336    ) -> Option<(
2337        u64,
2338        fdomain_client::fidl::ClientEnd<DirReceiverMarker>,
2339        CapabilityStoreDirConnectorCreateResponder,
2340    )> {
2341        if let CapabilityStoreRequest::DirConnectorCreate { id, receiver, responder } = self {
2342            Some((id, receiver, responder))
2343        } else {
2344            None
2345        }
2346    }
2347
2348    #[allow(irrefutable_let_patterns)]
2349    pub fn into_dir_connector_open(
2350        self,
2351    ) -> Option<(
2352        u64,
2353        fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
2354        CapabilityStoreDirConnectorOpenResponder,
2355    )> {
2356        if let CapabilityStoreRequest::DirConnectorOpen { id, server_end, responder } = self {
2357            Some((id, server_end, responder))
2358        } else {
2359            None
2360        }
2361    }
2362
2363    #[allow(irrefutable_let_patterns)]
2364    pub fn into_dictionary_create(self) -> Option<(u64, CapabilityStoreDictionaryCreateResponder)> {
2365        if let CapabilityStoreRequest::DictionaryCreate { id, responder } = self {
2366            Some((id, responder))
2367        } else {
2368            None
2369        }
2370    }
2371
2372    #[allow(irrefutable_let_patterns)]
2373    pub fn into_dictionary_legacy_import(
2374        self,
2375    ) -> Option<(u64, fdomain_client::Channel, CapabilityStoreDictionaryLegacyImportResponder)>
2376    {
2377        if let CapabilityStoreRequest::DictionaryLegacyImport { id, client_end, responder } = self {
2378            Some((id, client_end, responder))
2379        } else {
2380            None
2381        }
2382    }
2383
2384    #[allow(irrefutable_let_patterns)]
2385    pub fn into_dictionary_legacy_export(
2386        self,
2387    ) -> Option<(u64, fdomain_client::Channel, CapabilityStoreDictionaryLegacyExportResponder)>
2388    {
2389        if let CapabilityStoreRequest::DictionaryLegacyExport { id, server_end, responder } = self {
2390            Some((id, server_end, responder))
2391        } else {
2392            None
2393        }
2394    }
2395
2396    #[allow(irrefutable_let_patterns)]
2397    pub fn into_dictionary_insert(
2398        self,
2399    ) -> Option<(u64, DictionaryItem, CapabilityStoreDictionaryInsertResponder)> {
2400        if let CapabilityStoreRequest::DictionaryInsert { id, item, responder } = self {
2401            Some((id, item, responder))
2402        } else {
2403            None
2404        }
2405    }
2406
2407    #[allow(irrefutable_let_patterns)]
2408    pub fn into_dictionary_get(
2409        self,
2410    ) -> Option<(u64, String, u64, CapabilityStoreDictionaryGetResponder)> {
2411        if let CapabilityStoreRequest::DictionaryGet { id, key, dest_id, responder } = self {
2412            Some((id, key, dest_id, responder))
2413        } else {
2414            None
2415        }
2416    }
2417
2418    #[allow(irrefutable_let_patterns)]
2419    pub fn into_dictionary_remove(
2420        self,
2421    ) -> Option<(
2422        u64,
2423        String,
2424        Option<Box<WrappedCapabilityId>>,
2425        CapabilityStoreDictionaryRemoveResponder,
2426    )> {
2427        if let CapabilityStoreRequest::DictionaryRemove { id, key, dest_id, responder } = self {
2428            Some((id, key, dest_id, responder))
2429        } else {
2430            None
2431        }
2432    }
2433
2434    #[allow(irrefutable_let_patterns)]
2435    pub fn into_dictionary_copy(
2436        self,
2437    ) -> Option<(u64, u64, CapabilityStoreDictionaryCopyResponder)> {
2438        if let CapabilityStoreRequest::DictionaryCopy { id, dest_id, responder } = self {
2439            Some((id, dest_id, responder))
2440        } else {
2441            None
2442        }
2443    }
2444
2445    #[allow(irrefutable_let_patterns)]
2446    pub fn into_dictionary_keys(
2447        self,
2448    ) -> Option<(
2449        u64,
2450        fdomain_client::fidl::ServerEnd<DictionaryKeysIteratorMarker>,
2451        CapabilityStoreDictionaryKeysResponder,
2452    )> {
2453        if let CapabilityStoreRequest::DictionaryKeys { id, iterator, responder } = self {
2454            Some((id, iterator, responder))
2455        } else {
2456            None
2457        }
2458    }
2459
2460    #[allow(irrefutable_let_patterns)]
2461    pub fn into_dictionary_enumerate(
2462        self,
2463    ) -> Option<(
2464        u64,
2465        fdomain_client::fidl::ServerEnd<DictionaryEnumerateIteratorMarker>,
2466        CapabilityStoreDictionaryEnumerateResponder,
2467    )> {
2468        if let CapabilityStoreRequest::DictionaryEnumerate { id, iterator, responder } = self {
2469            Some((id, iterator, responder))
2470        } else {
2471            None
2472        }
2473    }
2474
2475    #[allow(irrefutable_let_patterns)]
2476    pub fn into_dictionary_drain(
2477        self,
2478    ) -> Option<(
2479        u64,
2480        Option<fdomain_client::fidl::ServerEnd<DictionaryDrainIteratorMarker>>,
2481        CapabilityStoreDictionaryDrainResponder,
2482    )> {
2483        if let CapabilityStoreRequest::DictionaryDrain { id, iterator, responder } = self {
2484            Some((id, iterator, responder))
2485        } else {
2486            None
2487        }
2488    }
2489
2490    /// Name of the method defined in FIDL
2491    pub fn method_name(&self) -> &'static str {
2492        match *self {
2493            CapabilityStoreRequest::Duplicate { .. } => "duplicate",
2494            CapabilityStoreRequest::Drop { .. } => "drop",
2495            CapabilityStoreRequest::Export { .. } => "export",
2496            CapabilityStoreRequest::Import { .. } => "import",
2497            CapabilityStoreRequest::ConnectorCreate { .. } => "connector_create",
2498            CapabilityStoreRequest::ConnectorOpen { .. } => "connector_open",
2499            CapabilityStoreRequest::DirConnectorCreate { .. } => "dir_connector_create",
2500            CapabilityStoreRequest::DirConnectorOpen { .. } => "dir_connector_open",
2501            CapabilityStoreRequest::DictionaryCreate { .. } => "dictionary_create",
2502            CapabilityStoreRequest::DictionaryLegacyImport { .. } => "dictionary_legacy_import",
2503            CapabilityStoreRequest::DictionaryLegacyExport { .. } => "dictionary_legacy_export",
2504            CapabilityStoreRequest::DictionaryInsert { .. } => "dictionary_insert",
2505            CapabilityStoreRequest::DictionaryGet { .. } => "dictionary_get",
2506            CapabilityStoreRequest::DictionaryRemove { .. } => "dictionary_remove",
2507            CapabilityStoreRequest::DictionaryCopy { .. } => "dictionary_copy",
2508            CapabilityStoreRequest::DictionaryKeys { .. } => "dictionary_keys",
2509            CapabilityStoreRequest::DictionaryEnumerate { .. } => "dictionary_enumerate",
2510            CapabilityStoreRequest::DictionaryDrain { .. } => "dictionary_drain",
2511            CapabilityStoreRequest::_UnknownMethod {
2512                method_type: fidl::MethodType::OneWay,
2513                ..
2514            } => "unknown one-way method",
2515            CapabilityStoreRequest::_UnknownMethod {
2516                method_type: fidl::MethodType::TwoWay,
2517                ..
2518            } => "unknown two-way method",
2519        }
2520    }
2521}
2522
2523#[derive(Debug, Clone)]
2524pub struct CapabilityStoreControlHandle {
2525    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
2526}
2527
2528impl fdomain_client::fidl::ControlHandle for CapabilityStoreControlHandle {
2529    fn shutdown(&self) {
2530        self.inner.shutdown()
2531    }
2532
2533    fn is_closed(&self) -> bool {
2534        self.inner.channel().is_closed()
2535    }
2536    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
2537        self.inner.channel().on_closed()
2538    }
2539}
2540
2541impl CapabilityStoreControlHandle {}
2542
2543#[must_use = "FIDL methods require a response to be sent"]
2544#[derive(Debug)]
2545pub struct CapabilityStoreDuplicateResponder {
2546    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
2547    tx_id: u32,
2548}
2549
2550/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
2551/// if the responder is dropped without sending a response, so that the client
2552/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2553impl std::ops::Drop for CapabilityStoreDuplicateResponder {
2554    fn drop(&mut self) {
2555        self.control_handle.shutdown();
2556        // Safety: drops once, never accessed again
2557        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2558    }
2559}
2560
2561impl fdomain_client::fidl::Responder for CapabilityStoreDuplicateResponder {
2562    type ControlHandle = CapabilityStoreControlHandle;
2563
2564    fn control_handle(&self) -> &CapabilityStoreControlHandle {
2565        &self.control_handle
2566    }
2567
2568    fn drop_without_shutdown(mut self) {
2569        // Safety: drops once, never accessed again due to mem::forget
2570        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2571        // Prevent Drop from running (which would shut down the channel)
2572        std::mem::forget(self);
2573    }
2574}
2575
2576impl CapabilityStoreDuplicateResponder {
2577    /// Sends a response to the FIDL transaction.
2578    ///
2579    /// Sets the channel to shutdown if an error occurs.
2580    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
2581        let _result = self.send_raw(result);
2582        if _result.is_err() {
2583            self.control_handle.shutdown();
2584        }
2585        self.drop_without_shutdown();
2586        _result
2587    }
2588
2589    /// Similar to "send" but does not shutdown the channel if an error occurs.
2590    pub fn send_no_shutdown_on_err(
2591        self,
2592        mut result: Result<(), CapabilityStoreError>,
2593    ) -> Result<(), fidl::Error> {
2594        let _result = self.send_raw(result);
2595        self.drop_without_shutdown();
2596        _result
2597    }
2598
2599    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
2600        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
2601            fidl::encoding::EmptyStruct,
2602            CapabilityStoreError,
2603        >>(
2604            fidl::encoding::FlexibleResult::new(result),
2605            self.tx_id,
2606            0x5d5d35d9c20a2184,
2607            fidl::encoding::DynamicFlags::FLEXIBLE,
2608        )
2609    }
2610}
2611
2612#[must_use = "FIDL methods require a response to be sent"]
2613#[derive(Debug)]
2614pub struct CapabilityStoreDropResponder {
2615    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
2616    tx_id: u32,
2617}
2618
2619/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
2620/// if the responder is dropped without sending a response, so that the client
2621/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2622impl std::ops::Drop for CapabilityStoreDropResponder {
2623    fn drop(&mut self) {
2624        self.control_handle.shutdown();
2625        // Safety: drops once, never accessed again
2626        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2627    }
2628}
2629
2630impl fdomain_client::fidl::Responder for CapabilityStoreDropResponder {
2631    type ControlHandle = CapabilityStoreControlHandle;
2632
2633    fn control_handle(&self) -> &CapabilityStoreControlHandle {
2634        &self.control_handle
2635    }
2636
2637    fn drop_without_shutdown(mut self) {
2638        // Safety: drops once, never accessed again due to mem::forget
2639        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2640        // Prevent Drop from running (which would shut down the channel)
2641        std::mem::forget(self);
2642    }
2643}
2644
2645impl CapabilityStoreDropResponder {
2646    /// Sends a response to the FIDL transaction.
2647    ///
2648    /// Sets the channel to shutdown if an error occurs.
2649    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
2650        let _result = self.send_raw(result);
2651        if _result.is_err() {
2652            self.control_handle.shutdown();
2653        }
2654        self.drop_without_shutdown();
2655        _result
2656    }
2657
2658    /// Similar to "send" but does not shutdown the channel if an error occurs.
2659    pub fn send_no_shutdown_on_err(
2660        self,
2661        mut result: Result<(), CapabilityStoreError>,
2662    ) -> Result<(), fidl::Error> {
2663        let _result = self.send_raw(result);
2664        self.drop_without_shutdown();
2665        _result
2666    }
2667
2668    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
2669        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
2670            fidl::encoding::EmptyStruct,
2671            CapabilityStoreError,
2672        >>(
2673            fidl::encoding::FlexibleResult::new(result),
2674            self.tx_id,
2675            0xa745c0990fc2559,
2676            fidl::encoding::DynamicFlags::FLEXIBLE,
2677        )
2678    }
2679}
2680
2681#[must_use = "FIDL methods require a response to be sent"]
2682#[derive(Debug)]
2683pub struct CapabilityStoreExportResponder {
2684    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
2685    tx_id: u32,
2686}
2687
2688/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
2689/// if the responder is dropped without sending a response, so that the client
2690/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2691impl std::ops::Drop for CapabilityStoreExportResponder {
2692    fn drop(&mut self) {
2693        self.control_handle.shutdown();
2694        // Safety: drops once, never accessed again
2695        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2696    }
2697}
2698
2699impl fdomain_client::fidl::Responder for CapabilityStoreExportResponder {
2700    type ControlHandle = CapabilityStoreControlHandle;
2701
2702    fn control_handle(&self) -> &CapabilityStoreControlHandle {
2703        &self.control_handle
2704    }
2705
2706    fn drop_without_shutdown(mut self) {
2707        // Safety: drops once, never accessed again due to mem::forget
2708        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2709        // Prevent Drop from running (which would shut down the channel)
2710        std::mem::forget(self);
2711    }
2712}
2713
2714impl CapabilityStoreExportResponder {
2715    /// Sends a response to the FIDL transaction.
2716    ///
2717    /// Sets the channel to shutdown if an error occurs.
2718    pub fn send(
2719        self,
2720        mut result: Result<Capability, CapabilityStoreError>,
2721    ) -> Result<(), fidl::Error> {
2722        let _result = self.send_raw(result);
2723        if _result.is_err() {
2724            self.control_handle.shutdown();
2725        }
2726        self.drop_without_shutdown();
2727        _result
2728    }
2729
2730    /// Similar to "send" but does not shutdown the channel if an error occurs.
2731    pub fn send_no_shutdown_on_err(
2732        self,
2733        mut result: Result<Capability, CapabilityStoreError>,
2734    ) -> Result<(), fidl::Error> {
2735        let _result = self.send_raw(result);
2736        self.drop_without_shutdown();
2737        _result
2738    }
2739
2740    fn send_raw(
2741        &self,
2742        mut result: Result<Capability, CapabilityStoreError>,
2743    ) -> Result<(), fidl::Error> {
2744        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
2745            CapabilityStoreExportResponse,
2746            CapabilityStoreError,
2747        >>(
2748            fidl::encoding::FlexibleResult::new(
2749                result.as_mut().map_err(|e| *e).map(|capability| (capability,)),
2750            ),
2751            self.tx_id,
2752            0x3237a8f4748faff,
2753            fidl::encoding::DynamicFlags::FLEXIBLE,
2754        )
2755    }
2756}
2757
2758#[must_use = "FIDL methods require a response to be sent"]
2759#[derive(Debug)]
2760pub struct CapabilityStoreImportResponder {
2761    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
2762    tx_id: u32,
2763}
2764
2765/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
2766/// if the responder is dropped without sending a response, so that the client
2767/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2768impl std::ops::Drop for CapabilityStoreImportResponder {
2769    fn drop(&mut self) {
2770        self.control_handle.shutdown();
2771        // Safety: drops once, never accessed again
2772        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2773    }
2774}
2775
2776impl fdomain_client::fidl::Responder for CapabilityStoreImportResponder {
2777    type ControlHandle = CapabilityStoreControlHandle;
2778
2779    fn control_handle(&self) -> &CapabilityStoreControlHandle {
2780        &self.control_handle
2781    }
2782
2783    fn drop_without_shutdown(mut self) {
2784        // Safety: drops once, never accessed again due to mem::forget
2785        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2786        // Prevent Drop from running (which would shut down the channel)
2787        std::mem::forget(self);
2788    }
2789}
2790
2791impl CapabilityStoreImportResponder {
2792    /// Sends a response to the FIDL transaction.
2793    ///
2794    /// Sets the channel to shutdown if an error occurs.
2795    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
2796        let _result = self.send_raw(result);
2797        if _result.is_err() {
2798            self.control_handle.shutdown();
2799        }
2800        self.drop_without_shutdown();
2801        _result
2802    }
2803
2804    /// Similar to "send" but does not shutdown the channel if an error occurs.
2805    pub fn send_no_shutdown_on_err(
2806        self,
2807        mut result: Result<(), CapabilityStoreError>,
2808    ) -> Result<(), fidl::Error> {
2809        let _result = self.send_raw(result);
2810        self.drop_without_shutdown();
2811        _result
2812    }
2813
2814    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
2815        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
2816            fidl::encoding::EmptyStruct,
2817            CapabilityStoreError,
2818        >>(
2819            fidl::encoding::FlexibleResult::new(result),
2820            self.tx_id,
2821            0x1f96157a29f4539b,
2822            fidl::encoding::DynamicFlags::FLEXIBLE,
2823        )
2824    }
2825}
2826
2827#[must_use = "FIDL methods require a response to be sent"]
2828#[derive(Debug)]
2829pub struct CapabilityStoreConnectorCreateResponder {
2830    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
2831    tx_id: u32,
2832}
2833
2834/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
2835/// if the responder is dropped without sending a response, so that the client
2836/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2837impl std::ops::Drop for CapabilityStoreConnectorCreateResponder {
2838    fn drop(&mut self) {
2839        self.control_handle.shutdown();
2840        // Safety: drops once, never accessed again
2841        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2842    }
2843}
2844
2845impl fdomain_client::fidl::Responder for CapabilityStoreConnectorCreateResponder {
2846    type ControlHandle = CapabilityStoreControlHandle;
2847
2848    fn control_handle(&self) -> &CapabilityStoreControlHandle {
2849        &self.control_handle
2850    }
2851
2852    fn drop_without_shutdown(mut self) {
2853        // Safety: drops once, never accessed again due to mem::forget
2854        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2855        // Prevent Drop from running (which would shut down the channel)
2856        std::mem::forget(self);
2857    }
2858}
2859
2860impl CapabilityStoreConnectorCreateResponder {
2861    /// Sends a response to the FIDL transaction.
2862    ///
2863    /// Sets the channel to shutdown if an error occurs.
2864    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
2865        let _result = self.send_raw(result);
2866        if _result.is_err() {
2867            self.control_handle.shutdown();
2868        }
2869        self.drop_without_shutdown();
2870        _result
2871    }
2872
2873    /// Similar to "send" but does not shutdown the channel if an error occurs.
2874    pub fn send_no_shutdown_on_err(
2875        self,
2876        mut result: Result<(), CapabilityStoreError>,
2877    ) -> Result<(), fidl::Error> {
2878        let _result = self.send_raw(result);
2879        self.drop_without_shutdown();
2880        _result
2881    }
2882
2883    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
2884        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
2885            fidl::encoding::EmptyStruct,
2886            CapabilityStoreError,
2887        >>(
2888            fidl::encoding::FlexibleResult::new(result),
2889            self.tx_id,
2890            0x29592c5d63e91c25,
2891            fidl::encoding::DynamicFlags::FLEXIBLE,
2892        )
2893    }
2894}
2895
2896#[must_use = "FIDL methods require a response to be sent"]
2897#[derive(Debug)]
2898pub struct CapabilityStoreConnectorOpenResponder {
2899    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
2900    tx_id: u32,
2901}
2902
2903/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
2904/// if the responder is dropped without sending a response, so that the client
2905/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2906impl std::ops::Drop for CapabilityStoreConnectorOpenResponder {
2907    fn drop(&mut self) {
2908        self.control_handle.shutdown();
2909        // Safety: drops once, never accessed again
2910        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2911    }
2912}
2913
2914impl fdomain_client::fidl::Responder for CapabilityStoreConnectorOpenResponder {
2915    type ControlHandle = CapabilityStoreControlHandle;
2916
2917    fn control_handle(&self) -> &CapabilityStoreControlHandle {
2918        &self.control_handle
2919    }
2920
2921    fn drop_without_shutdown(mut self) {
2922        // Safety: drops once, never accessed again due to mem::forget
2923        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2924        // Prevent Drop from running (which would shut down the channel)
2925        std::mem::forget(self);
2926    }
2927}
2928
2929impl CapabilityStoreConnectorOpenResponder {
2930    /// Sends a response to the FIDL transaction.
2931    ///
2932    /// Sets the channel to shutdown if an error occurs.
2933    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
2934        let _result = self.send_raw(result);
2935        if _result.is_err() {
2936            self.control_handle.shutdown();
2937        }
2938        self.drop_without_shutdown();
2939        _result
2940    }
2941
2942    /// Similar to "send" but does not shutdown the channel if an error occurs.
2943    pub fn send_no_shutdown_on_err(
2944        self,
2945        mut result: Result<(), CapabilityStoreError>,
2946    ) -> Result<(), fidl::Error> {
2947        let _result = self.send_raw(result);
2948        self.drop_without_shutdown();
2949        _result
2950    }
2951
2952    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
2953        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
2954            fidl::encoding::EmptyStruct,
2955            CapabilityStoreError,
2956        >>(
2957            fidl::encoding::FlexibleResult::new(result),
2958            self.tx_id,
2959            0x537e69ab40563b9f,
2960            fidl::encoding::DynamicFlags::FLEXIBLE,
2961        )
2962    }
2963}
2964
2965#[must_use = "FIDL methods require a response to be sent"]
2966#[derive(Debug)]
2967pub struct CapabilityStoreDirConnectorCreateResponder {
2968    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
2969    tx_id: u32,
2970}
2971
2972/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
2973/// if the responder is dropped without sending a response, so that the client
2974/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2975impl std::ops::Drop for CapabilityStoreDirConnectorCreateResponder {
2976    fn drop(&mut self) {
2977        self.control_handle.shutdown();
2978        // Safety: drops once, never accessed again
2979        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2980    }
2981}
2982
2983impl fdomain_client::fidl::Responder for CapabilityStoreDirConnectorCreateResponder {
2984    type ControlHandle = CapabilityStoreControlHandle;
2985
2986    fn control_handle(&self) -> &CapabilityStoreControlHandle {
2987        &self.control_handle
2988    }
2989
2990    fn drop_without_shutdown(mut self) {
2991        // Safety: drops once, never accessed again due to mem::forget
2992        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2993        // Prevent Drop from running (which would shut down the channel)
2994        std::mem::forget(self);
2995    }
2996}
2997
2998impl CapabilityStoreDirConnectorCreateResponder {
2999    /// Sends a response to the FIDL transaction.
3000    ///
3001    /// Sets the channel to shutdown if an error occurs.
3002    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3003        let _result = self.send_raw(result);
3004        if _result.is_err() {
3005            self.control_handle.shutdown();
3006        }
3007        self.drop_without_shutdown();
3008        _result
3009    }
3010
3011    /// Similar to "send" but does not shutdown the channel if an error occurs.
3012    pub fn send_no_shutdown_on_err(
3013        self,
3014        mut result: Result<(), CapabilityStoreError>,
3015    ) -> Result<(), fidl::Error> {
3016        let _result = self.send_raw(result);
3017        self.drop_without_shutdown();
3018        _result
3019    }
3020
3021    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3022        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3023            fidl::encoding::EmptyStruct,
3024            CapabilityStoreError,
3025        >>(
3026            fidl::encoding::FlexibleResult::new(result),
3027            self.tx_id,
3028            0x186138a11ccf19bb,
3029            fidl::encoding::DynamicFlags::FLEXIBLE,
3030        )
3031    }
3032}
3033
3034#[must_use = "FIDL methods require a response to be sent"]
3035#[derive(Debug)]
3036pub struct CapabilityStoreDirConnectorOpenResponder {
3037    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3038    tx_id: u32,
3039}
3040
3041/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3042/// if the responder is dropped without sending a response, so that the client
3043/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3044impl std::ops::Drop for CapabilityStoreDirConnectorOpenResponder {
3045    fn drop(&mut self) {
3046        self.control_handle.shutdown();
3047        // Safety: drops once, never accessed again
3048        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3049    }
3050}
3051
3052impl fdomain_client::fidl::Responder for CapabilityStoreDirConnectorOpenResponder {
3053    type ControlHandle = CapabilityStoreControlHandle;
3054
3055    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3056        &self.control_handle
3057    }
3058
3059    fn drop_without_shutdown(mut self) {
3060        // Safety: drops once, never accessed again due to mem::forget
3061        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3062        // Prevent Drop from running (which would shut down the channel)
3063        std::mem::forget(self);
3064    }
3065}
3066
3067impl CapabilityStoreDirConnectorOpenResponder {
3068    /// Sends a response to the FIDL transaction.
3069    ///
3070    /// Sets the channel to shutdown if an error occurs.
3071    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3072        let _result = self.send_raw(result);
3073        if _result.is_err() {
3074            self.control_handle.shutdown();
3075        }
3076        self.drop_without_shutdown();
3077        _result
3078    }
3079
3080    /// Similar to "send" but does not shutdown the channel if an error occurs.
3081    pub fn send_no_shutdown_on_err(
3082        self,
3083        mut result: Result<(), CapabilityStoreError>,
3084    ) -> Result<(), fidl::Error> {
3085        let _result = self.send_raw(result);
3086        self.drop_without_shutdown();
3087        _result
3088    }
3089
3090    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3091        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3092            fidl::encoding::EmptyStruct,
3093            CapabilityStoreError,
3094        >>(
3095            fidl::encoding::FlexibleResult::new(result),
3096            self.tx_id,
3097            0x5650d3d6a3a13901,
3098            fidl::encoding::DynamicFlags::FLEXIBLE,
3099        )
3100    }
3101}
3102
3103#[must_use = "FIDL methods require a response to be sent"]
3104#[derive(Debug)]
3105pub struct CapabilityStoreDictionaryCreateResponder {
3106    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3107    tx_id: u32,
3108}
3109
3110/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3111/// if the responder is dropped without sending a response, so that the client
3112/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3113impl std::ops::Drop for CapabilityStoreDictionaryCreateResponder {
3114    fn drop(&mut self) {
3115        self.control_handle.shutdown();
3116        // Safety: drops once, never accessed again
3117        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3118    }
3119}
3120
3121impl fdomain_client::fidl::Responder for CapabilityStoreDictionaryCreateResponder {
3122    type ControlHandle = CapabilityStoreControlHandle;
3123
3124    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3125        &self.control_handle
3126    }
3127
3128    fn drop_without_shutdown(mut self) {
3129        // Safety: drops once, never accessed again due to mem::forget
3130        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3131        // Prevent Drop from running (which would shut down the channel)
3132        std::mem::forget(self);
3133    }
3134}
3135
3136impl CapabilityStoreDictionaryCreateResponder {
3137    /// Sends a response to the FIDL transaction.
3138    ///
3139    /// Sets the channel to shutdown if an error occurs.
3140    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3141        let _result = self.send_raw(result);
3142        if _result.is_err() {
3143            self.control_handle.shutdown();
3144        }
3145        self.drop_without_shutdown();
3146        _result
3147    }
3148
3149    /// Similar to "send" but does not shutdown the channel if an error occurs.
3150    pub fn send_no_shutdown_on_err(
3151        self,
3152        mut result: Result<(), CapabilityStoreError>,
3153    ) -> Result<(), fidl::Error> {
3154        let _result = self.send_raw(result);
3155        self.drop_without_shutdown();
3156        _result
3157    }
3158
3159    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3160        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3161            fidl::encoding::EmptyStruct,
3162            CapabilityStoreError,
3163        >>(
3164            fidl::encoding::FlexibleResult::new(result),
3165            self.tx_id,
3166            0x6997c8dfc63de093,
3167            fidl::encoding::DynamicFlags::FLEXIBLE,
3168        )
3169    }
3170}
3171
3172#[must_use = "FIDL methods require a response to be sent"]
3173#[derive(Debug)]
3174pub struct CapabilityStoreDictionaryLegacyImportResponder {
3175    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3176    tx_id: u32,
3177}
3178
3179/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3180/// if the responder is dropped without sending a response, so that the client
3181/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3182impl std::ops::Drop for CapabilityStoreDictionaryLegacyImportResponder {
3183    fn drop(&mut self) {
3184        self.control_handle.shutdown();
3185        // Safety: drops once, never accessed again
3186        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3187    }
3188}
3189
3190impl fdomain_client::fidl::Responder for CapabilityStoreDictionaryLegacyImportResponder {
3191    type ControlHandle = CapabilityStoreControlHandle;
3192
3193    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3194        &self.control_handle
3195    }
3196
3197    fn drop_without_shutdown(mut self) {
3198        // Safety: drops once, never accessed again due to mem::forget
3199        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3200        // Prevent Drop from running (which would shut down the channel)
3201        std::mem::forget(self);
3202    }
3203}
3204
3205impl CapabilityStoreDictionaryLegacyImportResponder {
3206    /// Sends a response to the FIDL transaction.
3207    ///
3208    /// Sets the channel to shutdown if an error occurs.
3209    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3210        let _result = self.send_raw(result);
3211        if _result.is_err() {
3212            self.control_handle.shutdown();
3213        }
3214        self.drop_without_shutdown();
3215        _result
3216    }
3217
3218    /// Similar to "send" but does not shutdown the channel if an error occurs.
3219    pub fn send_no_shutdown_on_err(
3220        self,
3221        mut result: Result<(), CapabilityStoreError>,
3222    ) -> Result<(), fidl::Error> {
3223        let _result = self.send_raw(result);
3224        self.drop_without_shutdown();
3225        _result
3226    }
3227
3228    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3229        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3230            fidl::encoding::EmptyStruct,
3231            CapabilityStoreError,
3232        >>(
3233            fidl::encoding::FlexibleResult::new(result),
3234            self.tx_id,
3235            0x72fd686c37b6025f,
3236            fidl::encoding::DynamicFlags::FLEXIBLE,
3237        )
3238    }
3239}
3240
3241#[must_use = "FIDL methods require a response to be sent"]
3242#[derive(Debug)]
3243pub struct CapabilityStoreDictionaryLegacyExportResponder {
3244    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3245    tx_id: u32,
3246}
3247
3248/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3249/// if the responder is dropped without sending a response, so that the client
3250/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3251impl std::ops::Drop for CapabilityStoreDictionaryLegacyExportResponder {
3252    fn drop(&mut self) {
3253        self.control_handle.shutdown();
3254        // Safety: drops once, never accessed again
3255        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3256    }
3257}
3258
3259impl fdomain_client::fidl::Responder for CapabilityStoreDictionaryLegacyExportResponder {
3260    type ControlHandle = CapabilityStoreControlHandle;
3261
3262    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3263        &self.control_handle
3264    }
3265
3266    fn drop_without_shutdown(mut self) {
3267        // Safety: drops once, never accessed again due to mem::forget
3268        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3269        // Prevent Drop from running (which would shut down the channel)
3270        std::mem::forget(self);
3271    }
3272}
3273
3274impl CapabilityStoreDictionaryLegacyExportResponder {
3275    /// Sends a response to the FIDL transaction.
3276    ///
3277    /// Sets the channel to shutdown if an error occurs.
3278    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3279        let _result = self.send_raw(result);
3280        if _result.is_err() {
3281            self.control_handle.shutdown();
3282        }
3283        self.drop_without_shutdown();
3284        _result
3285    }
3286
3287    /// Similar to "send" but does not shutdown the channel if an error occurs.
3288    pub fn send_no_shutdown_on_err(
3289        self,
3290        mut result: Result<(), CapabilityStoreError>,
3291    ) -> Result<(), fidl::Error> {
3292        let _result = self.send_raw(result);
3293        self.drop_without_shutdown();
3294        _result
3295    }
3296
3297    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3298        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3299            fidl::encoding::EmptyStruct,
3300            CapabilityStoreError,
3301        >>(
3302            fidl::encoding::FlexibleResult::new(result),
3303            self.tx_id,
3304            0x407e15cc4bde5dcd,
3305            fidl::encoding::DynamicFlags::FLEXIBLE,
3306        )
3307    }
3308}
3309
3310#[must_use = "FIDL methods require a response to be sent"]
3311#[derive(Debug)]
3312pub struct CapabilityStoreDictionaryInsertResponder {
3313    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3314    tx_id: u32,
3315}
3316
3317/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3318/// if the responder is dropped without sending a response, so that the client
3319/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3320impl std::ops::Drop for CapabilityStoreDictionaryInsertResponder {
3321    fn drop(&mut self) {
3322        self.control_handle.shutdown();
3323        // Safety: drops once, never accessed again
3324        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3325    }
3326}
3327
3328impl fdomain_client::fidl::Responder for CapabilityStoreDictionaryInsertResponder {
3329    type ControlHandle = CapabilityStoreControlHandle;
3330
3331    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3332        &self.control_handle
3333    }
3334
3335    fn drop_without_shutdown(mut self) {
3336        // Safety: drops once, never accessed again due to mem::forget
3337        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3338        // Prevent Drop from running (which would shut down the channel)
3339        std::mem::forget(self);
3340    }
3341}
3342
3343impl CapabilityStoreDictionaryInsertResponder {
3344    /// Sends a response to the FIDL transaction.
3345    ///
3346    /// Sets the channel to shutdown if an error occurs.
3347    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3348        let _result = self.send_raw(result);
3349        if _result.is_err() {
3350            self.control_handle.shutdown();
3351        }
3352        self.drop_without_shutdown();
3353        _result
3354    }
3355
3356    /// Similar to "send" but does not shutdown the channel if an error occurs.
3357    pub fn send_no_shutdown_on_err(
3358        self,
3359        mut result: Result<(), CapabilityStoreError>,
3360    ) -> Result<(), fidl::Error> {
3361        let _result = self.send_raw(result);
3362        self.drop_without_shutdown();
3363        _result
3364    }
3365
3366    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3367        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3368            fidl::encoding::EmptyStruct,
3369            CapabilityStoreError,
3370        >>(
3371            fidl::encoding::FlexibleResult::new(result),
3372            self.tx_id,
3373            0x7702183689d44c27,
3374            fidl::encoding::DynamicFlags::FLEXIBLE,
3375        )
3376    }
3377}
3378
3379#[must_use = "FIDL methods require a response to be sent"]
3380#[derive(Debug)]
3381pub struct CapabilityStoreDictionaryGetResponder {
3382    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3383    tx_id: u32,
3384}
3385
3386/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3387/// if the responder is dropped without sending a response, so that the client
3388/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3389impl std::ops::Drop for CapabilityStoreDictionaryGetResponder {
3390    fn drop(&mut self) {
3391        self.control_handle.shutdown();
3392        // Safety: drops once, never accessed again
3393        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3394    }
3395}
3396
3397impl fdomain_client::fidl::Responder for CapabilityStoreDictionaryGetResponder {
3398    type ControlHandle = CapabilityStoreControlHandle;
3399
3400    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3401        &self.control_handle
3402    }
3403
3404    fn drop_without_shutdown(mut self) {
3405        // Safety: drops once, never accessed again due to mem::forget
3406        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3407        // Prevent Drop from running (which would shut down the channel)
3408        std::mem::forget(self);
3409    }
3410}
3411
3412impl CapabilityStoreDictionaryGetResponder {
3413    /// Sends a response to the FIDL transaction.
3414    ///
3415    /// Sets the channel to shutdown if an error occurs.
3416    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3417        let _result = self.send_raw(result);
3418        if _result.is_err() {
3419            self.control_handle.shutdown();
3420        }
3421        self.drop_without_shutdown();
3422        _result
3423    }
3424
3425    /// Similar to "send" but does not shutdown the channel if an error occurs.
3426    pub fn send_no_shutdown_on_err(
3427        self,
3428        mut result: Result<(), CapabilityStoreError>,
3429    ) -> Result<(), fidl::Error> {
3430        let _result = self.send_raw(result);
3431        self.drop_without_shutdown();
3432        _result
3433    }
3434
3435    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3436        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3437            fidl::encoding::EmptyStruct,
3438            CapabilityStoreError,
3439        >>(
3440            fidl::encoding::FlexibleResult::new(result),
3441            self.tx_id,
3442            0x4d9e27538284add2,
3443            fidl::encoding::DynamicFlags::FLEXIBLE,
3444        )
3445    }
3446}
3447
3448#[must_use = "FIDL methods require a response to be sent"]
3449#[derive(Debug)]
3450pub struct CapabilityStoreDictionaryRemoveResponder {
3451    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3452    tx_id: u32,
3453}
3454
3455/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3456/// if the responder is dropped without sending a response, so that the client
3457/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3458impl std::ops::Drop for CapabilityStoreDictionaryRemoveResponder {
3459    fn drop(&mut self) {
3460        self.control_handle.shutdown();
3461        // Safety: drops once, never accessed again
3462        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3463    }
3464}
3465
3466impl fdomain_client::fidl::Responder for CapabilityStoreDictionaryRemoveResponder {
3467    type ControlHandle = CapabilityStoreControlHandle;
3468
3469    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3470        &self.control_handle
3471    }
3472
3473    fn drop_without_shutdown(mut self) {
3474        // Safety: drops once, never accessed again due to mem::forget
3475        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3476        // Prevent Drop from running (which would shut down the channel)
3477        std::mem::forget(self);
3478    }
3479}
3480
3481impl CapabilityStoreDictionaryRemoveResponder {
3482    /// Sends a response to the FIDL transaction.
3483    ///
3484    /// Sets the channel to shutdown if an error occurs.
3485    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3486        let _result = self.send_raw(result);
3487        if _result.is_err() {
3488            self.control_handle.shutdown();
3489        }
3490        self.drop_without_shutdown();
3491        _result
3492    }
3493
3494    /// Similar to "send" but does not shutdown the channel if an error occurs.
3495    pub fn send_no_shutdown_on_err(
3496        self,
3497        mut result: Result<(), CapabilityStoreError>,
3498    ) -> Result<(), fidl::Error> {
3499        let _result = self.send_raw(result);
3500        self.drop_without_shutdown();
3501        _result
3502    }
3503
3504    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3505        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3506            fidl::encoding::EmptyStruct,
3507            CapabilityStoreError,
3508        >>(
3509            fidl::encoding::FlexibleResult::new(result),
3510            self.tx_id,
3511            0x4c5c025ab05d4f3,
3512            fidl::encoding::DynamicFlags::FLEXIBLE,
3513        )
3514    }
3515}
3516
3517#[must_use = "FIDL methods require a response to be sent"]
3518#[derive(Debug)]
3519pub struct CapabilityStoreDictionaryCopyResponder {
3520    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3521    tx_id: u32,
3522}
3523
3524/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3525/// if the responder is dropped without sending a response, so that the client
3526/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3527impl std::ops::Drop for CapabilityStoreDictionaryCopyResponder {
3528    fn drop(&mut self) {
3529        self.control_handle.shutdown();
3530        // Safety: drops once, never accessed again
3531        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3532    }
3533}
3534
3535impl fdomain_client::fidl::Responder for CapabilityStoreDictionaryCopyResponder {
3536    type ControlHandle = CapabilityStoreControlHandle;
3537
3538    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3539        &self.control_handle
3540    }
3541
3542    fn drop_without_shutdown(mut self) {
3543        // Safety: drops once, never accessed again due to mem::forget
3544        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3545        // Prevent Drop from running (which would shut down the channel)
3546        std::mem::forget(self);
3547    }
3548}
3549
3550impl CapabilityStoreDictionaryCopyResponder {
3551    /// Sends a response to the FIDL transaction.
3552    ///
3553    /// Sets the channel to shutdown if an error occurs.
3554    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3555        let _result = self.send_raw(result);
3556        if _result.is_err() {
3557            self.control_handle.shutdown();
3558        }
3559        self.drop_without_shutdown();
3560        _result
3561    }
3562
3563    /// Similar to "send" but does not shutdown the channel if an error occurs.
3564    pub fn send_no_shutdown_on_err(
3565        self,
3566        mut result: Result<(), CapabilityStoreError>,
3567    ) -> Result<(), fidl::Error> {
3568        let _result = self.send_raw(result);
3569        self.drop_without_shutdown();
3570        _result
3571    }
3572
3573    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3574        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3575            fidl::encoding::EmptyStruct,
3576            CapabilityStoreError,
3577        >>(
3578            fidl::encoding::FlexibleResult::new(result),
3579            self.tx_id,
3580            0x3733ecdf4ea1b44f,
3581            fidl::encoding::DynamicFlags::FLEXIBLE,
3582        )
3583    }
3584}
3585
3586#[must_use = "FIDL methods require a response to be sent"]
3587#[derive(Debug)]
3588pub struct CapabilityStoreDictionaryKeysResponder {
3589    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3590    tx_id: u32,
3591}
3592
3593/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3594/// if the responder is dropped without sending a response, so that the client
3595/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3596impl std::ops::Drop for CapabilityStoreDictionaryKeysResponder {
3597    fn drop(&mut self) {
3598        self.control_handle.shutdown();
3599        // Safety: drops once, never accessed again
3600        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3601    }
3602}
3603
3604impl fdomain_client::fidl::Responder for CapabilityStoreDictionaryKeysResponder {
3605    type ControlHandle = CapabilityStoreControlHandle;
3606
3607    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3608        &self.control_handle
3609    }
3610
3611    fn drop_without_shutdown(mut self) {
3612        // Safety: drops once, never accessed again due to mem::forget
3613        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3614        // Prevent Drop from running (which would shut down the channel)
3615        std::mem::forget(self);
3616    }
3617}
3618
3619impl CapabilityStoreDictionaryKeysResponder {
3620    /// Sends a response to the FIDL transaction.
3621    ///
3622    /// Sets the channel to shutdown if an error occurs.
3623    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3624        let _result = self.send_raw(result);
3625        if _result.is_err() {
3626            self.control_handle.shutdown();
3627        }
3628        self.drop_without_shutdown();
3629        _result
3630    }
3631
3632    /// Similar to "send" but does not shutdown the channel if an error occurs.
3633    pub fn send_no_shutdown_on_err(
3634        self,
3635        mut result: Result<(), CapabilityStoreError>,
3636    ) -> Result<(), fidl::Error> {
3637        let _result = self.send_raw(result);
3638        self.drop_without_shutdown();
3639        _result
3640    }
3641
3642    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3643        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3644            fidl::encoding::EmptyStruct,
3645            CapabilityStoreError,
3646        >>(
3647            fidl::encoding::FlexibleResult::new(result),
3648            self.tx_id,
3649            0x84b05577ceaec9e,
3650            fidl::encoding::DynamicFlags::FLEXIBLE,
3651        )
3652    }
3653}
3654
3655#[must_use = "FIDL methods require a response to be sent"]
3656#[derive(Debug)]
3657pub struct CapabilityStoreDictionaryEnumerateResponder {
3658    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3659    tx_id: u32,
3660}
3661
3662/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3663/// if the responder is dropped without sending a response, so that the client
3664/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3665impl std::ops::Drop for CapabilityStoreDictionaryEnumerateResponder {
3666    fn drop(&mut self) {
3667        self.control_handle.shutdown();
3668        // Safety: drops once, never accessed again
3669        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3670    }
3671}
3672
3673impl fdomain_client::fidl::Responder for CapabilityStoreDictionaryEnumerateResponder {
3674    type ControlHandle = CapabilityStoreControlHandle;
3675
3676    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3677        &self.control_handle
3678    }
3679
3680    fn drop_without_shutdown(mut self) {
3681        // Safety: drops once, never accessed again due to mem::forget
3682        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3683        // Prevent Drop from running (which would shut down the channel)
3684        std::mem::forget(self);
3685    }
3686}
3687
3688impl CapabilityStoreDictionaryEnumerateResponder {
3689    /// Sends a response to the FIDL transaction.
3690    ///
3691    /// Sets the channel to shutdown if an error occurs.
3692    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3693        let _result = self.send_raw(result);
3694        if _result.is_err() {
3695            self.control_handle.shutdown();
3696        }
3697        self.drop_without_shutdown();
3698        _result
3699    }
3700
3701    /// Similar to "send" but does not shutdown the channel if an error occurs.
3702    pub fn send_no_shutdown_on_err(
3703        self,
3704        mut result: Result<(), CapabilityStoreError>,
3705    ) -> Result<(), fidl::Error> {
3706        let _result = self.send_raw(result);
3707        self.drop_without_shutdown();
3708        _result
3709    }
3710
3711    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3712        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3713            fidl::encoding::EmptyStruct,
3714            CapabilityStoreError,
3715        >>(
3716            fidl::encoding::FlexibleResult::new(result),
3717            self.tx_id,
3718            0xd6279b6ced04641,
3719            fidl::encoding::DynamicFlags::FLEXIBLE,
3720        )
3721    }
3722}
3723
3724#[must_use = "FIDL methods require a response to be sent"]
3725#[derive(Debug)]
3726pub struct CapabilityStoreDictionaryDrainResponder {
3727    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3728    tx_id: u32,
3729}
3730
3731/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3732/// if the responder is dropped without sending a response, so that the client
3733/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3734impl std::ops::Drop for CapabilityStoreDictionaryDrainResponder {
3735    fn drop(&mut self) {
3736        self.control_handle.shutdown();
3737        // Safety: drops once, never accessed again
3738        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3739    }
3740}
3741
3742impl fdomain_client::fidl::Responder for CapabilityStoreDictionaryDrainResponder {
3743    type ControlHandle = CapabilityStoreControlHandle;
3744
3745    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3746        &self.control_handle
3747    }
3748
3749    fn drop_without_shutdown(mut self) {
3750        // Safety: drops once, never accessed again due to mem::forget
3751        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3752        // Prevent Drop from running (which would shut down the channel)
3753        std::mem::forget(self);
3754    }
3755}
3756
3757impl CapabilityStoreDictionaryDrainResponder {
3758    /// Sends a response to the FIDL transaction.
3759    ///
3760    /// Sets the channel to shutdown if an error occurs.
3761    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3762        let _result = self.send_raw(result);
3763        if _result.is_err() {
3764            self.control_handle.shutdown();
3765        }
3766        self.drop_without_shutdown();
3767        _result
3768    }
3769
3770    /// Similar to "send" but does not shutdown the channel if an error occurs.
3771    pub fn send_no_shutdown_on_err(
3772        self,
3773        mut result: Result<(), CapabilityStoreError>,
3774    ) -> Result<(), fidl::Error> {
3775        let _result = self.send_raw(result);
3776        self.drop_without_shutdown();
3777        _result
3778    }
3779
3780    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3781        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3782            fidl::encoding::EmptyStruct,
3783            CapabilityStoreError,
3784        >>(
3785            fidl::encoding::FlexibleResult::new(result),
3786            self.tx_id,
3787            0x28a3a3f84d928cd8,
3788            fidl::encoding::DynamicFlags::FLEXIBLE,
3789        )
3790    }
3791}
3792
3793#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3794pub struct ConnectorRouterMarker;
3795
3796impl fdomain_client::fidl::ProtocolMarker for ConnectorRouterMarker {
3797    type Proxy = ConnectorRouterProxy;
3798    type RequestStream = ConnectorRouterRequestStream;
3799
3800    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.ConnectorRouter";
3801}
3802impl fdomain_client::fidl::DiscoverableProtocolMarker for ConnectorRouterMarker {}
3803pub type ConnectorRouterRouteResult = Result<ConnectorRouterRouteResponse, RouterError>;
3804
3805pub trait ConnectorRouterProxyInterface: Send + Sync {
3806    type RouteResponseFut: std::future::Future<Output = Result<ConnectorRouterRouteResult, fidl::Error>>
3807        + Send;
3808    fn r#route(&self, payload: RouteRequest) -> Self::RouteResponseFut;
3809}
3810
3811#[derive(Debug, Clone)]
3812pub struct ConnectorRouterProxy {
3813    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
3814}
3815
3816impl fdomain_client::fidl::Proxy for ConnectorRouterProxy {
3817    type Protocol = ConnectorRouterMarker;
3818
3819    fn from_channel(inner: fdomain_client::Channel) -> Self {
3820        Self::new(inner)
3821    }
3822
3823    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
3824        self.client.into_channel().map_err(|client| Self { client })
3825    }
3826
3827    fn as_channel(&self) -> &fdomain_client::Channel {
3828        self.client.as_channel()
3829    }
3830}
3831
3832impl ConnectorRouterProxy {
3833    /// Create a new Proxy for fuchsia.component.sandbox/ConnectorRouter.
3834    pub fn new(channel: fdomain_client::Channel) -> Self {
3835        let protocol_name =
3836            <ConnectorRouterMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
3837        Self { client: fidl::client::Client::new(channel, protocol_name) }
3838    }
3839
3840    /// Get a Stream of events from the remote end of the protocol.
3841    ///
3842    /// # Panics
3843    ///
3844    /// Panics if the event stream was already taken.
3845    pub fn take_event_stream(&self) -> ConnectorRouterEventStream {
3846        ConnectorRouterEventStream { event_receiver: self.client.take_event_receiver() }
3847    }
3848
3849    pub fn r#route(
3850        &self,
3851        mut payload: RouteRequest,
3852    ) -> fidl::client::QueryResponseFut<
3853        ConnectorRouterRouteResult,
3854        fdomain_client::fidl::FDomainResourceDialect,
3855    > {
3856        ConnectorRouterProxyInterface::r#route(self, payload)
3857    }
3858}
3859
3860impl ConnectorRouterProxyInterface for ConnectorRouterProxy {
3861    type RouteResponseFut = fidl::client::QueryResponseFut<
3862        ConnectorRouterRouteResult,
3863        fdomain_client::fidl::FDomainResourceDialect,
3864    >;
3865    fn r#route(&self, mut payload: RouteRequest) -> Self::RouteResponseFut {
3866        fn _decode(
3867            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3868        ) -> Result<ConnectorRouterRouteResult, fidl::Error> {
3869            let _response = fidl::client::decode_transaction_body::<
3870                fidl::encoding::FlexibleResultType<ConnectorRouterRouteResponse, RouterError>,
3871                fdomain_client::fidl::FDomainResourceDialect,
3872                0x74dbb8bc13730766,
3873            >(_buf?)?
3874            .into_result_fdomain::<ConnectorRouterMarker>("route")?;
3875            Ok(_response.map(|x| x))
3876        }
3877        self.client.send_query_and_decode::<RouteRequest, ConnectorRouterRouteResult>(
3878            &mut payload,
3879            0x74dbb8bc13730766,
3880            fidl::encoding::DynamicFlags::FLEXIBLE,
3881            _decode,
3882        )
3883    }
3884}
3885
3886pub struct ConnectorRouterEventStream {
3887    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
3888}
3889
3890impl std::marker::Unpin for ConnectorRouterEventStream {}
3891
3892impl futures::stream::FusedStream for ConnectorRouterEventStream {
3893    fn is_terminated(&self) -> bool {
3894        self.event_receiver.is_terminated()
3895    }
3896}
3897
3898impl futures::Stream for ConnectorRouterEventStream {
3899    type Item = Result<ConnectorRouterEvent, fidl::Error>;
3900
3901    fn poll_next(
3902        mut self: std::pin::Pin<&mut Self>,
3903        cx: &mut std::task::Context<'_>,
3904    ) -> std::task::Poll<Option<Self::Item>> {
3905        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3906            &mut self.event_receiver,
3907            cx
3908        )?) {
3909            Some(buf) => std::task::Poll::Ready(Some(ConnectorRouterEvent::decode(buf))),
3910            None => std::task::Poll::Ready(None),
3911        }
3912    }
3913}
3914
3915#[derive(Debug)]
3916pub enum ConnectorRouterEvent {
3917    #[non_exhaustive]
3918    _UnknownEvent {
3919        /// Ordinal of the event that was sent.
3920        ordinal: u64,
3921    },
3922}
3923
3924impl ConnectorRouterEvent {
3925    /// Decodes a message buffer as a [`ConnectorRouterEvent`].
3926    fn decode(
3927        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3928    ) -> Result<ConnectorRouterEvent, fidl::Error> {
3929        let (bytes, _handles) = buf.split_mut();
3930        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3931        debug_assert_eq!(tx_header.tx_id, 0);
3932        match tx_header.ordinal {
3933            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
3934                Ok(ConnectorRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
3935            }
3936            _ => Err(fidl::Error::UnknownOrdinal {
3937                ordinal: tx_header.ordinal,
3938                protocol_name:
3939                    <ConnectorRouterMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
3940            }),
3941        }
3942    }
3943}
3944
3945/// A Stream of incoming requests for fuchsia.component.sandbox/ConnectorRouter.
3946pub struct ConnectorRouterRequestStream {
3947    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
3948    is_terminated: bool,
3949}
3950
3951impl std::marker::Unpin for ConnectorRouterRequestStream {}
3952
3953impl futures::stream::FusedStream for ConnectorRouterRequestStream {
3954    fn is_terminated(&self) -> bool {
3955        self.is_terminated
3956    }
3957}
3958
3959impl fdomain_client::fidl::RequestStream for ConnectorRouterRequestStream {
3960    type Protocol = ConnectorRouterMarker;
3961    type ControlHandle = ConnectorRouterControlHandle;
3962
3963    fn from_channel(channel: fdomain_client::Channel) -> Self {
3964        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3965    }
3966
3967    fn control_handle(&self) -> Self::ControlHandle {
3968        ConnectorRouterControlHandle { inner: self.inner.clone() }
3969    }
3970
3971    fn into_inner(
3972        self,
3973    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
3974    {
3975        (self.inner, self.is_terminated)
3976    }
3977
3978    fn from_inner(
3979        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
3980        is_terminated: bool,
3981    ) -> Self {
3982        Self { inner, is_terminated }
3983    }
3984}
3985
3986impl futures::Stream for ConnectorRouterRequestStream {
3987    type Item = Result<ConnectorRouterRequest, fidl::Error>;
3988
3989    fn poll_next(
3990        mut self: std::pin::Pin<&mut Self>,
3991        cx: &mut std::task::Context<'_>,
3992    ) -> std::task::Poll<Option<Self::Item>> {
3993        let this = &mut *self;
3994        if this.inner.check_shutdown(cx) {
3995            this.is_terminated = true;
3996            return std::task::Poll::Ready(None);
3997        }
3998        if this.is_terminated {
3999            panic!("polled ConnectorRouterRequestStream after completion");
4000        }
4001        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
4002            |bytes, handles| {
4003                match this.inner.channel().read_etc(cx, bytes, handles) {
4004                    std::task::Poll::Ready(Ok(())) => {}
4005                    std::task::Poll::Pending => return std::task::Poll::Pending,
4006                    std::task::Poll::Ready(Err(None)) => {
4007                        this.is_terminated = true;
4008                        return std::task::Poll::Ready(None);
4009                    }
4010                    std::task::Poll::Ready(Err(Some(e))) => {
4011                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4012                            e.into(),
4013                        ))))
4014                    }
4015                }
4016
4017                // A message has been received from the channel
4018                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4019
4020                std::task::Poll::Ready(Some(match header.ordinal {
4021                0x74dbb8bc13730766 => {
4022                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4023                    let mut req = fidl::new_empty!(RouteRequest, fdomain_client::fidl::FDomainResourceDialect);
4024                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<RouteRequest>(&header, _body_bytes, handles, &mut req)?;
4025                    let control_handle = ConnectorRouterControlHandle {
4026                        inner: this.inner.clone(),
4027                    };
4028                    Ok(ConnectorRouterRequest::Route {payload: req,
4029                        responder: ConnectorRouterRouteResponder {
4030                            control_handle: std::mem::ManuallyDrop::new(control_handle),
4031                            tx_id: header.tx_id,
4032                        },
4033                    })
4034                }
4035                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4036                    Ok(ConnectorRouterRequest::_UnknownMethod {
4037                        ordinal: header.ordinal,
4038                        control_handle: ConnectorRouterControlHandle { inner: this.inner.clone() },
4039                        method_type: fidl::MethodType::OneWay,
4040                    })
4041                }
4042                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4043                    this.inner.send_framework_err(
4044                        fidl::encoding::FrameworkErr::UnknownMethod,
4045                        header.tx_id,
4046                        header.ordinal,
4047                        header.dynamic_flags(),
4048                        (bytes, handles),
4049                    )?;
4050                    Ok(ConnectorRouterRequest::_UnknownMethod {
4051                        ordinal: header.ordinal,
4052                        control_handle: ConnectorRouterControlHandle { inner: this.inner.clone() },
4053                        method_type: fidl::MethodType::TwoWay,
4054                    })
4055                }
4056                _ => Err(fidl::Error::UnknownOrdinal {
4057                    ordinal: header.ordinal,
4058                    protocol_name: <ConnectorRouterMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
4059                }),
4060            }))
4061            },
4062        )
4063    }
4064}
4065
4066#[derive(Debug)]
4067pub enum ConnectorRouterRequest {
4068    Route {
4069        payload: RouteRequest,
4070        responder: ConnectorRouterRouteResponder,
4071    },
4072    /// An interaction was received which does not match any known method.
4073    #[non_exhaustive]
4074    _UnknownMethod {
4075        /// Ordinal of the method that was called.
4076        ordinal: u64,
4077        control_handle: ConnectorRouterControlHandle,
4078        method_type: fidl::MethodType,
4079    },
4080}
4081
4082impl ConnectorRouterRequest {
4083    #[allow(irrefutable_let_patterns)]
4084    pub fn into_route(self) -> Option<(RouteRequest, ConnectorRouterRouteResponder)> {
4085        if let ConnectorRouterRequest::Route { payload, responder } = self {
4086            Some((payload, responder))
4087        } else {
4088            None
4089        }
4090    }
4091
4092    /// Name of the method defined in FIDL
4093    pub fn method_name(&self) -> &'static str {
4094        match *self {
4095            ConnectorRouterRequest::Route { .. } => "route",
4096            ConnectorRouterRequest::_UnknownMethod {
4097                method_type: fidl::MethodType::OneWay,
4098                ..
4099            } => "unknown one-way method",
4100            ConnectorRouterRequest::_UnknownMethod {
4101                method_type: fidl::MethodType::TwoWay,
4102                ..
4103            } => "unknown two-way method",
4104        }
4105    }
4106}
4107
4108#[derive(Debug, Clone)]
4109pub struct ConnectorRouterControlHandle {
4110    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
4111}
4112
4113impl fdomain_client::fidl::ControlHandle for ConnectorRouterControlHandle {
4114    fn shutdown(&self) {
4115        self.inner.shutdown()
4116    }
4117
4118    fn is_closed(&self) -> bool {
4119        self.inner.channel().is_closed()
4120    }
4121    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
4122        self.inner.channel().on_closed()
4123    }
4124}
4125
4126impl ConnectorRouterControlHandle {}
4127
4128#[must_use = "FIDL methods require a response to be sent"]
4129#[derive(Debug)]
4130pub struct ConnectorRouterRouteResponder {
4131    control_handle: std::mem::ManuallyDrop<ConnectorRouterControlHandle>,
4132    tx_id: u32,
4133}
4134
4135/// Set the the channel to be shutdown (see [`ConnectorRouterControlHandle::shutdown`])
4136/// if the responder is dropped without sending a response, so that the client
4137/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4138impl std::ops::Drop for ConnectorRouterRouteResponder {
4139    fn drop(&mut self) {
4140        self.control_handle.shutdown();
4141        // Safety: drops once, never accessed again
4142        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4143    }
4144}
4145
4146impl fdomain_client::fidl::Responder for ConnectorRouterRouteResponder {
4147    type ControlHandle = ConnectorRouterControlHandle;
4148
4149    fn control_handle(&self) -> &ConnectorRouterControlHandle {
4150        &self.control_handle
4151    }
4152
4153    fn drop_without_shutdown(mut self) {
4154        // Safety: drops once, never accessed again due to mem::forget
4155        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4156        // Prevent Drop from running (which would shut down the channel)
4157        std::mem::forget(self);
4158    }
4159}
4160
4161impl ConnectorRouterRouteResponder {
4162    /// Sends a response to the FIDL transaction.
4163    ///
4164    /// Sets the channel to shutdown if an error occurs.
4165    pub fn send(
4166        self,
4167        mut result: Result<ConnectorRouterRouteResponse, RouterError>,
4168    ) -> Result<(), fidl::Error> {
4169        let _result = self.send_raw(result);
4170        if _result.is_err() {
4171            self.control_handle.shutdown();
4172        }
4173        self.drop_without_shutdown();
4174        _result
4175    }
4176
4177    /// Similar to "send" but does not shutdown the channel if an error occurs.
4178    pub fn send_no_shutdown_on_err(
4179        self,
4180        mut result: Result<ConnectorRouterRouteResponse, RouterError>,
4181    ) -> Result<(), fidl::Error> {
4182        let _result = self.send_raw(result);
4183        self.drop_without_shutdown();
4184        _result
4185    }
4186
4187    fn send_raw(
4188        &self,
4189        mut result: Result<ConnectorRouterRouteResponse, RouterError>,
4190    ) -> Result<(), fidl::Error> {
4191        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4192            ConnectorRouterRouteResponse,
4193            RouterError,
4194        >>(
4195            fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
4196            self.tx_id,
4197            0x74dbb8bc13730766,
4198            fidl::encoding::DynamicFlags::FLEXIBLE,
4199        )
4200    }
4201}
4202
4203#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4204pub struct DataRouterMarker;
4205
4206impl fdomain_client::fidl::ProtocolMarker for DataRouterMarker {
4207    type Proxy = DataRouterProxy;
4208    type RequestStream = DataRouterRequestStream;
4209
4210    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.DataRouter";
4211}
4212impl fdomain_client::fidl::DiscoverableProtocolMarker for DataRouterMarker {}
4213pub type DataRouterRouteResult = Result<DataRouterRouteResponse, RouterError>;
4214
4215pub trait DataRouterProxyInterface: Send + Sync {
4216    type RouteResponseFut: std::future::Future<Output = Result<DataRouterRouteResult, fidl::Error>>
4217        + Send;
4218    fn r#route(&self, payload: RouteRequest) -> Self::RouteResponseFut;
4219}
4220
4221#[derive(Debug, Clone)]
4222pub struct DataRouterProxy {
4223    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
4224}
4225
4226impl fdomain_client::fidl::Proxy for DataRouterProxy {
4227    type Protocol = DataRouterMarker;
4228
4229    fn from_channel(inner: fdomain_client::Channel) -> Self {
4230        Self::new(inner)
4231    }
4232
4233    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
4234        self.client.into_channel().map_err(|client| Self { client })
4235    }
4236
4237    fn as_channel(&self) -> &fdomain_client::Channel {
4238        self.client.as_channel()
4239    }
4240}
4241
4242impl DataRouterProxy {
4243    /// Create a new Proxy for fuchsia.component.sandbox/DataRouter.
4244    pub fn new(channel: fdomain_client::Channel) -> Self {
4245        let protocol_name = <DataRouterMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
4246        Self { client: fidl::client::Client::new(channel, protocol_name) }
4247    }
4248
4249    /// Get a Stream of events from the remote end of the protocol.
4250    ///
4251    /// # Panics
4252    ///
4253    /// Panics if the event stream was already taken.
4254    pub fn take_event_stream(&self) -> DataRouterEventStream {
4255        DataRouterEventStream { event_receiver: self.client.take_event_receiver() }
4256    }
4257
4258    pub fn r#route(
4259        &self,
4260        mut payload: RouteRequest,
4261    ) -> fidl::client::QueryResponseFut<
4262        DataRouterRouteResult,
4263        fdomain_client::fidl::FDomainResourceDialect,
4264    > {
4265        DataRouterProxyInterface::r#route(self, payload)
4266    }
4267}
4268
4269impl DataRouterProxyInterface for DataRouterProxy {
4270    type RouteResponseFut = fidl::client::QueryResponseFut<
4271        DataRouterRouteResult,
4272        fdomain_client::fidl::FDomainResourceDialect,
4273    >;
4274    fn r#route(&self, mut payload: RouteRequest) -> Self::RouteResponseFut {
4275        fn _decode(
4276            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4277        ) -> Result<DataRouterRouteResult, fidl::Error> {
4278            let _response = fidl::client::decode_transaction_body::<
4279                fidl::encoding::FlexibleResultType<DataRouterRouteResponse, RouterError>,
4280                fdomain_client::fidl::FDomainResourceDialect,
4281                0x2e87dc44dfc53804,
4282            >(_buf?)?
4283            .into_result_fdomain::<DataRouterMarker>("route")?;
4284            Ok(_response.map(|x| x))
4285        }
4286        self.client.send_query_and_decode::<RouteRequest, DataRouterRouteResult>(
4287            &mut payload,
4288            0x2e87dc44dfc53804,
4289            fidl::encoding::DynamicFlags::FLEXIBLE,
4290            _decode,
4291        )
4292    }
4293}
4294
4295pub struct DataRouterEventStream {
4296    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
4297}
4298
4299impl std::marker::Unpin for DataRouterEventStream {}
4300
4301impl futures::stream::FusedStream for DataRouterEventStream {
4302    fn is_terminated(&self) -> bool {
4303        self.event_receiver.is_terminated()
4304    }
4305}
4306
4307impl futures::Stream for DataRouterEventStream {
4308    type Item = Result<DataRouterEvent, fidl::Error>;
4309
4310    fn poll_next(
4311        mut self: std::pin::Pin<&mut Self>,
4312        cx: &mut std::task::Context<'_>,
4313    ) -> std::task::Poll<Option<Self::Item>> {
4314        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4315            &mut self.event_receiver,
4316            cx
4317        )?) {
4318            Some(buf) => std::task::Poll::Ready(Some(DataRouterEvent::decode(buf))),
4319            None => std::task::Poll::Ready(None),
4320        }
4321    }
4322}
4323
4324#[derive(Debug)]
4325pub enum DataRouterEvent {
4326    #[non_exhaustive]
4327    _UnknownEvent {
4328        /// Ordinal of the event that was sent.
4329        ordinal: u64,
4330    },
4331}
4332
4333impl DataRouterEvent {
4334    /// Decodes a message buffer as a [`DataRouterEvent`].
4335    fn decode(
4336        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4337    ) -> Result<DataRouterEvent, fidl::Error> {
4338        let (bytes, _handles) = buf.split_mut();
4339        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4340        debug_assert_eq!(tx_header.tx_id, 0);
4341        match tx_header.ordinal {
4342            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4343                Ok(DataRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
4344            }
4345            _ => Err(fidl::Error::UnknownOrdinal {
4346                ordinal: tx_header.ordinal,
4347                protocol_name:
4348                    <DataRouterMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
4349            }),
4350        }
4351    }
4352}
4353
4354/// A Stream of incoming requests for fuchsia.component.sandbox/DataRouter.
4355pub struct DataRouterRequestStream {
4356    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
4357    is_terminated: bool,
4358}
4359
4360impl std::marker::Unpin for DataRouterRequestStream {}
4361
4362impl futures::stream::FusedStream for DataRouterRequestStream {
4363    fn is_terminated(&self) -> bool {
4364        self.is_terminated
4365    }
4366}
4367
4368impl fdomain_client::fidl::RequestStream for DataRouterRequestStream {
4369    type Protocol = DataRouterMarker;
4370    type ControlHandle = DataRouterControlHandle;
4371
4372    fn from_channel(channel: fdomain_client::Channel) -> Self {
4373        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4374    }
4375
4376    fn control_handle(&self) -> Self::ControlHandle {
4377        DataRouterControlHandle { inner: self.inner.clone() }
4378    }
4379
4380    fn into_inner(
4381        self,
4382    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
4383    {
4384        (self.inner, self.is_terminated)
4385    }
4386
4387    fn from_inner(
4388        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
4389        is_terminated: bool,
4390    ) -> Self {
4391        Self { inner, is_terminated }
4392    }
4393}
4394
4395impl futures::Stream for DataRouterRequestStream {
4396    type Item = Result<DataRouterRequest, fidl::Error>;
4397
4398    fn poll_next(
4399        mut self: std::pin::Pin<&mut Self>,
4400        cx: &mut std::task::Context<'_>,
4401    ) -> std::task::Poll<Option<Self::Item>> {
4402        let this = &mut *self;
4403        if this.inner.check_shutdown(cx) {
4404            this.is_terminated = true;
4405            return std::task::Poll::Ready(None);
4406        }
4407        if this.is_terminated {
4408            panic!("polled DataRouterRequestStream after completion");
4409        }
4410        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
4411            |bytes, handles| {
4412                match this.inner.channel().read_etc(cx, bytes, handles) {
4413                    std::task::Poll::Ready(Ok(())) => {}
4414                    std::task::Poll::Pending => return std::task::Poll::Pending,
4415                    std::task::Poll::Ready(Err(None)) => {
4416                        this.is_terminated = true;
4417                        return std::task::Poll::Ready(None);
4418                    }
4419                    std::task::Poll::Ready(Err(Some(e))) => {
4420                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4421                            e.into(),
4422                        ))))
4423                    }
4424                }
4425
4426                // A message has been received from the channel
4427                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4428
4429                std::task::Poll::Ready(Some(match header.ordinal {
4430                    0x2e87dc44dfc53804 => {
4431                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4432                        let mut req = fidl::new_empty!(
4433                            RouteRequest,
4434                            fdomain_client::fidl::FDomainResourceDialect
4435                        );
4436                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<RouteRequest>(&header, _body_bytes, handles, &mut req)?;
4437                        let control_handle = DataRouterControlHandle { inner: this.inner.clone() };
4438                        Ok(DataRouterRequest::Route {
4439                            payload: req,
4440                            responder: DataRouterRouteResponder {
4441                                control_handle: std::mem::ManuallyDrop::new(control_handle),
4442                                tx_id: header.tx_id,
4443                            },
4444                        })
4445                    }
4446                    _ if header.tx_id == 0
4447                        && header
4448                            .dynamic_flags()
4449                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
4450                    {
4451                        Ok(DataRouterRequest::_UnknownMethod {
4452                            ordinal: header.ordinal,
4453                            control_handle: DataRouterControlHandle { inner: this.inner.clone() },
4454                            method_type: fidl::MethodType::OneWay,
4455                        })
4456                    }
4457                    _ if header
4458                        .dynamic_flags()
4459                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
4460                    {
4461                        this.inner.send_framework_err(
4462                            fidl::encoding::FrameworkErr::UnknownMethod,
4463                            header.tx_id,
4464                            header.ordinal,
4465                            header.dynamic_flags(),
4466                            (bytes, handles),
4467                        )?;
4468                        Ok(DataRouterRequest::_UnknownMethod {
4469                            ordinal: header.ordinal,
4470                            control_handle: DataRouterControlHandle { inner: this.inner.clone() },
4471                            method_type: fidl::MethodType::TwoWay,
4472                        })
4473                    }
4474                    _ => Err(fidl::Error::UnknownOrdinal {
4475                        ordinal: header.ordinal,
4476                        protocol_name:
4477                            <DataRouterMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
4478                    }),
4479                }))
4480            },
4481        )
4482    }
4483}
4484
4485#[derive(Debug)]
4486pub enum DataRouterRequest {
4487    Route {
4488        payload: RouteRequest,
4489        responder: DataRouterRouteResponder,
4490    },
4491    /// An interaction was received which does not match any known method.
4492    #[non_exhaustive]
4493    _UnknownMethod {
4494        /// Ordinal of the method that was called.
4495        ordinal: u64,
4496        control_handle: DataRouterControlHandle,
4497        method_type: fidl::MethodType,
4498    },
4499}
4500
4501impl DataRouterRequest {
4502    #[allow(irrefutable_let_patterns)]
4503    pub fn into_route(self) -> Option<(RouteRequest, DataRouterRouteResponder)> {
4504        if let DataRouterRequest::Route { payload, responder } = self {
4505            Some((payload, responder))
4506        } else {
4507            None
4508        }
4509    }
4510
4511    /// Name of the method defined in FIDL
4512    pub fn method_name(&self) -> &'static str {
4513        match *self {
4514            DataRouterRequest::Route { .. } => "route",
4515            DataRouterRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
4516                "unknown one-way method"
4517            }
4518            DataRouterRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
4519                "unknown two-way method"
4520            }
4521        }
4522    }
4523}
4524
4525#[derive(Debug, Clone)]
4526pub struct DataRouterControlHandle {
4527    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
4528}
4529
4530impl fdomain_client::fidl::ControlHandle for DataRouterControlHandle {
4531    fn shutdown(&self) {
4532        self.inner.shutdown()
4533    }
4534
4535    fn is_closed(&self) -> bool {
4536        self.inner.channel().is_closed()
4537    }
4538    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
4539        self.inner.channel().on_closed()
4540    }
4541}
4542
4543impl DataRouterControlHandle {}
4544
4545#[must_use = "FIDL methods require a response to be sent"]
4546#[derive(Debug)]
4547pub struct DataRouterRouteResponder {
4548    control_handle: std::mem::ManuallyDrop<DataRouterControlHandle>,
4549    tx_id: u32,
4550}
4551
4552/// Set the the channel to be shutdown (see [`DataRouterControlHandle::shutdown`])
4553/// if the responder is dropped without sending a response, so that the client
4554/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4555impl std::ops::Drop for DataRouterRouteResponder {
4556    fn drop(&mut self) {
4557        self.control_handle.shutdown();
4558        // Safety: drops once, never accessed again
4559        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4560    }
4561}
4562
4563impl fdomain_client::fidl::Responder for DataRouterRouteResponder {
4564    type ControlHandle = DataRouterControlHandle;
4565
4566    fn control_handle(&self) -> &DataRouterControlHandle {
4567        &self.control_handle
4568    }
4569
4570    fn drop_without_shutdown(mut self) {
4571        // Safety: drops once, never accessed again due to mem::forget
4572        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4573        // Prevent Drop from running (which would shut down the channel)
4574        std::mem::forget(self);
4575    }
4576}
4577
4578impl DataRouterRouteResponder {
4579    /// Sends a response to the FIDL transaction.
4580    ///
4581    /// Sets the channel to shutdown if an error occurs.
4582    pub fn send(
4583        self,
4584        mut result: Result<DataRouterRouteResponse, RouterError>,
4585    ) -> Result<(), fidl::Error> {
4586        let _result = self.send_raw(result);
4587        if _result.is_err() {
4588            self.control_handle.shutdown();
4589        }
4590        self.drop_without_shutdown();
4591        _result
4592    }
4593
4594    /// Similar to "send" but does not shutdown the channel if an error occurs.
4595    pub fn send_no_shutdown_on_err(
4596        self,
4597        mut result: Result<DataRouterRouteResponse, RouterError>,
4598    ) -> Result<(), fidl::Error> {
4599        let _result = self.send_raw(result);
4600        self.drop_without_shutdown();
4601        _result
4602    }
4603
4604    fn send_raw(
4605        &self,
4606        mut result: Result<DataRouterRouteResponse, RouterError>,
4607    ) -> Result<(), fidl::Error> {
4608        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4609            DataRouterRouteResponse,
4610            RouterError,
4611        >>(
4612            fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
4613            self.tx_id,
4614            0x2e87dc44dfc53804,
4615            fidl::encoding::DynamicFlags::FLEXIBLE,
4616        )
4617    }
4618}
4619
4620#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4621pub struct DictionaryMarker;
4622
4623impl fdomain_client::fidl::ProtocolMarker for DictionaryMarker {
4624    type Proxy = DictionaryProxy;
4625    type RequestStream = DictionaryRequestStream;
4626
4627    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.Dictionary";
4628}
4629impl fdomain_client::fidl::DiscoverableProtocolMarker for DictionaryMarker {}
4630
4631pub trait DictionaryProxyInterface: Send + Sync {}
4632
4633#[derive(Debug, Clone)]
4634pub struct DictionaryProxy {
4635    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
4636}
4637
4638impl fdomain_client::fidl::Proxy for DictionaryProxy {
4639    type Protocol = DictionaryMarker;
4640
4641    fn from_channel(inner: fdomain_client::Channel) -> Self {
4642        Self::new(inner)
4643    }
4644
4645    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
4646        self.client.into_channel().map_err(|client| Self { client })
4647    }
4648
4649    fn as_channel(&self) -> &fdomain_client::Channel {
4650        self.client.as_channel()
4651    }
4652}
4653
4654impl DictionaryProxy {
4655    /// Create a new Proxy for fuchsia.component.sandbox/Dictionary.
4656    pub fn new(channel: fdomain_client::Channel) -> Self {
4657        let protocol_name = <DictionaryMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
4658        Self { client: fidl::client::Client::new(channel, protocol_name) }
4659    }
4660
4661    /// Get a Stream of events from the remote end of the protocol.
4662    ///
4663    /// # Panics
4664    ///
4665    /// Panics if the event stream was already taken.
4666    pub fn take_event_stream(&self) -> DictionaryEventStream {
4667        DictionaryEventStream { event_receiver: self.client.take_event_receiver() }
4668    }
4669}
4670
4671impl DictionaryProxyInterface for DictionaryProxy {}
4672
4673pub struct DictionaryEventStream {
4674    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
4675}
4676
4677impl std::marker::Unpin for DictionaryEventStream {}
4678
4679impl futures::stream::FusedStream for DictionaryEventStream {
4680    fn is_terminated(&self) -> bool {
4681        self.event_receiver.is_terminated()
4682    }
4683}
4684
4685impl futures::Stream for DictionaryEventStream {
4686    type Item = Result<DictionaryEvent, fidl::Error>;
4687
4688    fn poll_next(
4689        mut self: std::pin::Pin<&mut Self>,
4690        cx: &mut std::task::Context<'_>,
4691    ) -> std::task::Poll<Option<Self::Item>> {
4692        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4693            &mut self.event_receiver,
4694            cx
4695        )?) {
4696            Some(buf) => std::task::Poll::Ready(Some(DictionaryEvent::decode(buf))),
4697            None => std::task::Poll::Ready(None),
4698        }
4699    }
4700}
4701
4702#[derive(Debug)]
4703pub enum DictionaryEvent {
4704    #[non_exhaustive]
4705    _UnknownEvent {
4706        /// Ordinal of the event that was sent.
4707        ordinal: u64,
4708    },
4709}
4710
4711impl DictionaryEvent {
4712    /// Decodes a message buffer as a [`DictionaryEvent`].
4713    fn decode(
4714        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4715    ) -> Result<DictionaryEvent, fidl::Error> {
4716        let (bytes, _handles) = buf.split_mut();
4717        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4718        debug_assert_eq!(tx_header.tx_id, 0);
4719        match tx_header.ordinal {
4720            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4721                Ok(DictionaryEvent::_UnknownEvent { ordinal: tx_header.ordinal })
4722            }
4723            _ => Err(fidl::Error::UnknownOrdinal {
4724                ordinal: tx_header.ordinal,
4725                protocol_name:
4726                    <DictionaryMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
4727            }),
4728        }
4729    }
4730}
4731
4732/// A Stream of incoming requests for fuchsia.component.sandbox/Dictionary.
4733pub struct DictionaryRequestStream {
4734    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
4735    is_terminated: bool,
4736}
4737
4738impl std::marker::Unpin for DictionaryRequestStream {}
4739
4740impl futures::stream::FusedStream for DictionaryRequestStream {
4741    fn is_terminated(&self) -> bool {
4742        self.is_terminated
4743    }
4744}
4745
4746impl fdomain_client::fidl::RequestStream for DictionaryRequestStream {
4747    type Protocol = DictionaryMarker;
4748    type ControlHandle = DictionaryControlHandle;
4749
4750    fn from_channel(channel: fdomain_client::Channel) -> Self {
4751        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4752    }
4753
4754    fn control_handle(&self) -> Self::ControlHandle {
4755        DictionaryControlHandle { inner: self.inner.clone() }
4756    }
4757
4758    fn into_inner(
4759        self,
4760    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
4761    {
4762        (self.inner, self.is_terminated)
4763    }
4764
4765    fn from_inner(
4766        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
4767        is_terminated: bool,
4768    ) -> Self {
4769        Self { inner, is_terminated }
4770    }
4771}
4772
4773impl futures::Stream for DictionaryRequestStream {
4774    type Item = Result<DictionaryRequest, fidl::Error>;
4775
4776    fn poll_next(
4777        mut self: std::pin::Pin<&mut Self>,
4778        cx: &mut std::task::Context<'_>,
4779    ) -> std::task::Poll<Option<Self::Item>> {
4780        let this = &mut *self;
4781        if this.inner.check_shutdown(cx) {
4782            this.is_terminated = true;
4783            return std::task::Poll::Ready(None);
4784        }
4785        if this.is_terminated {
4786            panic!("polled DictionaryRequestStream after completion");
4787        }
4788        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
4789            |bytes, handles| {
4790                match this.inner.channel().read_etc(cx, bytes, handles) {
4791                    std::task::Poll::Ready(Ok(())) => {}
4792                    std::task::Poll::Pending => return std::task::Poll::Pending,
4793                    std::task::Poll::Ready(Err(None)) => {
4794                        this.is_terminated = true;
4795                        return std::task::Poll::Ready(None);
4796                    }
4797                    std::task::Poll::Ready(Err(Some(e))) => {
4798                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4799                            e.into(),
4800                        ))))
4801                    }
4802                }
4803
4804                // A message has been received from the channel
4805                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4806
4807                std::task::Poll::Ready(Some(match header.ordinal {
4808                    _ if header.tx_id == 0
4809                        && header
4810                            .dynamic_flags()
4811                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
4812                    {
4813                        Ok(DictionaryRequest::_UnknownMethod {
4814                            ordinal: header.ordinal,
4815                            control_handle: DictionaryControlHandle { inner: this.inner.clone() },
4816                            method_type: fidl::MethodType::OneWay,
4817                        })
4818                    }
4819                    _ if header
4820                        .dynamic_flags()
4821                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
4822                    {
4823                        this.inner.send_framework_err(
4824                            fidl::encoding::FrameworkErr::UnknownMethod,
4825                            header.tx_id,
4826                            header.ordinal,
4827                            header.dynamic_flags(),
4828                            (bytes, handles),
4829                        )?;
4830                        Ok(DictionaryRequest::_UnknownMethod {
4831                            ordinal: header.ordinal,
4832                            control_handle: DictionaryControlHandle { inner: this.inner.clone() },
4833                            method_type: fidl::MethodType::TwoWay,
4834                        })
4835                    }
4836                    _ => Err(fidl::Error::UnknownOrdinal {
4837                        ordinal: header.ordinal,
4838                        protocol_name:
4839                            <DictionaryMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
4840                    }),
4841                }))
4842            },
4843        )
4844    }
4845}
4846
4847#[derive(Debug)]
4848pub enum DictionaryRequest {
4849    /// An interaction was received which does not match any known method.
4850    #[non_exhaustive]
4851    _UnknownMethod {
4852        /// Ordinal of the method that was called.
4853        ordinal: u64,
4854        control_handle: DictionaryControlHandle,
4855        method_type: fidl::MethodType,
4856    },
4857}
4858
4859impl DictionaryRequest {
4860    /// Name of the method defined in FIDL
4861    pub fn method_name(&self) -> &'static str {
4862        match *self {
4863            DictionaryRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
4864                "unknown one-way method"
4865            }
4866            DictionaryRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
4867                "unknown two-way method"
4868            }
4869        }
4870    }
4871}
4872
4873#[derive(Debug, Clone)]
4874pub struct DictionaryControlHandle {
4875    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
4876}
4877
4878impl fdomain_client::fidl::ControlHandle for DictionaryControlHandle {
4879    fn shutdown(&self) {
4880        self.inner.shutdown()
4881    }
4882
4883    fn is_closed(&self) -> bool {
4884        self.inner.channel().is_closed()
4885    }
4886    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
4887        self.inner.channel().on_closed()
4888    }
4889}
4890
4891impl DictionaryControlHandle {}
4892
4893#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4894pub struct DictionaryDrainIteratorMarker;
4895
4896impl fdomain_client::fidl::ProtocolMarker for DictionaryDrainIteratorMarker {
4897    type Proxy = DictionaryDrainIteratorProxy;
4898    type RequestStream = DictionaryDrainIteratorRequestStream;
4899
4900    const DEBUG_NAME: &'static str = "(anonymous) DictionaryDrainIterator";
4901}
4902pub type DictionaryDrainIteratorGetNextResult =
4903    Result<(Vec<DictionaryItem>, u64), CapabilityStoreError>;
4904
4905pub trait DictionaryDrainIteratorProxyInterface: Send + Sync {
4906    type GetNextResponseFut: std::future::Future<Output = Result<DictionaryDrainIteratorGetNextResult, fidl::Error>>
4907        + Send;
4908    fn r#get_next(&self, start_id: u64, limit: u32) -> Self::GetNextResponseFut;
4909}
4910
4911#[derive(Debug, Clone)]
4912pub struct DictionaryDrainIteratorProxy {
4913    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
4914}
4915
4916impl fdomain_client::fidl::Proxy for DictionaryDrainIteratorProxy {
4917    type Protocol = DictionaryDrainIteratorMarker;
4918
4919    fn from_channel(inner: fdomain_client::Channel) -> Self {
4920        Self::new(inner)
4921    }
4922
4923    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
4924        self.client.into_channel().map_err(|client| Self { client })
4925    }
4926
4927    fn as_channel(&self) -> &fdomain_client::Channel {
4928        self.client.as_channel()
4929    }
4930}
4931
4932impl DictionaryDrainIteratorProxy {
4933    /// Create a new Proxy for fuchsia.component.sandbox/DictionaryDrainIterator.
4934    pub fn new(channel: fdomain_client::Channel) -> Self {
4935        let protocol_name =
4936            <DictionaryDrainIteratorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
4937        Self { client: fidl::client::Client::new(channel, protocol_name) }
4938    }
4939
4940    /// Get a Stream of events from the remote end of the protocol.
4941    ///
4942    /// # Panics
4943    ///
4944    /// Panics if the event stream was already taken.
4945    pub fn take_event_stream(&self) -> DictionaryDrainIteratorEventStream {
4946        DictionaryDrainIteratorEventStream { event_receiver: self.client.take_event_receiver() }
4947    }
4948
4949    /// Returns the next batch of results for a [Dictionary.Drain] call, returning up to
4950    /// `limit` results. `limit` can be at most [MAX_DICTIONARY_ITERATOR_CHUNK].
4951    ///
4952    /// Each returned capability will be assigned a monotonically increasing [CapabilityId] starting
4953    /// from `start_id`.
4954    ///
4955    /// In addition to the `items`, returns `end_id`, which is one more than the highest id reserved
4956    /// by [GetNext]. `end_id` can be used as the `start_id` for the next call to [GetNext].
4957    ///
4958    /// If [GetNext] returns an error, the server will also close the channel.
4959    ///
4960    /// Errors:
4961    ///
4962    /// - `ID_ALREADY_EXISTS` if some id in the range `[start_id, limit)` already exists in this
4963    ///   store.
4964    /// - `INVALID_ARGS` if `limit` was `0` or greater than `MAX_DICTIONARY_ITERATOR_CHUNK`.
4965    pub fn r#get_next(
4966        &self,
4967        mut start_id: u64,
4968        mut limit: u32,
4969    ) -> fidl::client::QueryResponseFut<
4970        DictionaryDrainIteratorGetNextResult,
4971        fdomain_client::fidl::FDomainResourceDialect,
4972    > {
4973        DictionaryDrainIteratorProxyInterface::r#get_next(self, start_id, limit)
4974    }
4975}
4976
4977impl DictionaryDrainIteratorProxyInterface for DictionaryDrainIteratorProxy {
4978    type GetNextResponseFut = fidl::client::QueryResponseFut<
4979        DictionaryDrainIteratorGetNextResult,
4980        fdomain_client::fidl::FDomainResourceDialect,
4981    >;
4982    fn r#get_next(&self, mut start_id: u64, mut limit: u32) -> Self::GetNextResponseFut {
4983        fn _decode(
4984            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4985        ) -> Result<DictionaryDrainIteratorGetNextResult, fidl::Error> {
4986            let _response = fidl::client::decode_transaction_body::<
4987                fidl::encoding::FlexibleResultType<
4988                    DictionaryDrainIteratorGetNextResponse,
4989                    CapabilityStoreError,
4990                >,
4991                fdomain_client::fidl::FDomainResourceDialect,
4992                0x4f8082ca1ee26061,
4993            >(_buf?)?
4994            .into_result_fdomain::<DictionaryDrainIteratorMarker>("get_next")?;
4995            Ok(_response.map(|x| (x.items, x.end_id)))
4996        }
4997        self.client.send_query_and_decode::<
4998            DictionaryDrainIteratorGetNextRequest,
4999            DictionaryDrainIteratorGetNextResult,
5000        >(
5001            (start_id, limit,),
5002            0x4f8082ca1ee26061,
5003            fidl::encoding::DynamicFlags::FLEXIBLE,
5004            _decode,
5005        )
5006    }
5007}
5008
5009pub struct DictionaryDrainIteratorEventStream {
5010    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
5011}
5012
5013impl std::marker::Unpin for DictionaryDrainIteratorEventStream {}
5014
5015impl futures::stream::FusedStream for DictionaryDrainIteratorEventStream {
5016    fn is_terminated(&self) -> bool {
5017        self.event_receiver.is_terminated()
5018    }
5019}
5020
5021impl futures::Stream for DictionaryDrainIteratorEventStream {
5022    type Item = Result<DictionaryDrainIteratorEvent, fidl::Error>;
5023
5024    fn poll_next(
5025        mut self: std::pin::Pin<&mut Self>,
5026        cx: &mut std::task::Context<'_>,
5027    ) -> std::task::Poll<Option<Self::Item>> {
5028        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5029            &mut self.event_receiver,
5030            cx
5031        )?) {
5032            Some(buf) => std::task::Poll::Ready(Some(DictionaryDrainIteratorEvent::decode(buf))),
5033            None => std::task::Poll::Ready(None),
5034        }
5035    }
5036}
5037
5038#[derive(Debug)]
5039pub enum DictionaryDrainIteratorEvent {
5040    #[non_exhaustive]
5041    _UnknownEvent {
5042        /// Ordinal of the event that was sent.
5043        ordinal: u64,
5044    },
5045}
5046
5047impl DictionaryDrainIteratorEvent {
5048    /// Decodes a message buffer as a [`DictionaryDrainIteratorEvent`].
5049    fn decode(
5050        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5051    ) -> Result<DictionaryDrainIteratorEvent, fidl::Error> {
5052        let (bytes, _handles) = buf.split_mut();
5053        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5054        debug_assert_eq!(tx_header.tx_id, 0);
5055        match tx_header.ordinal {
5056            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
5057                Ok(DictionaryDrainIteratorEvent::_UnknownEvent {
5058                    ordinal: tx_header.ordinal,
5059                })
5060            }
5061            _ => Err(fidl::Error::UnknownOrdinal {
5062                ordinal: tx_header.ordinal,
5063                protocol_name: <DictionaryDrainIteratorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
5064            })
5065        }
5066    }
5067}
5068
5069/// A Stream of incoming requests for fuchsia.component.sandbox/DictionaryDrainIterator.
5070pub struct DictionaryDrainIteratorRequestStream {
5071    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
5072    is_terminated: bool,
5073}
5074
5075impl std::marker::Unpin for DictionaryDrainIteratorRequestStream {}
5076
5077impl futures::stream::FusedStream for DictionaryDrainIteratorRequestStream {
5078    fn is_terminated(&self) -> bool {
5079        self.is_terminated
5080    }
5081}
5082
5083impl fdomain_client::fidl::RequestStream for DictionaryDrainIteratorRequestStream {
5084    type Protocol = DictionaryDrainIteratorMarker;
5085    type ControlHandle = DictionaryDrainIteratorControlHandle;
5086
5087    fn from_channel(channel: fdomain_client::Channel) -> Self {
5088        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5089    }
5090
5091    fn control_handle(&self) -> Self::ControlHandle {
5092        DictionaryDrainIteratorControlHandle { inner: self.inner.clone() }
5093    }
5094
5095    fn into_inner(
5096        self,
5097    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
5098    {
5099        (self.inner, self.is_terminated)
5100    }
5101
5102    fn from_inner(
5103        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
5104        is_terminated: bool,
5105    ) -> Self {
5106        Self { inner, is_terminated }
5107    }
5108}
5109
5110impl futures::Stream for DictionaryDrainIteratorRequestStream {
5111    type Item = Result<DictionaryDrainIteratorRequest, fidl::Error>;
5112
5113    fn poll_next(
5114        mut self: std::pin::Pin<&mut Self>,
5115        cx: &mut std::task::Context<'_>,
5116    ) -> std::task::Poll<Option<Self::Item>> {
5117        let this = &mut *self;
5118        if this.inner.check_shutdown(cx) {
5119            this.is_terminated = true;
5120            return std::task::Poll::Ready(None);
5121        }
5122        if this.is_terminated {
5123            panic!("polled DictionaryDrainIteratorRequestStream after completion");
5124        }
5125        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
5126            |bytes, handles| {
5127                match this.inner.channel().read_etc(cx, bytes, handles) {
5128                    std::task::Poll::Ready(Ok(())) => {}
5129                    std::task::Poll::Pending => return std::task::Poll::Pending,
5130                    std::task::Poll::Ready(Err(None)) => {
5131                        this.is_terminated = true;
5132                        return std::task::Poll::Ready(None);
5133                    }
5134                    std::task::Poll::Ready(Err(Some(e))) => {
5135                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5136                            e.into(),
5137                        ))))
5138                    }
5139                }
5140
5141                // A message has been received from the channel
5142                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5143
5144                std::task::Poll::Ready(Some(match header.ordinal {
5145                0x4f8082ca1ee26061 => {
5146                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5147                    let mut req = fidl::new_empty!(DictionaryDrainIteratorGetNextRequest, fdomain_client::fidl::FDomainResourceDialect);
5148                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<DictionaryDrainIteratorGetNextRequest>(&header, _body_bytes, handles, &mut req)?;
5149                    let control_handle = DictionaryDrainIteratorControlHandle {
5150                        inner: this.inner.clone(),
5151                    };
5152                    Ok(DictionaryDrainIteratorRequest::GetNext {start_id: req.start_id,
5153limit: req.limit,
5154
5155                        responder: DictionaryDrainIteratorGetNextResponder {
5156                            control_handle: std::mem::ManuallyDrop::new(control_handle),
5157                            tx_id: header.tx_id,
5158                        },
5159                    })
5160                }
5161                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
5162                    Ok(DictionaryDrainIteratorRequest::_UnknownMethod {
5163                        ordinal: header.ordinal,
5164                        control_handle: DictionaryDrainIteratorControlHandle { inner: this.inner.clone() },
5165                        method_type: fidl::MethodType::OneWay,
5166                    })
5167                }
5168                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
5169                    this.inner.send_framework_err(
5170                        fidl::encoding::FrameworkErr::UnknownMethod,
5171                        header.tx_id,
5172                        header.ordinal,
5173                        header.dynamic_flags(),
5174                        (bytes, handles),
5175                    )?;
5176                    Ok(DictionaryDrainIteratorRequest::_UnknownMethod {
5177                        ordinal: header.ordinal,
5178                        control_handle: DictionaryDrainIteratorControlHandle { inner: this.inner.clone() },
5179                        method_type: fidl::MethodType::TwoWay,
5180                    })
5181                }
5182                _ => Err(fidl::Error::UnknownOrdinal {
5183                    ordinal: header.ordinal,
5184                    protocol_name: <DictionaryDrainIteratorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
5185                }),
5186            }))
5187            },
5188        )
5189    }
5190}
5191
5192#[derive(Debug)]
5193pub enum DictionaryDrainIteratorRequest {
5194    /// Returns the next batch of results for a [Dictionary.Drain] call, returning up to
5195    /// `limit` results. `limit` can be at most [MAX_DICTIONARY_ITERATOR_CHUNK].
5196    ///
5197    /// Each returned capability will be assigned a monotonically increasing [CapabilityId] starting
5198    /// from `start_id`.
5199    ///
5200    /// In addition to the `items`, returns `end_id`, which is one more than the highest id reserved
5201    /// by [GetNext]. `end_id` can be used as the `start_id` for the next call to [GetNext].
5202    ///
5203    /// If [GetNext] returns an error, the server will also close the channel.
5204    ///
5205    /// Errors:
5206    ///
5207    /// - `ID_ALREADY_EXISTS` if some id in the range `[start_id, limit)` already exists in this
5208    ///   store.
5209    /// - `INVALID_ARGS` if `limit` was `0` or greater than `MAX_DICTIONARY_ITERATOR_CHUNK`.
5210    GetNext { start_id: u64, limit: u32, responder: DictionaryDrainIteratorGetNextResponder },
5211    /// An interaction was received which does not match any known method.
5212    #[non_exhaustive]
5213    _UnknownMethod {
5214        /// Ordinal of the method that was called.
5215        ordinal: u64,
5216        control_handle: DictionaryDrainIteratorControlHandle,
5217        method_type: fidl::MethodType,
5218    },
5219}
5220
5221impl DictionaryDrainIteratorRequest {
5222    #[allow(irrefutable_let_patterns)]
5223    pub fn into_get_next(self) -> Option<(u64, u32, DictionaryDrainIteratorGetNextResponder)> {
5224        if let DictionaryDrainIteratorRequest::GetNext { start_id, limit, responder } = self {
5225            Some((start_id, limit, responder))
5226        } else {
5227            None
5228        }
5229    }
5230
5231    /// Name of the method defined in FIDL
5232    pub fn method_name(&self) -> &'static str {
5233        match *self {
5234            DictionaryDrainIteratorRequest::GetNext { .. } => "get_next",
5235            DictionaryDrainIteratorRequest::_UnknownMethod {
5236                method_type: fidl::MethodType::OneWay,
5237                ..
5238            } => "unknown one-way method",
5239            DictionaryDrainIteratorRequest::_UnknownMethod {
5240                method_type: fidl::MethodType::TwoWay,
5241                ..
5242            } => "unknown two-way method",
5243        }
5244    }
5245}
5246
5247#[derive(Debug, Clone)]
5248pub struct DictionaryDrainIteratorControlHandle {
5249    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
5250}
5251
5252impl fdomain_client::fidl::ControlHandle for DictionaryDrainIteratorControlHandle {
5253    fn shutdown(&self) {
5254        self.inner.shutdown()
5255    }
5256
5257    fn is_closed(&self) -> bool {
5258        self.inner.channel().is_closed()
5259    }
5260    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
5261        self.inner.channel().on_closed()
5262    }
5263}
5264
5265impl DictionaryDrainIteratorControlHandle {}
5266
5267#[must_use = "FIDL methods require a response to be sent"]
5268#[derive(Debug)]
5269pub struct DictionaryDrainIteratorGetNextResponder {
5270    control_handle: std::mem::ManuallyDrop<DictionaryDrainIteratorControlHandle>,
5271    tx_id: u32,
5272}
5273
5274/// Set the the channel to be shutdown (see [`DictionaryDrainIteratorControlHandle::shutdown`])
5275/// if the responder is dropped without sending a response, so that the client
5276/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5277impl std::ops::Drop for DictionaryDrainIteratorGetNextResponder {
5278    fn drop(&mut self) {
5279        self.control_handle.shutdown();
5280        // Safety: drops once, never accessed again
5281        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5282    }
5283}
5284
5285impl fdomain_client::fidl::Responder for DictionaryDrainIteratorGetNextResponder {
5286    type ControlHandle = DictionaryDrainIteratorControlHandle;
5287
5288    fn control_handle(&self) -> &DictionaryDrainIteratorControlHandle {
5289        &self.control_handle
5290    }
5291
5292    fn drop_without_shutdown(mut self) {
5293        // Safety: drops once, never accessed again due to mem::forget
5294        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5295        // Prevent Drop from running (which would shut down the channel)
5296        std::mem::forget(self);
5297    }
5298}
5299
5300impl DictionaryDrainIteratorGetNextResponder {
5301    /// Sends a response to the FIDL transaction.
5302    ///
5303    /// Sets the channel to shutdown if an error occurs.
5304    pub fn send(
5305        self,
5306        mut result: Result<(&[DictionaryItem], u64), CapabilityStoreError>,
5307    ) -> Result<(), fidl::Error> {
5308        let _result = self.send_raw(result);
5309        if _result.is_err() {
5310            self.control_handle.shutdown();
5311        }
5312        self.drop_without_shutdown();
5313        _result
5314    }
5315
5316    /// Similar to "send" but does not shutdown the channel if an error occurs.
5317    pub fn send_no_shutdown_on_err(
5318        self,
5319        mut result: Result<(&[DictionaryItem], u64), CapabilityStoreError>,
5320    ) -> Result<(), fidl::Error> {
5321        let _result = self.send_raw(result);
5322        self.drop_without_shutdown();
5323        _result
5324    }
5325
5326    fn send_raw(
5327        &self,
5328        mut result: Result<(&[DictionaryItem], u64), CapabilityStoreError>,
5329    ) -> Result<(), fidl::Error> {
5330        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
5331            DictionaryDrainIteratorGetNextResponse,
5332            CapabilityStoreError,
5333        >>(
5334            fidl::encoding::FlexibleResult::new(result),
5335            self.tx_id,
5336            0x4f8082ca1ee26061,
5337            fidl::encoding::DynamicFlags::FLEXIBLE,
5338        )
5339    }
5340}
5341
5342#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5343pub struct DictionaryEnumerateIteratorMarker;
5344
5345impl fdomain_client::fidl::ProtocolMarker for DictionaryEnumerateIteratorMarker {
5346    type Proxy = DictionaryEnumerateIteratorProxy;
5347    type RequestStream = DictionaryEnumerateIteratorRequestStream;
5348
5349    const DEBUG_NAME: &'static str = "(anonymous) DictionaryEnumerateIterator";
5350}
5351pub type DictionaryEnumerateIteratorGetNextResult =
5352    Result<(Vec<DictionaryOptionalItem>, u64), CapabilityStoreError>;
5353
5354pub trait DictionaryEnumerateIteratorProxyInterface: Send + Sync {
5355    type GetNextResponseFut: std::future::Future<Output = Result<DictionaryEnumerateIteratorGetNextResult, fidl::Error>>
5356        + Send;
5357    fn r#get_next(&self, start_id: u64, limit: u32) -> Self::GetNextResponseFut;
5358}
5359
5360#[derive(Debug, Clone)]
5361pub struct DictionaryEnumerateIteratorProxy {
5362    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
5363}
5364
5365impl fdomain_client::fidl::Proxy for DictionaryEnumerateIteratorProxy {
5366    type Protocol = DictionaryEnumerateIteratorMarker;
5367
5368    fn from_channel(inner: fdomain_client::Channel) -> Self {
5369        Self::new(inner)
5370    }
5371
5372    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
5373        self.client.into_channel().map_err(|client| Self { client })
5374    }
5375
5376    fn as_channel(&self) -> &fdomain_client::Channel {
5377        self.client.as_channel()
5378    }
5379}
5380
5381impl DictionaryEnumerateIteratorProxy {
5382    /// Create a new Proxy for fuchsia.component.sandbox/DictionaryEnumerateIterator.
5383    pub fn new(channel: fdomain_client::Channel) -> Self {
5384        let protocol_name =
5385            <DictionaryEnumerateIteratorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
5386        Self { client: fidl::client::Client::new(channel, protocol_name) }
5387    }
5388
5389    /// Get a Stream of events from the remote end of the protocol.
5390    ///
5391    /// # Panics
5392    ///
5393    /// Panics if the event stream was already taken.
5394    pub fn take_event_stream(&self) -> DictionaryEnumerateIteratorEventStream {
5395        DictionaryEnumerateIteratorEventStream { event_receiver: self.client.take_event_receiver() }
5396    }
5397
5398    /// Returns the next batch of results for a [Dictionary.Enumerate] call, returning up to
5399    /// `limit` results. `limit` can be at most [MAX_DICTIONARY_ITERATOR_CHUNK].
5400    ///
5401    /// The value of each of `items` is a duplicate of the original capability
5402    /// ([CapabilityStore.Duplicate]), unless it could not be duplicated, it which case it will
5403    /// be null.
5404    ///
5405    /// Each returned capability will be assigned a monotonically increasing [CapabilityId] starting
5406    /// from `start_id`.
5407    ///
5408    /// In addition to the `items`, returns `end_id`, which is one more than the highest id reserved
5409    /// by [GetNext]. `end_id` can be used as the `start_id` for the next call to [GetNext].
5410    ///
5411    /// If [GetNext] returns an error, the server will also close the channel.
5412    ///
5413    /// Errors:
5414    ///
5415    /// - `ID_ALREADY_EXISTS` if some id in the range `[start_id, limit)` already exists in this
5416    ///   store.
5417    /// - `INVALID_ARGS` if `limit` was `0` or greater than `MAX_DICTIONARY_ITERATOR_CHUNK`.
5418    pub fn r#get_next(
5419        &self,
5420        mut start_id: u64,
5421        mut limit: u32,
5422    ) -> fidl::client::QueryResponseFut<
5423        DictionaryEnumerateIteratorGetNextResult,
5424        fdomain_client::fidl::FDomainResourceDialect,
5425    > {
5426        DictionaryEnumerateIteratorProxyInterface::r#get_next(self, start_id, limit)
5427    }
5428}
5429
5430impl DictionaryEnumerateIteratorProxyInterface for DictionaryEnumerateIteratorProxy {
5431    type GetNextResponseFut = fidl::client::QueryResponseFut<
5432        DictionaryEnumerateIteratorGetNextResult,
5433        fdomain_client::fidl::FDomainResourceDialect,
5434    >;
5435    fn r#get_next(&self, mut start_id: u64, mut limit: u32) -> Self::GetNextResponseFut {
5436        fn _decode(
5437            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5438        ) -> Result<DictionaryEnumerateIteratorGetNextResult, fidl::Error> {
5439            let _response = fidl::client::decode_transaction_body::<
5440                fidl::encoding::FlexibleResultType<
5441                    DictionaryEnumerateIteratorGetNextResponse,
5442                    CapabilityStoreError,
5443                >,
5444                fdomain_client::fidl::FDomainResourceDialect,
5445                0x14f8bc286512f5cf,
5446            >(_buf?)?
5447            .into_result_fdomain::<DictionaryEnumerateIteratorMarker>("get_next")?;
5448            Ok(_response.map(|x| (x.items, x.end_id)))
5449        }
5450        self.client.send_query_and_decode::<
5451            DictionaryEnumerateIteratorGetNextRequest,
5452            DictionaryEnumerateIteratorGetNextResult,
5453        >(
5454            (start_id, limit,),
5455            0x14f8bc286512f5cf,
5456            fidl::encoding::DynamicFlags::FLEXIBLE,
5457            _decode,
5458        )
5459    }
5460}
5461
5462pub struct DictionaryEnumerateIteratorEventStream {
5463    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
5464}
5465
5466impl std::marker::Unpin for DictionaryEnumerateIteratorEventStream {}
5467
5468impl futures::stream::FusedStream for DictionaryEnumerateIteratorEventStream {
5469    fn is_terminated(&self) -> bool {
5470        self.event_receiver.is_terminated()
5471    }
5472}
5473
5474impl futures::Stream for DictionaryEnumerateIteratorEventStream {
5475    type Item = Result<DictionaryEnumerateIteratorEvent, fidl::Error>;
5476
5477    fn poll_next(
5478        mut self: std::pin::Pin<&mut Self>,
5479        cx: &mut std::task::Context<'_>,
5480    ) -> std::task::Poll<Option<Self::Item>> {
5481        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5482            &mut self.event_receiver,
5483            cx
5484        )?) {
5485            Some(buf) => {
5486                std::task::Poll::Ready(Some(DictionaryEnumerateIteratorEvent::decode(buf)))
5487            }
5488            None => std::task::Poll::Ready(None),
5489        }
5490    }
5491}
5492
5493#[derive(Debug)]
5494pub enum DictionaryEnumerateIteratorEvent {
5495    #[non_exhaustive]
5496    _UnknownEvent {
5497        /// Ordinal of the event that was sent.
5498        ordinal: u64,
5499    },
5500}
5501
5502impl DictionaryEnumerateIteratorEvent {
5503    /// Decodes a message buffer as a [`DictionaryEnumerateIteratorEvent`].
5504    fn decode(
5505        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5506    ) -> Result<DictionaryEnumerateIteratorEvent, fidl::Error> {
5507        let (bytes, _handles) = buf.split_mut();
5508        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5509        debug_assert_eq!(tx_header.tx_id, 0);
5510        match tx_header.ordinal {
5511            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
5512                Ok(DictionaryEnumerateIteratorEvent::_UnknownEvent {
5513                    ordinal: tx_header.ordinal,
5514                })
5515            }
5516            _ => Err(fidl::Error::UnknownOrdinal {
5517                ordinal: tx_header.ordinal,
5518                protocol_name: <DictionaryEnumerateIteratorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
5519            })
5520        }
5521    }
5522}
5523
5524/// A Stream of incoming requests for fuchsia.component.sandbox/DictionaryEnumerateIterator.
5525pub struct DictionaryEnumerateIteratorRequestStream {
5526    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
5527    is_terminated: bool,
5528}
5529
5530impl std::marker::Unpin for DictionaryEnumerateIteratorRequestStream {}
5531
5532impl futures::stream::FusedStream for DictionaryEnumerateIteratorRequestStream {
5533    fn is_terminated(&self) -> bool {
5534        self.is_terminated
5535    }
5536}
5537
5538impl fdomain_client::fidl::RequestStream for DictionaryEnumerateIteratorRequestStream {
5539    type Protocol = DictionaryEnumerateIteratorMarker;
5540    type ControlHandle = DictionaryEnumerateIteratorControlHandle;
5541
5542    fn from_channel(channel: fdomain_client::Channel) -> Self {
5543        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5544    }
5545
5546    fn control_handle(&self) -> Self::ControlHandle {
5547        DictionaryEnumerateIteratorControlHandle { inner: self.inner.clone() }
5548    }
5549
5550    fn into_inner(
5551        self,
5552    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
5553    {
5554        (self.inner, self.is_terminated)
5555    }
5556
5557    fn from_inner(
5558        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
5559        is_terminated: bool,
5560    ) -> Self {
5561        Self { inner, is_terminated }
5562    }
5563}
5564
5565impl futures::Stream for DictionaryEnumerateIteratorRequestStream {
5566    type Item = Result<DictionaryEnumerateIteratorRequest, fidl::Error>;
5567
5568    fn poll_next(
5569        mut self: std::pin::Pin<&mut Self>,
5570        cx: &mut std::task::Context<'_>,
5571    ) -> std::task::Poll<Option<Self::Item>> {
5572        let this = &mut *self;
5573        if this.inner.check_shutdown(cx) {
5574            this.is_terminated = true;
5575            return std::task::Poll::Ready(None);
5576        }
5577        if this.is_terminated {
5578            panic!("polled DictionaryEnumerateIteratorRequestStream after completion");
5579        }
5580        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
5581            |bytes, handles| {
5582                match this.inner.channel().read_etc(cx, bytes, handles) {
5583                    std::task::Poll::Ready(Ok(())) => {}
5584                    std::task::Poll::Pending => return std::task::Poll::Pending,
5585                    std::task::Poll::Ready(Err(None)) => {
5586                        this.is_terminated = true;
5587                        return std::task::Poll::Ready(None);
5588                    }
5589                    std::task::Poll::Ready(Err(Some(e))) => {
5590                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5591                            e.into(),
5592                        ))))
5593                    }
5594                }
5595
5596                // A message has been received from the channel
5597                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5598
5599                std::task::Poll::Ready(Some(match header.ordinal {
5600                0x14f8bc286512f5cf => {
5601                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5602                    let mut req = fidl::new_empty!(DictionaryEnumerateIteratorGetNextRequest, fdomain_client::fidl::FDomainResourceDialect);
5603                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<DictionaryEnumerateIteratorGetNextRequest>(&header, _body_bytes, handles, &mut req)?;
5604                    let control_handle = DictionaryEnumerateIteratorControlHandle {
5605                        inner: this.inner.clone(),
5606                    };
5607                    Ok(DictionaryEnumerateIteratorRequest::GetNext {start_id: req.start_id,
5608limit: req.limit,
5609
5610                        responder: DictionaryEnumerateIteratorGetNextResponder {
5611                            control_handle: std::mem::ManuallyDrop::new(control_handle),
5612                            tx_id: header.tx_id,
5613                        },
5614                    })
5615                }
5616                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
5617                    Ok(DictionaryEnumerateIteratorRequest::_UnknownMethod {
5618                        ordinal: header.ordinal,
5619                        control_handle: DictionaryEnumerateIteratorControlHandle { inner: this.inner.clone() },
5620                        method_type: fidl::MethodType::OneWay,
5621                    })
5622                }
5623                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
5624                    this.inner.send_framework_err(
5625                        fidl::encoding::FrameworkErr::UnknownMethod,
5626                        header.tx_id,
5627                        header.ordinal,
5628                        header.dynamic_flags(),
5629                        (bytes, handles),
5630                    )?;
5631                    Ok(DictionaryEnumerateIteratorRequest::_UnknownMethod {
5632                        ordinal: header.ordinal,
5633                        control_handle: DictionaryEnumerateIteratorControlHandle { inner: this.inner.clone() },
5634                        method_type: fidl::MethodType::TwoWay,
5635                    })
5636                }
5637                _ => Err(fidl::Error::UnknownOrdinal {
5638                    ordinal: header.ordinal,
5639                    protocol_name: <DictionaryEnumerateIteratorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
5640                }),
5641            }))
5642            },
5643        )
5644    }
5645}
5646
5647#[derive(Debug)]
5648pub enum DictionaryEnumerateIteratorRequest {
5649    /// Returns the next batch of results for a [Dictionary.Enumerate] call, returning up to
5650    /// `limit` results. `limit` can be at most [MAX_DICTIONARY_ITERATOR_CHUNK].
5651    ///
5652    /// The value of each of `items` is a duplicate of the original capability
5653    /// ([CapabilityStore.Duplicate]), unless it could not be duplicated, it which case it will
5654    /// be null.
5655    ///
5656    /// Each returned capability will be assigned a monotonically increasing [CapabilityId] starting
5657    /// from `start_id`.
5658    ///
5659    /// In addition to the `items`, returns `end_id`, which is one more than the highest id reserved
5660    /// by [GetNext]. `end_id` can be used as the `start_id` for the next call to [GetNext].
5661    ///
5662    /// If [GetNext] returns an error, the server will also close the channel.
5663    ///
5664    /// Errors:
5665    ///
5666    /// - `ID_ALREADY_EXISTS` if some id in the range `[start_id, limit)` already exists in this
5667    ///   store.
5668    /// - `INVALID_ARGS` if `limit` was `0` or greater than `MAX_DICTIONARY_ITERATOR_CHUNK`.
5669    GetNext { start_id: u64, limit: u32, responder: DictionaryEnumerateIteratorGetNextResponder },
5670    /// An interaction was received which does not match any known method.
5671    #[non_exhaustive]
5672    _UnknownMethod {
5673        /// Ordinal of the method that was called.
5674        ordinal: u64,
5675        control_handle: DictionaryEnumerateIteratorControlHandle,
5676        method_type: fidl::MethodType,
5677    },
5678}
5679
5680impl DictionaryEnumerateIteratorRequest {
5681    #[allow(irrefutable_let_patterns)]
5682    pub fn into_get_next(self) -> Option<(u64, u32, DictionaryEnumerateIteratorGetNextResponder)> {
5683        if let DictionaryEnumerateIteratorRequest::GetNext { start_id, limit, responder } = self {
5684            Some((start_id, limit, responder))
5685        } else {
5686            None
5687        }
5688    }
5689
5690    /// Name of the method defined in FIDL
5691    pub fn method_name(&self) -> &'static str {
5692        match *self {
5693            DictionaryEnumerateIteratorRequest::GetNext { .. } => "get_next",
5694            DictionaryEnumerateIteratorRequest::_UnknownMethod {
5695                method_type: fidl::MethodType::OneWay,
5696                ..
5697            } => "unknown one-way method",
5698            DictionaryEnumerateIteratorRequest::_UnknownMethod {
5699                method_type: fidl::MethodType::TwoWay,
5700                ..
5701            } => "unknown two-way method",
5702        }
5703    }
5704}
5705
5706#[derive(Debug, Clone)]
5707pub struct DictionaryEnumerateIteratorControlHandle {
5708    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
5709}
5710
5711impl fdomain_client::fidl::ControlHandle for DictionaryEnumerateIteratorControlHandle {
5712    fn shutdown(&self) {
5713        self.inner.shutdown()
5714    }
5715
5716    fn is_closed(&self) -> bool {
5717        self.inner.channel().is_closed()
5718    }
5719    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
5720        self.inner.channel().on_closed()
5721    }
5722}
5723
5724impl DictionaryEnumerateIteratorControlHandle {}
5725
5726#[must_use = "FIDL methods require a response to be sent"]
5727#[derive(Debug)]
5728pub struct DictionaryEnumerateIteratorGetNextResponder {
5729    control_handle: std::mem::ManuallyDrop<DictionaryEnumerateIteratorControlHandle>,
5730    tx_id: u32,
5731}
5732
5733/// Set the the channel to be shutdown (see [`DictionaryEnumerateIteratorControlHandle::shutdown`])
5734/// if the responder is dropped without sending a response, so that the client
5735/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5736impl std::ops::Drop for DictionaryEnumerateIteratorGetNextResponder {
5737    fn drop(&mut self) {
5738        self.control_handle.shutdown();
5739        // Safety: drops once, never accessed again
5740        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5741    }
5742}
5743
5744impl fdomain_client::fidl::Responder for DictionaryEnumerateIteratorGetNextResponder {
5745    type ControlHandle = DictionaryEnumerateIteratorControlHandle;
5746
5747    fn control_handle(&self) -> &DictionaryEnumerateIteratorControlHandle {
5748        &self.control_handle
5749    }
5750
5751    fn drop_without_shutdown(mut self) {
5752        // Safety: drops once, never accessed again due to mem::forget
5753        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5754        // Prevent Drop from running (which would shut down the channel)
5755        std::mem::forget(self);
5756    }
5757}
5758
5759impl DictionaryEnumerateIteratorGetNextResponder {
5760    /// Sends a response to the FIDL transaction.
5761    ///
5762    /// Sets the channel to shutdown if an error occurs.
5763    pub fn send(
5764        self,
5765        mut result: Result<(Vec<DictionaryOptionalItem>, u64), CapabilityStoreError>,
5766    ) -> Result<(), fidl::Error> {
5767        let _result = self.send_raw(result);
5768        if _result.is_err() {
5769            self.control_handle.shutdown();
5770        }
5771        self.drop_without_shutdown();
5772        _result
5773    }
5774
5775    /// Similar to "send" but does not shutdown the channel if an error occurs.
5776    pub fn send_no_shutdown_on_err(
5777        self,
5778        mut result: Result<(Vec<DictionaryOptionalItem>, u64), CapabilityStoreError>,
5779    ) -> Result<(), fidl::Error> {
5780        let _result = self.send_raw(result);
5781        self.drop_without_shutdown();
5782        _result
5783    }
5784
5785    fn send_raw(
5786        &self,
5787        mut result: Result<(Vec<DictionaryOptionalItem>, u64), CapabilityStoreError>,
5788    ) -> Result<(), fidl::Error> {
5789        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
5790            DictionaryEnumerateIteratorGetNextResponse,
5791            CapabilityStoreError,
5792        >>(
5793            fidl::encoding::FlexibleResult::new(
5794                result
5795                    .as_mut()
5796                    .map_err(|e| *e)
5797                    .map(|(items, end_id)| (items.as_mut_slice(), *end_id)),
5798            ),
5799            self.tx_id,
5800            0x14f8bc286512f5cf,
5801            fidl::encoding::DynamicFlags::FLEXIBLE,
5802        )
5803    }
5804}
5805
5806#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5807pub struct DictionaryKeysIteratorMarker;
5808
5809impl fdomain_client::fidl::ProtocolMarker for DictionaryKeysIteratorMarker {
5810    type Proxy = DictionaryKeysIteratorProxy;
5811    type RequestStream = DictionaryKeysIteratorRequestStream;
5812
5813    const DEBUG_NAME: &'static str = "(anonymous) DictionaryKeysIterator";
5814}
5815
5816pub trait DictionaryKeysIteratorProxyInterface: Send + Sync {
5817    type GetNextResponseFut: std::future::Future<Output = Result<Vec<String>, fidl::Error>> + Send;
5818    fn r#get_next(&self) -> Self::GetNextResponseFut;
5819}
5820
5821#[derive(Debug, Clone)]
5822pub struct DictionaryKeysIteratorProxy {
5823    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
5824}
5825
5826impl fdomain_client::fidl::Proxy for DictionaryKeysIteratorProxy {
5827    type Protocol = DictionaryKeysIteratorMarker;
5828
5829    fn from_channel(inner: fdomain_client::Channel) -> Self {
5830        Self::new(inner)
5831    }
5832
5833    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
5834        self.client.into_channel().map_err(|client| Self { client })
5835    }
5836
5837    fn as_channel(&self) -> &fdomain_client::Channel {
5838        self.client.as_channel()
5839    }
5840}
5841
5842impl DictionaryKeysIteratorProxy {
5843    /// Create a new Proxy for fuchsia.component.sandbox/DictionaryKeysIterator.
5844    pub fn new(channel: fdomain_client::Channel) -> Self {
5845        let protocol_name =
5846            <DictionaryKeysIteratorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
5847        Self { client: fidl::client::Client::new(channel, protocol_name) }
5848    }
5849
5850    /// Get a Stream of events from the remote end of the protocol.
5851    ///
5852    /// # Panics
5853    ///
5854    /// Panics if the event stream was already taken.
5855    pub fn take_event_stream(&self) -> DictionaryKeysIteratorEventStream {
5856        DictionaryKeysIteratorEventStream { event_receiver: self.client.take_event_receiver() }
5857    }
5858
5859    pub fn r#get_next(
5860        &self,
5861    ) -> fidl::client::QueryResponseFut<Vec<String>, fdomain_client::fidl::FDomainResourceDialect>
5862    {
5863        DictionaryKeysIteratorProxyInterface::r#get_next(self)
5864    }
5865}
5866
5867impl DictionaryKeysIteratorProxyInterface for DictionaryKeysIteratorProxy {
5868    type GetNextResponseFut =
5869        fidl::client::QueryResponseFut<Vec<String>, fdomain_client::fidl::FDomainResourceDialect>;
5870    fn r#get_next(&self) -> Self::GetNextResponseFut {
5871        fn _decode(
5872            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5873        ) -> Result<Vec<String>, fidl::Error> {
5874            let _response = fidl::client::decode_transaction_body::<
5875                fidl::encoding::FlexibleType<DictionaryKeysIteratorGetNextResponse>,
5876                fdomain_client::fidl::FDomainResourceDialect,
5877                0x453828cbacca7d53,
5878            >(_buf?)?
5879            .into_result_fdomain::<DictionaryKeysIteratorMarker>("get_next")?;
5880            Ok(_response.keys)
5881        }
5882        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<String>>(
5883            (),
5884            0x453828cbacca7d53,
5885            fidl::encoding::DynamicFlags::FLEXIBLE,
5886            _decode,
5887        )
5888    }
5889}
5890
5891pub struct DictionaryKeysIteratorEventStream {
5892    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
5893}
5894
5895impl std::marker::Unpin for DictionaryKeysIteratorEventStream {}
5896
5897impl futures::stream::FusedStream for DictionaryKeysIteratorEventStream {
5898    fn is_terminated(&self) -> bool {
5899        self.event_receiver.is_terminated()
5900    }
5901}
5902
5903impl futures::Stream for DictionaryKeysIteratorEventStream {
5904    type Item = Result<DictionaryKeysIteratorEvent, fidl::Error>;
5905
5906    fn poll_next(
5907        mut self: std::pin::Pin<&mut Self>,
5908        cx: &mut std::task::Context<'_>,
5909    ) -> std::task::Poll<Option<Self::Item>> {
5910        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5911            &mut self.event_receiver,
5912            cx
5913        )?) {
5914            Some(buf) => std::task::Poll::Ready(Some(DictionaryKeysIteratorEvent::decode(buf))),
5915            None => std::task::Poll::Ready(None),
5916        }
5917    }
5918}
5919
5920#[derive(Debug)]
5921pub enum DictionaryKeysIteratorEvent {
5922    #[non_exhaustive]
5923    _UnknownEvent {
5924        /// Ordinal of the event that was sent.
5925        ordinal: u64,
5926    },
5927}
5928
5929impl DictionaryKeysIteratorEvent {
5930    /// Decodes a message buffer as a [`DictionaryKeysIteratorEvent`].
5931    fn decode(
5932        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5933    ) -> Result<DictionaryKeysIteratorEvent, fidl::Error> {
5934        let (bytes, _handles) = buf.split_mut();
5935        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5936        debug_assert_eq!(tx_header.tx_id, 0);
5937        match tx_header.ordinal {
5938            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
5939                Ok(DictionaryKeysIteratorEvent::_UnknownEvent {
5940                    ordinal: tx_header.ordinal,
5941                })
5942            }
5943            _ => Err(fidl::Error::UnknownOrdinal {
5944                ordinal: tx_header.ordinal,
5945                protocol_name: <DictionaryKeysIteratorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
5946            })
5947        }
5948    }
5949}
5950
5951/// A Stream of incoming requests for fuchsia.component.sandbox/DictionaryKeysIterator.
5952pub struct DictionaryKeysIteratorRequestStream {
5953    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
5954    is_terminated: bool,
5955}
5956
5957impl std::marker::Unpin for DictionaryKeysIteratorRequestStream {}
5958
5959impl futures::stream::FusedStream for DictionaryKeysIteratorRequestStream {
5960    fn is_terminated(&self) -> bool {
5961        self.is_terminated
5962    }
5963}
5964
5965impl fdomain_client::fidl::RequestStream for DictionaryKeysIteratorRequestStream {
5966    type Protocol = DictionaryKeysIteratorMarker;
5967    type ControlHandle = DictionaryKeysIteratorControlHandle;
5968
5969    fn from_channel(channel: fdomain_client::Channel) -> Self {
5970        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5971    }
5972
5973    fn control_handle(&self) -> Self::ControlHandle {
5974        DictionaryKeysIteratorControlHandle { inner: self.inner.clone() }
5975    }
5976
5977    fn into_inner(
5978        self,
5979    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
5980    {
5981        (self.inner, self.is_terminated)
5982    }
5983
5984    fn from_inner(
5985        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
5986        is_terminated: bool,
5987    ) -> Self {
5988        Self { inner, is_terminated }
5989    }
5990}
5991
5992impl futures::Stream for DictionaryKeysIteratorRequestStream {
5993    type Item = Result<DictionaryKeysIteratorRequest, fidl::Error>;
5994
5995    fn poll_next(
5996        mut self: std::pin::Pin<&mut Self>,
5997        cx: &mut std::task::Context<'_>,
5998    ) -> std::task::Poll<Option<Self::Item>> {
5999        let this = &mut *self;
6000        if this.inner.check_shutdown(cx) {
6001            this.is_terminated = true;
6002            return std::task::Poll::Ready(None);
6003        }
6004        if this.is_terminated {
6005            panic!("polled DictionaryKeysIteratorRequestStream after completion");
6006        }
6007        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
6008            |bytes, handles| {
6009                match this.inner.channel().read_etc(cx, bytes, handles) {
6010                    std::task::Poll::Ready(Ok(())) => {}
6011                    std::task::Poll::Pending => return std::task::Poll::Pending,
6012                    std::task::Poll::Ready(Err(None)) => {
6013                        this.is_terminated = true;
6014                        return std::task::Poll::Ready(None);
6015                    }
6016                    std::task::Poll::Ready(Err(Some(e))) => {
6017                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6018                            e.into(),
6019                        ))))
6020                    }
6021                }
6022
6023                // A message has been received from the channel
6024                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6025
6026                std::task::Poll::Ready(Some(match header.ordinal {
6027                0x453828cbacca7d53 => {
6028                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6029                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fdomain_client::fidl::FDomainResourceDialect);
6030                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6031                    let control_handle = DictionaryKeysIteratorControlHandle {
6032                        inner: this.inner.clone(),
6033                    };
6034                    Ok(DictionaryKeysIteratorRequest::GetNext {
6035                        responder: DictionaryKeysIteratorGetNextResponder {
6036                            control_handle: std::mem::ManuallyDrop::new(control_handle),
6037                            tx_id: header.tx_id,
6038                        },
6039                    })
6040                }
6041                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6042                    Ok(DictionaryKeysIteratorRequest::_UnknownMethod {
6043                        ordinal: header.ordinal,
6044                        control_handle: DictionaryKeysIteratorControlHandle { inner: this.inner.clone() },
6045                        method_type: fidl::MethodType::OneWay,
6046                    })
6047                }
6048                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6049                    this.inner.send_framework_err(
6050                        fidl::encoding::FrameworkErr::UnknownMethod,
6051                        header.tx_id,
6052                        header.ordinal,
6053                        header.dynamic_flags(),
6054                        (bytes, handles),
6055                    )?;
6056                    Ok(DictionaryKeysIteratorRequest::_UnknownMethod {
6057                        ordinal: header.ordinal,
6058                        control_handle: DictionaryKeysIteratorControlHandle { inner: this.inner.clone() },
6059                        method_type: fidl::MethodType::TwoWay,
6060                    })
6061                }
6062                _ => Err(fidl::Error::UnknownOrdinal {
6063                    ordinal: header.ordinal,
6064                    protocol_name: <DictionaryKeysIteratorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
6065                }),
6066            }))
6067            },
6068        )
6069    }
6070}
6071
6072#[derive(Debug)]
6073pub enum DictionaryKeysIteratorRequest {
6074    GetNext {
6075        responder: DictionaryKeysIteratorGetNextResponder,
6076    },
6077    /// An interaction was received which does not match any known method.
6078    #[non_exhaustive]
6079    _UnknownMethod {
6080        /// Ordinal of the method that was called.
6081        ordinal: u64,
6082        control_handle: DictionaryKeysIteratorControlHandle,
6083        method_type: fidl::MethodType,
6084    },
6085}
6086
6087impl DictionaryKeysIteratorRequest {
6088    #[allow(irrefutable_let_patterns)]
6089    pub fn into_get_next(self) -> Option<(DictionaryKeysIteratorGetNextResponder)> {
6090        if let DictionaryKeysIteratorRequest::GetNext { responder } = self {
6091            Some((responder))
6092        } else {
6093            None
6094        }
6095    }
6096
6097    /// Name of the method defined in FIDL
6098    pub fn method_name(&self) -> &'static str {
6099        match *self {
6100            DictionaryKeysIteratorRequest::GetNext { .. } => "get_next",
6101            DictionaryKeysIteratorRequest::_UnknownMethod {
6102                method_type: fidl::MethodType::OneWay,
6103                ..
6104            } => "unknown one-way method",
6105            DictionaryKeysIteratorRequest::_UnknownMethod {
6106                method_type: fidl::MethodType::TwoWay,
6107                ..
6108            } => "unknown two-way method",
6109        }
6110    }
6111}
6112
6113#[derive(Debug, Clone)]
6114pub struct DictionaryKeysIteratorControlHandle {
6115    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
6116}
6117
6118impl fdomain_client::fidl::ControlHandle for DictionaryKeysIteratorControlHandle {
6119    fn shutdown(&self) {
6120        self.inner.shutdown()
6121    }
6122
6123    fn is_closed(&self) -> bool {
6124        self.inner.channel().is_closed()
6125    }
6126    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
6127        self.inner.channel().on_closed()
6128    }
6129}
6130
6131impl DictionaryKeysIteratorControlHandle {}
6132
6133#[must_use = "FIDL methods require a response to be sent"]
6134#[derive(Debug)]
6135pub struct DictionaryKeysIteratorGetNextResponder {
6136    control_handle: std::mem::ManuallyDrop<DictionaryKeysIteratorControlHandle>,
6137    tx_id: u32,
6138}
6139
6140/// Set the the channel to be shutdown (see [`DictionaryKeysIteratorControlHandle::shutdown`])
6141/// if the responder is dropped without sending a response, so that the client
6142/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6143impl std::ops::Drop for DictionaryKeysIteratorGetNextResponder {
6144    fn drop(&mut self) {
6145        self.control_handle.shutdown();
6146        // Safety: drops once, never accessed again
6147        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6148    }
6149}
6150
6151impl fdomain_client::fidl::Responder for DictionaryKeysIteratorGetNextResponder {
6152    type ControlHandle = DictionaryKeysIteratorControlHandle;
6153
6154    fn control_handle(&self) -> &DictionaryKeysIteratorControlHandle {
6155        &self.control_handle
6156    }
6157
6158    fn drop_without_shutdown(mut self) {
6159        // Safety: drops once, never accessed again due to mem::forget
6160        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6161        // Prevent Drop from running (which would shut down the channel)
6162        std::mem::forget(self);
6163    }
6164}
6165
6166impl DictionaryKeysIteratorGetNextResponder {
6167    /// Sends a response to the FIDL transaction.
6168    ///
6169    /// Sets the channel to shutdown if an error occurs.
6170    pub fn send(self, mut keys: &[String]) -> Result<(), fidl::Error> {
6171        let _result = self.send_raw(keys);
6172        if _result.is_err() {
6173            self.control_handle.shutdown();
6174        }
6175        self.drop_without_shutdown();
6176        _result
6177    }
6178
6179    /// Similar to "send" but does not shutdown the channel if an error occurs.
6180    pub fn send_no_shutdown_on_err(self, mut keys: &[String]) -> Result<(), fidl::Error> {
6181        let _result = self.send_raw(keys);
6182        self.drop_without_shutdown();
6183        _result
6184    }
6185
6186    fn send_raw(&self, mut keys: &[String]) -> Result<(), fidl::Error> {
6187        self.control_handle
6188            .inner
6189            .send::<fidl::encoding::FlexibleType<DictionaryKeysIteratorGetNextResponse>>(
6190                fidl::encoding::Flexible::new((keys,)),
6191                self.tx_id,
6192                0x453828cbacca7d53,
6193                fidl::encoding::DynamicFlags::FLEXIBLE,
6194            )
6195    }
6196}
6197
6198#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6199pub struct DictionaryRouterMarker;
6200
6201impl fdomain_client::fidl::ProtocolMarker for DictionaryRouterMarker {
6202    type Proxy = DictionaryRouterProxy;
6203    type RequestStream = DictionaryRouterRequestStream;
6204
6205    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.DictionaryRouter";
6206}
6207impl fdomain_client::fidl::DiscoverableProtocolMarker for DictionaryRouterMarker {}
6208pub type DictionaryRouterRouteResult = Result<DictionaryRouterRouteResponse, RouterError>;
6209
6210pub trait DictionaryRouterProxyInterface: Send + Sync {
6211    type RouteResponseFut: std::future::Future<Output = Result<DictionaryRouterRouteResult, fidl::Error>>
6212        + Send;
6213    fn r#route(&self, payload: RouteRequest) -> Self::RouteResponseFut;
6214}
6215
6216#[derive(Debug, Clone)]
6217pub struct DictionaryRouterProxy {
6218    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
6219}
6220
6221impl fdomain_client::fidl::Proxy for DictionaryRouterProxy {
6222    type Protocol = DictionaryRouterMarker;
6223
6224    fn from_channel(inner: fdomain_client::Channel) -> Self {
6225        Self::new(inner)
6226    }
6227
6228    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
6229        self.client.into_channel().map_err(|client| Self { client })
6230    }
6231
6232    fn as_channel(&self) -> &fdomain_client::Channel {
6233        self.client.as_channel()
6234    }
6235}
6236
6237impl DictionaryRouterProxy {
6238    /// Create a new Proxy for fuchsia.component.sandbox/DictionaryRouter.
6239    pub fn new(channel: fdomain_client::Channel) -> Self {
6240        let protocol_name =
6241            <DictionaryRouterMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
6242        Self { client: fidl::client::Client::new(channel, protocol_name) }
6243    }
6244
6245    /// Get a Stream of events from the remote end of the protocol.
6246    ///
6247    /// # Panics
6248    ///
6249    /// Panics if the event stream was already taken.
6250    pub fn take_event_stream(&self) -> DictionaryRouterEventStream {
6251        DictionaryRouterEventStream { event_receiver: self.client.take_event_receiver() }
6252    }
6253
6254    pub fn r#route(
6255        &self,
6256        mut payload: RouteRequest,
6257    ) -> fidl::client::QueryResponseFut<
6258        DictionaryRouterRouteResult,
6259        fdomain_client::fidl::FDomainResourceDialect,
6260    > {
6261        DictionaryRouterProxyInterface::r#route(self, payload)
6262    }
6263}
6264
6265impl DictionaryRouterProxyInterface for DictionaryRouterProxy {
6266    type RouteResponseFut = fidl::client::QueryResponseFut<
6267        DictionaryRouterRouteResult,
6268        fdomain_client::fidl::FDomainResourceDialect,
6269    >;
6270    fn r#route(&self, mut payload: RouteRequest) -> Self::RouteResponseFut {
6271        fn _decode(
6272            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6273        ) -> Result<DictionaryRouterRouteResult, fidl::Error> {
6274            let _response = fidl::client::decode_transaction_body::<
6275                fidl::encoding::FlexibleResultType<DictionaryRouterRouteResponse, RouterError>,
6276                fdomain_client::fidl::FDomainResourceDialect,
6277                0x714c65bfe54bd79f,
6278            >(_buf?)?
6279            .into_result_fdomain::<DictionaryRouterMarker>("route")?;
6280            Ok(_response.map(|x| x))
6281        }
6282        self.client.send_query_and_decode::<RouteRequest, DictionaryRouterRouteResult>(
6283            &mut payload,
6284            0x714c65bfe54bd79f,
6285            fidl::encoding::DynamicFlags::FLEXIBLE,
6286            _decode,
6287        )
6288    }
6289}
6290
6291pub struct DictionaryRouterEventStream {
6292    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
6293}
6294
6295impl std::marker::Unpin for DictionaryRouterEventStream {}
6296
6297impl futures::stream::FusedStream for DictionaryRouterEventStream {
6298    fn is_terminated(&self) -> bool {
6299        self.event_receiver.is_terminated()
6300    }
6301}
6302
6303impl futures::Stream for DictionaryRouterEventStream {
6304    type Item = Result<DictionaryRouterEvent, fidl::Error>;
6305
6306    fn poll_next(
6307        mut self: std::pin::Pin<&mut Self>,
6308        cx: &mut std::task::Context<'_>,
6309    ) -> std::task::Poll<Option<Self::Item>> {
6310        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6311            &mut self.event_receiver,
6312            cx
6313        )?) {
6314            Some(buf) => std::task::Poll::Ready(Some(DictionaryRouterEvent::decode(buf))),
6315            None => std::task::Poll::Ready(None),
6316        }
6317    }
6318}
6319
6320#[derive(Debug)]
6321pub enum DictionaryRouterEvent {
6322    #[non_exhaustive]
6323    _UnknownEvent {
6324        /// Ordinal of the event that was sent.
6325        ordinal: u64,
6326    },
6327}
6328
6329impl DictionaryRouterEvent {
6330    /// Decodes a message buffer as a [`DictionaryRouterEvent`].
6331    fn decode(
6332        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6333    ) -> Result<DictionaryRouterEvent, fidl::Error> {
6334        let (bytes, _handles) = buf.split_mut();
6335        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6336        debug_assert_eq!(tx_header.tx_id, 0);
6337        match tx_header.ordinal {
6338            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6339                Ok(DictionaryRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
6340            }
6341            _ => Err(fidl::Error::UnknownOrdinal {
6342                ordinal: tx_header.ordinal,
6343                protocol_name:
6344                    <DictionaryRouterMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
6345            }),
6346        }
6347    }
6348}
6349
6350/// A Stream of incoming requests for fuchsia.component.sandbox/DictionaryRouter.
6351pub struct DictionaryRouterRequestStream {
6352    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
6353    is_terminated: bool,
6354}
6355
6356impl std::marker::Unpin for DictionaryRouterRequestStream {}
6357
6358impl futures::stream::FusedStream for DictionaryRouterRequestStream {
6359    fn is_terminated(&self) -> bool {
6360        self.is_terminated
6361    }
6362}
6363
6364impl fdomain_client::fidl::RequestStream for DictionaryRouterRequestStream {
6365    type Protocol = DictionaryRouterMarker;
6366    type ControlHandle = DictionaryRouterControlHandle;
6367
6368    fn from_channel(channel: fdomain_client::Channel) -> Self {
6369        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6370    }
6371
6372    fn control_handle(&self) -> Self::ControlHandle {
6373        DictionaryRouterControlHandle { inner: self.inner.clone() }
6374    }
6375
6376    fn into_inner(
6377        self,
6378    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
6379    {
6380        (self.inner, self.is_terminated)
6381    }
6382
6383    fn from_inner(
6384        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
6385        is_terminated: bool,
6386    ) -> Self {
6387        Self { inner, is_terminated }
6388    }
6389}
6390
6391impl futures::Stream for DictionaryRouterRequestStream {
6392    type Item = Result<DictionaryRouterRequest, fidl::Error>;
6393
6394    fn poll_next(
6395        mut self: std::pin::Pin<&mut Self>,
6396        cx: &mut std::task::Context<'_>,
6397    ) -> std::task::Poll<Option<Self::Item>> {
6398        let this = &mut *self;
6399        if this.inner.check_shutdown(cx) {
6400            this.is_terminated = true;
6401            return std::task::Poll::Ready(None);
6402        }
6403        if this.is_terminated {
6404            panic!("polled DictionaryRouterRequestStream after completion");
6405        }
6406        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
6407            |bytes, handles| {
6408                match this.inner.channel().read_etc(cx, bytes, handles) {
6409                    std::task::Poll::Ready(Ok(())) => {}
6410                    std::task::Poll::Pending => return std::task::Poll::Pending,
6411                    std::task::Poll::Ready(Err(None)) => {
6412                        this.is_terminated = true;
6413                        return std::task::Poll::Ready(None);
6414                    }
6415                    std::task::Poll::Ready(Err(Some(e))) => {
6416                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6417                            e.into(),
6418                        ))))
6419                    }
6420                }
6421
6422                // A message has been received from the channel
6423                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6424
6425                std::task::Poll::Ready(Some(match header.ordinal {
6426                0x714c65bfe54bd79f => {
6427                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6428                    let mut req = fidl::new_empty!(RouteRequest, fdomain_client::fidl::FDomainResourceDialect);
6429                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<RouteRequest>(&header, _body_bytes, handles, &mut req)?;
6430                    let control_handle = DictionaryRouterControlHandle {
6431                        inner: this.inner.clone(),
6432                    };
6433                    Ok(DictionaryRouterRequest::Route {payload: req,
6434                        responder: DictionaryRouterRouteResponder {
6435                            control_handle: std::mem::ManuallyDrop::new(control_handle),
6436                            tx_id: header.tx_id,
6437                        },
6438                    })
6439                }
6440                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6441                    Ok(DictionaryRouterRequest::_UnknownMethod {
6442                        ordinal: header.ordinal,
6443                        control_handle: DictionaryRouterControlHandle { inner: this.inner.clone() },
6444                        method_type: fidl::MethodType::OneWay,
6445                    })
6446                }
6447                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6448                    this.inner.send_framework_err(
6449                        fidl::encoding::FrameworkErr::UnknownMethod,
6450                        header.tx_id,
6451                        header.ordinal,
6452                        header.dynamic_flags(),
6453                        (bytes, handles),
6454                    )?;
6455                    Ok(DictionaryRouterRequest::_UnknownMethod {
6456                        ordinal: header.ordinal,
6457                        control_handle: DictionaryRouterControlHandle { inner: this.inner.clone() },
6458                        method_type: fidl::MethodType::TwoWay,
6459                    })
6460                }
6461                _ => Err(fidl::Error::UnknownOrdinal {
6462                    ordinal: header.ordinal,
6463                    protocol_name: <DictionaryRouterMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
6464                }),
6465            }))
6466            },
6467        )
6468    }
6469}
6470
6471#[derive(Debug)]
6472pub enum DictionaryRouterRequest {
6473    Route {
6474        payload: RouteRequest,
6475        responder: DictionaryRouterRouteResponder,
6476    },
6477    /// An interaction was received which does not match any known method.
6478    #[non_exhaustive]
6479    _UnknownMethod {
6480        /// Ordinal of the method that was called.
6481        ordinal: u64,
6482        control_handle: DictionaryRouterControlHandle,
6483        method_type: fidl::MethodType,
6484    },
6485}
6486
6487impl DictionaryRouterRequest {
6488    #[allow(irrefutable_let_patterns)]
6489    pub fn into_route(self) -> Option<(RouteRequest, DictionaryRouterRouteResponder)> {
6490        if let DictionaryRouterRequest::Route { payload, responder } = self {
6491            Some((payload, responder))
6492        } else {
6493            None
6494        }
6495    }
6496
6497    /// Name of the method defined in FIDL
6498    pub fn method_name(&self) -> &'static str {
6499        match *self {
6500            DictionaryRouterRequest::Route { .. } => "route",
6501            DictionaryRouterRequest::_UnknownMethod {
6502                method_type: fidl::MethodType::OneWay,
6503                ..
6504            } => "unknown one-way method",
6505            DictionaryRouterRequest::_UnknownMethod {
6506                method_type: fidl::MethodType::TwoWay,
6507                ..
6508            } => "unknown two-way method",
6509        }
6510    }
6511}
6512
6513#[derive(Debug, Clone)]
6514pub struct DictionaryRouterControlHandle {
6515    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
6516}
6517
6518impl fdomain_client::fidl::ControlHandle for DictionaryRouterControlHandle {
6519    fn shutdown(&self) {
6520        self.inner.shutdown()
6521    }
6522
6523    fn is_closed(&self) -> bool {
6524        self.inner.channel().is_closed()
6525    }
6526    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
6527        self.inner.channel().on_closed()
6528    }
6529}
6530
6531impl DictionaryRouterControlHandle {}
6532
6533#[must_use = "FIDL methods require a response to be sent"]
6534#[derive(Debug)]
6535pub struct DictionaryRouterRouteResponder {
6536    control_handle: std::mem::ManuallyDrop<DictionaryRouterControlHandle>,
6537    tx_id: u32,
6538}
6539
6540/// Set the the channel to be shutdown (see [`DictionaryRouterControlHandle::shutdown`])
6541/// if the responder is dropped without sending a response, so that the client
6542/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6543impl std::ops::Drop for DictionaryRouterRouteResponder {
6544    fn drop(&mut self) {
6545        self.control_handle.shutdown();
6546        // Safety: drops once, never accessed again
6547        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6548    }
6549}
6550
6551impl fdomain_client::fidl::Responder for DictionaryRouterRouteResponder {
6552    type ControlHandle = DictionaryRouterControlHandle;
6553
6554    fn control_handle(&self) -> &DictionaryRouterControlHandle {
6555        &self.control_handle
6556    }
6557
6558    fn drop_without_shutdown(mut self) {
6559        // Safety: drops once, never accessed again due to mem::forget
6560        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6561        // Prevent Drop from running (which would shut down the channel)
6562        std::mem::forget(self);
6563    }
6564}
6565
6566impl DictionaryRouterRouteResponder {
6567    /// Sends a response to the FIDL transaction.
6568    ///
6569    /// Sets the channel to shutdown if an error occurs.
6570    pub fn send(
6571        self,
6572        mut result: Result<DictionaryRouterRouteResponse, RouterError>,
6573    ) -> Result<(), fidl::Error> {
6574        let _result = self.send_raw(result);
6575        if _result.is_err() {
6576            self.control_handle.shutdown();
6577        }
6578        self.drop_without_shutdown();
6579        _result
6580    }
6581
6582    /// Similar to "send" but does not shutdown the channel if an error occurs.
6583    pub fn send_no_shutdown_on_err(
6584        self,
6585        mut result: Result<DictionaryRouterRouteResponse, RouterError>,
6586    ) -> Result<(), fidl::Error> {
6587        let _result = self.send_raw(result);
6588        self.drop_without_shutdown();
6589        _result
6590    }
6591
6592    fn send_raw(
6593        &self,
6594        mut result: Result<DictionaryRouterRouteResponse, RouterError>,
6595    ) -> Result<(), fidl::Error> {
6596        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
6597            DictionaryRouterRouteResponse,
6598            RouterError,
6599        >>(
6600            fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
6601            self.tx_id,
6602            0x714c65bfe54bd79f,
6603            fidl::encoding::DynamicFlags::FLEXIBLE,
6604        )
6605    }
6606}
6607
6608#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6609pub struct DirConnectorRouterMarker;
6610
6611impl fdomain_client::fidl::ProtocolMarker for DirConnectorRouterMarker {
6612    type Proxy = DirConnectorRouterProxy;
6613    type RequestStream = DirConnectorRouterRequestStream;
6614
6615    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.DirConnectorRouter";
6616}
6617impl fdomain_client::fidl::DiscoverableProtocolMarker for DirConnectorRouterMarker {}
6618pub type DirConnectorRouterRouteResult = Result<DirConnectorRouterRouteResponse, RouterError>;
6619
6620pub trait DirConnectorRouterProxyInterface: Send + Sync {
6621    type RouteResponseFut: std::future::Future<Output = Result<DirConnectorRouterRouteResult, fidl::Error>>
6622        + Send;
6623    fn r#route(&self, payload: RouteRequest) -> Self::RouteResponseFut;
6624}
6625
6626#[derive(Debug, Clone)]
6627pub struct DirConnectorRouterProxy {
6628    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
6629}
6630
6631impl fdomain_client::fidl::Proxy for DirConnectorRouterProxy {
6632    type Protocol = DirConnectorRouterMarker;
6633
6634    fn from_channel(inner: fdomain_client::Channel) -> Self {
6635        Self::new(inner)
6636    }
6637
6638    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
6639        self.client.into_channel().map_err(|client| Self { client })
6640    }
6641
6642    fn as_channel(&self) -> &fdomain_client::Channel {
6643        self.client.as_channel()
6644    }
6645}
6646
6647impl DirConnectorRouterProxy {
6648    /// Create a new Proxy for fuchsia.component.sandbox/DirConnectorRouter.
6649    pub fn new(channel: fdomain_client::Channel) -> Self {
6650        let protocol_name =
6651            <DirConnectorRouterMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
6652        Self { client: fidl::client::Client::new(channel, protocol_name) }
6653    }
6654
6655    /// Get a Stream of events from the remote end of the protocol.
6656    ///
6657    /// # Panics
6658    ///
6659    /// Panics if the event stream was already taken.
6660    pub fn take_event_stream(&self) -> DirConnectorRouterEventStream {
6661        DirConnectorRouterEventStream { event_receiver: self.client.take_event_receiver() }
6662    }
6663
6664    pub fn r#route(
6665        &self,
6666        mut payload: RouteRequest,
6667    ) -> fidl::client::QueryResponseFut<
6668        DirConnectorRouterRouteResult,
6669        fdomain_client::fidl::FDomainResourceDialect,
6670    > {
6671        DirConnectorRouterProxyInterface::r#route(self, payload)
6672    }
6673}
6674
6675impl DirConnectorRouterProxyInterface for DirConnectorRouterProxy {
6676    type RouteResponseFut = fidl::client::QueryResponseFut<
6677        DirConnectorRouterRouteResult,
6678        fdomain_client::fidl::FDomainResourceDialect,
6679    >;
6680    fn r#route(&self, mut payload: RouteRequest) -> Self::RouteResponseFut {
6681        fn _decode(
6682            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6683        ) -> Result<DirConnectorRouterRouteResult, fidl::Error> {
6684            let _response = fidl::client::decode_transaction_body::<
6685                fidl::encoding::FlexibleResultType<DirConnectorRouterRouteResponse, RouterError>,
6686                fdomain_client::fidl::FDomainResourceDialect,
6687                0xd7e0f01da2c8e40,
6688            >(_buf?)?
6689            .into_result_fdomain::<DirConnectorRouterMarker>("route")?;
6690            Ok(_response.map(|x| x))
6691        }
6692        self.client.send_query_and_decode::<RouteRequest, DirConnectorRouterRouteResult>(
6693            &mut payload,
6694            0xd7e0f01da2c8e40,
6695            fidl::encoding::DynamicFlags::FLEXIBLE,
6696            _decode,
6697        )
6698    }
6699}
6700
6701pub struct DirConnectorRouterEventStream {
6702    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
6703}
6704
6705impl std::marker::Unpin for DirConnectorRouterEventStream {}
6706
6707impl futures::stream::FusedStream for DirConnectorRouterEventStream {
6708    fn is_terminated(&self) -> bool {
6709        self.event_receiver.is_terminated()
6710    }
6711}
6712
6713impl futures::Stream for DirConnectorRouterEventStream {
6714    type Item = Result<DirConnectorRouterEvent, fidl::Error>;
6715
6716    fn poll_next(
6717        mut self: std::pin::Pin<&mut Self>,
6718        cx: &mut std::task::Context<'_>,
6719    ) -> std::task::Poll<Option<Self::Item>> {
6720        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6721            &mut self.event_receiver,
6722            cx
6723        )?) {
6724            Some(buf) => std::task::Poll::Ready(Some(DirConnectorRouterEvent::decode(buf))),
6725            None => std::task::Poll::Ready(None),
6726        }
6727    }
6728}
6729
6730#[derive(Debug)]
6731pub enum DirConnectorRouterEvent {
6732    #[non_exhaustive]
6733    _UnknownEvent {
6734        /// Ordinal of the event that was sent.
6735        ordinal: u64,
6736    },
6737}
6738
6739impl DirConnectorRouterEvent {
6740    /// Decodes a message buffer as a [`DirConnectorRouterEvent`].
6741    fn decode(
6742        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6743    ) -> Result<DirConnectorRouterEvent, fidl::Error> {
6744        let (bytes, _handles) = buf.split_mut();
6745        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6746        debug_assert_eq!(tx_header.tx_id, 0);
6747        match tx_header.ordinal {
6748            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6749                Ok(DirConnectorRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
6750            }
6751            _ => Err(fidl::Error::UnknownOrdinal {
6752                ordinal: tx_header.ordinal,
6753                protocol_name:
6754                    <DirConnectorRouterMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
6755            }),
6756        }
6757    }
6758}
6759
6760/// A Stream of incoming requests for fuchsia.component.sandbox/DirConnectorRouter.
6761pub struct DirConnectorRouterRequestStream {
6762    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
6763    is_terminated: bool,
6764}
6765
6766impl std::marker::Unpin for DirConnectorRouterRequestStream {}
6767
6768impl futures::stream::FusedStream for DirConnectorRouterRequestStream {
6769    fn is_terminated(&self) -> bool {
6770        self.is_terminated
6771    }
6772}
6773
6774impl fdomain_client::fidl::RequestStream for DirConnectorRouterRequestStream {
6775    type Protocol = DirConnectorRouterMarker;
6776    type ControlHandle = DirConnectorRouterControlHandle;
6777
6778    fn from_channel(channel: fdomain_client::Channel) -> Self {
6779        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6780    }
6781
6782    fn control_handle(&self) -> Self::ControlHandle {
6783        DirConnectorRouterControlHandle { inner: self.inner.clone() }
6784    }
6785
6786    fn into_inner(
6787        self,
6788    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
6789    {
6790        (self.inner, self.is_terminated)
6791    }
6792
6793    fn from_inner(
6794        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
6795        is_terminated: bool,
6796    ) -> Self {
6797        Self { inner, is_terminated }
6798    }
6799}
6800
6801impl futures::Stream for DirConnectorRouterRequestStream {
6802    type Item = Result<DirConnectorRouterRequest, fidl::Error>;
6803
6804    fn poll_next(
6805        mut self: std::pin::Pin<&mut Self>,
6806        cx: &mut std::task::Context<'_>,
6807    ) -> std::task::Poll<Option<Self::Item>> {
6808        let this = &mut *self;
6809        if this.inner.check_shutdown(cx) {
6810            this.is_terminated = true;
6811            return std::task::Poll::Ready(None);
6812        }
6813        if this.is_terminated {
6814            panic!("polled DirConnectorRouterRequestStream after completion");
6815        }
6816        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
6817            |bytes, handles| {
6818                match this.inner.channel().read_etc(cx, bytes, handles) {
6819                    std::task::Poll::Ready(Ok(())) => {}
6820                    std::task::Poll::Pending => return std::task::Poll::Pending,
6821                    std::task::Poll::Ready(Err(None)) => {
6822                        this.is_terminated = true;
6823                        return std::task::Poll::Ready(None);
6824                    }
6825                    std::task::Poll::Ready(Err(Some(e))) => {
6826                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6827                            e.into(),
6828                        ))))
6829                    }
6830                }
6831
6832                // A message has been received from the channel
6833                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6834
6835                std::task::Poll::Ready(Some(match header.ordinal {
6836                0xd7e0f01da2c8e40 => {
6837                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6838                    let mut req = fidl::new_empty!(RouteRequest, fdomain_client::fidl::FDomainResourceDialect);
6839                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<RouteRequest>(&header, _body_bytes, handles, &mut req)?;
6840                    let control_handle = DirConnectorRouterControlHandle {
6841                        inner: this.inner.clone(),
6842                    };
6843                    Ok(DirConnectorRouterRequest::Route {payload: req,
6844                        responder: DirConnectorRouterRouteResponder {
6845                            control_handle: std::mem::ManuallyDrop::new(control_handle),
6846                            tx_id: header.tx_id,
6847                        },
6848                    })
6849                }
6850                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6851                    Ok(DirConnectorRouterRequest::_UnknownMethod {
6852                        ordinal: header.ordinal,
6853                        control_handle: DirConnectorRouterControlHandle { inner: this.inner.clone() },
6854                        method_type: fidl::MethodType::OneWay,
6855                    })
6856                }
6857                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6858                    this.inner.send_framework_err(
6859                        fidl::encoding::FrameworkErr::UnknownMethod,
6860                        header.tx_id,
6861                        header.ordinal,
6862                        header.dynamic_flags(),
6863                        (bytes, handles),
6864                    )?;
6865                    Ok(DirConnectorRouterRequest::_UnknownMethod {
6866                        ordinal: header.ordinal,
6867                        control_handle: DirConnectorRouterControlHandle { inner: this.inner.clone() },
6868                        method_type: fidl::MethodType::TwoWay,
6869                    })
6870                }
6871                _ => Err(fidl::Error::UnknownOrdinal {
6872                    ordinal: header.ordinal,
6873                    protocol_name: <DirConnectorRouterMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
6874                }),
6875            }))
6876            },
6877        )
6878    }
6879}
6880
6881#[derive(Debug)]
6882pub enum DirConnectorRouterRequest {
6883    Route {
6884        payload: RouteRequest,
6885        responder: DirConnectorRouterRouteResponder,
6886    },
6887    /// An interaction was received which does not match any known method.
6888    #[non_exhaustive]
6889    _UnknownMethod {
6890        /// Ordinal of the method that was called.
6891        ordinal: u64,
6892        control_handle: DirConnectorRouterControlHandle,
6893        method_type: fidl::MethodType,
6894    },
6895}
6896
6897impl DirConnectorRouterRequest {
6898    #[allow(irrefutable_let_patterns)]
6899    pub fn into_route(self) -> Option<(RouteRequest, DirConnectorRouterRouteResponder)> {
6900        if let DirConnectorRouterRequest::Route { payload, responder } = self {
6901            Some((payload, responder))
6902        } else {
6903            None
6904        }
6905    }
6906
6907    /// Name of the method defined in FIDL
6908    pub fn method_name(&self) -> &'static str {
6909        match *self {
6910            DirConnectorRouterRequest::Route { .. } => "route",
6911            DirConnectorRouterRequest::_UnknownMethod {
6912                method_type: fidl::MethodType::OneWay,
6913                ..
6914            } => "unknown one-way method",
6915            DirConnectorRouterRequest::_UnknownMethod {
6916                method_type: fidl::MethodType::TwoWay,
6917                ..
6918            } => "unknown two-way method",
6919        }
6920    }
6921}
6922
6923#[derive(Debug, Clone)]
6924pub struct DirConnectorRouterControlHandle {
6925    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
6926}
6927
6928impl fdomain_client::fidl::ControlHandle for DirConnectorRouterControlHandle {
6929    fn shutdown(&self) {
6930        self.inner.shutdown()
6931    }
6932
6933    fn is_closed(&self) -> bool {
6934        self.inner.channel().is_closed()
6935    }
6936    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
6937        self.inner.channel().on_closed()
6938    }
6939}
6940
6941impl DirConnectorRouterControlHandle {}
6942
6943#[must_use = "FIDL methods require a response to be sent"]
6944#[derive(Debug)]
6945pub struct DirConnectorRouterRouteResponder {
6946    control_handle: std::mem::ManuallyDrop<DirConnectorRouterControlHandle>,
6947    tx_id: u32,
6948}
6949
6950/// Set the the channel to be shutdown (see [`DirConnectorRouterControlHandle::shutdown`])
6951/// if the responder is dropped without sending a response, so that the client
6952/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6953impl std::ops::Drop for DirConnectorRouterRouteResponder {
6954    fn drop(&mut self) {
6955        self.control_handle.shutdown();
6956        // Safety: drops once, never accessed again
6957        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6958    }
6959}
6960
6961impl fdomain_client::fidl::Responder for DirConnectorRouterRouteResponder {
6962    type ControlHandle = DirConnectorRouterControlHandle;
6963
6964    fn control_handle(&self) -> &DirConnectorRouterControlHandle {
6965        &self.control_handle
6966    }
6967
6968    fn drop_without_shutdown(mut self) {
6969        // Safety: drops once, never accessed again due to mem::forget
6970        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6971        // Prevent Drop from running (which would shut down the channel)
6972        std::mem::forget(self);
6973    }
6974}
6975
6976impl DirConnectorRouterRouteResponder {
6977    /// Sends a response to the FIDL transaction.
6978    ///
6979    /// Sets the channel to shutdown if an error occurs.
6980    pub fn send(
6981        self,
6982        mut result: Result<DirConnectorRouterRouteResponse, RouterError>,
6983    ) -> Result<(), fidl::Error> {
6984        let _result = self.send_raw(result);
6985        if _result.is_err() {
6986            self.control_handle.shutdown();
6987        }
6988        self.drop_without_shutdown();
6989        _result
6990    }
6991
6992    /// Similar to "send" but does not shutdown the channel if an error occurs.
6993    pub fn send_no_shutdown_on_err(
6994        self,
6995        mut result: Result<DirConnectorRouterRouteResponse, RouterError>,
6996    ) -> Result<(), fidl::Error> {
6997        let _result = self.send_raw(result);
6998        self.drop_without_shutdown();
6999        _result
7000    }
7001
7002    fn send_raw(
7003        &self,
7004        mut result: Result<DirConnectorRouterRouteResponse, RouterError>,
7005    ) -> Result<(), fidl::Error> {
7006        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
7007            DirConnectorRouterRouteResponse,
7008            RouterError,
7009        >>(
7010            fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
7011            self.tx_id,
7012            0xd7e0f01da2c8e40,
7013            fidl::encoding::DynamicFlags::FLEXIBLE,
7014        )
7015    }
7016}
7017
7018#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
7019pub struct DirEntryRouterMarker;
7020
7021impl fdomain_client::fidl::ProtocolMarker for DirEntryRouterMarker {
7022    type Proxy = DirEntryRouterProxy;
7023    type RequestStream = DirEntryRouterRequestStream;
7024
7025    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.DirEntryRouter";
7026}
7027impl fdomain_client::fidl::DiscoverableProtocolMarker for DirEntryRouterMarker {}
7028pub type DirEntryRouterRouteResult = Result<DirEntryRouterRouteResponse, RouterError>;
7029
7030pub trait DirEntryRouterProxyInterface: Send + Sync {
7031    type RouteResponseFut: std::future::Future<Output = Result<DirEntryRouterRouteResult, fidl::Error>>
7032        + Send;
7033    fn r#route(&self, payload: RouteRequest) -> Self::RouteResponseFut;
7034}
7035
7036#[derive(Debug, Clone)]
7037pub struct DirEntryRouterProxy {
7038    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
7039}
7040
7041impl fdomain_client::fidl::Proxy for DirEntryRouterProxy {
7042    type Protocol = DirEntryRouterMarker;
7043
7044    fn from_channel(inner: fdomain_client::Channel) -> Self {
7045        Self::new(inner)
7046    }
7047
7048    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
7049        self.client.into_channel().map_err(|client| Self { client })
7050    }
7051
7052    fn as_channel(&self) -> &fdomain_client::Channel {
7053        self.client.as_channel()
7054    }
7055}
7056
7057impl DirEntryRouterProxy {
7058    /// Create a new Proxy for fuchsia.component.sandbox/DirEntryRouter.
7059    pub fn new(channel: fdomain_client::Channel) -> Self {
7060        let protocol_name =
7061            <DirEntryRouterMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
7062        Self { client: fidl::client::Client::new(channel, protocol_name) }
7063    }
7064
7065    /// Get a Stream of events from the remote end of the protocol.
7066    ///
7067    /// # Panics
7068    ///
7069    /// Panics if the event stream was already taken.
7070    pub fn take_event_stream(&self) -> DirEntryRouterEventStream {
7071        DirEntryRouterEventStream { event_receiver: self.client.take_event_receiver() }
7072    }
7073
7074    pub fn r#route(
7075        &self,
7076        mut payload: RouteRequest,
7077    ) -> fidl::client::QueryResponseFut<
7078        DirEntryRouterRouteResult,
7079        fdomain_client::fidl::FDomainResourceDialect,
7080    > {
7081        DirEntryRouterProxyInterface::r#route(self, payload)
7082    }
7083}
7084
7085impl DirEntryRouterProxyInterface for DirEntryRouterProxy {
7086    type RouteResponseFut = fidl::client::QueryResponseFut<
7087        DirEntryRouterRouteResult,
7088        fdomain_client::fidl::FDomainResourceDialect,
7089    >;
7090    fn r#route(&self, mut payload: RouteRequest) -> Self::RouteResponseFut {
7091        fn _decode(
7092            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7093        ) -> Result<DirEntryRouterRouteResult, fidl::Error> {
7094            let _response = fidl::client::decode_transaction_body::<
7095                fidl::encoding::FlexibleResultType<DirEntryRouterRouteResponse, RouterError>,
7096                fdomain_client::fidl::FDomainResourceDialect,
7097                0x1ac694001c208bd2,
7098            >(_buf?)?
7099            .into_result_fdomain::<DirEntryRouterMarker>("route")?;
7100            Ok(_response.map(|x| x))
7101        }
7102        self.client.send_query_and_decode::<RouteRequest, DirEntryRouterRouteResult>(
7103            &mut payload,
7104            0x1ac694001c208bd2,
7105            fidl::encoding::DynamicFlags::FLEXIBLE,
7106            _decode,
7107        )
7108    }
7109}
7110
7111pub struct DirEntryRouterEventStream {
7112    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
7113}
7114
7115impl std::marker::Unpin for DirEntryRouterEventStream {}
7116
7117impl futures::stream::FusedStream for DirEntryRouterEventStream {
7118    fn is_terminated(&self) -> bool {
7119        self.event_receiver.is_terminated()
7120    }
7121}
7122
7123impl futures::Stream for DirEntryRouterEventStream {
7124    type Item = Result<DirEntryRouterEvent, fidl::Error>;
7125
7126    fn poll_next(
7127        mut self: std::pin::Pin<&mut Self>,
7128        cx: &mut std::task::Context<'_>,
7129    ) -> std::task::Poll<Option<Self::Item>> {
7130        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7131            &mut self.event_receiver,
7132            cx
7133        )?) {
7134            Some(buf) => std::task::Poll::Ready(Some(DirEntryRouterEvent::decode(buf))),
7135            None => std::task::Poll::Ready(None),
7136        }
7137    }
7138}
7139
7140#[derive(Debug)]
7141pub enum DirEntryRouterEvent {
7142    #[non_exhaustive]
7143    _UnknownEvent {
7144        /// Ordinal of the event that was sent.
7145        ordinal: u64,
7146    },
7147}
7148
7149impl DirEntryRouterEvent {
7150    /// Decodes a message buffer as a [`DirEntryRouterEvent`].
7151    fn decode(
7152        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7153    ) -> Result<DirEntryRouterEvent, fidl::Error> {
7154        let (bytes, _handles) = buf.split_mut();
7155        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7156        debug_assert_eq!(tx_header.tx_id, 0);
7157        match tx_header.ordinal {
7158            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7159                Ok(DirEntryRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
7160            }
7161            _ => Err(fidl::Error::UnknownOrdinal {
7162                ordinal: tx_header.ordinal,
7163                protocol_name:
7164                    <DirEntryRouterMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
7165            }),
7166        }
7167    }
7168}
7169
7170/// A Stream of incoming requests for fuchsia.component.sandbox/DirEntryRouter.
7171pub struct DirEntryRouterRequestStream {
7172    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
7173    is_terminated: bool,
7174}
7175
7176impl std::marker::Unpin for DirEntryRouterRequestStream {}
7177
7178impl futures::stream::FusedStream for DirEntryRouterRequestStream {
7179    fn is_terminated(&self) -> bool {
7180        self.is_terminated
7181    }
7182}
7183
7184impl fdomain_client::fidl::RequestStream for DirEntryRouterRequestStream {
7185    type Protocol = DirEntryRouterMarker;
7186    type ControlHandle = DirEntryRouterControlHandle;
7187
7188    fn from_channel(channel: fdomain_client::Channel) -> Self {
7189        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7190    }
7191
7192    fn control_handle(&self) -> Self::ControlHandle {
7193        DirEntryRouterControlHandle { inner: self.inner.clone() }
7194    }
7195
7196    fn into_inner(
7197        self,
7198    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
7199    {
7200        (self.inner, self.is_terminated)
7201    }
7202
7203    fn from_inner(
7204        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
7205        is_terminated: bool,
7206    ) -> Self {
7207        Self { inner, is_terminated }
7208    }
7209}
7210
7211impl futures::Stream for DirEntryRouterRequestStream {
7212    type Item = Result<DirEntryRouterRequest, fidl::Error>;
7213
7214    fn poll_next(
7215        mut self: std::pin::Pin<&mut Self>,
7216        cx: &mut std::task::Context<'_>,
7217    ) -> std::task::Poll<Option<Self::Item>> {
7218        let this = &mut *self;
7219        if this.inner.check_shutdown(cx) {
7220            this.is_terminated = true;
7221            return std::task::Poll::Ready(None);
7222        }
7223        if this.is_terminated {
7224            panic!("polled DirEntryRouterRequestStream after completion");
7225        }
7226        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
7227            |bytes, handles| {
7228                match this.inner.channel().read_etc(cx, bytes, handles) {
7229                    std::task::Poll::Ready(Ok(())) => {}
7230                    std::task::Poll::Pending => return std::task::Poll::Pending,
7231                    std::task::Poll::Ready(Err(None)) => {
7232                        this.is_terminated = true;
7233                        return std::task::Poll::Ready(None);
7234                    }
7235                    std::task::Poll::Ready(Err(Some(e))) => {
7236                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7237                            e.into(),
7238                        ))))
7239                    }
7240                }
7241
7242                // A message has been received from the channel
7243                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7244
7245                std::task::Poll::Ready(Some(match header.ordinal {
7246                0x1ac694001c208bd2 => {
7247                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7248                    let mut req = fidl::new_empty!(RouteRequest, fdomain_client::fidl::FDomainResourceDialect);
7249                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<RouteRequest>(&header, _body_bytes, handles, &mut req)?;
7250                    let control_handle = DirEntryRouterControlHandle {
7251                        inner: this.inner.clone(),
7252                    };
7253                    Ok(DirEntryRouterRequest::Route {payload: req,
7254                        responder: DirEntryRouterRouteResponder {
7255                            control_handle: std::mem::ManuallyDrop::new(control_handle),
7256                            tx_id: header.tx_id,
7257                        },
7258                    })
7259                }
7260                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7261                    Ok(DirEntryRouterRequest::_UnknownMethod {
7262                        ordinal: header.ordinal,
7263                        control_handle: DirEntryRouterControlHandle { inner: this.inner.clone() },
7264                        method_type: fidl::MethodType::OneWay,
7265                    })
7266                }
7267                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7268                    this.inner.send_framework_err(
7269                        fidl::encoding::FrameworkErr::UnknownMethod,
7270                        header.tx_id,
7271                        header.ordinal,
7272                        header.dynamic_flags(),
7273                        (bytes, handles),
7274                    )?;
7275                    Ok(DirEntryRouterRequest::_UnknownMethod {
7276                        ordinal: header.ordinal,
7277                        control_handle: DirEntryRouterControlHandle { inner: this.inner.clone() },
7278                        method_type: fidl::MethodType::TwoWay,
7279                    })
7280                }
7281                _ => Err(fidl::Error::UnknownOrdinal {
7282                    ordinal: header.ordinal,
7283                    protocol_name: <DirEntryRouterMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
7284                }),
7285            }))
7286            },
7287        )
7288    }
7289}
7290
7291#[derive(Debug)]
7292pub enum DirEntryRouterRequest {
7293    Route {
7294        payload: RouteRequest,
7295        responder: DirEntryRouterRouteResponder,
7296    },
7297    /// An interaction was received which does not match any known method.
7298    #[non_exhaustive]
7299    _UnknownMethod {
7300        /// Ordinal of the method that was called.
7301        ordinal: u64,
7302        control_handle: DirEntryRouterControlHandle,
7303        method_type: fidl::MethodType,
7304    },
7305}
7306
7307impl DirEntryRouterRequest {
7308    #[allow(irrefutable_let_patterns)]
7309    pub fn into_route(self) -> Option<(RouteRequest, DirEntryRouterRouteResponder)> {
7310        if let DirEntryRouterRequest::Route { payload, responder } = self {
7311            Some((payload, responder))
7312        } else {
7313            None
7314        }
7315    }
7316
7317    /// Name of the method defined in FIDL
7318    pub fn method_name(&self) -> &'static str {
7319        match *self {
7320            DirEntryRouterRequest::Route { .. } => "route",
7321            DirEntryRouterRequest::_UnknownMethod {
7322                method_type: fidl::MethodType::OneWay, ..
7323            } => "unknown one-way method",
7324            DirEntryRouterRequest::_UnknownMethod {
7325                method_type: fidl::MethodType::TwoWay, ..
7326            } => "unknown two-way method",
7327        }
7328    }
7329}
7330
7331#[derive(Debug, Clone)]
7332pub struct DirEntryRouterControlHandle {
7333    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
7334}
7335
7336impl fdomain_client::fidl::ControlHandle for DirEntryRouterControlHandle {
7337    fn shutdown(&self) {
7338        self.inner.shutdown()
7339    }
7340
7341    fn is_closed(&self) -> bool {
7342        self.inner.channel().is_closed()
7343    }
7344    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
7345        self.inner.channel().on_closed()
7346    }
7347}
7348
7349impl DirEntryRouterControlHandle {}
7350
7351#[must_use = "FIDL methods require a response to be sent"]
7352#[derive(Debug)]
7353pub struct DirEntryRouterRouteResponder {
7354    control_handle: std::mem::ManuallyDrop<DirEntryRouterControlHandle>,
7355    tx_id: u32,
7356}
7357
7358/// Set the the channel to be shutdown (see [`DirEntryRouterControlHandle::shutdown`])
7359/// if the responder is dropped without sending a response, so that the client
7360/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7361impl std::ops::Drop for DirEntryRouterRouteResponder {
7362    fn drop(&mut self) {
7363        self.control_handle.shutdown();
7364        // Safety: drops once, never accessed again
7365        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7366    }
7367}
7368
7369impl fdomain_client::fidl::Responder for DirEntryRouterRouteResponder {
7370    type ControlHandle = DirEntryRouterControlHandle;
7371
7372    fn control_handle(&self) -> &DirEntryRouterControlHandle {
7373        &self.control_handle
7374    }
7375
7376    fn drop_without_shutdown(mut self) {
7377        // Safety: drops once, never accessed again due to mem::forget
7378        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7379        // Prevent Drop from running (which would shut down the channel)
7380        std::mem::forget(self);
7381    }
7382}
7383
7384impl DirEntryRouterRouteResponder {
7385    /// Sends a response to the FIDL transaction.
7386    ///
7387    /// Sets the channel to shutdown if an error occurs.
7388    pub fn send(
7389        self,
7390        mut result: Result<DirEntryRouterRouteResponse, RouterError>,
7391    ) -> Result<(), fidl::Error> {
7392        let _result = self.send_raw(result);
7393        if _result.is_err() {
7394            self.control_handle.shutdown();
7395        }
7396        self.drop_without_shutdown();
7397        _result
7398    }
7399
7400    /// Similar to "send" but does not shutdown the channel if an error occurs.
7401    pub fn send_no_shutdown_on_err(
7402        self,
7403        mut result: Result<DirEntryRouterRouteResponse, RouterError>,
7404    ) -> Result<(), fidl::Error> {
7405        let _result = self.send_raw(result);
7406        self.drop_without_shutdown();
7407        _result
7408    }
7409
7410    fn send_raw(
7411        &self,
7412        mut result: Result<DirEntryRouterRouteResponse, RouterError>,
7413    ) -> Result<(), fidl::Error> {
7414        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
7415            DirEntryRouterRouteResponse,
7416            RouterError,
7417        >>(
7418            fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
7419            self.tx_id,
7420            0x1ac694001c208bd2,
7421            fidl::encoding::DynamicFlags::FLEXIBLE,
7422        )
7423    }
7424}
7425
7426#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
7427pub struct DirReceiverMarker;
7428
7429impl fdomain_client::fidl::ProtocolMarker for DirReceiverMarker {
7430    type Proxy = DirReceiverProxy;
7431    type RequestStream = DirReceiverRequestStream;
7432
7433    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.DirReceiver";
7434}
7435impl fdomain_client::fidl::DiscoverableProtocolMarker for DirReceiverMarker {}
7436
7437pub trait DirReceiverProxyInterface: Send + Sync {
7438    fn r#receive(
7439        &self,
7440        channel: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
7441    ) -> Result<(), fidl::Error>;
7442}
7443
7444#[derive(Debug, Clone)]
7445pub struct DirReceiverProxy {
7446    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
7447}
7448
7449impl fdomain_client::fidl::Proxy for DirReceiverProxy {
7450    type Protocol = DirReceiverMarker;
7451
7452    fn from_channel(inner: fdomain_client::Channel) -> Self {
7453        Self::new(inner)
7454    }
7455
7456    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
7457        self.client.into_channel().map_err(|client| Self { client })
7458    }
7459
7460    fn as_channel(&self) -> &fdomain_client::Channel {
7461        self.client.as_channel()
7462    }
7463}
7464
7465impl DirReceiverProxy {
7466    /// Create a new Proxy for fuchsia.component.sandbox/DirReceiver.
7467    pub fn new(channel: fdomain_client::Channel) -> Self {
7468        let protocol_name = <DirReceiverMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
7469        Self { client: fidl::client::Client::new(channel, protocol_name) }
7470    }
7471
7472    /// Get a Stream of events from the remote end of the protocol.
7473    ///
7474    /// # Panics
7475    ///
7476    /// Panics if the event stream was already taken.
7477    pub fn take_event_stream(&self) -> DirReceiverEventStream {
7478        DirReceiverEventStream { event_receiver: self.client.take_event_receiver() }
7479    }
7480
7481    /// Sends a directory channel to this receiver.
7482    ///
7483    /// The server should implement this method by forwarding `channel` to a vfs instance
7484    /// of the language appropriate `vfs` library. To keep this interface decoupled from
7485    /// `fuchsia.io`, it deliberately omits `Open`/`Open3` parameters such as `flags` and
7486    /// `path`. If a client wishes to specify these, they can obtain an initial
7487    /// [fuchsia.io/Directory] channel first and then call `Open`/`Open3` on it.
7488    pub fn r#receive(
7489        &self,
7490        mut channel: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
7491    ) -> Result<(), fidl::Error> {
7492        DirReceiverProxyInterface::r#receive(self, channel)
7493    }
7494}
7495
7496impl DirReceiverProxyInterface for DirReceiverProxy {
7497    fn r#receive(
7498        &self,
7499        mut channel: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
7500    ) -> Result<(), fidl::Error> {
7501        self.client.send::<DirReceiverReceiveRequest>(
7502            (channel,),
7503            0xcdc3e9b89fe7bb4,
7504            fidl::encoding::DynamicFlags::FLEXIBLE,
7505        )
7506    }
7507}
7508
7509pub struct DirReceiverEventStream {
7510    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
7511}
7512
7513impl std::marker::Unpin for DirReceiverEventStream {}
7514
7515impl futures::stream::FusedStream for DirReceiverEventStream {
7516    fn is_terminated(&self) -> bool {
7517        self.event_receiver.is_terminated()
7518    }
7519}
7520
7521impl futures::Stream for DirReceiverEventStream {
7522    type Item = Result<DirReceiverEvent, fidl::Error>;
7523
7524    fn poll_next(
7525        mut self: std::pin::Pin<&mut Self>,
7526        cx: &mut std::task::Context<'_>,
7527    ) -> std::task::Poll<Option<Self::Item>> {
7528        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7529            &mut self.event_receiver,
7530            cx
7531        )?) {
7532            Some(buf) => std::task::Poll::Ready(Some(DirReceiverEvent::decode(buf))),
7533            None => std::task::Poll::Ready(None),
7534        }
7535    }
7536}
7537
7538#[derive(Debug)]
7539pub enum DirReceiverEvent {
7540    #[non_exhaustive]
7541    _UnknownEvent {
7542        /// Ordinal of the event that was sent.
7543        ordinal: u64,
7544    },
7545}
7546
7547impl DirReceiverEvent {
7548    /// Decodes a message buffer as a [`DirReceiverEvent`].
7549    fn decode(
7550        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7551    ) -> Result<DirReceiverEvent, fidl::Error> {
7552        let (bytes, _handles) = buf.split_mut();
7553        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7554        debug_assert_eq!(tx_header.tx_id, 0);
7555        match tx_header.ordinal {
7556            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7557                Ok(DirReceiverEvent::_UnknownEvent { ordinal: tx_header.ordinal })
7558            }
7559            _ => Err(fidl::Error::UnknownOrdinal {
7560                ordinal: tx_header.ordinal,
7561                protocol_name:
7562                    <DirReceiverMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
7563            }),
7564        }
7565    }
7566}
7567
7568/// A Stream of incoming requests for fuchsia.component.sandbox/DirReceiver.
7569pub struct DirReceiverRequestStream {
7570    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
7571    is_terminated: bool,
7572}
7573
7574impl std::marker::Unpin for DirReceiverRequestStream {}
7575
7576impl futures::stream::FusedStream for DirReceiverRequestStream {
7577    fn is_terminated(&self) -> bool {
7578        self.is_terminated
7579    }
7580}
7581
7582impl fdomain_client::fidl::RequestStream for DirReceiverRequestStream {
7583    type Protocol = DirReceiverMarker;
7584    type ControlHandle = DirReceiverControlHandle;
7585
7586    fn from_channel(channel: fdomain_client::Channel) -> Self {
7587        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7588    }
7589
7590    fn control_handle(&self) -> Self::ControlHandle {
7591        DirReceiverControlHandle { inner: self.inner.clone() }
7592    }
7593
7594    fn into_inner(
7595        self,
7596    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
7597    {
7598        (self.inner, self.is_terminated)
7599    }
7600
7601    fn from_inner(
7602        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
7603        is_terminated: bool,
7604    ) -> Self {
7605        Self { inner, is_terminated }
7606    }
7607}
7608
7609impl futures::Stream for DirReceiverRequestStream {
7610    type Item = Result<DirReceiverRequest, fidl::Error>;
7611
7612    fn poll_next(
7613        mut self: std::pin::Pin<&mut Self>,
7614        cx: &mut std::task::Context<'_>,
7615    ) -> std::task::Poll<Option<Self::Item>> {
7616        let this = &mut *self;
7617        if this.inner.check_shutdown(cx) {
7618            this.is_terminated = true;
7619            return std::task::Poll::Ready(None);
7620        }
7621        if this.is_terminated {
7622            panic!("polled DirReceiverRequestStream after completion");
7623        }
7624        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
7625            |bytes, handles| {
7626                match this.inner.channel().read_etc(cx, bytes, handles) {
7627                    std::task::Poll::Ready(Ok(())) => {}
7628                    std::task::Poll::Pending => return std::task::Poll::Pending,
7629                    std::task::Poll::Ready(Err(None)) => {
7630                        this.is_terminated = true;
7631                        return std::task::Poll::Ready(None);
7632                    }
7633                    std::task::Poll::Ready(Err(Some(e))) => {
7634                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7635                            e.into(),
7636                        ))))
7637                    }
7638                }
7639
7640                // A message has been received from the channel
7641                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7642
7643                std::task::Poll::Ready(Some(match header.ordinal {
7644                    0xcdc3e9b89fe7bb4 => {
7645                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
7646                        let mut req = fidl::new_empty!(
7647                            DirReceiverReceiveRequest,
7648                            fdomain_client::fidl::FDomainResourceDialect
7649                        );
7650                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<DirReceiverReceiveRequest>(&header, _body_bytes, handles, &mut req)?;
7651                        let control_handle = DirReceiverControlHandle { inner: this.inner.clone() };
7652                        Ok(DirReceiverRequest::Receive { channel: req.channel, control_handle })
7653                    }
7654                    _ if header.tx_id == 0
7655                        && header
7656                            .dynamic_flags()
7657                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
7658                    {
7659                        Ok(DirReceiverRequest::_UnknownMethod {
7660                            ordinal: header.ordinal,
7661                            control_handle: DirReceiverControlHandle { inner: this.inner.clone() },
7662                            method_type: fidl::MethodType::OneWay,
7663                        })
7664                    }
7665                    _ if header
7666                        .dynamic_flags()
7667                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
7668                    {
7669                        this.inner.send_framework_err(
7670                            fidl::encoding::FrameworkErr::UnknownMethod,
7671                            header.tx_id,
7672                            header.ordinal,
7673                            header.dynamic_flags(),
7674                            (bytes, handles),
7675                        )?;
7676                        Ok(DirReceiverRequest::_UnknownMethod {
7677                            ordinal: header.ordinal,
7678                            control_handle: DirReceiverControlHandle { inner: this.inner.clone() },
7679                            method_type: fidl::MethodType::TwoWay,
7680                        })
7681                    }
7682                    _ => Err(fidl::Error::UnknownOrdinal {
7683                        ordinal: header.ordinal,
7684                        protocol_name:
7685                            <DirReceiverMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
7686                    }),
7687                }))
7688            },
7689        )
7690    }
7691}
7692
7693/// A receiver is served by components and allows them to receive directory channels
7694/// framework.
7695#[derive(Debug)]
7696pub enum DirReceiverRequest {
7697    /// Sends a directory channel to this receiver.
7698    ///
7699    /// The server should implement this method by forwarding `channel` to a vfs instance
7700    /// of the language appropriate `vfs` library. To keep this interface decoupled from
7701    /// `fuchsia.io`, it deliberately omits `Open`/`Open3` parameters such as `flags` and
7702    /// `path`. If a client wishes to specify these, they can obtain an initial
7703    /// [fuchsia.io/Directory] channel first and then call `Open`/`Open3` on it.
7704    Receive {
7705        channel: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
7706        control_handle: DirReceiverControlHandle,
7707    },
7708    /// An interaction was received which does not match any known method.
7709    #[non_exhaustive]
7710    _UnknownMethod {
7711        /// Ordinal of the method that was called.
7712        ordinal: u64,
7713        control_handle: DirReceiverControlHandle,
7714        method_type: fidl::MethodType,
7715    },
7716}
7717
7718impl DirReceiverRequest {
7719    #[allow(irrefutable_let_patterns)]
7720    pub fn into_receive(
7721        self,
7722    ) -> Option<(
7723        fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
7724        DirReceiverControlHandle,
7725    )> {
7726        if let DirReceiverRequest::Receive { channel, control_handle } = self {
7727            Some((channel, control_handle))
7728        } else {
7729            None
7730        }
7731    }
7732
7733    /// Name of the method defined in FIDL
7734    pub fn method_name(&self) -> &'static str {
7735        match *self {
7736            DirReceiverRequest::Receive { .. } => "receive",
7737            DirReceiverRequest::_UnknownMethod {
7738                method_type: fidl::MethodType::OneWay, ..
7739            } => "unknown one-way method",
7740            DirReceiverRequest::_UnknownMethod {
7741                method_type: fidl::MethodType::TwoWay, ..
7742            } => "unknown two-way method",
7743        }
7744    }
7745}
7746
7747#[derive(Debug, Clone)]
7748pub struct DirReceiverControlHandle {
7749    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
7750}
7751
7752impl fdomain_client::fidl::ControlHandle for DirReceiverControlHandle {
7753    fn shutdown(&self) {
7754        self.inner.shutdown()
7755    }
7756
7757    fn is_closed(&self) -> bool {
7758        self.inner.channel().is_closed()
7759    }
7760    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
7761        self.inner.channel().on_closed()
7762    }
7763}
7764
7765impl DirReceiverControlHandle {}
7766
7767#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
7768pub struct DirectoryRouterMarker;
7769
7770impl fdomain_client::fidl::ProtocolMarker for DirectoryRouterMarker {
7771    type Proxy = DirectoryRouterProxy;
7772    type RequestStream = DirectoryRouterRequestStream;
7773
7774    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.DirectoryRouter";
7775}
7776impl fdomain_client::fidl::DiscoverableProtocolMarker for DirectoryRouterMarker {}
7777pub type DirectoryRouterRouteResult = Result<DirectoryRouterRouteResponse, RouterError>;
7778
7779pub trait DirectoryRouterProxyInterface: Send + Sync {
7780    type RouteResponseFut: std::future::Future<Output = Result<DirectoryRouterRouteResult, fidl::Error>>
7781        + Send;
7782    fn r#route(&self, payload: RouteRequest) -> Self::RouteResponseFut;
7783}
7784
7785#[derive(Debug, Clone)]
7786pub struct DirectoryRouterProxy {
7787    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
7788}
7789
7790impl fdomain_client::fidl::Proxy for DirectoryRouterProxy {
7791    type Protocol = DirectoryRouterMarker;
7792
7793    fn from_channel(inner: fdomain_client::Channel) -> Self {
7794        Self::new(inner)
7795    }
7796
7797    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
7798        self.client.into_channel().map_err(|client| Self { client })
7799    }
7800
7801    fn as_channel(&self) -> &fdomain_client::Channel {
7802        self.client.as_channel()
7803    }
7804}
7805
7806impl DirectoryRouterProxy {
7807    /// Create a new Proxy for fuchsia.component.sandbox/DirectoryRouter.
7808    pub fn new(channel: fdomain_client::Channel) -> Self {
7809        let protocol_name =
7810            <DirectoryRouterMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
7811        Self { client: fidl::client::Client::new(channel, protocol_name) }
7812    }
7813
7814    /// Get a Stream of events from the remote end of the protocol.
7815    ///
7816    /// # Panics
7817    ///
7818    /// Panics if the event stream was already taken.
7819    pub fn take_event_stream(&self) -> DirectoryRouterEventStream {
7820        DirectoryRouterEventStream { event_receiver: self.client.take_event_receiver() }
7821    }
7822
7823    pub fn r#route(
7824        &self,
7825        mut payload: RouteRequest,
7826    ) -> fidl::client::QueryResponseFut<
7827        DirectoryRouterRouteResult,
7828        fdomain_client::fidl::FDomainResourceDialect,
7829    > {
7830        DirectoryRouterProxyInterface::r#route(self, payload)
7831    }
7832}
7833
7834impl DirectoryRouterProxyInterface for DirectoryRouterProxy {
7835    type RouteResponseFut = fidl::client::QueryResponseFut<
7836        DirectoryRouterRouteResult,
7837        fdomain_client::fidl::FDomainResourceDialect,
7838    >;
7839    fn r#route(&self, mut payload: RouteRequest) -> Self::RouteResponseFut {
7840        fn _decode(
7841            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7842        ) -> Result<DirectoryRouterRouteResult, fidl::Error> {
7843            let _response = fidl::client::decode_transaction_body::<
7844                fidl::encoding::FlexibleResultType<DirectoryRouterRouteResponse, RouterError>,
7845                fdomain_client::fidl::FDomainResourceDialect,
7846                0x683b6c6be21b0f21,
7847            >(_buf?)?
7848            .into_result_fdomain::<DirectoryRouterMarker>("route")?;
7849            Ok(_response.map(|x| x))
7850        }
7851        self.client.send_query_and_decode::<RouteRequest, DirectoryRouterRouteResult>(
7852            &mut payload,
7853            0x683b6c6be21b0f21,
7854            fidl::encoding::DynamicFlags::FLEXIBLE,
7855            _decode,
7856        )
7857    }
7858}
7859
7860pub struct DirectoryRouterEventStream {
7861    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
7862}
7863
7864impl std::marker::Unpin for DirectoryRouterEventStream {}
7865
7866impl futures::stream::FusedStream for DirectoryRouterEventStream {
7867    fn is_terminated(&self) -> bool {
7868        self.event_receiver.is_terminated()
7869    }
7870}
7871
7872impl futures::Stream for DirectoryRouterEventStream {
7873    type Item = Result<DirectoryRouterEvent, fidl::Error>;
7874
7875    fn poll_next(
7876        mut self: std::pin::Pin<&mut Self>,
7877        cx: &mut std::task::Context<'_>,
7878    ) -> std::task::Poll<Option<Self::Item>> {
7879        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7880            &mut self.event_receiver,
7881            cx
7882        )?) {
7883            Some(buf) => std::task::Poll::Ready(Some(DirectoryRouterEvent::decode(buf))),
7884            None => std::task::Poll::Ready(None),
7885        }
7886    }
7887}
7888
7889#[derive(Debug)]
7890pub enum DirectoryRouterEvent {
7891    #[non_exhaustive]
7892    _UnknownEvent {
7893        /// Ordinal of the event that was sent.
7894        ordinal: u64,
7895    },
7896}
7897
7898impl DirectoryRouterEvent {
7899    /// Decodes a message buffer as a [`DirectoryRouterEvent`].
7900    fn decode(
7901        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7902    ) -> Result<DirectoryRouterEvent, fidl::Error> {
7903        let (bytes, _handles) = buf.split_mut();
7904        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7905        debug_assert_eq!(tx_header.tx_id, 0);
7906        match tx_header.ordinal {
7907            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7908                Ok(DirectoryRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
7909            }
7910            _ => Err(fidl::Error::UnknownOrdinal {
7911                ordinal: tx_header.ordinal,
7912                protocol_name:
7913                    <DirectoryRouterMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
7914            }),
7915        }
7916    }
7917}
7918
7919/// A Stream of incoming requests for fuchsia.component.sandbox/DirectoryRouter.
7920pub struct DirectoryRouterRequestStream {
7921    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
7922    is_terminated: bool,
7923}
7924
7925impl std::marker::Unpin for DirectoryRouterRequestStream {}
7926
7927impl futures::stream::FusedStream for DirectoryRouterRequestStream {
7928    fn is_terminated(&self) -> bool {
7929        self.is_terminated
7930    }
7931}
7932
7933impl fdomain_client::fidl::RequestStream for DirectoryRouterRequestStream {
7934    type Protocol = DirectoryRouterMarker;
7935    type ControlHandle = DirectoryRouterControlHandle;
7936
7937    fn from_channel(channel: fdomain_client::Channel) -> Self {
7938        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7939    }
7940
7941    fn control_handle(&self) -> Self::ControlHandle {
7942        DirectoryRouterControlHandle { inner: self.inner.clone() }
7943    }
7944
7945    fn into_inner(
7946        self,
7947    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
7948    {
7949        (self.inner, self.is_terminated)
7950    }
7951
7952    fn from_inner(
7953        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
7954        is_terminated: bool,
7955    ) -> Self {
7956        Self { inner, is_terminated }
7957    }
7958}
7959
7960impl futures::Stream for DirectoryRouterRequestStream {
7961    type Item = Result<DirectoryRouterRequest, fidl::Error>;
7962
7963    fn poll_next(
7964        mut self: std::pin::Pin<&mut Self>,
7965        cx: &mut std::task::Context<'_>,
7966    ) -> std::task::Poll<Option<Self::Item>> {
7967        let this = &mut *self;
7968        if this.inner.check_shutdown(cx) {
7969            this.is_terminated = true;
7970            return std::task::Poll::Ready(None);
7971        }
7972        if this.is_terminated {
7973            panic!("polled DirectoryRouterRequestStream after completion");
7974        }
7975        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
7976            |bytes, handles| {
7977                match this.inner.channel().read_etc(cx, bytes, handles) {
7978                    std::task::Poll::Ready(Ok(())) => {}
7979                    std::task::Poll::Pending => return std::task::Poll::Pending,
7980                    std::task::Poll::Ready(Err(None)) => {
7981                        this.is_terminated = true;
7982                        return std::task::Poll::Ready(None);
7983                    }
7984                    std::task::Poll::Ready(Err(Some(e))) => {
7985                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7986                            e.into(),
7987                        ))))
7988                    }
7989                }
7990
7991                // A message has been received from the channel
7992                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7993
7994                std::task::Poll::Ready(Some(match header.ordinal {
7995                0x683b6c6be21b0f21 => {
7996                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7997                    let mut req = fidl::new_empty!(RouteRequest, fdomain_client::fidl::FDomainResourceDialect);
7998                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<RouteRequest>(&header, _body_bytes, handles, &mut req)?;
7999                    let control_handle = DirectoryRouterControlHandle {
8000                        inner: this.inner.clone(),
8001                    };
8002                    Ok(DirectoryRouterRequest::Route {payload: req,
8003                        responder: DirectoryRouterRouteResponder {
8004                            control_handle: std::mem::ManuallyDrop::new(control_handle),
8005                            tx_id: header.tx_id,
8006                        },
8007                    })
8008                }
8009                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
8010                    Ok(DirectoryRouterRequest::_UnknownMethod {
8011                        ordinal: header.ordinal,
8012                        control_handle: DirectoryRouterControlHandle { inner: this.inner.clone() },
8013                        method_type: fidl::MethodType::OneWay,
8014                    })
8015                }
8016                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
8017                    this.inner.send_framework_err(
8018                        fidl::encoding::FrameworkErr::UnknownMethod,
8019                        header.tx_id,
8020                        header.ordinal,
8021                        header.dynamic_flags(),
8022                        (bytes, handles),
8023                    )?;
8024                    Ok(DirectoryRouterRequest::_UnknownMethod {
8025                        ordinal: header.ordinal,
8026                        control_handle: DirectoryRouterControlHandle { inner: this.inner.clone() },
8027                        method_type: fidl::MethodType::TwoWay,
8028                    })
8029                }
8030                _ => Err(fidl::Error::UnknownOrdinal {
8031                    ordinal: header.ordinal,
8032                    protocol_name: <DirectoryRouterMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
8033                }),
8034            }))
8035            },
8036        )
8037    }
8038}
8039
8040#[derive(Debug)]
8041pub enum DirectoryRouterRequest {
8042    Route {
8043        payload: RouteRequest,
8044        responder: DirectoryRouterRouteResponder,
8045    },
8046    /// An interaction was received which does not match any known method.
8047    #[non_exhaustive]
8048    _UnknownMethod {
8049        /// Ordinal of the method that was called.
8050        ordinal: u64,
8051        control_handle: DirectoryRouterControlHandle,
8052        method_type: fidl::MethodType,
8053    },
8054}
8055
8056impl DirectoryRouterRequest {
8057    #[allow(irrefutable_let_patterns)]
8058    pub fn into_route(self) -> Option<(RouteRequest, DirectoryRouterRouteResponder)> {
8059        if let DirectoryRouterRequest::Route { payload, responder } = self {
8060            Some((payload, responder))
8061        } else {
8062            None
8063        }
8064    }
8065
8066    /// Name of the method defined in FIDL
8067    pub fn method_name(&self) -> &'static str {
8068        match *self {
8069            DirectoryRouterRequest::Route { .. } => "route",
8070            DirectoryRouterRequest::_UnknownMethod {
8071                method_type: fidl::MethodType::OneWay,
8072                ..
8073            } => "unknown one-way method",
8074            DirectoryRouterRequest::_UnknownMethod {
8075                method_type: fidl::MethodType::TwoWay,
8076                ..
8077            } => "unknown two-way method",
8078        }
8079    }
8080}
8081
8082#[derive(Debug, Clone)]
8083pub struct DirectoryRouterControlHandle {
8084    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
8085}
8086
8087impl fdomain_client::fidl::ControlHandle for DirectoryRouterControlHandle {
8088    fn shutdown(&self) {
8089        self.inner.shutdown()
8090    }
8091
8092    fn is_closed(&self) -> bool {
8093        self.inner.channel().is_closed()
8094    }
8095    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
8096        self.inner.channel().on_closed()
8097    }
8098}
8099
8100impl DirectoryRouterControlHandle {}
8101
8102#[must_use = "FIDL methods require a response to be sent"]
8103#[derive(Debug)]
8104pub struct DirectoryRouterRouteResponder {
8105    control_handle: std::mem::ManuallyDrop<DirectoryRouterControlHandle>,
8106    tx_id: u32,
8107}
8108
8109/// Set the the channel to be shutdown (see [`DirectoryRouterControlHandle::shutdown`])
8110/// if the responder is dropped without sending a response, so that the client
8111/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8112impl std::ops::Drop for DirectoryRouterRouteResponder {
8113    fn drop(&mut self) {
8114        self.control_handle.shutdown();
8115        // Safety: drops once, never accessed again
8116        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8117    }
8118}
8119
8120impl fdomain_client::fidl::Responder for DirectoryRouterRouteResponder {
8121    type ControlHandle = DirectoryRouterControlHandle;
8122
8123    fn control_handle(&self) -> &DirectoryRouterControlHandle {
8124        &self.control_handle
8125    }
8126
8127    fn drop_without_shutdown(mut self) {
8128        // Safety: drops once, never accessed again due to mem::forget
8129        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8130        // Prevent Drop from running (which would shut down the channel)
8131        std::mem::forget(self);
8132    }
8133}
8134
8135impl DirectoryRouterRouteResponder {
8136    /// Sends a response to the FIDL transaction.
8137    ///
8138    /// Sets the channel to shutdown if an error occurs.
8139    pub fn send(
8140        self,
8141        mut result: Result<DirectoryRouterRouteResponse, RouterError>,
8142    ) -> Result<(), fidl::Error> {
8143        let _result = self.send_raw(result);
8144        if _result.is_err() {
8145            self.control_handle.shutdown();
8146        }
8147        self.drop_without_shutdown();
8148        _result
8149    }
8150
8151    /// Similar to "send" but does not shutdown the channel if an error occurs.
8152    pub fn send_no_shutdown_on_err(
8153        self,
8154        mut result: Result<DirectoryRouterRouteResponse, RouterError>,
8155    ) -> Result<(), fidl::Error> {
8156        let _result = self.send_raw(result);
8157        self.drop_without_shutdown();
8158        _result
8159    }
8160
8161    fn send_raw(
8162        &self,
8163        mut result: Result<DirectoryRouterRouteResponse, RouterError>,
8164    ) -> Result<(), fidl::Error> {
8165        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
8166            DirectoryRouterRouteResponse,
8167            RouterError,
8168        >>(
8169            fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
8170            self.tx_id,
8171            0x683b6c6be21b0f21,
8172            fidl::encoding::DynamicFlags::FLEXIBLE,
8173        )
8174    }
8175}
8176
8177#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
8178pub struct ReceiverMarker;
8179
8180impl fdomain_client::fidl::ProtocolMarker for ReceiverMarker {
8181    type Proxy = ReceiverProxy;
8182    type RequestStream = ReceiverRequestStream;
8183
8184    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.Receiver";
8185}
8186impl fdomain_client::fidl::DiscoverableProtocolMarker for ReceiverMarker {}
8187
8188pub trait ReceiverProxyInterface: Send + Sync {
8189    fn r#receive(&self, channel: fdomain_client::Channel) -> Result<(), fidl::Error>;
8190}
8191
8192#[derive(Debug, Clone)]
8193pub struct ReceiverProxy {
8194    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
8195}
8196
8197impl fdomain_client::fidl::Proxy for ReceiverProxy {
8198    type Protocol = ReceiverMarker;
8199
8200    fn from_channel(inner: fdomain_client::Channel) -> Self {
8201        Self::new(inner)
8202    }
8203
8204    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
8205        self.client.into_channel().map_err(|client| Self { client })
8206    }
8207
8208    fn as_channel(&self) -> &fdomain_client::Channel {
8209        self.client.as_channel()
8210    }
8211}
8212
8213impl ReceiverProxy {
8214    /// Create a new Proxy for fuchsia.component.sandbox/Receiver.
8215    pub fn new(channel: fdomain_client::Channel) -> Self {
8216        let protocol_name = <ReceiverMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
8217        Self { client: fidl::client::Client::new(channel, protocol_name) }
8218    }
8219
8220    /// Get a Stream of events from the remote end of the protocol.
8221    ///
8222    /// # Panics
8223    ///
8224    /// Panics if the event stream was already taken.
8225    pub fn take_event_stream(&self) -> ReceiverEventStream {
8226        ReceiverEventStream { event_receiver: self.client.take_event_receiver() }
8227    }
8228
8229    /// Sends a channel to this receiver.
8230    pub fn r#receive(&self, mut channel: fdomain_client::Channel) -> Result<(), fidl::Error> {
8231        ReceiverProxyInterface::r#receive(self, channel)
8232    }
8233}
8234
8235impl ReceiverProxyInterface for ReceiverProxy {
8236    fn r#receive(&self, mut channel: fdomain_client::Channel) -> Result<(), fidl::Error> {
8237        self.client.send::<ProtocolPayload>(
8238            (channel,),
8239            0x4bae18ab7aa1a94,
8240            fidl::encoding::DynamicFlags::FLEXIBLE,
8241        )
8242    }
8243}
8244
8245pub struct ReceiverEventStream {
8246    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
8247}
8248
8249impl std::marker::Unpin for ReceiverEventStream {}
8250
8251impl futures::stream::FusedStream for ReceiverEventStream {
8252    fn is_terminated(&self) -> bool {
8253        self.event_receiver.is_terminated()
8254    }
8255}
8256
8257impl futures::Stream for ReceiverEventStream {
8258    type Item = Result<ReceiverEvent, fidl::Error>;
8259
8260    fn poll_next(
8261        mut self: std::pin::Pin<&mut Self>,
8262        cx: &mut std::task::Context<'_>,
8263    ) -> std::task::Poll<Option<Self::Item>> {
8264        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
8265            &mut self.event_receiver,
8266            cx
8267        )?) {
8268            Some(buf) => std::task::Poll::Ready(Some(ReceiverEvent::decode(buf))),
8269            None => std::task::Poll::Ready(None),
8270        }
8271    }
8272}
8273
8274#[derive(Debug)]
8275pub enum ReceiverEvent {
8276    #[non_exhaustive]
8277    _UnknownEvent {
8278        /// Ordinal of the event that was sent.
8279        ordinal: u64,
8280    },
8281}
8282
8283impl ReceiverEvent {
8284    /// Decodes a message buffer as a [`ReceiverEvent`].
8285    fn decode(
8286        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
8287    ) -> Result<ReceiverEvent, fidl::Error> {
8288        let (bytes, _handles) = buf.split_mut();
8289        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8290        debug_assert_eq!(tx_header.tx_id, 0);
8291        match tx_header.ordinal {
8292            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
8293                Ok(ReceiverEvent::_UnknownEvent { ordinal: tx_header.ordinal })
8294            }
8295            _ => Err(fidl::Error::UnknownOrdinal {
8296                ordinal: tx_header.ordinal,
8297                protocol_name: <ReceiverMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
8298            }),
8299        }
8300    }
8301}
8302
8303/// A Stream of incoming requests for fuchsia.component.sandbox/Receiver.
8304pub struct ReceiverRequestStream {
8305    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
8306    is_terminated: bool,
8307}
8308
8309impl std::marker::Unpin for ReceiverRequestStream {}
8310
8311impl futures::stream::FusedStream for ReceiverRequestStream {
8312    fn is_terminated(&self) -> bool {
8313        self.is_terminated
8314    }
8315}
8316
8317impl fdomain_client::fidl::RequestStream for ReceiverRequestStream {
8318    type Protocol = ReceiverMarker;
8319    type ControlHandle = ReceiverControlHandle;
8320
8321    fn from_channel(channel: fdomain_client::Channel) -> Self {
8322        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
8323    }
8324
8325    fn control_handle(&self) -> Self::ControlHandle {
8326        ReceiverControlHandle { inner: self.inner.clone() }
8327    }
8328
8329    fn into_inner(
8330        self,
8331    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
8332    {
8333        (self.inner, self.is_terminated)
8334    }
8335
8336    fn from_inner(
8337        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
8338        is_terminated: bool,
8339    ) -> Self {
8340        Self { inner, is_terminated }
8341    }
8342}
8343
8344impl futures::Stream for ReceiverRequestStream {
8345    type Item = Result<ReceiverRequest, fidl::Error>;
8346
8347    fn poll_next(
8348        mut self: std::pin::Pin<&mut Self>,
8349        cx: &mut std::task::Context<'_>,
8350    ) -> std::task::Poll<Option<Self::Item>> {
8351        let this = &mut *self;
8352        if this.inner.check_shutdown(cx) {
8353            this.is_terminated = true;
8354            return std::task::Poll::Ready(None);
8355        }
8356        if this.is_terminated {
8357            panic!("polled ReceiverRequestStream after completion");
8358        }
8359        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
8360            |bytes, handles| {
8361                match this.inner.channel().read_etc(cx, bytes, handles) {
8362                    std::task::Poll::Ready(Ok(())) => {}
8363                    std::task::Poll::Pending => return std::task::Poll::Pending,
8364                    std::task::Poll::Ready(Err(None)) => {
8365                        this.is_terminated = true;
8366                        return std::task::Poll::Ready(None);
8367                    }
8368                    std::task::Poll::Ready(Err(Some(e))) => {
8369                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
8370                            e.into(),
8371                        ))))
8372                    }
8373                }
8374
8375                // A message has been received from the channel
8376                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8377
8378                std::task::Poll::Ready(Some(match header.ordinal {
8379                    0x4bae18ab7aa1a94 => {
8380                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
8381                        let mut req = fidl::new_empty!(
8382                            ProtocolPayload,
8383                            fdomain_client::fidl::FDomainResourceDialect
8384                        );
8385                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<ProtocolPayload>(&header, _body_bytes, handles, &mut req)?;
8386                        let control_handle = ReceiverControlHandle { inner: this.inner.clone() };
8387                        Ok(ReceiverRequest::Receive { channel: req.channel, control_handle })
8388                    }
8389                    _ if header.tx_id == 0
8390                        && header
8391                            .dynamic_flags()
8392                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
8393                    {
8394                        Ok(ReceiverRequest::_UnknownMethod {
8395                            ordinal: header.ordinal,
8396                            control_handle: ReceiverControlHandle { inner: this.inner.clone() },
8397                            method_type: fidl::MethodType::OneWay,
8398                        })
8399                    }
8400                    _ if header
8401                        .dynamic_flags()
8402                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
8403                    {
8404                        this.inner.send_framework_err(
8405                            fidl::encoding::FrameworkErr::UnknownMethod,
8406                            header.tx_id,
8407                            header.ordinal,
8408                            header.dynamic_flags(),
8409                            (bytes, handles),
8410                        )?;
8411                        Ok(ReceiverRequest::_UnknownMethod {
8412                            ordinal: header.ordinal,
8413                            control_handle: ReceiverControlHandle { inner: this.inner.clone() },
8414                            method_type: fidl::MethodType::TwoWay,
8415                        })
8416                    }
8417                    _ => Err(fidl::Error::UnknownOrdinal {
8418                        ordinal: header.ordinal,
8419                        protocol_name:
8420                            <ReceiverMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
8421                    }),
8422                }))
8423            },
8424        )
8425    }
8426}
8427
8428/// A receiver is served by components and allows them to receive channels
8429/// from the framework.
8430#[derive(Debug)]
8431pub enum ReceiverRequest {
8432    /// Sends a channel to this receiver.
8433    Receive { channel: fdomain_client::Channel, control_handle: ReceiverControlHandle },
8434    /// An interaction was received which does not match any known method.
8435    #[non_exhaustive]
8436    _UnknownMethod {
8437        /// Ordinal of the method that was called.
8438        ordinal: u64,
8439        control_handle: ReceiverControlHandle,
8440        method_type: fidl::MethodType,
8441    },
8442}
8443
8444impl ReceiverRequest {
8445    #[allow(irrefutable_let_patterns)]
8446    pub fn into_receive(self) -> Option<(fdomain_client::Channel, ReceiverControlHandle)> {
8447        if let ReceiverRequest::Receive { channel, control_handle } = self {
8448            Some((channel, control_handle))
8449        } else {
8450            None
8451        }
8452    }
8453
8454    /// Name of the method defined in FIDL
8455    pub fn method_name(&self) -> &'static str {
8456        match *self {
8457            ReceiverRequest::Receive { .. } => "receive",
8458            ReceiverRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
8459                "unknown one-way method"
8460            }
8461            ReceiverRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
8462                "unknown two-way method"
8463            }
8464        }
8465    }
8466}
8467
8468#[derive(Debug, Clone)]
8469pub struct ReceiverControlHandle {
8470    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
8471}
8472
8473impl fdomain_client::fidl::ControlHandle for ReceiverControlHandle {
8474    fn shutdown(&self) {
8475        self.inner.shutdown()
8476    }
8477
8478    fn is_closed(&self) -> bool {
8479        self.inner.channel().is_closed()
8480    }
8481    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
8482        self.inner.channel().on_closed()
8483    }
8484}
8485
8486impl ReceiverControlHandle {}
8487
8488mod internal {
8489    use super::*;
8490
8491    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreConnectorCreateRequest {
8492        type Borrowed<'a> = &'a mut Self;
8493        fn take_or_borrow<'a>(
8494            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8495        ) -> Self::Borrowed<'a> {
8496            value
8497        }
8498    }
8499
8500    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreConnectorCreateRequest {
8501        type Owned = Self;
8502
8503        #[inline(always)]
8504        fn inline_align(_context: fidl::encoding::Context) -> usize {
8505            8
8506        }
8507
8508        #[inline(always)]
8509        fn inline_size(_context: fidl::encoding::Context) -> usize {
8510            16
8511        }
8512    }
8513
8514    unsafe impl
8515        fidl::encoding::Encode<
8516            CapabilityStoreConnectorCreateRequest,
8517            fdomain_client::fidl::FDomainResourceDialect,
8518        > for &mut CapabilityStoreConnectorCreateRequest
8519    {
8520        #[inline]
8521        unsafe fn encode(
8522            self,
8523            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8524            offset: usize,
8525            _depth: fidl::encoding::Depth,
8526        ) -> fidl::Result<()> {
8527            encoder.debug_check_bounds::<CapabilityStoreConnectorCreateRequest>(offset);
8528            // Delegate to tuple encoding.
8529            fidl::encoding::Encode::<CapabilityStoreConnectorCreateRequest, fdomain_client::fidl::FDomainResourceDialect>::encode(
8530                (
8531                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
8532                    <fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<ReceiverMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.receiver),
8533                ),
8534                encoder, offset, _depth
8535            )
8536        }
8537    }
8538    unsafe impl<
8539            T0: fidl::encoding::Encode<u64, fdomain_client::fidl::FDomainResourceDialect>,
8540            T1: fidl::encoding::Encode<
8541                fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<ReceiverMarker>>,
8542                fdomain_client::fidl::FDomainResourceDialect,
8543            >,
8544        >
8545        fidl::encoding::Encode<
8546            CapabilityStoreConnectorCreateRequest,
8547            fdomain_client::fidl::FDomainResourceDialect,
8548        > for (T0, T1)
8549    {
8550        #[inline]
8551        unsafe fn encode(
8552            self,
8553            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8554            offset: usize,
8555            depth: fidl::encoding::Depth,
8556        ) -> fidl::Result<()> {
8557            encoder.debug_check_bounds::<CapabilityStoreConnectorCreateRequest>(offset);
8558            // Zero out padding regions. There's no need to apply masks
8559            // because the unmasked parts will be overwritten by fields.
8560            unsafe {
8561                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
8562                (ptr as *mut u64).write_unaligned(0);
8563            }
8564            // Write the fields.
8565            self.0.encode(encoder, offset + 0, depth)?;
8566            self.1.encode(encoder, offset + 8, depth)?;
8567            Ok(())
8568        }
8569    }
8570
8571    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
8572        for CapabilityStoreConnectorCreateRequest
8573    {
8574        #[inline(always)]
8575        fn new_empty() -> Self {
8576            Self {
8577                id: fidl::new_empty!(u64, fdomain_client::fidl::FDomainResourceDialect),
8578                receiver: fidl::new_empty!(
8579                    fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<ReceiverMarker>>,
8580                    fdomain_client::fidl::FDomainResourceDialect
8581                ),
8582            }
8583        }
8584
8585        #[inline]
8586        unsafe fn decode(
8587            &mut self,
8588            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8589            offset: usize,
8590            _depth: fidl::encoding::Depth,
8591        ) -> fidl::Result<()> {
8592            decoder.debug_check_bounds::<Self>(offset);
8593            // Verify that padding bytes are zero.
8594            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
8595            let padval = unsafe { (ptr as *const u64).read_unaligned() };
8596            let mask = 0xffffffff00000000u64;
8597            let maskedval = padval & mask;
8598            if maskedval != 0 {
8599                return Err(fidl::Error::NonZeroPadding {
8600                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
8601                });
8602            }
8603            fidl::decode!(
8604                u64,
8605                fdomain_client::fidl::FDomainResourceDialect,
8606                &mut self.id,
8607                decoder,
8608                offset + 0,
8609                _depth
8610            )?;
8611            fidl::decode!(
8612                fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<ReceiverMarker>>,
8613                fdomain_client::fidl::FDomainResourceDialect,
8614                &mut self.receiver,
8615                decoder,
8616                offset + 8,
8617                _depth
8618            )?;
8619            Ok(())
8620        }
8621    }
8622
8623    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreConnectorOpenRequest {
8624        type Borrowed<'a> = &'a mut Self;
8625        fn take_or_borrow<'a>(
8626            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8627        ) -> Self::Borrowed<'a> {
8628            value
8629        }
8630    }
8631
8632    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreConnectorOpenRequest {
8633        type Owned = Self;
8634
8635        #[inline(always)]
8636        fn inline_align(_context: fidl::encoding::Context) -> usize {
8637            8
8638        }
8639
8640        #[inline(always)]
8641        fn inline_size(_context: fidl::encoding::Context) -> usize {
8642            16
8643        }
8644    }
8645
8646    unsafe impl
8647        fidl::encoding::Encode<
8648            CapabilityStoreConnectorOpenRequest,
8649            fdomain_client::fidl::FDomainResourceDialect,
8650        > for &mut CapabilityStoreConnectorOpenRequest
8651    {
8652        #[inline]
8653        unsafe fn encode(
8654            self,
8655            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8656            offset: usize,
8657            _depth: fidl::encoding::Depth,
8658        ) -> fidl::Result<()> {
8659            encoder.debug_check_bounds::<CapabilityStoreConnectorOpenRequest>(offset);
8660            // Delegate to tuple encoding.
8661            fidl::encoding::Encode::<
8662                CapabilityStoreConnectorOpenRequest,
8663                fdomain_client::fidl::FDomainResourceDialect,
8664            >::encode(
8665                (
8666                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
8667                    <fidl::encoding::HandleType<
8668                        fdomain_client::Channel,
8669                        { fidl::ObjectType::CHANNEL.into_raw() },
8670                        2147483648,
8671                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
8672                        &mut self.server_end
8673                    ),
8674                ),
8675                encoder,
8676                offset,
8677                _depth,
8678            )
8679        }
8680    }
8681    unsafe impl<
8682            T0: fidl::encoding::Encode<u64, fdomain_client::fidl::FDomainResourceDialect>,
8683            T1: fidl::encoding::Encode<
8684                fidl::encoding::HandleType<
8685                    fdomain_client::Channel,
8686                    { fidl::ObjectType::CHANNEL.into_raw() },
8687                    2147483648,
8688                >,
8689                fdomain_client::fidl::FDomainResourceDialect,
8690            >,
8691        >
8692        fidl::encoding::Encode<
8693            CapabilityStoreConnectorOpenRequest,
8694            fdomain_client::fidl::FDomainResourceDialect,
8695        > for (T0, T1)
8696    {
8697        #[inline]
8698        unsafe fn encode(
8699            self,
8700            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8701            offset: usize,
8702            depth: fidl::encoding::Depth,
8703        ) -> fidl::Result<()> {
8704            encoder.debug_check_bounds::<CapabilityStoreConnectorOpenRequest>(offset);
8705            // Zero out padding regions. There's no need to apply masks
8706            // because the unmasked parts will be overwritten by fields.
8707            unsafe {
8708                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
8709                (ptr as *mut u64).write_unaligned(0);
8710            }
8711            // Write the fields.
8712            self.0.encode(encoder, offset + 0, depth)?;
8713            self.1.encode(encoder, offset + 8, depth)?;
8714            Ok(())
8715        }
8716    }
8717
8718    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
8719        for CapabilityStoreConnectorOpenRequest
8720    {
8721        #[inline(always)]
8722        fn new_empty() -> Self {
8723            Self {
8724                id: fidl::new_empty!(u64, fdomain_client::fidl::FDomainResourceDialect),
8725                server_end: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
8726            }
8727        }
8728
8729        #[inline]
8730        unsafe fn decode(
8731            &mut self,
8732            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8733            offset: usize,
8734            _depth: fidl::encoding::Depth,
8735        ) -> fidl::Result<()> {
8736            decoder.debug_check_bounds::<Self>(offset);
8737            // Verify that padding bytes are zero.
8738            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
8739            let padval = unsafe { (ptr as *const u64).read_unaligned() };
8740            let mask = 0xffffffff00000000u64;
8741            let maskedval = padval & mask;
8742            if maskedval != 0 {
8743                return Err(fidl::Error::NonZeroPadding {
8744                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
8745                });
8746            }
8747            fidl::decode!(
8748                u64,
8749                fdomain_client::fidl::FDomainResourceDialect,
8750                &mut self.id,
8751                decoder,
8752                offset + 0,
8753                _depth
8754            )?;
8755            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)?;
8756            Ok(())
8757        }
8758    }
8759
8760    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDictionaryDrainRequest {
8761        type Borrowed<'a> = &'a mut Self;
8762        fn take_or_borrow<'a>(
8763            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8764        ) -> Self::Borrowed<'a> {
8765            value
8766        }
8767    }
8768
8769    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDictionaryDrainRequest {
8770        type Owned = Self;
8771
8772        #[inline(always)]
8773        fn inline_align(_context: fidl::encoding::Context) -> usize {
8774            8
8775        }
8776
8777        #[inline(always)]
8778        fn inline_size(_context: fidl::encoding::Context) -> usize {
8779            16
8780        }
8781    }
8782
8783    unsafe impl
8784        fidl::encoding::Encode<
8785            CapabilityStoreDictionaryDrainRequest,
8786            fdomain_client::fidl::FDomainResourceDialect,
8787        > for &mut CapabilityStoreDictionaryDrainRequest
8788    {
8789        #[inline]
8790        unsafe fn encode(
8791            self,
8792            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8793            offset: usize,
8794            _depth: fidl::encoding::Depth,
8795        ) -> fidl::Result<()> {
8796            encoder.debug_check_bounds::<CapabilityStoreDictionaryDrainRequest>(offset);
8797            // Delegate to tuple encoding.
8798            fidl::encoding::Encode::<
8799                CapabilityStoreDictionaryDrainRequest,
8800                fdomain_client::fidl::FDomainResourceDialect,
8801            >::encode(
8802                (
8803                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
8804                    <fidl::encoding::Optional<
8805                        fidl::encoding::Endpoint<
8806                            fdomain_client::fidl::ServerEnd<DictionaryDrainIteratorMarker>,
8807                        >,
8808                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
8809                        &mut self.iterator
8810                    ),
8811                ),
8812                encoder,
8813                offset,
8814                _depth,
8815            )
8816        }
8817    }
8818    unsafe impl<
8819            T0: fidl::encoding::Encode<u64, fdomain_client::fidl::FDomainResourceDialect>,
8820            T1: fidl::encoding::Encode<
8821                fidl::encoding::Optional<
8822                    fidl::encoding::Endpoint<
8823                        fdomain_client::fidl::ServerEnd<DictionaryDrainIteratorMarker>,
8824                    >,
8825                >,
8826                fdomain_client::fidl::FDomainResourceDialect,
8827            >,
8828        >
8829        fidl::encoding::Encode<
8830            CapabilityStoreDictionaryDrainRequest,
8831            fdomain_client::fidl::FDomainResourceDialect,
8832        > for (T0, T1)
8833    {
8834        #[inline]
8835        unsafe fn encode(
8836            self,
8837            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8838            offset: usize,
8839            depth: fidl::encoding::Depth,
8840        ) -> fidl::Result<()> {
8841            encoder.debug_check_bounds::<CapabilityStoreDictionaryDrainRequest>(offset);
8842            // Zero out padding regions. There's no need to apply masks
8843            // because the unmasked parts will be overwritten by fields.
8844            unsafe {
8845                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
8846                (ptr as *mut u64).write_unaligned(0);
8847            }
8848            // Write the fields.
8849            self.0.encode(encoder, offset + 0, depth)?;
8850            self.1.encode(encoder, offset + 8, depth)?;
8851            Ok(())
8852        }
8853    }
8854
8855    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
8856        for CapabilityStoreDictionaryDrainRequest
8857    {
8858        #[inline(always)]
8859        fn new_empty() -> Self {
8860            Self {
8861                id: fidl::new_empty!(u64, fdomain_client::fidl::FDomainResourceDialect),
8862                iterator: fidl::new_empty!(
8863                    fidl::encoding::Optional<
8864                        fidl::encoding::Endpoint<
8865                            fdomain_client::fidl::ServerEnd<DictionaryDrainIteratorMarker>,
8866                        >,
8867                    >,
8868                    fdomain_client::fidl::FDomainResourceDialect
8869                ),
8870            }
8871        }
8872
8873        #[inline]
8874        unsafe fn decode(
8875            &mut self,
8876            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8877            offset: usize,
8878            _depth: fidl::encoding::Depth,
8879        ) -> fidl::Result<()> {
8880            decoder.debug_check_bounds::<Self>(offset);
8881            // Verify that padding bytes are zero.
8882            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
8883            let padval = unsafe { (ptr as *const u64).read_unaligned() };
8884            let mask = 0xffffffff00000000u64;
8885            let maskedval = padval & mask;
8886            if maskedval != 0 {
8887                return Err(fidl::Error::NonZeroPadding {
8888                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
8889                });
8890            }
8891            fidl::decode!(
8892                u64,
8893                fdomain_client::fidl::FDomainResourceDialect,
8894                &mut self.id,
8895                decoder,
8896                offset + 0,
8897                _depth
8898            )?;
8899            fidl::decode!(
8900                fidl::encoding::Optional<
8901                    fidl::encoding::Endpoint<
8902                        fdomain_client::fidl::ServerEnd<DictionaryDrainIteratorMarker>,
8903                    >,
8904                >,
8905                fdomain_client::fidl::FDomainResourceDialect,
8906                &mut self.iterator,
8907                decoder,
8908                offset + 8,
8909                _depth
8910            )?;
8911            Ok(())
8912        }
8913    }
8914
8915    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDictionaryEnumerateRequest {
8916        type Borrowed<'a> = &'a mut Self;
8917        fn take_or_borrow<'a>(
8918            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8919        ) -> Self::Borrowed<'a> {
8920            value
8921        }
8922    }
8923
8924    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDictionaryEnumerateRequest {
8925        type Owned = Self;
8926
8927        #[inline(always)]
8928        fn inline_align(_context: fidl::encoding::Context) -> usize {
8929            8
8930        }
8931
8932        #[inline(always)]
8933        fn inline_size(_context: fidl::encoding::Context) -> usize {
8934            16
8935        }
8936    }
8937
8938    unsafe impl
8939        fidl::encoding::Encode<
8940            CapabilityStoreDictionaryEnumerateRequest,
8941            fdomain_client::fidl::FDomainResourceDialect,
8942        > for &mut CapabilityStoreDictionaryEnumerateRequest
8943    {
8944        #[inline]
8945        unsafe fn encode(
8946            self,
8947            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8948            offset: usize,
8949            _depth: fidl::encoding::Depth,
8950        ) -> fidl::Result<()> {
8951            encoder.debug_check_bounds::<CapabilityStoreDictionaryEnumerateRequest>(offset);
8952            // Delegate to tuple encoding.
8953            fidl::encoding::Encode::<
8954                CapabilityStoreDictionaryEnumerateRequest,
8955                fdomain_client::fidl::FDomainResourceDialect,
8956            >::encode(
8957                (
8958                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
8959                    <fidl::encoding::Endpoint<
8960                        fdomain_client::fidl::ServerEnd<DictionaryEnumerateIteratorMarker>,
8961                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
8962                        &mut self.iterator
8963                    ),
8964                ),
8965                encoder,
8966                offset,
8967                _depth,
8968            )
8969        }
8970    }
8971    unsafe impl<
8972            T0: fidl::encoding::Encode<u64, fdomain_client::fidl::FDomainResourceDialect>,
8973            T1: fidl::encoding::Encode<
8974                fidl::encoding::Endpoint<
8975                    fdomain_client::fidl::ServerEnd<DictionaryEnumerateIteratorMarker>,
8976                >,
8977                fdomain_client::fidl::FDomainResourceDialect,
8978            >,
8979        >
8980        fidl::encoding::Encode<
8981            CapabilityStoreDictionaryEnumerateRequest,
8982            fdomain_client::fidl::FDomainResourceDialect,
8983        > for (T0, T1)
8984    {
8985        #[inline]
8986        unsafe fn encode(
8987            self,
8988            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8989            offset: usize,
8990            depth: fidl::encoding::Depth,
8991        ) -> fidl::Result<()> {
8992            encoder.debug_check_bounds::<CapabilityStoreDictionaryEnumerateRequest>(offset);
8993            // Zero out padding regions. There's no need to apply masks
8994            // because the unmasked parts will be overwritten by fields.
8995            unsafe {
8996                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
8997                (ptr as *mut u64).write_unaligned(0);
8998            }
8999            // Write the fields.
9000            self.0.encode(encoder, offset + 0, depth)?;
9001            self.1.encode(encoder, offset + 8, depth)?;
9002            Ok(())
9003        }
9004    }
9005
9006    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
9007        for CapabilityStoreDictionaryEnumerateRequest
9008    {
9009        #[inline(always)]
9010        fn new_empty() -> Self {
9011            Self {
9012                id: fidl::new_empty!(u64, fdomain_client::fidl::FDomainResourceDialect),
9013                iterator: fidl::new_empty!(
9014                    fidl::encoding::Endpoint<
9015                        fdomain_client::fidl::ServerEnd<DictionaryEnumerateIteratorMarker>,
9016                    >,
9017                    fdomain_client::fidl::FDomainResourceDialect
9018                ),
9019            }
9020        }
9021
9022        #[inline]
9023        unsafe fn decode(
9024            &mut self,
9025            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9026            offset: usize,
9027            _depth: fidl::encoding::Depth,
9028        ) -> fidl::Result<()> {
9029            decoder.debug_check_bounds::<Self>(offset);
9030            // Verify that padding bytes are zero.
9031            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
9032            let padval = unsafe { (ptr as *const u64).read_unaligned() };
9033            let mask = 0xffffffff00000000u64;
9034            let maskedval = padval & mask;
9035            if maskedval != 0 {
9036                return Err(fidl::Error::NonZeroPadding {
9037                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
9038                });
9039            }
9040            fidl::decode!(
9041                u64,
9042                fdomain_client::fidl::FDomainResourceDialect,
9043                &mut self.id,
9044                decoder,
9045                offset + 0,
9046                _depth
9047            )?;
9048            fidl::decode!(
9049                fidl::encoding::Endpoint<
9050                    fdomain_client::fidl::ServerEnd<DictionaryEnumerateIteratorMarker>,
9051                >,
9052                fdomain_client::fidl::FDomainResourceDialect,
9053                &mut self.iterator,
9054                decoder,
9055                offset + 8,
9056                _depth
9057            )?;
9058            Ok(())
9059        }
9060    }
9061
9062    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDictionaryKeysRequest {
9063        type Borrowed<'a> = &'a mut Self;
9064        fn take_or_borrow<'a>(
9065            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9066        ) -> Self::Borrowed<'a> {
9067            value
9068        }
9069    }
9070
9071    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDictionaryKeysRequest {
9072        type Owned = Self;
9073
9074        #[inline(always)]
9075        fn inline_align(_context: fidl::encoding::Context) -> usize {
9076            8
9077        }
9078
9079        #[inline(always)]
9080        fn inline_size(_context: fidl::encoding::Context) -> usize {
9081            16
9082        }
9083    }
9084
9085    unsafe impl
9086        fidl::encoding::Encode<
9087            CapabilityStoreDictionaryKeysRequest,
9088            fdomain_client::fidl::FDomainResourceDialect,
9089        > for &mut CapabilityStoreDictionaryKeysRequest
9090    {
9091        #[inline]
9092        unsafe fn encode(
9093            self,
9094            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9095            offset: usize,
9096            _depth: fidl::encoding::Depth,
9097        ) -> fidl::Result<()> {
9098            encoder.debug_check_bounds::<CapabilityStoreDictionaryKeysRequest>(offset);
9099            // Delegate to tuple encoding.
9100            fidl::encoding::Encode::<
9101                CapabilityStoreDictionaryKeysRequest,
9102                fdomain_client::fidl::FDomainResourceDialect,
9103            >::encode(
9104                (
9105                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
9106                    <fidl::encoding::Endpoint<
9107                        fdomain_client::fidl::ServerEnd<DictionaryKeysIteratorMarker>,
9108                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9109                        &mut self.iterator
9110                    ),
9111                ),
9112                encoder,
9113                offset,
9114                _depth,
9115            )
9116        }
9117    }
9118    unsafe impl<
9119            T0: fidl::encoding::Encode<u64, fdomain_client::fidl::FDomainResourceDialect>,
9120            T1: fidl::encoding::Encode<
9121                fidl::encoding::Endpoint<
9122                    fdomain_client::fidl::ServerEnd<DictionaryKeysIteratorMarker>,
9123                >,
9124                fdomain_client::fidl::FDomainResourceDialect,
9125            >,
9126        >
9127        fidl::encoding::Encode<
9128            CapabilityStoreDictionaryKeysRequest,
9129            fdomain_client::fidl::FDomainResourceDialect,
9130        > for (T0, T1)
9131    {
9132        #[inline]
9133        unsafe fn encode(
9134            self,
9135            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9136            offset: usize,
9137            depth: fidl::encoding::Depth,
9138        ) -> fidl::Result<()> {
9139            encoder.debug_check_bounds::<CapabilityStoreDictionaryKeysRequest>(offset);
9140            // Zero out padding regions. There's no need to apply masks
9141            // because the unmasked parts will be overwritten by fields.
9142            unsafe {
9143                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
9144                (ptr as *mut u64).write_unaligned(0);
9145            }
9146            // Write the fields.
9147            self.0.encode(encoder, offset + 0, depth)?;
9148            self.1.encode(encoder, offset + 8, depth)?;
9149            Ok(())
9150        }
9151    }
9152
9153    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
9154        for CapabilityStoreDictionaryKeysRequest
9155    {
9156        #[inline(always)]
9157        fn new_empty() -> Self {
9158            Self {
9159                id: fidl::new_empty!(u64, fdomain_client::fidl::FDomainResourceDialect),
9160                iterator: fidl::new_empty!(
9161                    fidl::encoding::Endpoint<
9162                        fdomain_client::fidl::ServerEnd<DictionaryKeysIteratorMarker>,
9163                    >,
9164                    fdomain_client::fidl::FDomainResourceDialect
9165                ),
9166            }
9167        }
9168
9169        #[inline]
9170        unsafe fn decode(
9171            &mut self,
9172            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9173            offset: usize,
9174            _depth: fidl::encoding::Depth,
9175        ) -> fidl::Result<()> {
9176            decoder.debug_check_bounds::<Self>(offset);
9177            // Verify that padding bytes are zero.
9178            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
9179            let padval = unsafe { (ptr as *const u64).read_unaligned() };
9180            let mask = 0xffffffff00000000u64;
9181            let maskedval = padval & mask;
9182            if maskedval != 0 {
9183                return Err(fidl::Error::NonZeroPadding {
9184                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
9185                });
9186            }
9187            fidl::decode!(
9188                u64,
9189                fdomain_client::fidl::FDomainResourceDialect,
9190                &mut self.id,
9191                decoder,
9192                offset + 0,
9193                _depth
9194            )?;
9195            fidl::decode!(
9196                fidl::encoding::Endpoint<
9197                    fdomain_client::fidl::ServerEnd<DictionaryKeysIteratorMarker>,
9198                >,
9199                fdomain_client::fidl::FDomainResourceDialect,
9200                &mut self.iterator,
9201                decoder,
9202                offset + 8,
9203                _depth
9204            )?;
9205            Ok(())
9206        }
9207    }
9208
9209    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDictionaryLegacyExportRequest {
9210        type Borrowed<'a> = &'a mut Self;
9211        fn take_or_borrow<'a>(
9212            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9213        ) -> Self::Borrowed<'a> {
9214            value
9215        }
9216    }
9217
9218    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDictionaryLegacyExportRequest {
9219        type Owned = Self;
9220
9221        #[inline(always)]
9222        fn inline_align(_context: fidl::encoding::Context) -> usize {
9223            8
9224        }
9225
9226        #[inline(always)]
9227        fn inline_size(_context: fidl::encoding::Context) -> usize {
9228            16
9229        }
9230    }
9231
9232    unsafe impl
9233        fidl::encoding::Encode<
9234            CapabilityStoreDictionaryLegacyExportRequest,
9235            fdomain_client::fidl::FDomainResourceDialect,
9236        > for &mut CapabilityStoreDictionaryLegacyExportRequest
9237    {
9238        #[inline]
9239        unsafe fn encode(
9240            self,
9241            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9242            offset: usize,
9243            _depth: fidl::encoding::Depth,
9244        ) -> fidl::Result<()> {
9245            encoder.debug_check_bounds::<CapabilityStoreDictionaryLegacyExportRequest>(offset);
9246            // Delegate to tuple encoding.
9247            fidl::encoding::Encode::<
9248                CapabilityStoreDictionaryLegacyExportRequest,
9249                fdomain_client::fidl::FDomainResourceDialect,
9250            >::encode(
9251                (
9252                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
9253                    <fidl::encoding::HandleType<
9254                        fdomain_client::Channel,
9255                        { fidl::ObjectType::CHANNEL.into_raw() },
9256                        2147483648,
9257                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9258                        &mut self.server_end
9259                    ),
9260                ),
9261                encoder,
9262                offset,
9263                _depth,
9264            )
9265        }
9266    }
9267    unsafe impl<
9268            T0: fidl::encoding::Encode<u64, fdomain_client::fidl::FDomainResourceDialect>,
9269            T1: fidl::encoding::Encode<
9270                fidl::encoding::HandleType<
9271                    fdomain_client::Channel,
9272                    { fidl::ObjectType::CHANNEL.into_raw() },
9273                    2147483648,
9274                >,
9275                fdomain_client::fidl::FDomainResourceDialect,
9276            >,
9277        >
9278        fidl::encoding::Encode<
9279            CapabilityStoreDictionaryLegacyExportRequest,
9280            fdomain_client::fidl::FDomainResourceDialect,
9281        > for (T0, T1)
9282    {
9283        #[inline]
9284        unsafe fn encode(
9285            self,
9286            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9287            offset: usize,
9288            depth: fidl::encoding::Depth,
9289        ) -> fidl::Result<()> {
9290            encoder.debug_check_bounds::<CapabilityStoreDictionaryLegacyExportRequest>(offset);
9291            // Zero out padding regions. There's no need to apply masks
9292            // because the unmasked parts will be overwritten by fields.
9293            unsafe {
9294                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
9295                (ptr as *mut u64).write_unaligned(0);
9296            }
9297            // Write the fields.
9298            self.0.encode(encoder, offset + 0, depth)?;
9299            self.1.encode(encoder, offset + 8, depth)?;
9300            Ok(())
9301        }
9302    }
9303
9304    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
9305        for CapabilityStoreDictionaryLegacyExportRequest
9306    {
9307        #[inline(always)]
9308        fn new_empty() -> Self {
9309            Self {
9310                id: fidl::new_empty!(u64, fdomain_client::fidl::FDomainResourceDialect),
9311                server_end: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
9312            }
9313        }
9314
9315        #[inline]
9316        unsafe fn decode(
9317            &mut self,
9318            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9319            offset: usize,
9320            _depth: fidl::encoding::Depth,
9321        ) -> fidl::Result<()> {
9322            decoder.debug_check_bounds::<Self>(offset);
9323            // Verify that padding bytes are zero.
9324            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
9325            let padval = unsafe { (ptr as *const u64).read_unaligned() };
9326            let mask = 0xffffffff00000000u64;
9327            let maskedval = padval & mask;
9328            if maskedval != 0 {
9329                return Err(fidl::Error::NonZeroPadding {
9330                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
9331                });
9332            }
9333            fidl::decode!(
9334                u64,
9335                fdomain_client::fidl::FDomainResourceDialect,
9336                &mut self.id,
9337                decoder,
9338                offset + 0,
9339                _depth
9340            )?;
9341            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)?;
9342            Ok(())
9343        }
9344    }
9345
9346    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDictionaryLegacyImportRequest {
9347        type Borrowed<'a> = &'a mut Self;
9348        fn take_or_borrow<'a>(
9349            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9350        ) -> Self::Borrowed<'a> {
9351            value
9352        }
9353    }
9354
9355    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDictionaryLegacyImportRequest {
9356        type Owned = Self;
9357
9358        #[inline(always)]
9359        fn inline_align(_context: fidl::encoding::Context) -> usize {
9360            8
9361        }
9362
9363        #[inline(always)]
9364        fn inline_size(_context: fidl::encoding::Context) -> usize {
9365            16
9366        }
9367    }
9368
9369    unsafe impl
9370        fidl::encoding::Encode<
9371            CapabilityStoreDictionaryLegacyImportRequest,
9372            fdomain_client::fidl::FDomainResourceDialect,
9373        > for &mut CapabilityStoreDictionaryLegacyImportRequest
9374    {
9375        #[inline]
9376        unsafe fn encode(
9377            self,
9378            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9379            offset: usize,
9380            _depth: fidl::encoding::Depth,
9381        ) -> fidl::Result<()> {
9382            encoder.debug_check_bounds::<CapabilityStoreDictionaryLegacyImportRequest>(offset);
9383            // Delegate to tuple encoding.
9384            fidl::encoding::Encode::<
9385                CapabilityStoreDictionaryLegacyImportRequest,
9386                fdomain_client::fidl::FDomainResourceDialect,
9387            >::encode(
9388                (
9389                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
9390                    <fidl::encoding::HandleType<
9391                        fdomain_client::Channel,
9392                        { fidl::ObjectType::CHANNEL.into_raw() },
9393                        2147483648,
9394                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9395                        &mut self.client_end
9396                    ),
9397                ),
9398                encoder,
9399                offset,
9400                _depth,
9401            )
9402        }
9403    }
9404    unsafe impl<
9405            T0: fidl::encoding::Encode<u64, fdomain_client::fidl::FDomainResourceDialect>,
9406            T1: fidl::encoding::Encode<
9407                fidl::encoding::HandleType<
9408                    fdomain_client::Channel,
9409                    { fidl::ObjectType::CHANNEL.into_raw() },
9410                    2147483648,
9411                >,
9412                fdomain_client::fidl::FDomainResourceDialect,
9413            >,
9414        >
9415        fidl::encoding::Encode<
9416            CapabilityStoreDictionaryLegacyImportRequest,
9417            fdomain_client::fidl::FDomainResourceDialect,
9418        > for (T0, T1)
9419    {
9420        #[inline]
9421        unsafe fn encode(
9422            self,
9423            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9424            offset: usize,
9425            depth: fidl::encoding::Depth,
9426        ) -> fidl::Result<()> {
9427            encoder.debug_check_bounds::<CapabilityStoreDictionaryLegacyImportRequest>(offset);
9428            // Zero out padding regions. There's no need to apply masks
9429            // because the unmasked parts will be overwritten by fields.
9430            unsafe {
9431                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
9432                (ptr as *mut u64).write_unaligned(0);
9433            }
9434            // Write the fields.
9435            self.0.encode(encoder, offset + 0, depth)?;
9436            self.1.encode(encoder, offset + 8, depth)?;
9437            Ok(())
9438        }
9439    }
9440
9441    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
9442        for CapabilityStoreDictionaryLegacyImportRequest
9443    {
9444        #[inline(always)]
9445        fn new_empty() -> Self {
9446            Self {
9447                id: fidl::new_empty!(u64, fdomain_client::fidl::FDomainResourceDialect),
9448                client_end: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
9449            }
9450        }
9451
9452        #[inline]
9453        unsafe fn decode(
9454            &mut self,
9455            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9456            offset: usize,
9457            _depth: fidl::encoding::Depth,
9458        ) -> fidl::Result<()> {
9459            decoder.debug_check_bounds::<Self>(offset);
9460            // Verify that padding bytes are zero.
9461            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
9462            let padval = unsafe { (ptr as *const u64).read_unaligned() };
9463            let mask = 0xffffffff00000000u64;
9464            let maskedval = padval & mask;
9465            if maskedval != 0 {
9466                return Err(fidl::Error::NonZeroPadding {
9467                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
9468                });
9469            }
9470            fidl::decode!(
9471                u64,
9472                fdomain_client::fidl::FDomainResourceDialect,
9473                &mut self.id,
9474                decoder,
9475                offset + 0,
9476                _depth
9477            )?;
9478            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)?;
9479            Ok(())
9480        }
9481    }
9482
9483    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDirConnectorCreateRequest {
9484        type Borrowed<'a> = &'a mut Self;
9485        fn take_or_borrow<'a>(
9486            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9487        ) -> Self::Borrowed<'a> {
9488            value
9489        }
9490    }
9491
9492    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDirConnectorCreateRequest {
9493        type Owned = Self;
9494
9495        #[inline(always)]
9496        fn inline_align(_context: fidl::encoding::Context) -> usize {
9497            8
9498        }
9499
9500        #[inline(always)]
9501        fn inline_size(_context: fidl::encoding::Context) -> usize {
9502            16
9503        }
9504    }
9505
9506    unsafe impl
9507        fidl::encoding::Encode<
9508            CapabilityStoreDirConnectorCreateRequest,
9509            fdomain_client::fidl::FDomainResourceDialect,
9510        > for &mut CapabilityStoreDirConnectorCreateRequest
9511    {
9512        #[inline]
9513        unsafe fn encode(
9514            self,
9515            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9516            offset: usize,
9517            _depth: fidl::encoding::Depth,
9518        ) -> fidl::Result<()> {
9519            encoder.debug_check_bounds::<CapabilityStoreDirConnectorCreateRequest>(offset);
9520            // Delegate to tuple encoding.
9521            fidl::encoding::Encode::<CapabilityStoreDirConnectorCreateRequest, fdomain_client::fidl::FDomainResourceDialect>::encode(
9522                (
9523                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
9524                    <fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<DirReceiverMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.receiver),
9525                ),
9526                encoder, offset, _depth
9527            )
9528        }
9529    }
9530    unsafe impl<
9531            T0: fidl::encoding::Encode<u64, fdomain_client::fidl::FDomainResourceDialect>,
9532            T1: fidl::encoding::Encode<
9533                fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<DirReceiverMarker>>,
9534                fdomain_client::fidl::FDomainResourceDialect,
9535            >,
9536        >
9537        fidl::encoding::Encode<
9538            CapabilityStoreDirConnectorCreateRequest,
9539            fdomain_client::fidl::FDomainResourceDialect,
9540        > for (T0, T1)
9541    {
9542        #[inline]
9543        unsafe fn encode(
9544            self,
9545            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9546            offset: usize,
9547            depth: fidl::encoding::Depth,
9548        ) -> fidl::Result<()> {
9549            encoder.debug_check_bounds::<CapabilityStoreDirConnectorCreateRequest>(offset);
9550            // Zero out padding regions. There's no need to apply masks
9551            // because the unmasked parts will be overwritten by fields.
9552            unsafe {
9553                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
9554                (ptr as *mut u64).write_unaligned(0);
9555            }
9556            // Write the fields.
9557            self.0.encode(encoder, offset + 0, depth)?;
9558            self.1.encode(encoder, offset + 8, depth)?;
9559            Ok(())
9560        }
9561    }
9562
9563    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
9564        for CapabilityStoreDirConnectorCreateRequest
9565    {
9566        #[inline(always)]
9567        fn new_empty() -> Self {
9568            Self {
9569                id: fidl::new_empty!(u64, fdomain_client::fidl::FDomainResourceDialect),
9570                receiver: fidl::new_empty!(
9571                    fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<DirReceiverMarker>>,
9572                    fdomain_client::fidl::FDomainResourceDialect
9573                ),
9574            }
9575        }
9576
9577        #[inline]
9578        unsafe fn decode(
9579            &mut self,
9580            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9581            offset: usize,
9582            _depth: fidl::encoding::Depth,
9583        ) -> fidl::Result<()> {
9584            decoder.debug_check_bounds::<Self>(offset);
9585            // Verify that padding bytes are zero.
9586            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
9587            let padval = unsafe { (ptr as *const u64).read_unaligned() };
9588            let mask = 0xffffffff00000000u64;
9589            let maskedval = padval & mask;
9590            if maskedval != 0 {
9591                return Err(fidl::Error::NonZeroPadding {
9592                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
9593                });
9594            }
9595            fidl::decode!(
9596                u64,
9597                fdomain_client::fidl::FDomainResourceDialect,
9598                &mut self.id,
9599                decoder,
9600                offset + 0,
9601                _depth
9602            )?;
9603            fidl::decode!(
9604                fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<DirReceiverMarker>>,
9605                fdomain_client::fidl::FDomainResourceDialect,
9606                &mut self.receiver,
9607                decoder,
9608                offset + 8,
9609                _depth
9610            )?;
9611            Ok(())
9612        }
9613    }
9614
9615    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDirConnectorOpenRequest {
9616        type Borrowed<'a> = &'a mut Self;
9617        fn take_or_borrow<'a>(
9618            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9619        ) -> Self::Borrowed<'a> {
9620            value
9621        }
9622    }
9623
9624    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDirConnectorOpenRequest {
9625        type Owned = Self;
9626
9627        #[inline(always)]
9628        fn inline_align(_context: fidl::encoding::Context) -> usize {
9629            8
9630        }
9631
9632        #[inline(always)]
9633        fn inline_size(_context: fidl::encoding::Context) -> usize {
9634            16
9635        }
9636    }
9637
9638    unsafe impl
9639        fidl::encoding::Encode<
9640            CapabilityStoreDirConnectorOpenRequest,
9641            fdomain_client::fidl::FDomainResourceDialect,
9642        > for &mut CapabilityStoreDirConnectorOpenRequest
9643    {
9644        #[inline]
9645        unsafe fn encode(
9646            self,
9647            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9648            offset: usize,
9649            _depth: fidl::encoding::Depth,
9650        ) -> fidl::Result<()> {
9651            encoder.debug_check_bounds::<CapabilityStoreDirConnectorOpenRequest>(offset);
9652            // Delegate to tuple encoding.
9653            fidl::encoding::Encode::<
9654                CapabilityStoreDirConnectorOpenRequest,
9655                fdomain_client::fidl::FDomainResourceDialect,
9656            >::encode(
9657                (
9658                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
9659                    <fidl::encoding::Endpoint<
9660                        fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
9661                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9662                        &mut self.server_end
9663                    ),
9664                ),
9665                encoder,
9666                offset,
9667                _depth,
9668            )
9669        }
9670    }
9671    unsafe impl<
9672            T0: fidl::encoding::Encode<u64, fdomain_client::fidl::FDomainResourceDialect>,
9673            T1: fidl::encoding::Encode<
9674                fidl::encoding::Endpoint<
9675                    fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
9676                >,
9677                fdomain_client::fidl::FDomainResourceDialect,
9678            >,
9679        >
9680        fidl::encoding::Encode<
9681            CapabilityStoreDirConnectorOpenRequest,
9682            fdomain_client::fidl::FDomainResourceDialect,
9683        > for (T0, T1)
9684    {
9685        #[inline]
9686        unsafe fn encode(
9687            self,
9688            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9689            offset: usize,
9690            depth: fidl::encoding::Depth,
9691        ) -> fidl::Result<()> {
9692            encoder.debug_check_bounds::<CapabilityStoreDirConnectorOpenRequest>(offset);
9693            // Zero out padding regions. There's no need to apply masks
9694            // because the unmasked parts will be overwritten by fields.
9695            unsafe {
9696                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
9697                (ptr as *mut u64).write_unaligned(0);
9698            }
9699            // Write the fields.
9700            self.0.encode(encoder, offset + 0, depth)?;
9701            self.1.encode(encoder, offset + 8, depth)?;
9702            Ok(())
9703        }
9704    }
9705
9706    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
9707        for CapabilityStoreDirConnectorOpenRequest
9708    {
9709        #[inline(always)]
9710        fn new_empty() -> Self {
9711            Self {
9712                id: fidl::new_empty!(u64, fdomain_client::fidl::FDomainResourceDialect),
9713                server_end: fidl::new_empty!(
9714                    fidl::encoding::Endpoint<
9715                        fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
9716                    >,
9717                    fdomain_client::fidl::FDomainResourceDialect
9718                ),
9719            }
9720        }
9721
9722        #[inline]
9723        unsafe fn decode(
9724            &mut self,
9725            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9726            offset: usize,
9727            _depth: fidl::encoding::Depth,
9728        ) -> fidl::Result<()> {
9729            decoder.debug_check_bounds::<Self>(offset);
9730            // Verify that padding bytes are zero.
9731            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
9732            let padval = unsafe { (ptr as *const u64).read_unaligned() };
9733            let mask = 0xffffffff00000000u64;
9734            let maskedval = padval & mask;
9735            if maskedval != 0 {
9736                return Err(fidl::Error::NonZeroPadding {
9737                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
9738                });
9739            }
9740            fidl::decode!(
9741                u64,
9742                fdomain_client::fidl::FDomainResourceDialect,
9743                &mut self.id,
9744                decoder,
9745                offset + 0,
9746                _depth
9747            )?;
9748            fidl::decode!(
9749                fidl::encoding::Endpoint<
9750                    fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
9751                >,
9752                fdomain_client::fidl::FDomainResourceDialect,
9753                &mut self.server_end,
9754                decoder,
9755                offset + 8,
9756                _depth
9757            )?;
9758            Ok(())
9759        }
9760    }
9761
9762    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreImportRequest {
9763        type Borrowed<'a> = &'a mut Self;
9764        fn take_or_borrow<'a>(
9765            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9766        ) -> Self::Borrowed<'a> {
9767            value
9768        }
9769    }
9770
9771    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreImportRequest {
9772        type Owned = Self;
9773
9774        #[inline(always)]
9775        fn inline_align(_context: fidl::encoding::Context) -> usize {
9776            8
9777        }
9778
9779        #[inline(always)]
9780        fn inline_size(_context: fidl::encoding::Context) -> usize {
9781            24
9782        }
9783    }
9784
9785    unsafe impl
9786        fidl::encoding::Encode<
9787            CapabilityStoreImportRequest,
9788            fdomain_client::fidl::FDomainResourceDialect,
9789        > for &mut CapabilityStoreImportRequest
9790    {
9791        #[inline]
9792        unsafe fn encode(
9793            self,
9794            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9795            offset: usize,
9796            _depth: fidl::encoding::Depth,
9797        ) -> fidl::Result<()> {
9798            encoder.debug_check_bounds::<CapabilityStoreImportRequest>(offset);
9799            // Delegate to tuple encoding.
9800            fidl::encoding::Encode::<
9801                CapabilityStoreImportRequest,
9802                fdomain_client::fidl::FDomainResourceDialect,
9803            >::encode(
9804                (
9805                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
9806                    <Capability as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9807                        &mut self.capability,
9808                    ),
9809                ),
9810                encoder,
9811                offset,
9812                _depth,
9813            )
9814        }
9815    }
9816    unsafe impl<
9817            T0: fidl::encoding::Encode<u64, fdomain_client::fidl::FDomainResourceDialect>,
9818            T1: fidl::encoding::Encode<Capability, fdomain_client::fidl::FDomainResourceDialect>,
9819        >
9820        fidl::encoding::Encode<
9821            CapabilityStoreImportRequest,
9822            fdomain_client::fidl::FDomainResourceDialect,
9823        > for (T0, T1)
9824    {
9825        #[inline]
9826        unsafe fn encode(
9827            self,
9828            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9829            offset: usize,
9830            depth: fidl::encoding::Depth,
9831        ) -> fidl::Result<()> {
9832            encoder.debug_check_bounds::<CapabilityStoreImportRequest>(offset);
9833            // Zero out padding regions. There's no need to apply masks
9834            // because the unmasked parts will be overwritten by fields.
9835            // Write the fields.
9836            self.0.encode(encoder, offset + 0, depth)?;
9837            self.1.encode(encoder, offset + 8, depth)?;
9838            Ok(())
9839        }
9840    }
9841
9842    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
9843        for CapabilityStoreImportRequest
9844    {
9845        #[inline(always)]
9846        fn new_empty() -> Self {
9847            Self {
9848                id: fidl::new_empty!(u64, fdomain_client::fidl::FDomainResourceDialect),
9849                capability: fidl::new_empty!(
9850                    Capability,
9851                    fdomain_client::fidl::FDomainResourceDialect
9852                ),
9853            }
9854        }
9855
9856        #[inline]
9857        unsafe fn decode(
9858            &mut self,
9859            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9860            offset: usize,
9861            _depth: fidl::encoding::Depth,
9862        ) -> fidl::Result<()> {
9863            decoder.debug_check_bounds::<Self>(offset);
9864            // Verify that padding bytes are zero.
9865            fidl::decode!(
9866                u64,
9867                fdomain_client::fidl::FDomainResourceDialect,
9868                &mut self.id,
9869                decoder,
9870                offset + 0,
9871                _depth
9872            )?;
9873            fidl::decode!(
9874                Capability,
9875                fdomain_client::fidl::FDomainResourceDialect,
9876                &mut self.capability,
9877                decoder,
9878                offset + 8,
9879                _depth
9880            )?;
9881            Ok(())
9882        }
9883    }
9884
9885    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreExportResponse {
9886        type Borrowed<'a> = &'a mut Self;
9887        fn take_or_borrow<'a>(
9888            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9889        ) -> Self::Borrowed<'a> {
9890            value
9891        }
9892    }
9893
9894    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreExportResponse {
9895        type Owned = Self;
9896
9897        #[inline(always)]
9898        fn inline_align(_context: fidl::encoding::Context) -> usize {
9899            8
9900        }
9901
9902        #[inline(always)]
9903        fn inline_size(_context: fidl::encoding::Context) -> usize {
9904            16
9905        }
9906    }
9907
9908    unsafe impl
9909        fidl::encoding::Encode<
9910            CapabilityStoreExportResponse,
9911            fdomain_client::fidl::FDomainResourceDialect,
9912        > for &mut CapabilityStoreExportResponse
9913    {
9914        #[inline]
9915        unsafe fn encode(
9916            self,
9917            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9918            offset: usize,
9919            _depth: fidl::encoding::Depth,
9920        ) -> fidl::Result<()> {
9921            encoder.debug_check_bounds::<CapabilityStoreExportResponse>(offset);
9922            // Delegate to tuple encoding.
9923            fidl::encoding::Encode::<
9924                CapabilityStoreExportResponse,
9925                fdomain_client::fidl::FDomainResourceDialect,
9926            >::encode(
9927                (<Capability as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9928                    &mut self.capability,
9929                ),),
9930                encoder,
9931                offset,
9932                _depth,
9933            )
9934        }
9935    }
9936    unsafe impl<T0: fidl::encoding::Encode<Capability, fdomain_client::fidl::FDomainResourceDialect>>
9937        fidl::encoding::Encode<
9938            CapabilityStoreExportResponse,
9939            fdomain_client::fidl::FDomainResourceDialect,
9940        > for (T0,)
9941    {
9942        #[inline]
9943        unsafe fn encode(
9944            self,
9945            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9946            offset: usize,
9947            depth: fidl::encoding::Depth,
9948        ) -> fidl::Result<()> {
9949            encoder.debug_check_bounds::<CapabilityStoreExportResponse>(offset);
9950            // Zero out padding regions. There's no need to apply masks
9951            // because the unmasked parts will be overwritten by fields.
9952            // Write the fields.
9953            self.0.encode(encoder, offset + 0, depth)?;
9954            Ok(())
9955        }
9956    }
9957
9958    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
9959        for CapabilityStoreExportResponse
9960    {
9961        #[inline(always)]
9962        fn new_empty() -> Self {
9963            Self {
9964                capability: fidl::new_empty!(
9965                    Capability,
9966                    fdomain_client::fidl::FDomainResourceDialect
9967                ),
9968            }
9969        }
9970
9971        #[inline]
9972        unsafe fn decode(
9973            &mut self,
9974            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9975            offset: usize,
9976            _depth: fidl::encoding::Depth,
9977        ) -> fidl::Result<()> {
9978            decoder.debug_check_bounds::<Self>(offset);
9979            // Verify that padding bytes are zero.
9980            fidl::decode!(
9981                Capability,
9982                fdomain_client::fidl::FDomainResourceDialect,
9983                &mut self.capability,
9984                decoder,
9985                offset + 0,
9986                _depth
9987            )?;
9988            Ok(())
9989        }
9990    }
9991
9992    impl fidl::encoding::ResourceTypeMarker for Connector {
9993        type Borrowed<'a> = &'a mut Self;
9994        fn take_or_borrow<'a>(
9995            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9996        ) -> Self::Borrowed<'a> {
9997            value
9998        }
9999    }
10000
10001    unsafe impl fidl::encoding::TypeMarker for Connector {
10002        type Owned = Self;
10003
10004        #[inline(always)]
10005        fn inline_align(_context: fidl::encoding::Context) -> usize {
10006            4
10007        }
10008
10009        #[inline(always)]
10010        fn inline_size(_context: fidl::encoding::Context) -> usize {
10011            4
10012        }
10013    }
10014
10015    unsafe impl fidl::encoding::Encode<Connector, fdomain_client::fidl::FDomainResourceDialect>
10016        for &mut Connector
10017    {
10018        #[inline]
10019        unsafe fn encode(
10020            self,
10021            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10022            offset: usize,
10023            _depth: fidl::encoding::Depth,
10024        ) -> fidl::Result<()> {
10025            encoder.debug_check_bounds::<Connector>(offset);
10026            // Delegate to tuple encoding.
10027            fidl::encoding::Encode::<Connector, fdomain_client::fidl::FDomainResourceDialect>::encode(
10028                (
10029                    <fidl::encoding::HandleType<fdomain_client::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.token),
10030                ),
10031                encoder, offset, _depth
10032            )
10033        }
10034    }
10035    unsafe impl<
10036            T0: fidl::encoding::Encode<
10037                fidl::encoding::HandleType<
10038                    fdomain_client::EventPair,
10039                    { fidl::ObjectType::EVENTPAIR.into_raw() },
10040                    2147483648,
10041                >,
10042                fdomain_client::fidl::FDomainResourceDialect,
10043            >,
10044        > fidl::encoding::Encode<Connector, fdomain_client::fidl::FDomainResourceDialect> for (T0,)
10045    {
10046        #[inline]
10047        unsafe fn encode(
10048            self,
10049            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10050            offset: usize,
10051            depth: fidl::encoding::Depth,
10052        ) -> fidl::Result<()> {
10053            encoder.debug_check_bounds::<Connector>(offset);
10054            // Zero out padding regions. There's no need to apply masks
10055            // because the unmasked parts will be overwritten by fields.
10056            // Write the fields.
10057            self.0.encode(encoder, offset + 0, depth)?;
10058            Ok(())
10059        }
10060    }
10061
10062    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect> for Connector {
10063        #[inline(always)]
10064        fn new_empty() -> Self {
10065            Self {
10066                token: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
10067            }
10068        }
10069
10070        #[inline]
10071        unsafe fn decode(
10072            &mut self,
10073            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10074            offset: usize,
10075            _depth: fidl::encoding::Depth,
10076        ) -> fidl::Result<()> {
10077            decoder.debug_check_bounds::<Self>(offset);
10078            // Verify that padding bytes are zero.
10079            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)?;
10080            Ok(())
10081        }
10082    }
10083
10084    impl fidl::encoding::ResourceTypeMarker for DictionaryDrainIteratorGetNextResponse {
10085        type Borrowed<'a> = &'a mut Self;
10086        fn take_or_borrow<'a>(
10087            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10088        ) -> Self::Borrowed<'a> {
10089            value
10090        }
10091    }
10092
10093    unsafe impl fidl::encoding::TypeMarker for DictionaryDrainIteratorGetNextResponse {
10094        type Owned = Self;
10095
10096        #[inline(always)]
10097        fn inline_align(_context: fidl::encoding::Context) -> usize {
10098            8
10099        }
10100
10101        #[inline(always)]
10102        fn inline_size(_context: fidl::encoding::Context) -> usize {
10103            24
10104        }
10105    }
10106
10107    unsafe impl
10108        fidl::encoding::Encode<
10109            DictionaryDrainIteratorGetNextResponse,
10110            fdomain_client::fidl::FDomainResourceDialect,
10111        > for &mut DictionaryDrainIteratorGetNextResponse
10112    {
10113        #[inline]
10114        unsafe fn encode(
10115            self,
10116            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10117            offset: usize,
10118            _depth: fidl::encoding::Depth,
10119        ) -> fidl::Result<()> {
10120            encoder.debug_check_bounds::<DictionaryDrainIteratorGetNextResponse>(offset);
10121            // Delegate to tuple encoding.
10122            fidl::encoding::Encode::<DictionaryDrainIteratorGetNextResponse, fdomain_client::fidl::FDomainResourceDialect>::encode(
10123                (
10124                    <fidl::encoding::Vector<DictionaryItem, 128> as fidl::encoding::ValueTypeMarker>::borrow(&self.items),
10125                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.end_id),
10126                ),
10127                encoder, offset, _depth
10128            )
10129        }
10130    }
10131    unsafe impl<
10132            T0: fidl::encoding::Encode<
10133                fidl::encoding::Vector<DictionaryItem, 128>,
10134                fdomain_client::fidl::FDomainResourceDialect,
10135            >,
10136            T1: fidl::encoding::Encode<u64, fdomain_client::fidl::FDomainResourceDialect>,
10137        >
10138        fidl::encoding::Encode<
10139            DictionaryDrainIteratorGetNextResponse,
10140            fdomain_client::fidl::FDomainResourceDialect,
10141        > for (T0, T1)
10142    {
10143        #[inline]
10144        unsafe fn encode(
10145            self,
10146            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10147            offset: usize,
10148            depth: fidl::encoding::Depth,
10149        ) -> fidl::Result<()> {
10150            encoder.debug_check_bounds::<DictionaryDrainIteratorGetNextResponse>(offset);
10151            // Zero out padding regions. There's no need to apply masks
10152            // because the unmasked parts will be overwritten by fields.
10153            // Write the fields.
10154            self.0.encode(encoder, offset + 0, depth)?;
10155            self.1.encode(encoder, offset + 16, depth)?;
10156            Ok(())
10157        }
10158    }
10159
10160    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
10161        for DictionaryDrainIteratorGetNextResponse
10162    {
10163        #[inline(always)]
10164        fn new_empty() -> Self {
10165            Self {
10166                items: fidl::new_empty!(fidl::encoding::Vector<DictionaryItem, 128>, fdomain_client::fidl::FDomainResourceDialect),
10167                end_id: fidl::new_empty!(u64, fdomain_client::fidl::FDomainResourceDialect),
10168            }
10169        }
10170
10171        #[inline]
10172        unsafe fn decode(
10173            &mut self,
10174            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10175            offset: usize,
10176            _depth: fidl::encoding::Depth,
10177        ) -> fidl::Result<()> {
10178            decoder.debug_check_bounds::<Self>(offset);
10179            // Verify that padding bytes are zero.
10180            fidl::decode!(fidl::encoding::Vector<DictionaryItem, 128>, fdomain_client::fidl::FDomainResourceDialect, &mut self.items, decoder, offset + 0, _depth)?;
10181            fidl::decode!(
10182                u64,
10183                fdomain_client::fidl::FDomainResourceDialect,
10184                &mut self.end_id,
10185                decoder,
10186                offset + 16,
10187                _depth
10188            )?;
10189            Ok(())
10190        }
10191    }
10192
10193    impl fidl::encoding::ResourceTypeMarker for DictionaryEnumerateIteratorGetNextResponse {
10194        type Borrowed<'a> = &'a mut Self;
10195        fn take_or_borrow<'a>(
10196            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10197        ) -> Self::Borrowed<'a> {
10198            value
10199        }
10200    }
10201
10202    unsafe impl fidl::encoding::TypeMarker for DictionaryEnumerateIteratorGetNextResponse {
10203        type Owned = Self;
10204
10205        #[inline(always)]
10206        fn inline_align(_context: fidl::encoding::Context) -> usize {
10207            8
10208        }
10209
10210        #[inline(always)]
10211        fn inline_size(_context: fidl::encoding::Context) -> usize {
10212            24
10213        }
10214    }
10215
10216    unsafe impl
10217        fidl::encoding::Encode<
10218            DictionaryEnumerateIteratorGetNextResponse,
10219            fdomain_client::fidl::FDomainResourceDialect,
10220        > for &mut DictionaryEnumerateIteratorGetNextResponse
10221    {
10222        #[inline]
10223        unsafe fn encode(
10224            self,
10225            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10226            offset: usize,
10227            _depth: fidl::encoding::Depth,
10228        ) -> fidl::Result<()> {
10229            encoder.debug_check_bounds::<DictionaryEnumerateIteratorGetNextResponse>(offset);
10230            // Delegate to tuple encoding.
10231            fidl::encoding::Encode::<DictionaryEnumerateIteratorGetNextResponse, fdomain_client::fidl::FDomainResourceDialect>::encode(
10232                (
10233                    <fidl::encoding::Vector<DictionaryOptionalItem, 128> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.items),
10234                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.end_id),
10235                ),
10236                encoder, offset, _depth
10237            )
10238        }
10239    }
10240    unsafe impl<
10241            T0: fidl::encoding::Encode<
10242                fidl::encoding::Vector<DictionaryOptionalItem, 128>,
10243                fdomain_client::fidl::FDomainResourceDialect,
10244            >,
10245            T1: fidl::encoding::Encode<u64, fdomain_client::fidl::FDomainResourceDialect>,
10246        >
10247        fidl::encoding::Encode<
10248            DictionaryEnumerateIteratorGetNextResponse,
10249            fdomain_client::fidl::FDomainResourceDialect,
10250        > for (T0, T1)
10251    {
10252        #[inline]
10253        unsafe fn encode(
10254            self,
10255            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10256            offset: usize,
10257            depth: fidl::encoding::Depth,
10258        ) -> fidl::Result<()> {
10259            encoder.debug_check_bounds::<DictionaryEnumerateIteratorGetNextResponse>(offset);
10260            // Zero out padding regions. There's no need to apply masks
10261            // because the unmasked parts will be overwritten by fields.
10262            // Write the fields.
10263            self.0.encode(encoder, offset + 0, depth)?;
10264            self.1.encode(encoder, offset + 16, depth)?;
10265            Ok(())
10266        }
10267    }
10268
10269    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
10270        for DictionaryEnumerateIteratorGetNextResponse
10271    {
10272        #[inline(always)]
10273        fn new_empty() -> Self {
10274            Self {
10275                items: fidl::new_empty!(fidl::encoding::Vector<DictionaryOptionalItem, 128>, fdomain_client::fidl::FDomainResourceDialect),
10276                end_id: fidl::new_empty!(u64, fdomain_client::fidl::FDomainResourceDialect),
10277            }
10278        }
10279
10280        #[inline]
10281        unsafe fn decode(
10282            &mut self,
10283            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10284            offset: usize,
10285            _depth: fidl::encoding::Depth,
10286        ) -> fidl::Result<()> {
10287            decoder.debug_check_bounds::<Self>(offset);
10288            // Verify that padding bytes are zero.
10289            fidl::decode!(fidl::encoding::Vector<DictionaryOptionalItem, 128>, fdomain_client::fidl::FDomainResourceDialect, &mut self.items, decoder, offset + 0, _depth)?;
10290            fidl::decode!(
10291                u64,
10292                fdomain_client::fidl::FDomainResourceDialect,
10293                &mut self.end_id,
10294                decoder,
10295                offset + 16,
10296                _depth
10297            )?;
10298            Ok(())
10299        }
10300    }
10301
10302    impl fidl::encoding::ResourceTypeMarker for DictionaryKeysIteratorGetNextResponse {
10303        type Borrowed<'a> = &'a mut Self;
10304        fn take_or_borrow<'a>(
10305            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10306        ) -> Self::Borrowed<'a> {
10307            value
10308        }
10309    }
10310
10311    unsafe impl fidl::encoding::TypeMarker for DictionaryKeysIteratorGetNextResponse {
10312        type Owned = Self;
10313
10314        #[inline(always)]
10315        fn inline_align(_context: fidl::encoding::Context) -> usize {
10316            8
10317        }
10318
10319        #[inline(always)]
10320        fn inline_size(_context: fidl::encoding::Context) -> usize {
10321            16
10322        }
10323    }
10324
10325    unsafe impl
10326        fidl::encoding::Encode<
10327            DictionaryKeysIteratorGetNextResponse,
10328            fdomain_client::fidl::FDomainResourceDialect,
10329        > for &mut DictionaryKeysIteratorGetNextResponse
10330    {
10331        #[inline]
10332        unsafe fn encode(
10333            self,
10334            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10335            offset: usize,
10336            _depth: fidl::encoding::Depth,
10337        ) -> fidl::Result<()> {
10338            encoder.debug_check_bounds::<DictionaryKeysIteratorGetNextResponse>(offset);
10339            // Delegate to tuple encoding.
10340            fidl::encoding::Encode::<DictionaryKeysIteratorGetNextResponse, fdomain_client::fidl::FDomainResourceDialect>::encode(
10341                (
10342                    <fidl::encoding::Vector<fidl::encoding::BoundedString<255>, 128> as fidl::encoding::ValueTypeMarker>::borrow(&self.keys),
10343                ),
10344                encoder, offset, _depth
10345            )
10346        }
10347    }
10348    unsafe impl<
10349            T0: fidl::encoding::Encode<
10350                fidl::encoding::Vector<fidl::encoding::BoundedString<255>, 128>,
10351                fdomain_client::fidl::FDomainResourceDialect,
10352            >,
10353        >
10354        fidl::encoding::Encode<
10355            DictionaryKeysIteratorGetNextResponse,
10356            fdomain_client::fidl::FDomainResourceDialect,
10357        > for (T0,)
10358    {
10359        #[inline]
10360        unsafe fn encode(
10361            self,
10362            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10363            offset: usize,
10364            depth: fidl::encoding::Depth,
10365        ) -> fidl::Result<()> {
10366            encoder.debug_check_bounds::<DictionaryKeysIteratorGetNextResponse>(offset);
10367            // Zero out padding regions. There's no need to apply masks
10368            // because the unmasked parts will be overwritten by fields.
10369            // Write the fields.
10370            self.0.encode(encoder, offset + 0, depth)?;
10371            Ok(())
10372        }
10373    }
10374
10375    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
10376        for DictionaryKeysIteratorGetNextResponse
10377    {
10378        #[inline(always)]
10379        fn new_empty() -> Self {
10380            Self {
10381                keys: fidl::new_empty!(
10382                    fidl::encoding::Vector<fidl::encoding::BoundedString<255>, 128>,
10383                    fdomain_client::fidl::FDomainResourceDialect
10384                ),
10385            }
10386        }
10387
10388        #[inline]
10389        unsafe fn decode(
10390            &mut self,
10391            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10392            offset: usize,
10393            _depth: fidl::encoding::Depth,
10394        ) -> fidl::Result<()> {
10395            decoder.debug_check_bounds::<Self>(offset);
10396            // Verify that padding bytes are zero.
10397            fidl::decode!(
10398                fidl::encoding::Vector<fidl::encoding::BoundedString<255>, 128>,
10399                fdomain_client::fidl::FDomainResourceDialect,
10400                &mut self.keys,
10401                decoder,
10402                offset + 0,
10403                _depth
10404            )?;
10405            Ok(())
10406        }
10407    }
10408
10409    impl fidl::encoding::ResourceTypeMarker for DictionaryOptionalItem {
10410        type Borrowed<'a> = &'a mut Self;
10411        fn take_or_borrow<'a>(
10412            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10413        ) -> Self::Borrowed<'a> {
10414            value
10415        }
10416    }
10417
10418    unsafe impl fidl::encoding::TypeMarker for DictionaryOptionalItem {
10419        type Owned = Self;
10420
10421        #[inline(always)]
10422        fn inline_align(_context: fidl::encoding::Context) -> usize {
10423            8
10424        }
10425
10426        #[inline(always)]
10427        fn inline_size(_context: fidl::encoding::Context) -> usize {
10428            24
10429        }
10430    }
10431
10432    unsafe impl
10433        fidl::encoding::Encode<DictionaryOptionalItem, fdomain_client::fidl::FDomainResourceDialect>
10434        for &mut DictionaryOptionalItem
10435    {
10436        #[inline]
10437        unsafe fn encode(
10438            self,
10439            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10440            offset: usize,
10441            _depth: fidl::encoding::Depth,
10442        ) -> fidl::Result<()> {
10443            encoder.debug_check_bounds::<DictionaryOptionalItem>(offset);
10444            // Delegate to tuple encoding.
10445            fidl::encoding::Encode::<DictionaryOptionalItem, fdomain_client::fidl::FDomainResourceDialect>::encode(
10446                (
10447                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(&self.key),
10448                    <fidl::encoding::Boxed<WrappedCapabilityId> as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
10449                ),
10450                encoder, offset, _depth
10451            )
10452        }
10453    }
10454    unsafe impl<
10455            T0: fidl::encoding::Encode<
10456                fidl::encoding::BoundedString<255>,
10457                fdomain_client::fidl::FDomainResourceDialect,
10458            >,
10459            T1: fidl::encoding::Encode<
10460                fidl::encoding::Boxed<WrappedCapabilityId>,
10461                fdomain_client::fidl::FDomainResourceDialect,
10462            >,
10463        >
10464        fidl::encoding::Encode<DictionaryOptionalItem, fdomain_client::fidl::FDomainResourceDialect>
10465        for (T0, T1)
10466    {
10467        #[inline]
10468        unsafe fn encode(
10469            self,
10470            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10471            offset: usize,
10472            depth: fidl::encoding::Depth,
10473        ) -> fidl::Result<()> {
10474            encoder.debug_check_bounds::<DictionaryOptionalItem>(offset);
10475            // Zero out padding regions. There's no need to apply masks
10476            // because the unmasked parts will be overwritten by fields.
10477            // Write the fields.
10478            self.0.encode(encoder, offset + 0, depth)?;
10479            self.1.encode(encoder, offset + 16, depth)?;
10480            Ok(())
10481        }
10482    }
10483
10484    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
10485        for DictionaryOptionalItem
10486    {
10487        #[inline(always)]
10488        fn new_empty() -> Self {
10489            Self {
10490                key: fidl::new_empty!(
10491                    fidl::encoding::BoundedString<255>,
10492                    fdomain_client::fidl::FDomainResourceDialect
10493                ),
10494                value: fidl::new_empty!(
10495                    fidl::encoding::Boxed<WrappedCapabilityId>,
10496                    fdomain_client::fidl::FDomainResourceDialect
10497                ),
10498            }
10499        }
10500
10501        #[inline]
10502        unsafe fn decode(
10503            &mut self,
10504            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10505            offset: usize,
10506            _depth: fidl::encoding::Depth,
10507        ) -> fidl::Result<()> {
10508            decoder.debug_check_bounds::<Self>(offset);
10509            // Verify that padding bytes are zero.
10510            fidl::decode!(
10511                fidl::encoding::BoundedString<255>,
10512                fdomain_client::fidl::FDomainResourceDialect,
10513                &mut self.key,
10514                decoder,
10515                offset + 0,
10516                _depth
10517            )?;
10518            fidl::decode!(
10519                fidl::encoding::Boxed<WrappedCapabilityId>,
10520                fdomain_client::fidl::FDomainResourceDialect,
10521                &mut self.value,
10522                decoder,
10523                offset + 16,
10524                _depth
10525            )?;
10526            Ok(())
10527        }
10528    }
10529
10530    impl fidl::encoding::ResourceTypeMarker for DictionaryRef {
10531        type Borrowed<'a> = &'a mut Self;
10532        fn take_or_borrow<'a>(
10533            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10534        ) -> Self::Borrowed<'a> {
10535            value
10536        }
10537    }
10538
10539    unsafe impl fidl::encoding::TypeMarker for DictionaryRef {
10540        type Owned = Self;
10541
10542        #[inline(always)]
10543        fn inline_align(_context: fidl::encoding::Context) -> usize {
10544            4
10545        }
10546
10547        #[inline(always)]
10548        fn inline_size(_context: fidl::encoding::Context) -> usize {
10549            4
10550        }
10551    }
10552
10553    unsafe impl fidl::encoding::Encode<DictionaryRef, fdomain_client::fidl::FDomainResourceDialect>
10554        for &mut DictionaryRef
10555    {
10556        #[inline]
10557        unsafe fn encode(
10558            self,
10559            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10560            offset: usize,
10561            _depth: fidl::encoding::Depth,
10562        ) -> fidl::Result<()> {
10563            encoder.debug_check_bounds::<DictionaryRef>(offset);
10564            // Delegate to tuple encoding.
10565            fidl::encoding::Encode::<DictionaryRef, fdomain_client::fidl::FDomainResourceDialect>::encode(
10566                (
10567                    <fidl::encoding::HandleType<fdomain_client::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.token),
10568                ),
10569                encoder, offset, _depth
10570            )
10571        }
10572    }
10573    unsafe impl<
10574            T0: fidl::encoding::Encode<
10575                fidl::encoding::HandleType<
10576                    fdomain_client::EventPair,
10577                    { fidl::ObjectType::EVENTPAIR.into_raw() },
10578                    2147483648,
10579                >,
10580                fdomain_client::fidl::FDomainResourceDialect,
10581            >,
10582        > fidl::encoding::Encode<DictionaryRef, fdomain_client::fidl::FDomainResourceDialect>
10583        for (T0,)
10584    {
10585        #[inline]
10586        unsafe fn encode(
10587            self,
10588            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10589            offset: usize,
10590            depth: fidl::encoding::Depth,
10591        ) -> fidl::Result<()> {
10592            encoder.debug_check_bounds::<DictionaryRef>(offset);
10593            // Zero out padding regions. There's no need to apply masks
10594            // because the unmasked parts will be overwritten by fields.
10595            // Write the fields.
10596            self.0.encode(encoder, offset + 0, depth)?;
10597            Ok(())
10598        }
10599    }
10600
10601    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect> for DictionaryRef {
10602        #[inline(always)]
10603        fn new_empty() -> Self {
10604            Self {
10605                token: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
10606            }
10607        }
10608
10609        #[inline]
10610        unsafe fn decode(
10611            &mut self,
10612            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10613            offset: usize,
10614            _depth: fidl::encoding::Depth,
10615        ) -> fidl::Result<()> {
10616            decoder.debug_check_bounds::<Self>(offset);
10617            // Verify that padding bytes are zero.
10618            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)?;
10619            Ok(())
10620        }
10621    }
10622
10623    impl fidl::encoding::ResourceTypeMarker for DirConnector {
10624        type Borrowed<'a> = &'a mut Self;
10625        fn take_or_borrow<'a>(
10626            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10627        ) -> Self::Borrowed<'a> {
10628            value
10629        }
10630    }
10631
10632    unsafe impl fidl::encoding::TypeMarker for DirConnector {
10633        type Owned = Self;
10634
10635        #[inline(always)]
10636        fn inline_align(_context: fidl::encoding::Context) -> usize {
10637            4
10638        }
10639
10640        #[inline(always)]
10641        fn inline_size(_context: fidl::encoding::Context) -> usize {
10642            4
10643        }
10644    }
10645
10646    unsafe impl fidl::encoding::Encode<DirConnector, fdomain_client::fidl::FDomainResourceDialect>
10647        for &mut DirConnector
10648    {
10649        #[inline]
10650        unsafe fn encode(
10651            self,
10652            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10653            offset: usize,
10654            _depth: fidl::encoding::Depth,
10655        ) -> fidl::Result<()> {
10656            encoder.debug_check_bounds::<DirConnector>(offset);
10657            // Delegate to tuple encoding.
10658            fidl::encoding::Encode::<DirConnector, fdomain_client::fidl::FDomainResourceDialect>::encode(
10659                (
10660                    <fidl::encoding::HandleType<fdomain_client::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.token),
10661                ),
10662                encoder, offset, _depth
10663            )
10664        }
10665    }
10666    unsafe impl<
10667            T0: fidl::encoding::Encode<
10668                fidl::encoding::HandleType<
10669                    fdomain_client::EventPair,
10670                    { fidl::ObjectType::EVENTPAIR.into_raw() },
10671                    2147483648,
10672                >,
10673                fdomain_client::fidl::FDomainResourceDialect,
10674            >,
10675        > fidl::encoding::Encode<DirConnector, fdomain_client::fidl::FDomainResourceDialect>
10676        for (T0,)
10677    {
10678        #[inline]
10679        unsafe fn encode(
10680            self,
10681            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10682            offset: usize,
10683            depth: fidl::encoding::Depth,
10684        ) -> fidl::Result<()> {
10685            encoder.debug_check_bounds::<DirConnector>(offset);
10686            // Zero out padding regions. There's no need to apply masks
10687            // because the unmasked parts will be overwritten by fields.
10688            // Write the fields.
10689            self.0.encode(encoder, offset + 0, depth)?;
10690            Ok(())
10691        }
10692    }
10693
10694    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect> for DirConnector {
10695        #[inline(always)]
10696        fn new_empty() -> Self {
10697            Self {
10698                token: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
10699            }
10700        }
10701
10702        #[inline]
10703        unsafe fn decode(
10704            &mut self,
10705            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10706            offset: usize,
10707            _depth: fidl::encoding::Depth,
10708        ) -> fidl::Result<()> {
10709            decoder.debug_check_bounds::<Self>(offset);
10710            // Verify that padding bytes are zero.
10711            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)?;
10712            Ok(())
10713        }
10714    }
10715
10716    impl fidl::encoding::ResourceTypeMarker for DirEntry {
10717        type Borrowed<'a> = &'a mut Self;
10718        fn take_or_borrow<'a>(
10719            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10720        ) -> Self::Borrowed<'a> {
10721            value
10722        }
10723    }
10724
10725    unsafe impl fidl::encoding::TypeMarker for DirEntry {
10726        type Owned = Self;
10727
10728        #[inline(always)]
10729        fn inline_align(_context: fidl::encoding::Context) -> usize {
10730            4
10731        }
10732
10733        #[inline(always)]
10734        fn inline_size(_context: fidl::encoding::Context) -> usize {
10735            4
10736        }
10737    }
10738
10739    unsafe impl fidl::encoding::Encode<DirEntry, fdomain_client::fidl::FDomainResourceDialect>
10740        for &mut DirEntry
10741    {
10742        #[inline]
10743        unsafe fn encode(
10744            self,
10745            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10746            offset: usize,
10747            _depth: fidl::encoding::Depth,
10748        ) -> fidl::Result<()> {
10749            encoder.debug_check_bounds::<DirEntry>(offset);
10750            // Delegate to tuple encoding.
10751            fidl::encoding::Encode::<DirEntry, fdomain_client::fidl::FDomainResourceDialect>::encode(
10752                (<fidl::encoding::HandleType<
10753                    fdomain_client::EventPair,
10754                    { fidl::ObjectType::EVENTPAIR.into_raw() },
10755                    2147483648,
10756                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10757                    &mut self.token
10758                ),),
10759                encoder,
10760                offset,
10761                _depth,
10762            )
10763        }
10764    }
10765    unsafe impl<
10766            T0: fidl::encoding::Encode<
10767                fidl::encoding::HandleType<
10768                    fdomain_client::EventPair,
10769                    { fidl::ObjectType::EVENTPAIR.into_raw() },
10770                    2147483648,
10771                >,
10772                fdomain_client::fidl::FDomainResourceDialect,
10773            >,
10774        > fidl::encoding::Encode<DirEntry, fdomain_client::fidl::FDomainResourceDialect> for (T0,)
10775    {
10776        #[inline]
10777        unsafe fn encode(
10778            self,
10779            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10780            offset: usize,
10781            depth: fidl::encoding::Depth,
10782        ) -> fidl::Result<()> {
10783            encoder.debug_check_bounds::<DirEntry>(offset);
10784            // Zero out padding regions. There's no need to apply masks
10785            // because the unmasked parts will be overwritten by fields.
10786            // Write the fields.
10787            self.0.encode(encoder, offset + 0, depth)?;
10788            Ok(())
10789        }
10790    }
10791
10792    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect> for DirEntry {
10793        #[inline(always)]
10794        fn new_empty() -> Self {
10795            Self {
10796                token: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
10797            }
10798        }
10799
10800        #[inline]
10801        unsafe fn decode(
10802            &mut self,
10803            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10804            offset: usize,
10805            _depth: fidl::encoding::Depth,
10806        ) -> fidl::Result<()> {
10807            decoder.debug_check_bounds::<Self>(offset);
10808            // Verify that padding bytes are zero.
10809            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)?;
10810            Ok(())
10811        }
10812    }
10813
10814    impl fidl::encoding::ResourceTypeMarker for DirReceiverReceiveRequest {
10815        type Borrowed<'a> = &'a mut Self;
10816        fn take_or_borrow<'a>(
10817            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10818        ) -> Self::Borrowed<'a> {
10819            value
10820        }
10821    }
10822
10823    unsafe impl fidl::encoding::TypeMarker for DirReceiverReceiveRequest {
10824        type Owned = Self;
10825
10826        #[inline(always)]
10827        fn inline_align(_context: fidl::encoding::Context) -> usize {
10828            4
10829        }
10830
10831        #[inline(always)]
10832        fn inline_size(_context: fidl::encoding::Context) -> usize {
10833            4
10834        }
10835    }
10836
10837    unsafe impl
10838        fidl::encoding::Encode<
10839            DirReceiverReceiveRequest,
10840            fdomain_client::fidl::FDomainResourceDialect,
10841        > for &mut DirReceiverReceiveRequest
10842    {
10843        #[inline]
10844        unsafe fn encode(
10845            self,
10846            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10847            offset: usize,
10848            _depth: fidl::encoding::Depth,
10849        ) -> fidl::Result<()> {
10850            encoder.debug_check_bounds::<DirReceiverReceiveRequest>(offset);
10851            // Delegate to tuple encoding.
10852            fidl::encoding::Encode::<
10853                DirReceiverReceiveRequest,
10854                fdomain_client::fidl::FDomainResourceDialect,
10855            >::encode(
10856                (<fidl::encoding::Endpoint<
10857                    fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
10858                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10859                    &mut self.channel
10860                ),),
10861                encoder,
10862                offset,
10863                _depth,
10864            )
10865        }
10866    }
10867    unsafe impl<
10868            T0: fidl::encoding::Encode<
10869                fidl::encoding::Endpoint<
10870                    fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
10871                >,
10872                fdomain_client::fidl::FDomainResourceDialect,
10873            >,
10874        >
10875        fidl::encoding::Encode<
10876            DirReceiverReceiveRequest,
10877            fdomain_client::fidl::FDomainResourceDialect,
10878        > for (T0,)
10879    {
10880        #[inline]
10881        unsafe fn encode(
10882            self,
10883            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10884            offset: usize,
10885            depth: fidl::encoding::Depth,
10886        ) -> fidl::Result<()> {
10887            encoder.debug_check_bounds::<DirReceiverReceiveRequest>(offset);
10888            // Zero out padding regions. There's no need to apply masks
10889            // because the unmasked parts will be overwritten by fields.
10890            // Write the fields.
10891            self.0.encode(encoder, offset + 0, depth)?;
10892            Ok(())
10893        }
10894    }
10895
10896    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
10897        for DirReceiverReceiveRequest
10898    {
10899        #[inline(always)]
10900        fn new_empty() -> Self {
10901            Self {
10902                channel: fidl::new_empty!(
10903                    fidl::encoding::Endpoint<
10904                        fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
10905                    >,
10906                    fdomain_client::fidl::FDomainResourceDialect
10907                ),
10908            }
10909        }
10910
10911        #[inline]
10912        unsafe fn decode(
10913            &mut self,
10914            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10915            offset: usize,
10916            _depth: fidl::encoding::Depth,
10917        ) -> fidl::Result<()> {
10918            decoder.debug_check_bounds::<Self>(offset);
10919            // Verify that padding bytes are zero.
10920            fidl::decode!(
10921                fidl::encoding::Endpoint<
10922                    fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
10923                >,
10924                fdomain_client::fidl::FDomainResourceDialect,
10925                &mut self.channel,
10926                decoder,
10927                offset + 0,
10928                _depth
10929            )?;
10930            Ok(())
10931        }
10932    }
10933
10934    impl fidl::encoding::ResourceTypeMarker for InstanceToken {
10935        type Borrowed<'a> = &'a mut Self;
10936        fn take_or_borrow<'a>(
10937            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10938        ) -> Self::Borrowed<'a> {
10939            value
10940        }
10941    }
10942
10943    unsafe impl fidl::encoding::TypeMarker for InstanceToken {
10944        type Owned = Self;
10945
10946        #[inline(always)]
10947        fn inline_align(_context: fidl::encoding::Context) -> usize {
10948            4
10949        }
10950
10951        #[inline(always)]
10952        fn inline_size(_context: fidl::encoding::Context) -> usize {
10953            4
10954        }
10955    }
10956
10957    unsafe impl fidl::encoding::Encode<InstanceToken, fdomain_client::fidl::FDomainResourceDialect>
10958        for &mut InstanceToken
10959    {
10960        #[inline]
10961        unsafe fn encode(
10962            self,
10963            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10964            offset: usize,
10965            _depth: fidl::encoding::Depth,
10966        ) -> fidl::Result<()> {
10967            encoder.debug_check_bounds::<InstanceToken>(offset);
10968            // Delegate to tuple encoding.
10969            fidl::encoding::Encode::<InstanceToken, fdomain_client::fidl::FDomainResourceDialect>::encode(
10970                (
10971                    <fidl::encoding::HandleType<fdomain_client::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.token),
10972                ),
10973                encoder, offset, _depth
10974            )
10975        }
10976    }
10977    unsafe impl<
10978            T0: fidl::encoding::Encode<
10979                fidl::encoding::HandleType<
10980                    fdomain_client::EventPair,
10981                    { fidl::ObjectType::EVENTPAIR.into_raw() },
10982                    2147483648,
10983                >,
10984                fdomain_client::fidl::FDomainResourceDialect,
10985            >,
10986        > fidl::encoding::Encode<InstanceToken, fdomain_client::fidl::FDomainResourceDialect>
10987        for (T0,)
10988    {
10989        #[inline]
10990        unsafe fn encode(
10991            self,
10992            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10993            offset: usize,
10994            depth: fidl::encoding::Depth,
10995        ) -> fidl::Result<()> {
10996            encoder.debug_check_bounds::<InstanceToken>(offset);
10997            // Zero out padding regions. There's no need to apply masks
10998            // because the unmasked parts will be overwritten by fields.
10999            // Write the fields.
11000            self.0.encode(encoder, offset + 0, depth)?;
11001            Ok(())
11002        }
11003    }
11004
11005    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect> for InstanceToken {
11006        #[inline(always)]
11007        fn new_empty() -> Self {
11008            Self {
11009                token: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
11010            }
11011        }
11012
11013        #[inline]
11014        unsafe fn decode(
11015            &mut self,
11016            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
11017            offset: usize,
11018            _depth: fidl::encoding::Depth,
11019        ) -> fidl::Result<()> {
11020            decoder.debug_check_bounds::<Self>(offset);
11021            // Verify that padding bytes are zero.
11022            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)?;
11023            Ok(())
11024        }
11025    }
11026
11027    impl fidl::encoding::ResourceTypeMarker for ProtocolPayload {
11028        type Borrowed<'a> = &'a mut Self;
11029        fn take_or_borrow<'a>(
11030            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11031        ) -> Self::Borrowed<'a> {
11032            value
11033        }
11034    }
11035
11036    unsafe impl fidl::encoding::TypeMarker for ProtocolPayload {
11037        type Owned = Self;
11038
11039        #[inline(always)]
11040        fn inline_align(_context: fidl::encoding::Context) -> usize {
11041            4
11042        }
11043
11044        #[inline(always)]
11045        fn inline_size(_context: fidl::encoding::Context) -> usize {
11046            4
11047        }
11048    }
11049
11050    unsafe impl
11051        fidl::encoding::Encode<ProtocolPayload, fdomain_client::fidl::FDomainResourceDialect>
11052        for &mut ProtocolPayload
11053    {
11054        #[inline]
11055        unsafe fn encode(
11056            self,
11057            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
11058            offset: usize,
11059            _depth: fidl::encoding::Depth,
11060        ) -> fidl::Result<()> {
11061            encoder.debug_check_bounds::<ProtocolPayload>(offset);
11062            // Delegate to tuple encoding.
11063            fidl::encoding::Encode::<ProtocolPayload, fdomain_client::fidl::FDomainResourceDialect>::encode(
11064                (
11065                    <fidl::encoding::HandleType<fdomain_client::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.channel),
11066                ),
11067                encoder, offset, _depth
11068            )
11069        }
11070    }
11071    unsafe impl<
11072            T0: fidl::encoding::Encode<
11073                fidl::encoding::HandleType<
11074                    fdomain_client::Channel,
11075                    { fidl::ObjectType::CHANNEL.into_raw() },
11076                    2147483648,
11077                >,
11078                fdomain_client::fidl::FDomainResourceDialect,
11079            >,
11080        > fidl::encoding::Encode<ProtocolPayload, fdomain_client::fidl::FDomainResourceDialect>
11081        for (T0,)
11082    {
11083        #[inline]
11084        unsafe fn encode(
11085            self,
11086            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
11087            offset: usize,
11088            depth: fidl::encoding::Depth,
11089        ) -> fidl::Result<()> {
11090            encoder.debug_check_bounds::<ProtocolPayload>(offset);
11091            // Zero out padding regions. There's no need to apply masks
11092            // because the unmasked parts will be overwritten by fields.
11093            // Write the fields.
11094            self.0.encode(encoder, offset + 0, depth)?;
11095            Ok(())
11096        }
11097    }
11098
11099    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
11100        for ProtocolPayload
11101    {
11102        #[inline(always)]
11103        fn new_empty() -> Self {
11104            Self {
11105                channel: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
11106            }
11107        }
11108
11109        #[inline]
11110        unsafe fn decode(
11111            &mut self,
11112            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
11113            offset: usize,
11114            _depth: fidl::encoding::Depth,
11115        ) -> fidl::Result<()> {
11116            decoder.debug_check_bounds::<Self>(offset);
11117            // Verify that padding bytes are zero.
11118            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)?;
11119            Ok(())
11120        }
11121    }
11122
11123    impl RouteRequest {
11124        #[inline(always)]
11125        fn max_ordinal_present(&self) -> u64 {
11126            if let Some(_) = self.metadata {
11127                return 2;
11128            }
11129            if let Some(_) = self.requesting {
11130                return 1;
11131            }
11132            0
11133        }
11134    }
11135
11136    impl fidl::encoding::ResourceTypeMarker for RouteRequest {
11137        type Borrowed<'a> = &'a mut Self;
11138        fn take_or_borrow<'a>(
11139            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11140        ) -> Self::Borrowed<'a> {
11141            value
11142        }
11143    }
11144
11145    unsafe impl fidl::encoding::TypeMarker for RouteRequest {
11146        type Owned = Self;
11147
11148        #[inline(always)]
11149        fn inline_align(_context: fidl::encoding::Context) -> usize {
11150            8
11151        }
11152
11153        #[inline(always)]
11154        fn inline_size(_context: fidl::encoding::Context) -> usize {
11155            16
11156        }
11157    }
11158
11159    unsafe impl fidl::encoding::Encode<RouteRequest, fdomain_client::fidl::FDomainResourceDialect>
11160        for &mut RouteRequest
11161    {
11162        unsafe fn encode(
11163            self,
11164            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
11165            offset: usize,
11166            mut depth: fidl::encoding::Depth,
11167        ) -> fidl::Result<()> {
11168            encoder.debug_check_bounds::<RouteRequest>(offset);
11169            // Vector header
11170            let max_ordinal: u64 = self.max_ordinal_present();
11171            encoder.write_num(max_ordinal, offset);
11172            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
11173            // Calling encoder.out_of_line_offset(0) is not allowed.
11174            if max_ordinal == 0 {
11175                return Ok(());
11176            }
11177            depth.increment()?;
11178            let envelope_size = 8;
11179            let bytes_len = max_ordinal as usize * envelope_size;
11180            #[allow(unused_variables)]
11181            let offset = encoder.out_of_line_offset(bytes_len);
11182            let mut _prev_end_offset: usize = 0;
11183            if 1 > max_ordinal {
11184                return Ok(());
11185            }
11186
11187            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11188            // are envelope_size bytes.
11189            let cur_offset: usize = (1 - 1) * envelope_size;
11190
11191            // Zero reserved fields.
11192            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11193
11194            // Safety:
11195            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11196            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11197            //   envelope_size bytes, there is always sufficient room.
11198            fidl::encoding::encode_in_envelope_optional::<
11199                InstanceToken,
11200                fdomain_client::fidl::FDomainResourceDialect,
11201            >(
11202                self.requesting
11203                    .as_mut()
11204                    .map(<InstanceToken as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
11205                encoder,
11206                offset + cur_offset,
11207                depth,
11208            )?;
11209
11210            _prev_end_offset = cur_offset + envelope_size;
11211            if 2 > max_ordinal {
11212                return Ok(());
11213            }
11214
11215            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11216            // are envelope_size bytes.
11217            let cur_offset: usize = (2 - 1) * envelope_size;
11218
11219            // Zero reserved fields.
11220            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11221
11222            // Safety:
11223            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11224            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11225            //   envelope_size bytes, there is always sufficient room.
11226            fidl::encoding::encode_in_envelope_optional::<
11227                DictionaryRef,
11228                fdomain_client::fidl::FDomainResourceDialect,
11229            >(
11230                self.metadata
11231                    .as_mut()
11232                    .map(<DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
11233                encoder,
11234                offset + cur_offset,
11235                depth,
11236            )?;
11237
11238            _prev_end_offset = cur_offset + envelope_size;
11239
11240            Ok(())
11241        }
11242    }
11243
11244    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect> for RouteRequest {
11245        #[inline(always)]
11246        fn new_empty() -> Self {
11247            Self::default()
11248        }
11249
11250        unsafe fn decode(
11251            &mut self,
11252            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
11253            offset: usize,
11254            mut depth: fidl::encoding::Depth,
11255        ) -> fidl::Result<()> {
11256            decoder.debug_check_bounds::<Self>(offset);
11257            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
11258                None => return Err(fidl::Error::NotNullable),
11259                Some(len) => len,
11260            };
11261            // Calling decoder.out_of_line_offset(0) is not allowed.
11262            if len == 0 {
11263                return Ok(());
11264            };
11265            depth.increment()?;
11266            let envelope_size = 8;
11267            let bytes_len = len * envelope_size;
11268            let offset = decoder.out_of_line_offset(bytes_len)?;
11269            // Decode the envelope for each type.
11270            let mut _next_ordinal_to_read = 0;
11271            let mut next_offset = offset;
11272            let end_offset = offset + bytes_len;
11273            _next_ordinal_to_read += 1;
11274            if next_offset >= end_offset {
11275                return Ok(());
11276            }
11277
11278            // Decode unknown envelopes for gaps in ordinals.
11279            while _next_ordinal_to_read < 1 {
11280                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11281                _next_ordinal_to_read += 1;
11282                next_offset += envelope_size;
11283            }
11284
11285            let next_out_of_line = decoder.next_out_of_line();
11286            let handles_before = decoder.remaining_handles();
11287            if let Some((inlined, num_bytes, num_handles)) =
11288                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11289            {
11290                let member_inline_size =
11291                    <InstanceToken as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11292                if inlined != (member_inline_size <= 4) {
11293                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11294                }
11295                let inner_offset;
11296                let mut inner_depth = depth.clone();
11297                if inlined {
11298                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11299                    inner_offset = next_offset;
11300                } else {
11301                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11302                    inner_depth.increment()?;
11303                }
11304                let val_ref = self.requesting.get_or_insert_with(|| {
11305                    fidl::new_empty!(InstanceToken, fdomain_client::fidl::FDomainResourceDialect)
11306                });
11307                fidl::decode!(
11308                    InstanceToken,
11309                    fdomain_client::fidl::FDomainResourceDialect,
11310                    val_ref,
11311                    decoder,
11312                    inner_offset,
11313                    inner_depth
11314                )?;
11315                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11316                {
11317                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11318                }
11319                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11320                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11321                }
11322            }
11323
11324            next_offset += envelope_size;
11325            _next_ordinal_to_read += 1;
11326            if next_offset >= end_offset {
11327                return Ok(());
11328            }
11329
11330            // Decode unknown envelopes for gaps in ordinals.
11331            while _next_ordinal_to_read < 2 {
11332                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11333                _next_ordinal_to_read += 1;
11334                next_offset += envelope_size;
11335            }
11336
11337            let next_out_of_line = decoder.next_out_of_line();
11338            let handles_before = decoder.remaining_handles();
11339            if let Some((inlined, num_bytes, num_handles)) =
11340                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11341            {
11342                let member_inline_size =
11343                    <DictionaryRef as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11344                if inlined != (member_inline_size <= 4) {
11345                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11346                }
11347                let inner_offset;
11348                let mut inner_depth = depth.clone();
11349                if inlined {
11350                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11351                    inner_offset = next_offset;
11352                } else {
11353                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11354                    inner_depth.increment()?;
11355                }
11356                let val_ref = self.metadata.get_or_insert_with(|| {
11357                    fidl::new_empty!(DictionaryRef, fdomain_client::fidl::FDomainResourceDialect)
11358                });
11359                fidl::decode!(
11360                    DictionaryRef,
11361                    fdomain_client::fidl::FDomainResourceDialect,
11362                    val_ref,
11363                    decoder,
11364                    inner_offset,
11365                    inner_depth
11366                )?;
11367                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11368                {
11369                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11370                }
11371                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11372                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11373                }
11374            }
11375
11376            next_offset += envelope_size;
11377
11378            // Decode the remaining unknown envelopes.
11379            while next_offset < end_offset {
11380                _next_ordinal_to_read += 1;
11381                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11382                next_offset += envelope_size;
11383            }
11384
11385            Ok(())
11386        }
11387    }
11388
11389    impl fidl::encoding::ResourceTypeMarker for Capability {
11390        type Borrowed<'a> = &'a mut Self;
11391        fn take_or_borrow<'a>(
11392            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11393        ) -> Self::Borrowed<'a> {
11394            value
11395        }
11396    }
11397
11398    unsafe impl fidl::encoding::TypeMarker for Capability {
11399        type Owned = Self;
11400
11401        #[inline(always)]
11402        fn inline_align(_context: fidl::encoding::Context) -> usize {
11403            8
11404        }
11405
11406        #[inline(always)]
11407        fn inline_size(_context: fidl::encoding::Context) -> usize {
11408            16
11409        }
11410    }
11411
11412    unsafe impl fidl::encoding::Encode<Capability, fdomain_client::fidl::FDomainResourceDialect>
11413        for &mut Capability
11414    {
11415        #[inline]
11416        unsafe fn encode(
11417            self,
11418            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
11419            offset: usize,
11420            _depth: fidl::encoding::Depth,
11421        ) -> fidl::Result<()> {
11422            encoder.debug_check_bounds::<Capability>(offset);
11423            encoder.write_num::<u64>(self.ordinal(), offset);
11424            match self {
11425            Capability::Unit(ref val) => {
11426                fidl::encoding::encode_in_envelope::<Unit, fdomain_client::fidl::FDomainResourceDialect>(
11427                    <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
11428                    encoder, offset + 8, _depth
11429                )
11430            }
11431            Capability::Handle(ref mut val) => {
11432                fidl::encoding::encode_in_envelope::<fidl::encoding::HandleType<fdomain_client::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect>(
11433                    <fidl::encoding::HandleType<fdomain_client::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
11434                    encoder, offset + 8, _depth
11435                )
11436            }
11437            Capability::Data(ref val) => {
11438                fidl::encoding::encode_in_envelope::<Data, fdomain_client::fidl::FDomainResourceDialect>(
11439                    <Data as fidl::encoding::ValueTypeMarker>::borrow(val),
11440                    encoder, offset + 8, _depth
11441                )
11442            }
11443            Capability::Dictionary(ref mut val) => {
11444                fidl::encoding::encode_in_envelope::<DictionaryRef, fdomain_client::fidl::FDomainResourceDialect>(
11445                    <DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
11446                    encoder, offset + 8, _depth
11447                )
11448            }
11449            Capability::Connector(ref mut val) => {
11450                fidl::encoding::encode_in_envelope::<Connector, fdomain_client::fidl::FDomainResourceDialect>(
11451                    <Connector as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
11452                    encoder, offset + 8, _depth
11453                )
11454            }
11455            Capability::DirConnector(ref mut val) => {
11456                fidl::encoding::encode_in_envelope::<DirConnector, fdomain_client::fidl::FDomainResourceDialect>(
11457                    <DirConnector as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
11458                    encoder, offset + 8, _depth
11459                )
11460            }
11461            Capability::Directory(ref mut val) => {
11462                fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<fdomain_fuchsia_io::DirectoryMarker>>, fdomain_client::fidl::FDomainResourceDialect>(
11463                    <fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<fdomain_fuchsia_io::DirectoryMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
11464                    encoder, offset + 8, _depth
11465                )
11466            }
11467            Capability::DirEntry(ref mut val) => {
11468                fidl::encoding::encode_in_envelope::<DirEntry, fdomain_client::fidl::FDomainResourceDialect>(
11469                    <DirEntry as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
11470                    encoder, offset + 8, _depth
11471                )
11472            }
11473            Capability::ConnectorRouter(ref mut val) => {
11474                fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<ConnectorRouterMarker>>, fdomain_client::fidl::FDomainResourceDialect>(
11475                    <fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<ConnectorRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
11476                    encoder, offset + 8, _depth
11477                )
11478            }
11479            Capability::DictionaryRouter(ref mut val) => {
11480                fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<DictionaryRouterMarker>>, fdomain_client::fidl::FDomainResourceDialect>(
11481                    <fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<DictionaryRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
11482                    encoder, offset + 8, _depth
11483                )
11484            }
11485            Capability::DirEntryRouter(ref mut val) => {
11486                fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<DirEntryRouterMarker>>, fdomain_client::fidl::FDomainResourceDialect>(
11487                    <fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<DirEntryRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
11488                    encoder, offset + 8, _depth
11489                )
11490            }
11491            Capability::DataRouter(ref mut val) => {
11492                fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<DataRouterMarker>>, fdomain_client::fidl::FDomainResourceDialect>(
11493                    <fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<DataRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
11494                    encoder, offset + 8, _depth
11495                )
11496            }
11497            Capability::DirConnectorRouter(ref mut val) => {
11498                fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<DirConnectorRouterMarker>>, fdomain_client::fidl::FDomainResourceDialect>(
11499                    <fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<DirConnectorRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
11500                    encoder, offset + 8, _depth
11501                )
11502            }
11503            Capability::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
11504        }
11505        }
11506    }
11507
11508    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect> for Capability {
11509        #[inline(always)]
11510        fn new_empty() -> Self {
11511            Self::__SourceBreaking { unknown_ordinal: 0 }
11512        }
11513
11514        #[inline]
11515        unsafe fn decode(
11516            &mut self,
11517            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
11518            offset: usize,
11519            mut depth: fidl::encoding::Depth,
11520        ) -> fidl::Result<()> {
11521            decoder.debug_check_bounds::<Self>(offset);
11522            #[allow(unused_variables)]
11523            let next_out_of_line = decoder.next_out_of_line();
11524            let handles_before = decoder.remaining_handles();
11525            let (ordinal, inlined, num_bytes, num_handles) =
11526                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
11527
11528            let member_inline_size =
11529                match ordinal {
11530                    1 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
11531                    2 => <fidl::encoding::HandleType<
11532                        fdomain_client::Handle,
11533                        { fidl::ObjectType::NONE.into_raw() },
11534                        2147483648,
11535                    > as fidl::encoding::TypeMarker>::inline_size(
11536                        decoder.context
11537                    ),
11538                    3 => <Data as fidl::encoding::TypeMarker>::inline_size(decoder.context),
11539                    4 => {
11540                        <DictionaryRef as fidl::encoding::TypeMarker>::inline_size(decoder.context)
11541                    }
11542                    5 => <Connector as fidl::encoding::TypeMarker>::inline_size(decoder.context),
11543                    6 => <DirConnector as fidl::encoding::TypeMarker>::inline_size(decoder.context),
11544                    7 => <fidl::encoding::Endpoint<
11545                        fdomain_client::fidl::ClientEnd<fdomain_fuchsia_io::DirectoryMarker>,
11546                    > as fidl::encoding::TypeMarker>::inline_size(
11547                        decoder.context
11548                    ),
11549                    8 => <DirEntry as fidl::encoding::TypeMarker>::inline_size(decoder.context),
11550                    9 => <fidl::encoding::Endpoint<
11551                        fdomain_client::fidl::ClientEnd<ConnectorRouterMarker>,
11552                    > as fidl::encoding::TypeMarker>::inline_size(
11553                        decoder.context
11554                    ),
11555                    10 => <fidl::encoding::Endpoint<
11556                        fdomain_client::fidl::ClientEnd<DictionaryRouterMarker>,
11557                    > as fidl::encoding::TypeMarker>::inline_size(
11558                        decoder.context
11559                    ),
11560                    11 => <fidl::encoding::Endpoint<
11561                        fdomain_client::fidl::ClientEnd<DirEntryRouterMarker>,
11562                    > as fidl::encoding::TypeMarker>::inline_size(
11563                        decoder.context
11564                    ),
11565                    12 => <fidl::encoding::Endpoint<
11566                        fdomain_client::fidl::ClientEnd<DataRouterMarker>,
11567                    > as fidl::encoding::TypeMarker>::inline_size(
11568                        decoder.context
11569                    ),
11570                    13 => <fidl::encoding::Endpoint<
11571                        fdomain_client::fidl::ClientEnd<DirConnectorRouterMarker>,
11572                    > as fidl::encoding::TypeMarker>::inline_size(
11573                        decoder.context
11574                    ),
11575                    0 => return Err(fidl::Error::UnknownUnionTag),
11576                    _ => num_bytes as usize,
11577                };
11578
11579            if inlined != (member_inline_size <= 4) {
11580                return Err(fidl::Error::InvalidInlineBitInEnvelope);
11581            }
11582            let _inner_offset;
11583            if inlined {
11584                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
11585                _inner_offset = offset + 8;
11586            } else {
11587                depth.increment()?;
11588                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11589            }
11590            match ordinal {
11591                1 => {
11592                    #[allow(irrefutable_let_patterns)]
11593                    if let Capability::Unit(_) = self {
11594                        // Do nothing, read the value into the object
11595                    } else {
11596                        // Initialize `self` to the right variant
11597                        *self = Capability::Unit(fidl::new_empty!(
11598                            Unit,
11599                            fdomain_client::fidl::FDomainResourceDialect
11600                        ));
11601                    }
11602                    #[allow(irrefutable_let_patterns)]
11603                    if let Capability::Unit(ref mut val) = self {
11604                        fidl::decode!(
11605                            Unit,
11606                            fdomain_client::fidl::FDomainResourceDialect,
11607                            val,
11608                            decoder,
11609                            _inner_offset,
11610                            depth
11611                        )?;
11612                    } else {
11613                        unreachable!()
11614                    }
11615                }
11616                2 => {
11617                    #[allow(irrefutable_let_patterns)]
11618                    if let Capability::Handle(_) = self {
11619                        // Do nothing, read the value into the object
11620                    } else {
11621                        // Initialize `self` to the right variant
11622                        *self = Capability::Handle(
11623                            fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
11624                        );
11625                    }
11626                    #[allow(irrefutable_let_patterns)]
11627                    if let Capability::Handle(ref mut val) = self {
11628                        fidl::decode!(fidl::encoding::HandleType<fdomain_client::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect, val, decoder, _inner_offset, depth)?;
11629                    } else {
11630                        unreachable!()
11631                    }
11632                }
11633                3 => {
11634                    #[allow(irrefutable_let_patterns)]
11635                    if let Capability::Data(_) = self {
11636                        // Do nothing, read the value into the object
11637                    } else {
11638                        // Initialize `self` to the right variant
11639                        *self = Capability::Data(fidl::new_empty!(
11640                            Data,
11641                            fdomain_client::fidl::FDomainResourceDialect
11642                        ));
11643                    }
11644                    #[allow(irrefutable_let_patterns)]
11645                    if let Capability::Data(ref mut val) = self {
11646                        fidl::decode!(
11647                            Data,
11648                            fdomain_client::fidl::FDomainResourceDialect,
11649                            val,
11650                            decoder,
11651                            _inner_offset,
11652                            depth
11653                        )?;
11654                    } else {
11655                        unreachable!()
11656                    }
11657                }
11658                4 => {
11659                    #[allow(irrefutable_let_patterns)]
11660                    if let Capability::Dictionary(_) = self {
11661                        // Do nothing, read the value into the object
11662                    } else {
11663                        // Initialize `self` to the right variant
11664                        *self = Capability::Dictionary(fidl::new_empty!(
11665                            DictionaryRef,
11666                            fdomain_client::fidl::FDomainResourceDialect
11667                        ));
11668                    }
11669                    #[allow(irrefutable_let_patterns)]
11670                    if let Capability::Dictionary(ref mut val) = self {
11671                        fidl::decode!(
11672                            DictionaryRef,
11673                            fdomain_client::fidl::FDomainResourceDialect,
11674                            val,
11675                            decoder,
11676                            _inner_offset,
11677                            depth
11678                        )?;
11679                    } else {
11680                        unreachable!()
11681                    }
11682                }
11683                5 => {
11684                    #[allow(irrefutable_let_patterns)]
11685                    if let Capability::Connector(_) = self {
11686                        // Do nothing, read the value into the object
11687                    } else {
11688                        // Initialize `self` to the right variant
11689                        *self = Capability::Connector(fidl::new_empty!(
11690                            Connector,
11691                            fdomain_client::fidl::FDomainResourceDialect
11692                        ));
11693                    }
11694                    #[allow(irrefutable_let_patterns)]
11695                    if let Capability::Connector(ref mut val) = self {
11696                        fidl::decode!(
11697                            Connector,
11698                            fdomain_client::fidl::FDomainResourceDialect,
11699                            val,
11700                            decoder,
11701                            _inner_offset,
11702                            depth
11703                        )?;
11704                    } else {
11705                        unreachable!()
11706                    }
11707                }
11708                6 => {
11709                    #[allow(irrefutable_let_patterns)]
11710                    if let Capability::DirConnector(_) = self {
11711                        // Do nothing, read the value into the object
11712                    } else {
11713                        // Initialize `self` to the right variant
11714                        *self = Capability::DirConnector(fidl::new_empty!(
11715                            DirConnector,
11716                            fdomain_client::fidl::FDomainResourceDialect
11717                        ));
11718                    }
11719                    #[allow(irrefutable_let_patterns)]
11720                    if let Capability::DirConnector(ref mut val) = self {
11721                        fidl::decode!(
11722                            DirConnector,
11723                            fdomain_client::fidl::FDomainResourceDialect,
11724                            val,
11725                            decoder,
11726                            _inner_offset,
11727                            depth
11728                        )?;
11729                    } else {
11730                        unreachable!()
11731                    }
11732                }
11733                7 => {
11734                    #[allow(irrefutable_let_patterns)]
11735                    if let Capability::Directory(_) = self {
11736                        // Do nothing, read the value into the object
11737                    } else {
11738                        // Initialize `self` to the right variant
11739                        *self = Capability::Directory(fidl::new_empty!(
11740                            fidl::encoding::Endpoint<
11741                                fdomain_client::fidl::ClientEnd<
11742                                    fdomain_fuchsia_io::DirectoryMarker,
11743                                >,
11744                            >,
11745                            fdomain_client::fidl::FDomainResourceDialect
11746                        ));
11747                    }
11748                    #[allow(irrefutable_let_patterns)]
11749                    if let Capability::Directory(ref mut val) = self {
11750                        fidl::decode!(
11751                            fidl::encoding::Endpoint<
11752                                fdomain_client::fidl::ClientEnd<
11753                                    fdomain_fuchsia_io::DirectoryMarker,
11754                                >,
11755                            >,
11756                            fdomain_client::fidl::FDomainResourceDialect,
11757                            val,
11758                            decoder,
11759                            _inner_offset,
11760                            depth
11761                        )?;
11762                    } else {
11763                        unreachable!()
11764                    }
11765                }
11766                8 => {
11767                    #[allow(irrefutable_let_patterns)]
11768                    if let Capability::DirEntry(_) = self {
11769                        // Do nothing, read the value into the object
11770                    } else {
11771                        // Initialize `self` to the right variant
11772                        *self = Capability::DirEntry(fidl::new_empty!(
11773                            DirEntry,
11774                            fdomain_client::fidl::FDomainResourceDialect
11775                        ));
11776                    }
11777                    #[allow(irrefutable_let_patterns)]
11778                    if let Capability::DirEntry(ref mut val) = self {
11779                        fidl::decode!(
11780                            DirEntry,
11781                            fdomain_client::fidl::FDomainResourceDialect,
11782                            val,
11783                            decoder,
11784                            _inner_offset,
11785                            depth
11786                        )?;
11787                    } else {
11788                        unreachable!()
11789                    }
11790                }
11791                9 => {
11792                    #[allow(irrefutable_let_patterns)]
11793                    if let Capability::ConnectorRouter(_) = self {
11794                        // Do nothing, read the value into the object
11795                    } else {
11796                        // Initialize `self` to the right variant
11797                        *self = Capability::ConnectorRouter(fidl::new_empty!(
11798                            fidl::encoding::Endpoint<
11799                                fdomain_client::fidl::ClientEnd<ConnectorRouterMarker>,
11800                            >,
11801                            fdomain_client::fidl::FDomainResourceDialect
11802                        ));
11803                    }
11804                    #[allow(irrefutable_let_patterns)]
11805                    if let Capability::ConnectorRouter(ref mut val) = self {
11806                        fidl::decode!(
11807                            fidl::encoding::Endpoint<
11808                                fdomain_client::fidl::ClientEnd<ConnectorRouterMarker>,
11809                            >,
11810                            fdomain_client::fidl::FDomainResourceDialect,
11811                            val,
11812                            decoder,
11813                            _inner_offset,
11814                            depth
11815                        )?;
11816                    } else {
11817                        unreachable!()
11818                    }
11819                }
11820                10 => {
11821                    #[allow(irrefutable_let_patterns)]
11822                    if let Capability::DictionaryRouter(_) = self {
11823                        // Do nothing, read the value into the object
11824                    } else {
11825                        // Initialize `self` to the right variant
11826                        *self = Capability::DictionaryRouter(fidl::new_empty!(
11827                            fidl::encoding::Endpoint<
11828                                fdomain_client::fidl::ClientEnd<DictionaryRouterMarker>,
11829                            >,
11830                            fdomain_client::fidl::FDomainResourceDialect
11831                        ));
11832                    }
11833                    #[allow(irrefutable_let_patterns)]
11834                    if let Capability::DictionaryRouter(ref mut val) = self {
11835                        fidl::decode!(
11836                            fidl::encoding::Endpoint<
11837                                fdomain_client::fidl::ClientEnd<DictionaryRouterMarker>,
11838                            >,
11839                            fdomain_client::fidl::FDomainResourceDialect,
11840                            val,
11841                            decoder,
11842                            _inner_offset,
11843                            depth
11844                        )?;
11845                    } else {
11846                        unreachable!()
11847                    }
11848                }
11849                11 => {
11850                    #[allow(irrefutable_let_patterns)]
11851                    if let Capability::DirEntryRouter(_) = self {
11852                        // Do nothing, read the value into the object
11853                    } else {
11854                        // Initialize `self` to the right variant
11855                        *self = Capability::DirEntryRouter(fidl::new_empty!(
11856                            fidl::encoding::Endpoint<
11857                                fdomain_client::fidl::ClientEnd<DirEntryRouterMarker>,
11858                            >,
11859                            fdomain_client::fidl::FDomainResourceDialect
11860                        ));
11861                    }
11862                    #[allow(irrefutable_let_patterns)]
11863                    if let Capability::DirEntryRouter(ref mut val) = self {
11864                        fidl::decode!(
11865                            fidl::encoding::Endpoint<
11866                                fdomain_client::fidl::ClientEnd<DirEntryRouterMarker>,
11867                            >,
11868                            fdomain_client::fidl::FDomainResourceDialect,
11869                            val,
11870                            decoder,
11871                            _inner_offset,
11872                            depth
11873                        )?;
11874                    } else {
11875                        unreachable!()
11876                    }
11877                }
11878                12 => {
11879                    #[allow(irrefutable_let_patterns)]
11880                    if let Capability::DataRouter(_) = self {
11881                        // Do nothing, read the value into the object
11882                    } else {
11883                        // Initialize `self` to the right variant
11884                        *self = Capability::DataRouter(fidl::new_empty!(
11885                            fidl::encoding::Endpoint<
11886                                fdomain_client::fidl::ClientEnd<DataRouterMarker>,
11887                            >,
11888                            fdomain_client::fidl::FDomainResourceDialect
11889                        ));
11890                    }
11891                    #[allow(irrefutable_let_patterns)]
11892                    if let Capability::DataRouter(ref mut val) = self {
11893                        fidl::decode!(
11894                            fidl::encoding::Endpoint<
11895                                fdomain_client::fidl::ClientEnd<DataRouterMarker>,
11896                            >,
11897                            fdomain_client::fidl::FDomainResourceDialect,
11898                            val,
11899                            decoder,
11900                            _inner_offset,
11901                            depth
11902                        )?;
11903                    } else {
11904                        unreachable!()
11905                    }
11906                }
11907                13 => {
11908                    #[allow(irrefutable_let_patterns)]
11909                    if let Capability::DirConnectorRouter(_) = self {
11910                        // Do nothing, read the value into the object
11911                    } else {
11912                        // Initialize `self` to the right variant
11913                        *self = Capability::DirConnectorRouter(fidl::new_empty!(
11914                            fidl::encoding::Endpoint<
11915                                fdomain_client::fidl::ClientEnd<DirConnectorRouterMarker>,
11916                            >,
11917                            fdomain_client::fidl::FDomainResourceDialect
11918                        ));
11919                    }
11920                    #[allow(irrefutable_let_patterns)]
11921                    if let Capability::DirConnectorRouter(ref mut val) = self {
11922                        fidl::decode!(
11923                            fidl::encoding::Endpoint<
11924                                fdomain_client::fidl::ClientEnd<DirConnectorRouterMarker>,
11925                            >,
11926                            fdomain_client::fidl::FDomainResourceDialect,
11927                            val,
11928                            decoder,
11929                            _inner_offset,
11930                            depth
11931                        )?;
11932                    } else {
11933                        unreachable!()
11934                    }
11935                }
11936                #[allow(deprecated)]
11937                ordinal => {
11938                    for _ in 0..num_handles {
11939                        decoder.drop_next_handle()?;
11940                    }
11941                    *self = Capability::__SourceBreaking { unknown_ordinal: ordinal };
11942                }
11943            }
11944            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
11945                return Err(fidl::Error::InvalidNumBytesInEnvelope);
11946            }
11947            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11948                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11949            }
11950            Ok(())
11951        }
11952    }
11953
11954    impl fidl::encoding::ResourceTypeMarker for ConnectorRouterRouteResponse {
11955        type Borrowed<'a> = &'a mut Self;
11956        fn take_or_borrow<'a>(
11957            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11958        ) -> Self::Borrowed<'a> {
11959            value
11960        }
11961    }
11962
11963    unsafe impl fidl::encoding::TypeMarker for ConnectorRouterRouteResponse {
11964        type Owned = Self;
11965
11966        #[inline(always)]
11967        fn inline_align(_context: fidl::encoding::Context) -> usize {
11968            8
11969        }
11970
11971        #[inline(always)]
11972        fn inline_size(_context: fidl::encoding::Context) -> usize {
11973            16
11974        }
11975    }
11976
11977    unsafe impl
11978        fidl::encoding::Encode<
11979            ConnectorRouterRouteResponse,
11980            fdomain_client::fidl::FDomainResourceDialect,
11981        > for &mut ConnectorRouterRouteResponse
11982    {
11983        #[inline]
11984        unsafe fn encode(
11985            self,
11986            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
11987            offset: usize,
11988            _depth: fidl::encoding::Depth,
11989        ) -> fidl::Result<()> {
11990            encoder.debug_check_bounds::<ConnectorRouterRouteResponse>(offset);
11991            encoder.write_num::<u64>(self.ordinal(), offset);
11992            match self {
11993                ConnectorRouterRouteResponse::Connector(ref mut val) => {
11994                    fidl::encoding::encode_in_envelope::<
11995                        Connector,
11996                        fdomain_client::fidl::FDomainResourceDialect,
11997                    >(
11998                        <Connector as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
11999                        encoder,
12000                        offset + 8,
12001                        _depth,
12002                    )
12003                }
12004                ConnectorRouterRouteResponse::Unavailable(ref val) => {
12005                    fidl::encoding::encode_in_envelope::<
12006                        Unit,
12007                        fdomain_client::fidl::FDomainResourceDialect,
12008                    >(
12009                        <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
12010                        encoder,
12011                        offset + 8,
12012                        _depth,
12013                    )
12014                }
12015            }
12016        }
12017    }
12018
12019    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
12020        for ConnectorRouterRouteResponse
12021    {
12022        #[inline(always)]
12023        fn new_empty() -> Self {
12024            Self::Connector(fidl::new_empty!(
12025                Connector,
12026                fdomain_client::fidl::FDomainResourceDialect
12027            ))
12028        }
12029
12030        #[inline]
12031        unsafe fn decode(
12032            &mut self,
12033            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
12034            offset: usize,
12035            mut depth: fidl::encoding::Depth,
12036        ) -> fidl::Result<()> {
12037            decoder.debug_check_bounds::<Self>(offset);
12038            #[allow(unused_variables)]
12039            let next_out_of_line = decoder.next_out_of_line();
12040            let handles_before = decoder.remaining_handles();
12041            let (ordinal, inlined, num_bytes, num_handles) =
12042                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
12043
12044            let member_inline_size = match ordinal {
12045                1 => <Connector as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12046                2 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12047                _ => return Err(fidl::Error::UnknownUnionTag),
12048            };
12049
12050            if inlined != (member_inline_size <= 4) {
12051                return Err(fidl::Error::InvalidInlineBitInEnvelope);
12052            }
12053            let _inner_offset;
12054            if inlined {
12055                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
12056                _inner_offset = offset + 8;
12057            } else {
12058                depth.increment()?;
12059                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12060            }
12061            match ordinal {
12062                1 => {
12063                    #[allow(irrefutable_let_patterns)]
12064                    if let ConnectorRouterRouteResponse::Connector(_) = self {
12065                        // Do nothing, read the value into the object
12066                    } else {
12067                        // Initialize `self` to the right variant
12068                        *self = ConnectorRouterRouteResponse::Connector(fidl::new_empty!(
12069                            Connector,
12070                            fdomain_client::fidl::FDomainResourceDialect
12071                        ));
12072                    }
12073                    #[allow(irrefutable_let_patterns)]
12074                    if let ConnectorRouterRouteResponse::Connector(ref mut val) = self {
12075                        fidl::decode!(
12076                            Connector,
12077                            fdomain_client::fidl::FDomainResourceDialect,
12078                            val,
12079                            decoder,
12080                            _inner_offset,
12081                            depth
12082                        )?;
12083                    } else {
12084                        unreachable!()
12085                    }
12086                }
12087                2 => {
12088                    #[allow(irrefutable_let_patterns)]
12089                    if let ConnectorRouterRouteResponse::Unavailable(_) = self {
12090                        // Do nothing, read the value into the object
12091                    } else {
12092                        // Initialize `self` to the right variant
12093                        *self = ConnectorRouterRouteResponse::Unavailable(fidl::new_empty!(
12094                            Unit,
12095                            fdomain_client::fidl::FDomainResourceDialect
12096                        ));
12097                    }
12098                    #[allow(irrefutable_let_patterns)]
12099                    if let ConnectorRouterRouteResponse::Unavailable(ref mut val) = self {
12100                        fidl::decode!(
12101                            Unit,
12102                            fdomain_client::fidl::FDomainResourceDialect,
12103                            val,
12104                            decoder,
12105                            _inner_offset,
12106                            depth
12107                        )?;
12108                    } else {
12109                        unreachable!()
12110                    }
12111                }
12112                ordinal => panic!("unexpected ordinal {:?}", ordinal),
12113            }
12114            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
12115                return Err(fidl::Error::InvalidNumBytesInEnvelope);
12116            }
12117            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12118                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12119            }
12120            Ok(())
12121        }
12122    }
12123
12124    impl fidl::encoding::ResourceTypeMarker for DataRouterRouteResponse {
12125        type Borrowed<'a> = &'a mut Self;
12126        fn take_or_borrow<'a>(
12127            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12128        ) -> Self::Borrowed<'a> {
12129            value
12130        }
12131    }
12132
12133    unsafe impl fidl::encoding::TypeMarker for DataRouterRouteResponse {
12134        type Owned = Self;
12135
12136        #[inline(always)]
12137        fn inline_align(_context: fidl::encoding::Context) -> usize {
12138            8
12139        }
12140
12141        #[inline(always)]
12142        fn inline_size(_context: fidl::encoding::Context) -> usize {
12143            16
12144        }
12145    }
12146
12147    unsafe impl
12148        fidl::encoding::Encode<
12149            DataRouterRouteResponse,
12150            fdomain_client::fidl::FDomainResourceDialect,
12151        > for &mut DataRouterRouteResponse
12152    {
12153        #[inline]
12154        unsafe fn encode(
12155            self,
12156            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
12157            offset: usize,
12158            _depth: fidl::encoding::Depth,
12159        ) -> fidl::Result<()> {
12160            encoder.debug_check_bounds::<DataRouterRouteResponse>(offset);
12161            encoder.write_num::<u64>(self.ordinal(), offset);
12162            match self {
12163                DataRouterRouteResponse::Data(ref val) => fidl::encoding::encode_in_envelope::<
12164                    Data,
12165                    fdomain_client::fidl::FDomainResourceDialect,
12166                >(
12167                    <Data as fidl::encoding::ValueTypeMarker>::borrow(val),
12168                    encoder,
12169                    offset + 8,
12170                    _depth,
12171                ),
12172                DataRouterRouteResponse::Unavailable(ref val) => {
12173                    fidl::encoding::encode_in_envelope::<
12174                        Unit,
12175                        fdomain_client::fidl::FDomainResourceDialect,
12176                    >(
12177                        <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
12178                        encoder,
12179                        offset + 8,
12180                        _depth,
12181                    )
12182                }
12183            }
12184        }
12185    }
12186
12187    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
12188        for DataRouterRouteResponse
12189    {
12190        #[inline(always)]
12191        fn new_empty() -> Self {
12192            Self::Data(fidl::new_empty!(Data, fdomain_client::fidl::FDomainResourceDialect))
12193        }
12194
12195        #[inline]
12196        unsafe fn decode(
12197            &mut self,
12198            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
12199            offset: usize,
12200            mut depth: fidl::encoding::Depth,
12201        ) -> fidl::Result<()> {
12202            decoder.debug_check_bounds::<Self>(offset);
12203            #[allow(unused_variables)]
12204            let next_out_of_line = decoder.next_out_of_line();
12205            let handles_before = decoder.remaining_handles();
12206            let (ordinal, inlined, num_bytes, num_handles) =
12207                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
12208
12209            let member_inline_size = match ordinal {
12210                1 => <Data as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12211                2 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12212                _ => return Err(fidl::Error::UnknownUnionTag),
12213            };
12214
12215            if inlined != (member_inline_size <= 4) {
12216                return Err(fidl::Error::InvalidInlineBitInEnvelope);
12217            }
12218            let _inner_offset;
12219            if inlined {
12220                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
12221                _inner_offset = offset + 8;
12222            } else {
12223                depth.increment()?;
12224                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12225            }
12226            match ordinal {
12227                1 => {
12228                    #[allow(irrefutable_let_patterns)]
12229                    if let DataRouterRouteResponse::Data(_) = self {
12230                        // Do nothing, read the value into the object
12231                    } else {
12232                        // Initialize `self` to the right variant
12233                        *self = DataRouterRouteResponse::Data(fidl::new_empty!(
12234                            Data,
12235                            fdomain_client::fidl::FDomainResourceDialect
12236                        ));
12237                    }
12238                    #[allow(irrefutable_let_patterns)]
12239                    if let DataRouterRouteResponse::Data(ref mut val) = self {
12240                        fidl::decode!(
12241                            Data,
12242                            fdomain_client::fidl::FDomainResourceDialect,
12243                            val,
12244                            decoder,
12245                            _inner_offset,
12246                            depth
12247                        )?;
12248                    } else {
12249                        unreachable!()
12250                    }
12251                }
12252                2 => {
12253                    #[allow(irrefutable_let_patterns)]
12254                    if let DataRouterRouteResponse::Unavailable(_) = self {
12255                        // Do nothing, read the value into the object
12256                    } else {
12257                        // Initialize `self` to the right variant
12258                        *self = DataRouterRouteResponse::Unavailable(fidl::new_empty!(
12259                            Unit,
12260                            fdomain_client::fidl::FDomainResourceDialect
12261                        ));
12262                    }
12263                    #[allow(irrefutable_let_patterns)]
12264                    if let DataRouterRouteResponse::Unavailable(ref mut val) = self {
12265                        fidl::decode!(
12266                            Unit,
12267                            fdomain_client::fidl::FDomainResourceDialect,
12268                            val,
12269                            decoder,
12270                            _inner_offset,
12271                            depth
12272                        )?;
12273                    } else {
12274                        unreachable!()
12275                    }
12276                }
12277                ordinal => panic!("unexpected ordinal {:?}", ordinal),
12278            }
12279            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
12280                return Err(fidl::Error::InvalidNumBytesInEnvelope);
12281            }
12282            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12283                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12284            }
12285            Ok(())
12286        }
12287    }
12288
12289    impl fidl::encoding::ResourceTypeMarker for DictionaryRouterRouteResponse {
12290        type Borrowed<'a> = &'a mut Self;
12291        fn take_or_borrow<'a>(
12292            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12293        ) -> Self::Borrowed<'a> {
12294            value
12295        }
12296    }
12297
12298    unsafe impl fidl::encoding::TypeMarker for DictionaryRouterRouteResponse {
12299        type Owned = Self;
12300
12301        #[inline(always)]
12302        fn inline_align(_context: fidl::encoding::Context) -> usize {
12303            8
12304        }
12305
12306        #[inline(always)]
12307        fn inline_size(_context: fidl::encoding::Context) -> usize {
12308            16
12309        }
12310    }
12311
12312    unsafe impl
12313        fidl::encoding::Encode<
12314            DictionaryRouterRouteResponse,
12315            fdomain_client::fidl::FDomainResourceDialect,
12316        > for &mut DictionaryRouterRouteResponse
12317    {
12318        #[inline]
12319        unsafe fn encode(
12320            self,
12321            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
12322            offset: usize,
12323            _depth: fidl::encoding::Depth,
12324        ) -> fidl::Result<()> {
12325            encoder.debug_check_bounds::<DictionaryRouterRouteResponse>(offset);
12326            encoder.write_num::<u64>(self.ordinal(), offset);
12327            match self {
12328                DictionaryRouterRouteResponse::Dictionary(ref mut val) => {
12329                    fidl::encoding::encode_in_envelope::<
12330                        DictionaryRef,
12331                        fdomain_client::fidl::FDomainResourceDialect,
12332                    >(
12333                        <DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
12334                        encoder,
12335                        offset + 8,
12336                        _depth,
12337                    )
12338                }
12339                DictionaryRouterRouteResponse::Unavailable(ref val) => {
12340                    fidl::encoding::encode_in_envelope::<
12341                        Unit,
12342                        fdomain_client::fidl::FDomainResourceDialect,
12343                    >(
12344                        <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
12345                        encoder,
12346                        offset + 8,
12347                        _depth,
12348                    )
12349                }
12350            }
12351        }
12352    }
12353
12354    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
12355        for DictionaryRouterRouteResponse
12356    {
12357        #[inline(always)]
12358        fn new_empty() -> Self {
12359            Self::Dictionary(fidl::new_empty!(
12360                DictionaryRef,
12361                fdomain_client::fidl::FDomainResourceDialect
12362            ))
12363        }
12364
12365        #[inline]
12366        unsafe fn decode(
12367            &mut self,
12368            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
12369            offset: usize,
12370            mut depth: fidl::encoding::Depth,
12371        ) -> fidl::Result<()> {
12372            decoder.debug_check_bounds::<Self>(offset);
12373            #[allow(unused_variables)]
12374            let next_out_of_line = decoder.next_out_of_line();
12375            let handles_before = decoder.remaining_handles();
12376            let (ordinal, inlined, num_bytes, num_handles) =
12377                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
12378
12379            let member_inline_size = match ordinal {
12380                1 => <DictionaryRef as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12381                2 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12382                _ => return Err(fidl::Error::UnknownUnionTag),
12383            };
12384
12385            if inlined != (member_inline_size <= 4) {
12386                return Err(fidl::Error::InvalidInlineBitInEnvelope);
12387            }
12388            let _inner_offset;
12389            if inlined {
12390                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
12391                _inner_offset = offset + 8;
12392            } else {
12393                depth.increment()?;
12394                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12395            }
12396            match ordinal {
12397                1 => {
12398                    #[allow(irrefutable_let_patterns)]
12399                    if let DictionaryRouterRouteResponse::Dictionary(_) = self {
12400                        // Do nothing, read the value into the object
12401                    } else {
12402                        // Initialize `self` to the right variant
12403                        *self = DictionaryRouterRouteResponse::Dictionary(fidl::new_empty!(
12404                            DictionaryRef,
12405                            fdomain_client::fidl::FDomainResourceDialect
12406                        ));
12407                    }
12408                    #[allow(irrefutable_let_patterns)]
12409                    if let DictionaryRouterRouteResponse::Dictionary(ref mut val) = self {
12410                        fidl::decode!(
12411                            DictionaryRef,
12412                            fdomain_client::fidl::FDomainResourceDialect,
12413                            val,
12414                            decoder,
12415                            _inner_offset,
12416                            depth
12417                        )?;
12418                    } else {
12419                        unreachable!()
12420                    }
12421                }
12422                2 => {
12423                    #[allow(irrefutable_let_patterns)]
12424                    if let DictionaryRouterRouteResponse::Unavailable(_) = self {
12425                        // Do nothing, read the value into the object
12426                    } else {
12427                        // Initialize `self` to the right variant
12428                        *self = DictionaryRouterRouteResponse::Unavailable(fidl::new_empty!(
12429                            Unit,
12430                            fdomain_client::fidl::FDomainResourceDialect
12431                        ));
12432                    }
12433                    #[allow(irrefutable_let_patterns)]
12434                    if let DictionaryRouterRouteResponse::Unavailable(ref mut val) = self {
12435                        fidl::decode!(
12436                            Unit,
12437                            fdomain_client::fidl::FDomainResourceDialect,
12438                            val,
12439                            decoder,
12440                            _inner_offset,
12441                            depth
12442                        )?;
12443                    } else {
12444                        unreachable!()
12445                    }
12446                }
12447                ordinal => panic!("unexpected ordinal {:?}", ordinal),
12448            }
12449            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
12450                return Err(fidl::Error::InvalidNumBytesInEnvelope);
12451            }
12452            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12453                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12454            }
12455            Ok(())
12456        }
12457    }
12458
12459    impl fidl::encoding::ResourceTypeMarker for DirConnectorRouterRouteResponse {
12460        type Borrowed<'a> = &'a mut Self;
12461        fn take_or_borrow<'a>(
12462            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12463        ) -> Self::Borrowed<'a> {
12464            value
12465        }
12466    }
12467
12468    unsafe impl fidl::encoding::TypeMarker for DirConnectorRouterRouteResponse {
12469        type Owned = Self;
12470
12471        #[inline(always)]
12472        fn inline_align(_context: fidl::encoding::Context) -> usize {
12473            8
12474        }
12475
12476        #[inline(always)]
12477        fn inline_size(_context: fidl::encoding::Context) -> usize {
12478            16
12479        }
12480    }
12481
12482    unsafe impl
12483        fidl::encoding::Encode<
12484            DirConnectorRouterRouteResponse,
12485            fdomain_client::fidl::FDomainResourceDialect,
12486        > for &mut DirConnectorRouterRouteResponse
12487    {
12488        #[inline]
12489        unsafe fn encode(
12490            self,
12491            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
12492            offset: usize,
12493            _depth: fidl::encoding::Depth,
12494        ) -> fidl::Result<()> {
12495            encoder.debug_check_bounds::<DirConnectorRouterRouteResponse>(offset);
12496            encoder.write_num::<u64>(self.ordinal(), offset);
12497            match self {
12498                DirConnectorRouterRouteResponse::DirConnector(ref mut val) => {
12499                    fidl::encoding::encode_in_envelope::<
12500                        DirConnector,
12501                        fdomain_client::fidl::FDomainResourceDialect,
12502                    >(
12503                        <DirConnector as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
12504                        encoder,
12505                        offset + 8,
12506                        _depth,
12507                    )
12508                }
12509                DirConnectorRouterRouteResponse::Unavailable(ref val) => {
12510                    fidl::encoding::encode_in_envelope::<
12511                        Unit,
12512                        fdomain_client::fidl::FDomainResourceDialect,
12513                    >(
12514                        <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
12515                        encoder,
12516                        offset + 8,
12517                        _depth,
12518                    )
12519                }
12520            }
12521        }
12522    }
12523
12524    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
12525        for DirConnectorRouterRouteResponse
12526    {
12527        #[inline(always)]
12528        fn new_empty() -> Self {
12529            Self::DirConnector(fidl::new_empty!(
12530                DirConnector,
12531                fdomain_client::fidl::FDomainResourceDialect
12532            ))
12533        }
12534
12535        #[inline]
12536        unsafe fn decode(
12537            &mut self,
12538            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
12539            offset: usize,
12540            mut depth: fidl::encoding::Depth,
12541        ) -> fidl::Result<()> {
12542            decoder.debug_check_bounds::<Self>(offset);
12543            #[allow(unused_variables)]
12544            let next_out_of_line = decoder.next_out_of_line();
12545            let handles_before = decoder.remaining_handles();
12546            let (ordinal, inlined, num_bytes, num_handles) =
12547                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
12548
12549            let member_inline_size = match ordinal {
12550                1 => <DirConnector as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12551                2 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12552                _ => return Err(fidl::Error::UnknownUnionTag),
12553            };
12554
12555            if inlined != (member_inline_size <= 4) {
12556                return Err(fidl::Error::InvalidInlineBitInEnvelope);
12557            }
12558            let _inner_offset;
12559            if inlined {
12560                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
12561                _inner_offset = offset + 8;
12562            } else {
12563                depth.increment()?;
12564                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12565            }
12566            match ordinal {
12567                1 => {
12568                    #[allow(irrefutable_let_patterns)]
12569                    if let DirConnectorRouterRouteResponse::DirConnector(_) = self {
12570                        // Do nothing, read the value into the object
12571                    } else {
12572                        // Initialize `self` to the right variant
12573                        *self = DirConnectorRouterRouteResponse::DirConnector(fidl::new_empty!(
12574                            DirConnector,
12575                            fdomain_client::fidl::FDomainResourceDialect
12576                        ));
12577                    }
12578                    #[allow(irrefutable_let_patterns)]
12579                    if let DirConnectorRouterRouteResponse::DirConnector(ref mut val) = self {
12580                        fidl::decode!(
12581                            DirConnector,
12582                            fdomain_client::fidl::FDomainResourceDialect,
12583                            val,
12584                            decoder,
12585                            _inner_offset,
12586                            depth
12587                        )?;
12588                    } else {
12589                        unreachable!()
12590                    }
12591                }
12592                2 => {
12593                    #[allow(irrefutable_let_patterns)]
12594                    if let DirConnectorRouterRouteResponse::Unavailable(_) = self {
12595                        // Do nothing, read the value into the object
12596                    } else {
12597                        // Initialize `self` to the right variant
12598                        *self = DirConnectorRouterRouteResponse::Unavailable(fidl::new_empty!(
12599                            Unit,
12600                            fdomain_client::fidl::FDomainResourceDialect
12601                        ));
12602                    }
12603                    #[allow(irrefutable_let_patterns)]
12604                    if let DirConnectorRouterRouteResponse::Unavailable(ref mut val) = self {
12605                        fidl::decode!(
12606                            Unit,
12607                            fdomain_client::fidl::FDomainResourceDialect,
12608                            val,
12609                            decoder,
12610                            _inner_offset,
12611                            depth
12612                        )?;
12613                    } else {
12614                        unreachable!()
12615                    }
12616                }
12617                ordinal => panic!("unexpected ordinal {:?}", ordinal),
12618            }
12619            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
12620                return Err(fidl::Error::InvalidNumBytesInEnvelope);
12621            }
12622            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12623                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12624            }
12625            Ok(())
12626        }
12627    }
12628
12629    impl fidl::encoding::ResourceTypeMarker for DirEntryRouterRouteResponse {
12630        type Borrowed<'a> = &'a mut Self;
12631        fn take_or_borrow<'a>(
12632            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12633        ) -> Self::Borrowed<'a> {
12634            value
12635        }
12636    }
12637
12638    unsafe impl fidl::encoding::TypeMarker for DirEntryRouterRouteResponse {
12639        type Owned = Self;
12640
12641        #[inline(always)]
12642        fn inline_align(_context: fidl::encoding::Context) -> usize {
12643            8
12644        }
12645
12646        #[inline(always)]
12647        fn inline_size(_context: fidl::encoding::Context) -> usize {
12648            16
12649        }
12650    }
12651
12652    unsafe impl
12653        fidl::encoding::Encode<
12654            DirEntryRouterRouteResponse,
12655            fdomain_client::fidl::FDomainResourceDialect,
12656        > for &mut DirEntryRouterRouteResponse
12657    {
12658        #[inline]
12659        unsafe fn encode(
12660            self,
12661            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
12662            offset: usize,
12663            _depth: fidl::encoding::Depth,
12664        ) -> fidl::Result<()> {
12665            encoder.debug_check_bounds::<DirEntryRouterRouteResponse>(offset);
12666            encoder.write_num::<u64>(self.ordinal(), offset);
12667            match self {
12668                DirEntryRouterRouteResponse::DirEntry(ref mut val) => {
12669                    fidl::encoding::encode_in_envelope::<
12670                        DirEntry,
12671                        fdomain_client::fidl::FDomainResourceDialect,
12672                    >(
12673                        <DirEntry as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
12674                        encoder,
12675                        offset + 8,
12676                        _depth,
12677                    )
12678                }
12679                DirEntryRouterRouteResponse::Unavailable(ref val) => {
12680                    fidl::encoding::encode_in_envelope::<
12681                        Unit,
12682                        fdomain_client::fidl::FDomainResourceDialect,
12683                    >(
12684                        <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
12685                        encoder,
12686                        offset + 8,
12687                        _depth,
12688                    )
12689                }
12690            }
12691        }
12692    }
12693
12694    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
12695        for DirEntryRouterRouteResponse
12696    {
12697        #[inline(always)]
12698        fn new_empty() -> Self {
12699            Self::DirEntry(fidl::new_empty!(DirEntry, fdomain_client::fidl::FDomainResourceDialect))
12700        }
12701
12702        #[inline]
12703        unsafe fn decode(
12704            &mut self,
12705            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
12706            offset: usize,
12707            mut depth: fidl::encoding::Depth,
12708        ) -> fidl::Result<()> {
12709            decoder.debug_check_bounds::<Self>(offset);
12710            #[allow(unused_variables)]
12711            let next_out_of_line = decoder.next_out_of_line();
12712            let handles_before = decoder.remaining_handles();
12713            let (ordinal, inlined, num_bytes, num_handles) =
12714                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
12715
12716            let member_inline_size = match ordinal {
12717                1 => <DirEntry as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12718                2 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12719                _ => return Err(fidl::Error::UnknownUnionTag),
12720            };
12721
12722            if inlined != (member_inline_size <= 4) {
12723                return Err(fidl::Error::InvalidInlineBitInEnvelope);
12724            }
12725            let _inner_offset;
12726            if inlined {
12727                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
12728                _inner_offset = offset + 8;
12729            } else {
12730                depth.increment()?;
12731                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12732            }
12733            match ordinal {
12734                1 => {
12735                    #[allow(irrefutable_let_patterns)]
12736                    if let DirEntryRouterRouteResponse::DirEntry(_) = self {
12737                        // Do nothing, read the value into the object
12738                    } else {
12739                        // Initialize `self` to the right variant
12740                        *self = DirEntryRouterRouteResponse::DirEntry(fidl::new_empty!(
12741                            DirEntry,
12742                            fdomain_client::fidl::FDomainResourceDialect
12743                        ));
12744                    }
12745                    #[allow(irrefutable_let_patterns)]
12746                    if let DirEntryRouterRouteResponse::DirEntry(ref mut val) = self {
12747                        fidl::decode!(
12748                            DirEntry,
12749                            fdomain_client::fidl::FDomainResourceDialect,
12750                            val,
12751                            decoder,
12752                            _inner_offset,
12753                            depth
12754                        )?;
12755                    } else {
12756                        unreachable!()
12757                    }
12758                }
12759                2 => {
12760                    #[allow(irrefutable_let_patterns)]
12761                    if let DirEntryRouterRouteResponse::Unavailable(_) = self {
12762                        // Do nothing, read the value into the object
12763                    } else {
12764                        // Initialize `self` to the right variant
12765                        *self = DirEntryRouterRouteResponse::Unavailable(fidl::new_empty!(
12766                            Unit,
12767                            fdomain_client::fidl::FDomainResourceDialect
12768                        ));
12769                    }
12770                    #[allow(irrefutable_let_patterns)]
12771                    if let DirEntryRouterRouteResponse::Unavailable(ref mut val) = self {
12772                        fidl::decode!(
12773                            Unit,
12774                            fdomain_client::fidl::FDomainResourceDialect,
12775                            val,
12776                            decoder,
12777                            _inner_offset,
12778                            depth
12779                        )?;
12780                    } else {
12781                        unreachable!()
12782                    }
12783                }
12784                ordinal => panic!("unexpected ordinal {:?}", ordinal),
12785            }
12786            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
12787                return Err(fidl::Error::InvalidNumBytesInEnvelope);
12788            }
12789            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12790                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12791            }
12792            Ok(())
12793        }
12794    }
12795
12796    impl fidl::encoding::ResourceTypeMarker for DirectoryRouterRouteResponse {
12797        type Borrowed<'a> = &'a mut Self;
12798        fn take_or_borrow<'a>(
12799            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12800        ) -> Self::Borrowed<'a> {
12801            value
12802        }
12803    }
12804
12805    unsafe impl fidl::encoding::TypeMarker for DirectoryRouterRouteResponse {
12806        type Owned = Self;
12807
12808        #[inline(always)]
12809        fn inline_align(_context: fidl::encoding::Context) -> usize {
12810            8
12811        }
12812
12813        #[inline(always)]
12814        fn inline_size(_context: fidl::encoding::Context) -> usize {
12815            16
12816        }
12817    }
12818
12819    unsafe impl
12820        fidl::encoding::Encode<
12821            DirectoryRouterRouteResponse,
12822            fdomain_client::fidl::FDomainResourceDialect,
12823        > for &mut DirectoryRouterRouteResponse
12824    {
12825        #[inline]
12826        unsafe fn encode(
12827            self,
12828            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
12829            offset: usize,
12830            _depth: fidl::encoding::Depth,
12831        ) -> fidl::Result<()> {
12832            encoder.debug_check_bounds::<DirectoryRouterRouteResponse>(offset);
12833            encoder.write_num::<u64>(self.ordinal(), offset);
12834            match self {
12835                DirectoryRouterRouteResponse::Directory(ref mut val) => {
12836                    fidl::encoding::encode_in_envelope::<
12837                        fidl::encoding::Endpoint<
12838                            fdomain_client::fidl::ClientEnd<fdomain_fuchsia_io::DirectoryMarker>,
12839                        >,
12840                        fdomain_client::fidl::FDomainResourceDialect,
12841                    >(
12842                        <fidl::encoding::Endpoint<
12843                            fdomain_client::fidl::ClientEnd<fdomain_fuchsia_io::DirectoryMarker>,
12844                        > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
12845                            val
12846                        ),
12847                        encoder,
12848                        offset + 8,
12849                        _depth,
12850                    )
12851                }
12852                DirectoryRouterRouteResponse::Unavailable(ref val) => {
12853                    fidl::encoding::encode_in_envelope::<
12854                        Unit,
12855                        fdomain_client::fidl::FDomainResourceDialect,
12856                    >(
12857                        <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
12858                        encoder,
12859                        offset + 8,
12860                        _depth,
12861                    )
12862                }
12863            }
12864        }
12865    }
12866
12867    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
12868        for DirectoryRouterRouteResponse
12869    {
12870        #[inline(always)]
12871        fn new_empty() -> Self {
12872            Self::Directory(fidl::new_empty!(
12873                fidl::encoding::Endpoint<
12874                    fdomain_client::fidl::ClientEnd<fdomain_fuchsia_io::DirectoryMarker>,
12875                >,
12876                fdomain_client::fidl::FDomainResourceDialect
12877            ))
12878        }
12879
12880        #[inline]
12881        unsafe fn decode(
12882            &mut self,
12883            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
12884            offset: usize,
12885            mut depth: fidl::encoding::Depth,
12886        ) -> fidl::Result<()> {
12887            decoder.debug_check_bounds::<Self>(offset);
12888            #[allow(unused_variables)]
12889            let next_out_of_line = decoder.next_out_of_line();
12890            let handles_before = decoder.remaining_handles();
12891            let (ordinal, inlined, num_bytes, num_handles) =
12892                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
12893
12894            let member_inline_size = match ordinal {
12895                1 => <fidl::encoding::Endpoint<
12896                    fdomain_client::fidl::ClientEnd<fdomain_fuchsia_io::DirectoryMarker>,
12897                > as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12898                2 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12899                _ => return Err(fidl::Error::UnknownUnionTag),
12900            };
12901
12902            if inlined != (member_inline_size <= 4) {
12903                return Err(fidl::Error::InvalidInlineBitInEnvelope);
12904            }
12905            let _inner_offset;
12906            if inlined {
12907                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
12908                _inner_offset = offset + 8;
12909            } else {
12910                depth.increment()?;
12911                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12912            }
12913            match ordinal {
12914                1 => {
12915                    #[allow(irrefutable_let_patterns)]
12916                    if let DirectoryRouterRouteResponse::Directory(_) = self {
12917                        // Do nothing, read the value into the object
12918                    } else {
12919                        // Initialize `self` to the right variant
12920                        *self = DirectoryRouterRouteResponse::Directory(fidl::new_empty!(
12921                            fidl::encoding::Endpoint<
12922                                fdomain_client::fidl::ClientEnd<
12923                                    fdomain_fuchsia_io::DirectoryMarker,
12924                                >,
12925                            >,
12926                            fdomain_client::fidl::FDomainResourceDialect
12927                        ));
12928                    }
12929                    #[allow(irrefutable_let_patterns)]
12930                    if let DirectoryRouterRouteResponse::Directory(ref mut val) = self {
12931                        fidl::decode!(
12932                            fidl::encoding::Endpoint<
12933                                fdomain_client::fidl::ClientEnd<
12934                                    fdomain_fuchsia_io::DirectoryMarker,
12935                                >,
12936                            >,
12937                            fdomain_client::fidl::FDomainResourceDialect,
12938                            val,
12939                            decoder,
12940                            _inner_offset,
12941                            depth
12942                        )?;
12943                    } else {
12944                        unreachable!()
12945                    }
12946                }
12947                2 => {
12948                    #[allow(irrefutable_let_patterns)]
12949                    if let DirectoryRouterRouteResponse::Unavailable(_) = self {
12950                        // Do nothing, read the value into the object
12951                    } else {
12952                        // Initialize `self` to the right variant
12953                        *self = DirectoryRouterRouteResponse::Unavailable(fidl::new_empty!(
12954                            Unit,
12955                            fdomain_client::fidl::FDomainResourceDialect
12956                        ));
12957                    }
12958                    #[allow(irrefutable_let_patterns)]
12959                    if let DirectoryRouterRouteResponse::Unavailable(ref mut val) = self {
12960                        fidl::decode!(
12961                            Unit,
12962                            fdomain_client::fidl::FDomainResourceDialect,
12963                            val,
12964                            decoder,
12965                            _inner_offset,
12966                            depth
12967                        )?;
12968                    } else {
12969                        unreachable!()
12970                    }
12971                }
12972                ordinal => panic!("unexpected ordinal {:?}", ordinal),
12973            }
12974            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
12975                return Err(fidl::Error::InvalidNumBytesInEnvelope);
12976            }
12977            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12978                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12979            }
12980            Ok(())
12981        }
12982    }
12983}