fidl_fuchsia_component_sandbox/
fidl_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 fidl::client::QueryResponseFut;
8use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
9use fidl::endpoints::{ControlHandle as _, Responder as _};
10pub use fidl_fuchsia_component_sandbox__common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14/// A token represents a bedrock object. Tokens are reference counted, dropping
15/// all counts of the token removes the object.
16pub type Token = fidl::EventPair;
17
18#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
19pub struct CapabilityStoreConnectorCreateRequest {
20    pub id: u64,
21    pub receiver: fidl::endpoints::ClientEnd<ReceiverMarker>,
22}
23
24impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
25    for CapabilityStoreConnectorCreateRequest
26{
27}
28
29#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
30pub struct CapabilityStoreConnectorOpenRequest {
31    pub id: u64,
32    pub server_end: fidl::Channel,
33}
34
35impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
36    for CapabilityStoreConnectorOpenRequest
37{
38}
39
40#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
41pub struct CapabilityStoreDictionaryDrainRequest {
42    pub id: u64,
43    pub iterator: Option<fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>>,
44}
45
46impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
47    for CapabilityStoreDictionaryDrainRequest
48{
49}
50
51#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
52pub struct CapabilityStoreDictionaryEnumerateRequest {
53    pub id: u64,
54    pub iterator: fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
55}
56
57impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
58    for CapabilityStoreDictionaryEnumerateRequest
59{
60}
61
62#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
63pub struct CapabilityStoreDictionaryKeysRequest {
64    pub id: u64,
65    pub iterator: fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>,
66}
67
68impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
69    for CapabilityStoreDictionaryKeysRequest
70{
71}
72
73#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
74pub struct CapabilityStoreDictionaryLegacyExportRequest {
75    pub id: u64,
76    pub server_end: fidl::Channel,
77}
78
79impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
80    for CapabilityStoreDictionaryLegacyExportRequest
81{
82}
83
84#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
85pub struct CapabilityStoreDictionaryLegacyImportRequest {
86    pub id: u64,
87    pub client_end: fidl::Channel,
88}
89
90impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
91    for CapabilityStoreDictionaryLegacyImportRequest
92{
93}
94
95#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
96pub struct CapabilityStoreDirConnectorCreateRequest {
97    pub id: u64,
98    pub receiver: fidl::endpoints::ClientEnd<DirReceiverMarker>,
99}
100
101impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
102    for CapabilityStoreDirConnectorCreateRequest
103{
104}
105
106#[derive(Debug, PartialEq)]
107pub struct CapabilityStoreImportRequest {
108    pub id: u64,
109    pub capability: Capability,
110}
111
112impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
113    for CapabilityStoreImportRequest
114{
115}
116
117#[derive(Debug, PartialEq)]
118pub struct CapabilityStoreExportResponse {
119    pub capability: Capability,
120}
121
122impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
123    for CapabilityStoreExportResponse
124{
125}
126
127#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
128pub struct Connector {
129    pub token: fidl::EventPair,
130}
131
132impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Connector {}
133
134#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
135pub struct DictionaryDrainIteratorGetNextResponse {
136    pub items: Vec<DictionaryItem>,
137    pub end_id: u64,
138}
139
140impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
141    for DictionaryDrainIteratorGetNextResponse
142{
143}
144
145#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
146pub struct DictionaryEnumerateIteratorGetNextResponse {
147    pub items: Vec<DictionaryOptionalItem>,
148    pub end_id: u64,
149}
150
151impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
152    for DictionaryEnumerateIteratorGetNextResponse
153{
154}
155
156#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
157pub struct DictionaryKeysIteratorGetNextResponse {
158    pub keys: Vec<String>,
159}
160
161impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
162    for DictionaryKeysIteratorGetNextResponse
163{
164}
165
166/// A key-value pair in a [`DictionaryRef`], where the value may be elided.
167/// This is useful for APIs that may wish to omit the value, for example if it could not be
168/// duplicated.
169#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
170pub struct DictionaryOptionalItem {
171    pub key: String,
172    pub value: Option<Box<WrappedCapabilityId>>,
173}
174
175impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DictionaryOptionalItem {}
176
177#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
178pub struct DictionaryRef {
179    pub token: fidl::EventPair,
180}
181
182impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DictionaryRef {}
183
184#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
185pub struct DirConnector {
186    pub token: fidl::EventPair,
187}
188
189impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DirConnector {}
190
191#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
192pub struct DirEntry {
193    pub token: fidl::EventPair,
194}
195
196impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DirEntry {}
197
198/// Represents an instance in the component tree, either a component
199/// instance or component manager's instance.
200#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
201pub struct InstanceToken {
202    pub token: fidl::EventPair,
203}
204
205impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for InstanceToken {}
206
207/// Contains a protocol open request.
208#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
209pub struct ProtocolPayload {
210    pub channel: fidl::Channel,
211}
212
213impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ProtocolPayload {}
214
215#[derive(Debug, Default, PartialEq)]
216pub struct CapabilityStoreDirConnectorOpenRequest {
217    pub id: Option<u64>,
218    pub server_end: Option<fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>>,
219    pub flags: Option<fidl_fuchsia_io::Flags>,
220    pub path: Option<String>,
221    #[doc(hidden)]
222    pub __source_breaking: fidl::marker::SourceBreaking,
223}
224
225impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
226    for CapabilityStoreDirConnectorOpenRequest
227{
228}
229
230#[derive(Debug, Default, PartialEq)]
231pub struct DirReceiverReceiveRequest {
232    pub channel: Option<fidl::Channel>,
233    pub flags: Option<fidl_fuchsia_io::Flags>,
234    pub subdir: Option<String>,
235    #[doc(hidden)]
236    pub __source_breaking: fidl::marker::SourceBreaking,
237}
238
239impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DirReceiverReceiveRequest {}
240
241/// A request for a route.
242#[derive(Debug, Default, PartialEq)]
243pub struct RouteRequest {
244    /// The component that is requesting the capability. May be omitted for a default request
245    /// (see `*Router.Route`).
246    pub requesting: Option<InstanceToken>,
247    /// Metadata associated with this capability request. May be omitted for a default request
248    /// (see `*Router.Route`).
249    pub metadata: Option<DictionaryRef>,
250    #[doc(hidden)]
251    pub __source_breaking: fidl::marker::SourceBreaking,
252}
253
254impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for RouteRequest {}
255
256#[derive(Debug)]
257pub enum Capability {
258    Unit(Unit),
259    Handle(fidl::NullableHandle),
260    Data(Data),
261    Dictionary(DictionaryRef),
262    Connector(Connector),
263    DirConnector(DirConnector),
264    Directory(fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>),
265    DirEntry(DirEntry),
266    ConnectorRouter(fidl::endpoints::ClientEnd<ConnectorRouterMarker>),
267    DictionaryRouter(fidl::endpoints::ClientEnd<DictionaryRouterMarker>),
268    DirEntryRouter(fidl::endpoints::ClientEnd<DirEntryRouterMarker>),
269    DataRouter(fidl::endpoints::ClientEnd<DataRouterMarker>),
270    DirConnectorRouter(fidl::endpoints::ClientEnd<DirConnectorRouterMarker>),
271    #[doc(hidden)]
272    __SourceBreaking {
273        unknown_ordinal: u64,
274    },
275}
276
277/// Pattern that matches an unknown `Capability` member.
278#[macro_export]
279macro_rules! CapabilityUnknown {
280    () => {
281        _
282    };
283}
284
285// Custom PartialEq so that unknown variants are not equal to themselves.
286impl PartialEq for Capability {
287    fn eq(&self, other: &Self) -> bool {
288        match (self, other) {
289            (Self::Unit(x), Self::Unit(y)) => *x == *y,
290            (Self::Handle(x), Self::Handle(y)) => *x == *y,
291            (Self::Data(x), Self::Data(y)) => *x == *y,
292            (Self::Dictionary(x), Self::Dictionary(y)) => *x == *y,
293            (Self::Connector(x), Self::Connector(y)) => *x == *y,
294            (Self::DirConnector(x), Self::DirConnector(y)) => *x == *y,
295            (Self::Directory(x), Self::Directory(y)) => *x == *y,
296            (Self::DirEntry(x), Self::DirEntry(y)) => *x == *y,
297            (Self::ConnectorRouter(x), Self::ConnectorRouter(y)) => *x == *y,
298            (Self::DictionaryRouter(x), Self::DictionaryRouter(y)) => *x == *y,
299            (Self::DirEntryRouter(x), Self::DirEntryRouter(y)) => *x == *y,
300            (Self::DataRouter(x), Self::DataRouter(y)) => *x == *y,
301            (Self::DirConnectorRouter(x), Self::DirConnectorRouter(y)) => *x == *y,
302            _ => false,
303        }
304    }
305}
306
307impl Capability {
308    #[inline]
309    pub fn ordinal(&self) -> u64 {
310        match *self {
311            Self::Unit(_) => 1,
312            Self::Handle(_) => 2,
313            Self::Data(_) => 3,
314            Self::Dictionary(_) => 4,
315            Self::Connector(_) => 5,
316            Self::DirConnector(_) => 6,
317            Self::Directory(_) => 7,
318            Self::DirEntry(_) => 8,
319            Self::ConnectorRouter(_) => 9,
320            Self::DictionaryRouter(_) => 10,
321            Self::DirEntryRouter(_) => 11,
322            Self::DataRouter(_) => 12,
323            Self::DirConnectorRouter(_) => 13,
324            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
325        }
326    }
327
328    #[inline]
329    pub fn unknown_variant_for_testing() -> Self {
330        Self::__SourceBreaking { unknown_ordinal: 0 }
331    }
332
333    #[inline]
334    pub fn is_unknown(&self) -> bool {
335        match self {
336            Self::__SourceBreaking { .. } => true,
337            _ => false,
338        }
339    }
340}
341
342impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Capability {}
343
344#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
345pub enum ConnectorRouterRouteResponse {
346    Connector(Connector),
347    Unavailable(Unit),
348}
349
350impl ConnectorRouterRouteResponse {
351    #[inline]
352    pub fn ordinal(&self) -> u64 {
353        match *self {
354            Self::Connector(_) => 1,
355            Self::Unavailable(_) => 2,
356        }
357    }
358}
359
360impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
361    for ConnectorRouterRouteResponse
362{
363}
364
365#[derive(Debug, PartialEq)]
366pub enum DataRouterRouteResponse {
367    Data(Data),
368    Unavailable(Unit),
369}
370
371impl DataRouterRouteResponse {
372    #[inline]
373    pub fn ordinal(&self) -> u64 {
374        match *self {
375            Self::Data(_) => 1,
376            Self::Unavailable(_) => 2,
377        }
378    }
379}
380
381impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DataRouterRouteResponse {}
382
383#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
384pub enum DictionaryRouterRouteResponse {
385    Dictionary(DictionaryRef),
386    Unavailable(Unit),
387}
388
389impl DictionaryRouterRouteResponse {
390    #[inline]
391    pub fn ordinal(&self) -> u64 {
392        match *self {
393            Self::Dictionary(_) => 1,
394            Self::Unavailable(_) => 2,
395        }
396    }
397}
398
399impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
400    for DictionaryRouterRouteResponse
401{
402}
403
404#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
405pub enum DirConnectorRouterRouteResponse {
406    DirConnector(DirConnector),
407    Unavailable(Unit),
408}
409
410impl DirConnectorRouterRouteResponse {
411    #[inline]
412    pub fn ordinal(&self) -> u64 {
413        match *self {
414            Self::DirConnector(_) => 1,
415            Self::Unavailable(_) => 2,
416        }
417    }
418}
419
420impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
421    for DirConnectorRouterRouteResponse
422{
423}
424
425#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
426pub enum DirEntryRouterRouteResponse {
427    DirEntry(DirEntry),
428    Unavailable(Unit),
429}
430
431impl DirEntryRouterRouteResponse {
432    #[inline]
433    pub fn ordinal(&self) -> u64 {
434        match *self {
435            Self::DirEntry(_) => 1,
436            Self::Unavailable(_) => 2,
437        }
438    }
439}
440
441impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
442    for DirEntryRouterRouteResponse
443{
444}
445
446#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
447pub enum DirectoryRouterRouteResponse {
448    Directory(fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>),
449    Unavailable(Unit),
450}
451
452impl DirectoryRouterRouteResponse {
453    #[inline]
454    pub fn ordinal(&self) -> u64 {
455        match *self {
456            Self::Directory(_) => 1,
457            Self::Unavailable(_) => 2,
458        }
459    }
460}
461
462impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
463    for DirectoryRouterRouteResponse
464{
465}
466
467#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
468pub struct CapabilityStoreMarker;
469
470impl fidl::endpoints::ProtocolMarker for CapabilityStoreMarker {
471    type Proxy = CapabilityStoreProxy;
472    type RequestStream = CapabilityStoreRequestStream;
473    #[cfg(target_os = "fuchsia")]
474    type SynchronousProxy = CapabilityStoreSynchronousProxy;
475
476    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.CapabilityStore";
477}
478impl fidl::endpoints::DiscoverableProtocolMarker for CapabilityStoreMarker {}
479pub type CapabilityStoreDuplicateResult = Result<(), CapabilityStoreError>;
480pub type CapabilityStoreDropResult = Result<(), CapabilityStoreError>;
481pub type CapabilityStoreExportResult = Result<Capability, CapabilityStoreError>;
482pub type CapabilityStoreImportResult = Result<(), CapabilityStoreError>;
483pub type CapabilityStoreConnectorCreateResult = Result<(), CapabilityStoreError>;
484pub type CapabilityStoreConnectorOpenResult = Result<(), CapabilityStoreError>;
485pub type CapabilityStoreDirConnectorCreateResult = Result<(), CapabilityStoreError>;
486pub type CapabilityStoreDirConnectorOpenResult = Result<(), CapabilityStoreError>;
487pub type CapabilityStoreDictionaryCreateResult = Result<(), CapabilityStoreError>;
488pub type CapabilityStoreDictionaryLegacyImportResult = Result<(), CapabilityStoreError>;
489pub type CapabilityStoreDictionaryLegacyExportResult = Result<(), CapabilityStoreError>;
490pub type CapabilityStoreDictionaryInsertResult = Result<(), CapabilityStoreError>;
491pub type CapabilityStoreDictionaryGetResult = Result<(), CapabilityStoreError>;
492pub type CapabilityStoreDictionaryRemoveResult = Result<(), CapabilityStoreError>;
493pub type CapabilityStoreDictionaryCopyResult = Result<(), CapabilityStoreError>;
494pub type CapabilityStoreDictionaryKeysResult = Result<(), CapabilityStoreError>;
495pub type CapabilityStoreDictionaryEnumerateResult = Result<(), CapabilityStoreError>;
496pub type CapabilityStoreDictionaryDrainResult = Result<(), CapabilityStoreError>;
497
498pub trait CapabilityStoreProxyInterface: Send + Sync {
499    type DuplicateResponseFut: std::future::Future<Output = Result<CapabilityStoreDuplicateResult, fidl::Error>>
500        + Send;
501    fn r#duplicate(&self, id: u64, dest_id: u64) -> Self::DuplicateResponseFut;
502    type DropResponseFut: std::future::Future<Output = Result<CapabilityStoreDropResult, fidl::Error>>
503        + Send;
504    fn r#drop(&self, id: u64) -> Self::DropResponseFut;
505    type ExportResponseFut: std::future::Future<Output = Result<CapabilityStoreExportResult, fidl::Error>>
506        + Send;
507    fn r#export(&self, id: u64) -> Self::ExportResponseFut;
508    type ImportResponseFut: std::future::Future<Output = Result<CapabilityStoreImportResult, fidl::Error>>
509        + Send;
510    fn r#import(&self, id: u64, capability: Capability) -> Self::ImportResponseFut;
511    type ConnectorCreateResponseFut: std::future::Future<Output = Result<CapabilityStoreConnectorCreateResult, fidl::Error>>
512        + Send;
513    fn r#connector_create(
514        &self,
515        id: u64,
516        receiver: fidl::endpoints::ClientEnd<ReceiverMarker>,
517    ) -> Self::ConnectorCreateResponseFut;
518    type ConnectorOpenResponseFut: std::future::Future<Output = Result<CapabilityStoreConnectorOpenResult, fidl::Error>>
519        + Send;
520    fn r#connector_open(
521        &self,
522        id: u64,
523        server_end: fidl::Channel,
524    ) -> Self::ConnectorOpenResponseFut;
525    type DirConnectorCreateResponseFut: std::future::Future<Output = Result<CapabilityStoreDirConnectorCreateResult, fidl::Error>>
526        + Send;
527    fn r#dir_connector_create(
528        &self,
529        id: u64,
530        receiver: fidl::endpoints::ClientEnd<DirReceiverMarker>,
531    ) -> Self::DirConnectorCreateResponseFut;
532    type DirConnectorOpenResponseFut: std::future::Future<Output = Result<CapabilityStoreDirConnectorOpenResult, fidl::Error>>
533        + Send;
534    fn r#dir_connector_open(
535        &self,
536        payload: CapabilityStoreDirConnectorOpenRequest,
537    ) -> Self::DirConnectorOpenResponseFut;
538    type DictionaryCreateResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryCreateResult, fidl::Error>>
539        + Send;
540    fn r#dictionary_create(&self, id: u64) -> Self::DictionaryCreateResponseFut;
541    type DictionaryLegacyImportResponseFut: std::future::Future<
542            Output = Result<CapabilityStoreDictionaryLegacyImportResult, fidl::Error>,
543        > + Send;
544    fn r#dictionary_legacy_import(
545        &self,
546        id: u64,
547        client_end: fidl::Channel,
548    ) -> Self::DictionaryLegacyImportResponseFut;
549    type DictionaryLegacyExportResponseFut: std::future::Future<
550            Output = Result<CapabilityStoreDictionaryLegacyExportResult, fidl::Error>,
551        > + Send;
552    fn r#dictionary_legacy_export(
553        &self,
554        id: u64,
555        server_end: fidl::Channel,
556    ) -> Self::DictionaryLegacyExportResponseFut;
557    type DictionaryInsertResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryInsertResult, fidl::Error>>
558        + Send;
559    fn r#dictionary_insert(
560        &self,
561        id: u64,
562        item: &DictionaryItem,
563    ) -> Self::DictionaryInsertResponseFut;
564    type DictionaryGetResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryGetResult, fidl::Error>>
565        + Send;
566    fn r#dictionary_get(&self, id: u64, key: &str, dest_id: u64) -> Self::DictionaryGetResponseFut;
567    type DictionaryRemoveResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryRemoveResult, fidl::Error>>
568        + Send;
569    fn r#dictionary_remove(
570        &self,
571        id: u64,
572        key: &str,
573        dest_id: Option<&WrappedCapabilityId>,
574    ) -> Self::DictionaryRemoveResponseFut;
575    type DictionaryCopyResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryCopyResult, fidl::Error>>
576        + Send;
577    fn r#dictionary_copy(&self, id: u64, dest_id: u64) -> Self::DictionaryCopyResponseFut;
578    type DictionaryKeysResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryKeysResult, fidl::Error>>
579        + Send;
580    fn r#dictionary_keys(
581        &self,
582        id: u64,
583        iterator: fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>,
584    ) -> Self::DictionaryKeysResponseFut;
585    type DictionaryEnumerateResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryEnumerateResult, fidl::Error>>
586        + Send;
587    fn r#dictionary_enumerate(
588        &self,
589        id: u64,
590        iterator: fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
591    ) -> Self::DictionaryEnumerateResponseFut;
592    type DictionaryDrainResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryDrainResult, fidl::Error>>
593        + Send;
594    fn r#dictionary_drain(
595        &self,
596        id: u64,
597        iterator: Option<fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>>,
598    ) -> Self::DictionaryDrainResponseFut;
599}
600#[derive(Debug)]
601#[cfg(target_os = "fuchsia")]
602pub struct CapabilityStoreSynchronousProxy {
603    client: fidl::client::sync::Client,
604}
605
606#[cfg(target_os = "fuchsia")]
607impl fidl::endpoints::SynchronousProxy for CapabilityStoreSynchronousProxy {
608    type Proxy = CapabilityStoreProxy;
609    type Protocol = CapabilityStoreMarker;
610
611    fn from_channel(inner: fidl::Channel) -> Self {
612        Self::new(inner)
613    }
614
615    fn into_channel(self) -> fidl::Channel {
616        self.client.into_channel()
617    }
618
619    fn as_channel(&self) -> &fidl::Channel {
620        self.client.as_channel()
621    }
622}
623
624#[cfg(target_os = "fuchsia")]
625impl CapabilityStoreSynchronousProxy {
626    pub fn new(channel: fidl::Channel) -> Self {
627        let protocol_name = <CapabilityStoreMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
628        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
629    }
630
631    pub fn into_channel(self) -> fidl::Channel {
632        self.client.into_channel()
633    }
634
635    /// Waits until an event arrives and returns it. It is safe for other
636    /// threads to make concurrent requests while waiting for an event.
637    pub fn wait_for_event(
638        &self,
639        deadline: zx::MonotonicInstant,
640    ) -> Result<CapabilityStoreEvent, fidl::Error> {
641        CapabilityStoreEvent::decode(self.client.wait_for_event(deadline)?)
642    }
643
644    /// Duplicates the capability with `id` to `dest_id`.
645    ///
646    /// Errors:
647    ///
648    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
649    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
650    /// - `NOT_DUPLICATABLE` if `id` could not be duplicated.
651    pub fn r#duplicate(
652        &self,
653        mut id: u64,
654        mut dest_id: u64,
655        ___deadline: zx::MonotonicInstant,
656    ) -> Result<CapabilityStoreDuplicateResult, fidl::Error> {
657        let _response =
658            self.client
659                .send_query::<CapabilityStoreDuplicateRequest, fidl::encoding::FlexibleResultType<
660                    fidl::encoding::EmptyStruct,
661                    CapabilityStoreError,
662                >>(
663                    (id, dest_id),
664                    0x5d5d35d9c20a2184,
665                    fidl::encoding::DynamicFlags::FLEXIBLE,
666                    ___deadline,
667                )?
668                .into_result::<CapabilityStoreMarker>("duplicate")?;
669        Ok(_response.map(|x| x))
670    }
671
672    /// Drops the capability with `id` from this [`CapabilityStore`].
673    ///
674    /// Errors:
675    ///
676    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
677    pub fn r#drop(
678        &self,
679        mut id: u64,
680        ___deadline: zx::MonotonicInstant,
681    ) -> Result<CapabilityStoreDropResult, fidl::Error> {
682        let _response =
683            self.client
684                .send_query::<CapabilityStoreDropRequest, fidl::encoding::FlexibleResultType<
685                    fidl::encoding::EmptyStruct,
686                    CapabilityStoreError,
687                >>(
688                    (id,), 0xa745c0990fc2559, fidl::encoding::DynamicFlags::FLEXIBLE, ___deadline
689                )?
690                .into_result::<CapabilityStoreMarker>("drop")?;
691        Ok(_response.map(|x| x))
692    }
693
694    /// Exports the capability with the client-assigned identifier `id` to
695    /// `capability`. This operation removes the capability from the store. If
696    /// this is not desired, [Duplicate] the capability first.
697    ///
698    /// Errors:
699    ///
700    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
701    pub fn r#export(
702        &self,
703        mut id: u64,
704        ___deadline: zx::MonotonicInstant,
705    ) -> Result<CapabilityStoreExportResult, fidl::Error> {
706        let _response =
707            self.client
708                .send_query::<CapabilityStoreExportRequest, fidl::encoding::FlexibleResultType<
709                    CapabilityStoreExportResponse,
710                    CapabilityStoreError,
711                >>(
712                    (id,), 0x3237a8f4748faff, fidl::encoding::DynamicFlags::FLEXIBLE, ___deadline
713                )?
714                .into_result::<CapabilityStoreMarker>("export")?;
715        Ok(_response.map(|x| x.capability))
716    }
717
718    /// Imports `capability` into this store with the client-assigned `id`.
719    ///
720    /// Errors:
721    ///
722    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
723    /// - `BAD_CAPABILITY` if `capability` was not a valid [Capability].
724    pub fn r#import(
725        &self,
726        mut id: u64,
727        mut capability: Capability,
728        ___deadline: zx::MonotonicInstant,
729    ) -> Result<CapabilityStoreImportResult, fidl::Error> {
730        let _response =
731            self.client
732                .send_query::<CapabilityStoreImportRequest, fidl::encoding::FlexibleResultType<
733                    fidl::encoding::EmptyStruct,
734                    CapabilityStoreError,
735                >>(
736                    (id, &mut capability),
737                    0x1f96157a29f4539b,
738                    fidl::encoding::DynamicFlags::FLEXIBLE,
739                    ___deadline,
740                )?
741                .into_result::<CapabilityStoreMarker>("import")?;
742        Ok(_response.map(|x| x))
743    }
744
745    /// Creates a [Connector] from a [Receiver]. Incoming connections to the [Connector] will be
746    /// dispatched to this [Receiver].
747    ///
748    /// Errors:
749    ///
750    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
751    pub fn r#connector_create(
752        &self,
753        mut id: u64,
754        mut receiver: fidl::endpoints::ClientEnd<ReceiverMarker>,
755        ___deadline: zx::MonotonicInstant,
756    ) -> Result<CapabilityStoreConnectorCreateResult, fidl::Error> {
757        let _response = self.client.send_query::<
758            CapabilityStoreConnectorCreateRequest,
759            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
760        >(
761            (id, receiver,),
762            0x29592c5d63e91c25,
763            fidl::encoding::DynamicFlags::FLEXIBLE,
764            ___deadline,
765        )?
766        .into_result::<CapabilityStoreMarker>("connector_create")?;
767        Ok(_response.map(|x| x))
768    }
769
770    /// Open a connection from the provided [Connector] capability that will be dispatched to
771    /// the [Receiver] on the other end.
772    ///
773    /// If there is an error, it will be reported as a zx.Status epitaph on `server_end`.
774    ///
775    /// Errors:
776    ///
777    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
778    /// - `WRONG_TYPE` if `id` was not a connector capability.
779    pub fn r#connector_open(
780        &self,
781        mut id: u64,
782        mut server_end: fidl::Channel,
783        ___deadline: zx::MonotonicInstant,
784    ) -> Result<CapabilityStoreConnectorOpenResult, fidl::Error> {
785        let _response = self.client.send_query::<
786            CapabilityStoreConnectorOpenRequest,
787            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
788        >(
789            (id, server_end,),
790            0x537e69ab40563b9f,
791            fidl::encoding::DynamicFlags::FLEXIBLE,
792            ___deadline,
793        )?
794        .into_result::<CapabilityStoreMarker>("connector_open")?;
795        Ok(_response.map(|x| x))
796    }
797
798    /// Creates a [DirConnector] from a [DirReceiver]. Incoming connections to the [DirConnector]
799    /// will be dispatched to this [DirReceiver].
800    ///
801    /// Errors:
802    ///
803    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
804    pub fn r#dir_connector_create(
805        &self,
806        mut id: u64,
807        mut receiver: fidl::endpoints::ClientEnd<DirReceiverMarker>,
808        ___deadline: zx::MonotonicInstant,
809    ) -> Result<CapabilityStoreDirConnectorCreateResult, fidl::Error> {
810        let _response = self.client.send_query::<
811            CapabilityStoreDirConnectorCreateRequest,
812            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
813        >(
814            (id, receiver,),
815            0x186138a11ccf19bb,
816            fidl::encoding::DynamicFlags::FLEXIBLE,
817            ___deadline,
818        )?
819        .into_result::<CapabilityStoreMarker>("dir_connector_create")?;
820        Ok(_response.map(|x| x))
821    }
822
823    /// Open a connection from the provided [DirConnector] capability that will
824    /// be dispatched to the [DirReceiver] on the other end. The `id` and
825    /// `server_end` arguments are required, and the `flags` and `path`
826    /// arguments are optional (a path of `.` will be used if one is not
827    /// otherwise set).
828    ///
829    /// If there was an error making the connection, it will be reported as a zx.Status
830    /// epitaph on `server_end`.
831    ///
832    /// Errors:
833    ///
834    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
835    /// - `WRONG_TYPE` if `id` was not a connector capability.
836    pub fn r#dir_connector_open(
837        &self,
838        mut payload: CapabilityStoreDirConnectorOpenRequest,
839        ___deadline: zx::MonotonicInstant,
840    ) -> Result<CapabilityStoreDirConnectorOpenResult, fidl::Error> {
841        let _response = self.client.send_query::<
842            CapabilityStoreDirConnectorOpenRequest,
843            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
844        >(
845            &mut payload,
846            0x5650d3d6a3a13901,
847            fidl::encoding::DynamicFlags::FLEXIBLE,
848            ___deadline,
849        )?
850        .into_result::<CapabilityStoreMarker>("dir_connector_open")?;
851        Ok(_response.map(|x| x))
852    }
853
854    /// Creates a new empty dictionary in this [`CapabilityStore`] with client-assigned `id`.
855    ///
856    /// Errors:
857    ///
858    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
859    pub fn r#dictionary_create(
860        &self,
861        mut id: u64,
862        ___deadline: zx::MonotonicInstant,
863    ) -> Result<CapabilityStoreDictionaryCreateResult, fidl::Error> {
864        let _response = self.client.send_query::<
865            CapabilityStoreDictionaryCreateRequest,
866            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
867        >(
868            (id,),
869            0x6997c8dfc63de093,
870            fidl::encoding::DynamicFlags::FLEXIBLE,
871            ___deadline,
872        )?
873        .into_result::<CapabilityStoreMarker>("dictionary_create")?;
874        Ok(_response.map(|x| x))
875    }
876
877    /// Imports a dictionary in the form of a channel.
878    ///
879    /// This is a legacy API to support backward compatibility with APIs that take a [Dictionary]
880    /// channel.
881    ///
882    /// Errors:
883    ///
884    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
885    /// - `BAD_CAPABILITY` if `client_end` was not a valid dictionary channel.
886    pub fn r#dictionary_legacy_import(
887        &self,
888        mut id: u64,
889        mut client_end: fidl::Channel,
890        ___deadline: zx::MonotonicInstant,
891    ) -> Result<CapabilityStoreDictionaryLegacyImportResult, fidl::Error> {
892        let _response = self.client.send_query::<
893            CapabilityStoreDictionaryLegacyImportRequest,
894            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
895        >(
896            (id, client_end,),
897            0x72fd686c37b6025f,
898            fidl::encoding::DynamicFlags::FLEXIBLE,
899            ___deadline,
900        )?
901        .into_result::<CapabilityStoreMarker>("dictionary_legacy_import")?;
902        Ok(_response.map(|x| x))
903    }
904
905    /// Binds a channel to the dictionary with `id`. The channel can
906    /// be re-imported into a [CapabilityStore] with [DictionaryImportLegacy].
907    ///
908    /// This is a legacy API to support backward compatibility with APIs that take a [Dictionary]
909    /// channel.
910    ///
911    /// Errors:
912    ///
913    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
914    pub fn r#dictionary_legacy_export(
915        &self,
916        mut id: u64,
917        mut server_end: fidl::Channel,
918        ___deadline: zx::MonotonicInstant,
919    ) -> Result<CapabilityStoreDictionaryLegacyExportResult, fidl::Error> {
920        let _response = self.client.send_query::<
921            CapabilityStoreDictionaryLegacyExportRequest,
922            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
923        >(
924            (id, server_end,),
925            0x407e15cc4bde5dcd,
926            fidl::encoding::DynamicFlags::FLEXIBLE,
927            ___deadline,
928        )?
929        .into_result::<CapabilityStoreMarker>("dictionary_legacy_export")?;
930        Ok(_response.map(|x| x))
931    }
932
933    /// Inserts `item` into the dictionary with `id`. `item.value` is moved into the dictionary and
934    /// its id is released if this call succeeds.
935    ///
936    /// Errors:
937    ///
938    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
939    /// - `WRONG_TYPE` if `id` was not a dictionary.
940    /// - `INVALID_KEY` if `item.key` was invalid.
941    /// - `ITEM_ALREADY_EXISTS` if the dictionary already contains an item with `item.key`.
942    pub fn r#dictionary_insert(
943        &self,
944        mut id: u64,
945        mut item: &DictionaryItem,
946        ___deadline: zx::MonotonicInstant,
947    ) -> Result<CapabilityStoreDictionaryInsertResult, fidl::Error> {
948        let _response = self.client.send_query::<
949            CapabilityStoreDictionaryInsertRequest,
950            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
951        >(
952            (id, item,),
953            0x7702183689d44c27,
954            fidl::encoding::DynamicFlags::FLEXIBLE,
955            ___deadline,
956        )?
957        .into_result::<CapabilityStoreMarker>("dictionary_insert")?;
958        Ok(_response.map(|x| x))
959    }
960
961    /// Get a duplicate of a capability from the dictionary with `id`, which is
962    /// loaded into `dest_id`.
963    ///
964    /// Errors:
965    ///
966    /// - `ID_NOT_FOUND` if `id` was not a recognized capability id in this store.
967    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
968    /// - `WRONG_TYPE` if `id` was not a dictionary.
969    /// - `INVALID_KEY` if `item.key` was invalid.
970    /// - `ITEM_NOT_FOUND` if the dictionary does not contain `key`.
971    /// - `NOT_DUPLICATABLE` if the capability could not be duplicated.
972    pub fn r#dictionary_get(
973        &self,
974        mut id: u64,
975        mut key: &str,
976        mut dest_id: u64,
977        ___deadline: zx::MonotonicInstant,
978    ) -> Result<CapabilityStoreDictionaryGetResult, fidl::Error> {
979        let _response = self.client.send_query::<
980            CapabilityStoreDictionaryGetRequest,
981            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
982        >(
983            (id, key, dest_id,),
984            0x4d9e27538284add2,
985            fidl::encoding::DynamicFlags::FLEXIBLE,
986            ___deadline,
987        )?
988        .into_result::<CapabilityStoreMarker>("dictionary_get")?;
989        Ok(_response.map(|x| x))
990    }
991
992    /// Removes a key from the dictionary with `id`. If `dest_id` is present, loads the value
993    /// into it, otherwise discards the value.
994    ///
995    /// Errors:
996    ///
997    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
998    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
999    /// - `WRONG_TYPE` if `id` was not a dictionary.
1000    /// - `INVALID_KEY` if `key` was invalid.
1001    /// - `ITEM_NOT_FOUND` if the dictionary does not contain the key.
1002    pub fn r#dictionary_remove(
1003        &self,
1004        mut id: u64,
1005        mut key: &str,
1006        mut dest_id: Option<&WrappedCapabilityId>,
1007        ___deadline: zx::MonotonicInstant,
1008    ) -> Result<CapabilityStoreDictionaryRemoveResult, fidl::Error> {
1009        let _response = self.client.send_query::<
1010            CapabilityStoreDictionaryRemoveRequest,
1011            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
1012        >(
1013            (id, key, dest_id,),
1014            0x4c5c025ab05d4f3,
1015            fidl::encoding::DynamicFlags::FLEXIBLE,
1016            ___deadline,
1017        )?
1018        .into_result::<CapabilityStoreMarker>("dictionary_remove")?;
1019        Ok(_response.map(|x| x))
1020    }
1021
1022    /// Create a new dictionary that contains a duplicate of all the entries in
1023    /// the dictionary with `id`, assigning `dest_id` to the new dictionary.
1024    /// The runtime of this method is linear in the number of top-level entries
1025    /// in the dictionary.
1026    ///
1027    /// For example, if the dictionary contains nested dictionaries, the newly
1028    /// created dictionary will contain references to those same nested
1029    /// dictionaries because the entries are duplicated rather than deep-copied.
1030    ///
1031    /// Errors:
1032    ///
1033    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1034    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
1035    /// - `WRONG_TYPE` if `id` was not a dictionary.
1036    /// - `NOT_DUPLICATABLE` if one of the capabilities in `id` could not be duplicated.
1037    pub fn r#dictionary_copy(
1038        &self,
1039        mut id: u64,
1040        mut dest_id: u64,
1041        ___deadline: zx::MonotonicInstant,
1042    ) -> Result<CapabilityStoreDictionaryCopyResult, fidl::Error> {
1043        let _response = self.client.send_query::<
1044            CapabilityStoreDictionaryCopyRequest,
1045            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
1046        >(
1047            (id, dest_id,),
1048            0x3733ecdf4ea1b44f,
1049            fidl::encoding::DynamicFlags::FLEXIBLE,
1050            ___deadline,
1051        )?
1052        .into_result::<CapabilityStoreMarker>("dictionary_copy")?;
1053        Ok(_response.map(|x| x))
1054    }
1055
1056    /// Enumerates the keys in the dictionary with `id`.
1057    ///
1058    /// Errors:
1059    ///
1060    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1061    /// - `WRONG_TYPE` if `id` was not a dictionary.
1062    pub fn r#dictionary_keys(
1063        &self,
1064        mut id: u64,
1065        mut iterator: fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>,
1066        ___deadline: zx::MonotonicInstant,
1067    ) -> Result<CapabilityStoreDictionaryKeysResult, fidl::Error> {
1068        let _response = self.client.send_query::<
1069            CapabilityStoreDictionaryKeysRequest,
1070            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
1071        >(
1072            (id, iterator,),
1073            0x84b05577ceaec9e,
1074            fidl::encoding::DynamicFlags::FLEXIBLE,
1075            ___deadline,
1076        )?
1077        .into_result::<CapabilityStoreMarker>("dictionary_keys")?;
1078        Ok(_response.map(|x| x))
1079    }
1080
1081    /// Enumerates the items (keys and values) in the dictionary with `id`.
1082    ///
1083    /// Creates a duplicate of each value (capability). If a value could not be duplicated,
1084    /// the value will be null.
1085    ///
1086    /// Errors:
1087    ///
1088    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1089    /// - `WRONG_TYPE` if `id` was not a dictionary.
1090    pub fn r#dictionary_enumerate(
1091        &self,
1092        mut id: u64,
1093        mut iterator: fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
1094        ___deadline: zx::MonotonicInstant,
1095    ) -> Result<CapabilityStoreDictionaryEnumerateResult, fidl::Error> {
1096        let _response = self.client.send_query::<
1097            CapabilityStoreDictionaryEnumerateRequest,
1098            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
1099        >(
1100            (id, iterator,),
1101            0xd6279b6ced04641,
1102            fidl::encoding::DynamicFlags::FLEXIBLE,
1103            ___deadline,
1104        )?
1105        .into_result::<CapabilityStoreMarker>("dictionary_enumerate")?;
1106        Ok(_response.map(|x| x))
1107    }
1108
1109    /// Removes all the entries in this dictionary, returning them in `contents` if provided.
1110    /// If `contents` is not provided, all the items are discarded without enumerating them.
1111    ///
1112    /// Errors:
1113    ///
1114    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1115    /// - `WRONG_TYPE` if `id` was not a dictionary.
1116    pub fn r#dictionary_drain(
1117        &self,
1118        mut id: u64,
1119        mut iterator: Option<fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>>,
1120        ___deadline: zx::MonotonicInstant,
1121    ) -> Result<CapabilityStoreDictionaryDrainResult, fidl::Error> {
1122        let _response = self.client.send_query::<
1123            CapabilityStoreDictionaryDrainRequest,
1124            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
1125        >(
1126            (id, iterator,),
1127            0x28a3a3f84d928cd8,
1128            fidl::encoding::DynamicFlags::FLEXIBLE,
1129            ___deadline,
1130        )?
1131        .into_result::<CapabilityStoreMarker>("dictionary_drain")?;
1132        Ok(_response.map(|x| x))
1133    }
1134}
1135
1136#[cfg(target_os = "fuchsia")]
1137impl From<CapabilityStoreSynchronousProxy> for zx::NullableHandle {
1138    fn from(value: CapabilityStoreSynchronousProxy) -> Self {
1139        value.into_channel().into()
1140    }
1141}
1142
1143#[cfg(target_os = "fuchsia")]
1144impl From<fidl::Channel> for CapabilityStoreSynchronousProxy {
1145    fn from(value: fidl::Channel) -> Self {
1146        Self::new(value)
1147    }
1148}
1149
1150#[cfg(target_os = "fuchsia")]
1151impl fidl::endpoints::FromClient for CapabilityStoreSynchronousProxy {
1152    type Protocol = CapabilityStoreMarker;
1153
1154    fn from_client(value: fidl::endpoints::ClientEnd<CapabilityStoreMarker>) -> Self {
1155        Self::new(value.into_channel())
1156    }
1157}
1158
1159#[derive(Debug, Clone)]
1160pub struct CapabilityStoreProxy {
1161    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1162}
1163
1164impl fidl::endpoints::Proxy for CapabilityStoreProxy {
1165    type Protocol = CapabilityStoreMarker;
1166
1167    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1168        Self::new(inner)
1169    }
1170
1171    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1172        self.client.into_channel().map_err(|client| Self { client })
1173    }
1174
1175    fn as_channel(&self) -> &::fidl::AsyncChannel {
1176        self.client.as_channel()
1177    }
1178}
1179
1180impl CapabilityStoreProxy {
1181    /// Create a new Proxy for fuchsia.component.sandbox/CapabilityStore.
1182    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1183        let protocol_name = <CapabilityStoreMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1184        Self { client: fidl::client::Client::new(channel, protocol_name) }
1185    }
1186
1187    /// Get a Stream of events from the remote end of the protocol.
1188    ///
1189    /// # Panics
1190    ///
1191    /// Panics if the event stream was already taken.
1192    pub fn take_event_stream(&self) -> CapabilityStoreEventStream {
1193        CapabilityStoreEventStream { event_receiver: self.client.take_event_receiver() }
1194    }
1195
1196    /// Duplicates the capability with `id` to `dest_id`.
1197    ///
1198    /// Errors:
1199    ///
1200    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1201    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
1202    /// - `NOT_DUPLICATABLE` if `id` could not be duplicated.
1203    pub fn r#duplicate(
1204        &self,
1205        mut id: u64,
1206        mut dest_id: u64,
1207    ) -> fidl::client::QueryResponseFut<
1208        CapabilityStoreDuplicateResult,
1209        fidl::encoding::DefaultFuchsiaResourceDialect,
1210    > {
1211        CapabilityStoreProxyInterface::r#duplicate(self, id, dest_id)
1212    }
1213
1214    /// Drops the capability with `id` from this [`CapabilityStore`].
1215    ///
1216    /// Errors:
1217    ///
1218    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1219    pub fn r#drop(
1220        &self,
1221        mut id: u64,
1222    ) -> fidl::client::QueryResponseFut<
1223        CapabilityStoreDropResult,
1224        fidl::encoding::DefaultFuchsiaResourceDialect,
1225    > {
1226        CapabilityStoreProxyInterface::r#drop(self, id)
1227    }
1228
1229    /// Exports the capability with the client-assigned identifier `id` to
1230    /// `capability`. This operation removes the capability from the store. If
1231    /// this is not desired, [Duplicate] the capability first.
1232    ///
1233    /// Errors:
1234    ///
1235    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1236    pub fn r#export(
1237        &self,
1238        mut id: u64,
1239    ) -> fidl::client::QueryResponseFut<
1240        CapabilityStoreExportResult,
1241        fidl::encoding::DefaultFuchsiaResourceDialect,
1242    > {
1243        CapabilityStoreProxyInterface::r#export(self, id)
1244    }
1245
1246    /// Imports `capability` into this store with the client-assigned `id`.
1247    ///
1248    /// Errors:
1249    ///
1250    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
1251    /// - `BAD_CAPABILITY` if `capability` was not a valid [Capability].
1252    pub fn r#import(
1253        &self,
1254        mut id: u64,
1255        mut capability: Capability,
1256    ) -> fidl::client::QueryResponseFut<
1257        CapabilityStoreImportResult,
1258        fidl::encoding::DefaultFuchsiaResourceDialect,
1259    > {
1260        CapabilityStoreProxyInterface::r#import(self, id, capability)
1261    }
1262
1263    /// Creates a [Connector] from a [Receiver]. Incoming connections to the [Connector] will be
1264    /// dispatched to this [Receiver].
1265    ///
1266    /// Errors:
1267    ///
1268    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
1269    pub fn r#connector_create(
1270        &self,
1271        mut id: u64,
1272        mut receiver: fidl::endpoints::ClientEnd<ReceiverMarker>,
1273    ) -> fidl::client::QueryResponseFut<
1274        CapabilityStoreConnectorCreateResult,
1275        fidl::encoding::DefaultFuchsiaResourceDialect,
1276    > {
1277        CapabilityStoreProxyInterface::r#connector_create(self, id, receiver)
1278    }
1279
1280    /// Open a connection from the provided [Connector] capability that will be dispatched to
1281    /// the [Receiver] on the other end.
1282    ///
1283    /// If there is an error, it will be reported as a zx.Status epitaph on `server_end`.
1284    ///
1285    /// Errors:
1286    ///
1287    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1288    /// - `WRONG_TYPE` if `id` was not a connector capability.
1289    pub fn r#connector_open(
1290        &self,
1291        mut id: u64,
1292        mut server_end: fidl::Channel,
1293    ) -> fidl::client::QueryResponseFut<
1294        CapabilityStoreConnectorOpenResult,
1295        fidl::encoding::DefaultFuchsiaResourceDialect,
1296    > {
1297        CapabilityStoreProxyInterface::r#connector_open(self, id, server_end)
1298    }
1299
1300    /// Creates a [DirConnector] from a [DirReceiver]. Incoming connections to the [DirConnector]
1301    /// will be dispatched to this [DirReceiver].
1302    ///
1303    /// Errors:
1304    ///
1305    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
1306    pub fn r#dir_connector_create(
1307        &self,
1308        mut id: u64,
1309        mut receiver: fidl::endpoints::ClientEnd<DirReceiverMarker>,
1310    ) -> fidl::client::QueryResponseFut<
1311        CapabilityStoreDirConnectorCreateResult,
1312        fidl::encoding::DefaultFuchsiaResourceDialect,
1313    > {
1314        CapabilityStoreProxyInterface::r#dir_connector_create(self, id, receiver)
1315    }
1316
1317    /// Open a connection from the provided [DirConnector] capability that will
1318    /// be dispatched to the [DirReceiver] on the other end. The `id` and
1319    /// `server_end` arguments are required, and the `flags` and `path`
1320    /// arguments are optional (a path of `.` will be used if one is not
1321    /// otherwise set).
1322    ///
1323    /// If there was an error making the connection, it will be reported as a zx.Status
1324    /// epitaph on `server_end`.
1325    ///
1326    /// Errors:
1327    ///
1328    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1329    /// - `WRONG_TYPE` if `id` was not a connector capability.
1330    pub fn r#dir_connector_open(
1331        &self,
1332        mut payload: CapabilityStoreDirConnectorOpenRequest,
1333    ) -> fidl::client::QueryResponseFut<
1334        CapabilityStoreDirConnectorOpenResult,
1335        fidl::encoding::DefaultFuchsiaResourceDialect,
1336    > {
1337        CapabilityStoreProxyInterface::r#dir_connector_open(self, payload)
1338    }
1339
1340    /// Creates a new empty dictionary in this [`CapabilityStore`] with client-assigned `id`.
1341    ///
1342    /// Errors:
1343    ///
1344    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
1345    pub fn r#dictionary_create(
1346        &self,
1347        mut id: u64,
1348    ) -> fidl::client::QueryResponseFut<
1349        CapabilityStoreDictionaryCreateResult,
1350        fidl::encoding::DefaultFuchsiaResourceDialect,
1351    > {
1352        CapabilityStoreProxyInterface::r#dictionary_create(self, id)
1353    }
1354
1355    /// Imports a dictionary in the form of a channel.
1356    ///
1357    /// This is a legacy API to support backward compatibility with APIs that take a [Dictionary]
1358    /// channel.
1359    ///
1360    /// Errors:
1361    ///
1362    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
1363    /// - `BAD_CAPABILITY` if `client_end` was not a valid dictionary channel.
1364    pub fn r#dictionary_legacy_import(
1365        &self,
1366        mut id: u64,
1367        mut client_end: fidl::Channel,
1368    ) -> fidl::client::QueryResponseFut<
1369        CapabilityStoreDictionaryLegacyImportResult,
1370        fidl::encoding::DefaultFuchsiaResourceDialect,
1371    > {
1372        CapabilityStoreProxyInterface::r#dictionary_legacy_import(self, id, client_end)
1373    }
1374
1375    /// Binds a channel to the dictionary with `id`. The channel can
1376    /// be re-imported into a [CapabilityStore] with [DictionaryImportLegacy].
1377    ///
1378    /// This is a legacy API to support backward compatibility with APIs that take a [Dictionary]
1379    /// channel.
1380    ///
1381    /// Errors:
1382    ///
1383    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1384    pub fn r#dictionary_legacy_export(
1385        &self,
1386        mut id: u64,
1387        mut server_end: fidl::Channel,
1388    ) -> fidl::client::QueryResponseFut<
1389        CapabilityStoreDictionaryLegacyExportResult,
1390        fidl::encoding::DefaultFuchsiaResourceDialect,
1391    > {
1392        CapabilityStoreProxyInterface::r#dictionary_legacy_export(self, id, server_end)
1393    }
1394
1395    /// Inserts `item` into the dictionary with `id`. `item.value` is moved into the dictionary and
1396    /// its id is released if this call succeeds.
1397    ///
1398    /// Errors:
1399    ///
1400    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1401    /// - `WRONG_TYPE` if `id` was not a dictionary.
1402    /// - `INVALID_KEY` if `item.key` was invalid.
1403    /// - `ITEM_ALREADY_EXISTS` if the dictionary already contains an item with `item.key`.
1404    pub fn r#dictionary_insert(
1405        &self,
1406        mut id: u64,
1407        mut item: &DictionaryItem,
1408    ) -> fidl::client::QueryResponseFut<
1409        CapabilityStoreDictionaryInsertResult,
1410        fidl::encoding::DefaultFuchsiaResourceDialect,
1411    > {
1412        CapabilityStoreProxyInterface::r#dictionary_insert(self, id, item)
1413    }
1414
1415    /// Get a duplicate of a capability from the dictionary with `id`, which is
1416    /// loaded into `dest_id`.
1417    ///
1418    /// Errors:
1419    ///
1420    /// - `ID_NOT_FOUND` if `id` was not a recognized capability id in this store.
1421    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
1422    /// - `WRONG_TYPE` if `id` was not a dictionary.
1423    /// - `INVALID_KEY` if `item.key` was invalid.
1424    /// - `ITEM_NOT_FOUND` if the dictionary does not contain `key`.
1425    /// - `NOT_DUPLICATABLE` if the capability could not be duplicated.
1426    pub fn r#dictionary_get(
1427        &self,
1428        mut id: u64,
1429        mut key: &str,
1430        mut dest_id: u64,
1431    ) -> fidl::client::QueryResponseFut<
1432        CapabilityStoreDictionaryGetResult,
1433        fidl::encoding::DefaultFuchsiaResourceDialect,
1434    > {
1435        CapabilityStoreProxyInterface::r#dictionary_get(self, id, key, dest_id)
1436    }
1437
1438    /// Removes a key from the dictionary with `id`. If `dest_id` is present, loads the value
1439    /// into it, otherwise discards the value.
1440    ///
1441    /// Errors:
1442    ///
1443    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1444    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
1445    /// - `WRONG_TYPE` if `id` was not a dictionary.
1446    /// - `INVALID_KEY` if `key` was invalid.
1447    /// - `ITEM_NOT_FOUND` if the dictionary does not contain the key.
1448    pub fn r#dictionary_remove(
1449        &self,
1450        mut id: u64,
1451        mut key: &str,
1452        mut dest_id: Option<&WrappedCapabilityId>,
1453    ) -> fidl::client::QueryResponseFut<
1454        CapabilityStoreDictionaryRemoveResult,
1455        fidl::encoding::DefaultFuchsiaResourceDialect,
1456    > {
1457        CapabilityStoreProxyInterface::r#dictionary_remove(self, id, key, dest_id)
1458    }
1459
1460    /// Create a new dictionary that contains a duplicate of all the entries in
1461    /// the dictionary with `id`, assigning `dest_id` to the new dictionary.
1462    /// The runtime of this method is linear in the number of top-level entries
1463    /// in the dictionary.
1464    ///
1465    /// For example, if the dictionary contains nested dictionaries, the newly
1466    /// created dictionary will contain references to those same nested
1467    /// dictionaries because the entries are duplicated rather than deep-copied.
1468    ///
1469    /// Errors:
1470    ///
1471    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1472    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
1473    /// - `WRONG_TYPE` if `id` was not a dictionary.
1474    /// - `NOT_DUPLICATABLE` if one of the capabilities in `id` could not be duplicated.
1475    pub fn r#dictionary_copy(
1476        &self,
1477        mut id: u64,
1478        mut dest_id: u64,
1479    ) -> fidl::client::QueryResponseFut<
1480        CapabilityStoreDictionaryCopyResult,
1481        fidl::encoding::DefaultFuchsiaResourceDialect,
1482    > {
1483        CapabilityStoreProxyInterface::r#dictionary_copy(self, id, dest_id)
1484    }
1485
1486    /// Enumerates the keys in the dictionary with `id`.
1487    ///
1488    /// Errors:
1489    ///
1490    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1491    /// - `WRONG_TYPE` if `id` was not a dictionary.
1492    pub fn r#dictionary_keys(
1493        &self,
1494        mut id: u64,
1495        mut iterator: fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>,
1496    ) -> fidl::client::QueryResponseFut<
1497        CapabilityStoreDictionaryKeysResult,
1498        fidl::encoding::DefaultFuchsiaResourceDialect,
1499    > {
1500        CapabilityStoreProxyInterface::r#dictionary_keys(self, id, iterator)
1501    }
1502
1503    /// Enumerates the items (keys and values) in the dictionary with `id`.
1504    ///
1505    /// Creates a duplicate of each value (capability). If a value could not be duplicated,
1506    /// the value will be null.
1507    ///
1508    /// Errors:
1509    ///
1510    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1511    /// - `WRONG_TYPE` if `id` was not a dictionary.
1512    pub fn r#dictionary_enumerate(
1513        &self,
1514        mut id: u64,
1515        mut iterator: fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
1516    ) -> fidl::client::QueryResponseFut<
1517        CapabilityStoreDictionaryEnumerateResult,
1518        fidl::encoding::DefaultFuchsiaResourceDialect,
1519    > {
1520        CapabilityStoreProxyInterface::r#dictionary_enumerate(self, id, iterator)
1521    }
1522
1523    /// Removes all the entries in this dictionary, returning them in `contents` if provided.
1524    /// If `contents` is not provided, all the items are discarded without enumerating them.
1525    ///
1526    /// Errors:
1527    ///
1528    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1529    /// - `WRONG_TYPE` if `id` was not a dictionary.
1530    pub fn r#dictionary_drain(
1531        &self,
1532        mut id: u64,
1533        mut iterator: Option<fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>>,
1534    ) -> fidl::client::QueryResponseFut<
1535        CapabilityStoreDictionaryDrainResult,
1536        fidl::encoding::DefaultFuchsiaResourceDialect,
1537    > {
1538        CapabilityStoreProxyInterface::r#dictionary_drain(self, id, iterator)
1539    }
1540}
1541
1542impl CapabilityStoreProxyInterface for CapabilityStoreProxy {
1543    type DuplicateResponseFut = fidl::client::QueryResponseFut<
1544        CapabilityStoreDuplicateResult,
1545        fidl::encoding::DefaultFuchsiaResourceDialect,
1546    >;
1547    fn r#duplicate(&self, mut id: u64, mut dest_id: u64) -> Self::DuplicateResponseFut {
1548        fn _decode(
1549            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1550        ) -> Result<CapabilityStoreDuplicateResult, fidl::Error> {
1551            let _response = fidl::client::decode_transaction_body::<
1552                fidl::encoding::FlexibleResultType<
1553                    fidl::encoding::EmptyStruct,
1554                    CapabilityStoreError,
1555                >,
1556                fidl::encoding::DefaultFuchsiaResourceDialect,
1557                0x5d5d35d9c20a2184,
1558            >(_buf?)?
1559            .into_result::<CapabilityStoreMarker>("duplicate")?;
1560            Ok(_response.map(|x| x))
1561        }
1562        self.client.send_query_and_decode::<
1563            CapabilityStoreDuplicateRequest,
1564            CapabilityStoreDuplicateResult,
1565        >(
1566            (id, dest_id,),
1567            0x5d5d35d9c20a2184,
1568            fidl::encoding::DynamicFlags::FLEXIBLE,
1569            _decode,
1570        )
1571    }
1572
1573    type DropResponseFut = fidl::client::QueryResponseFut<
1574        CapabilityStoreDropResult,
1575        fidl::encoding::DefaultFuchsiaResourceDialect,
1576    >;
1577    fn r#drop(&self, mut id: u64) -> Self::DropResponseFut {
1578        fn _decode(
1579            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1580        ) -> Result<CapabilityStoreDropResult, fidl::Error> {
1581            let _response = fidl::client::decode_transaction_body::<
1582                fidl::encoding::FlexibleResultType<
1583                    fidl::encoding::EmptyStruct,
1584                    CapabilityStoreError,
1585                >,
1586                fidl::encoding::DefaultFuchsiaResourceDialect,
1587                0xa745c0990fc2559,
1588            >(_buf?)?
1589            .into_result::<CapabilityStoreMarker>("drop")?;
1590            Ok(_response.map(|x| x))
1591        }
1592        self.client.send_query_and_decode::<CapabilityStoreDropRequest, CapabilityStoreDropResult>(
1593            (id,),
1594            0xa745c0990fc2559,
1595            fidl::encoding::DynamicFlags::FLEXIBLE,
1596            _decode,
1597        )
1598    }
1599
1600    type ExportResponseFut = fidl::client::QueryResponseFut<
1601        CapabilityStoreExportResult,
1602        fidl::encoding::DefaultFuchsiaResourceDialect,
1603    >;
1604    fn r#export(&self, mut id: u64) -> Self::ExportResponseFut {
1605        fn _decode(
1606            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1607        ) -> Result<CapabilityStoreExportResult, fidl::Error> {
1608            let _response = fidl::client::decode_transaction_body::<
1609                fidl::encoding::FlexibleResultType<
1610                    CapabilityStoreExportResponse,
1611                    CapabilityStoreError,
1612                >,
1613                fidl::encoding::DefaultFuchsiaResourceDialect,
1614                0x3237a8f4748faff,
1615            >(_buf?)?
1616            .into_result::<CapabilityStoreMarker>("export")?;
1617            Ok(_response.map(|x| x.capability))
1618        }
1619        self.client
1620            .send_query_and_decode::<CapabilityStoreExportRequest, CapabilityStoreExportResult>(
1621                (id,),
1622                0x3237a8f4748faff,
1623                fidl::encoding::DynamicFlags::FLEXIBLE,
1624                _decode,
1625            )
1626    }
1627
1628    type ImportResponseFut = fidl::client::QueryResponseFut<
1629        CapabilityStoreImportResult,
1630        fidl::encoding::DefaultFuchsiaResourceDialect,
1631    >;
1632    fn r#import(&self, mut id: u64, mut capability: Capability) -> Self::ImportResponseFut {
1633        fn _decode(
1634            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1635        ) -> Result<CapabilityStoreImportResult, fidl::Error> {
1636            let _response = fidl::client::decode_transaction_body::<
1637                fidl::encoding::FlexibleResultType<
1638                    fidl::encoding::EmptyStruct,
1639                    CapabilityStoreError,
1640                >,
1641                fidl::encoding::DefaultFuchsiaResourceDialect,
1642                0x1f96157a29f4539b,
1643            >(_buf?)?
1644            .into_result::<CapabilityStoreMarker>("import")?;
1645            Ok(_response.map(|x| x))
1646        }
1647        self.client
1648            .send_query_and_decode::<CapabilityStoreImportRequest, CapabilityStoreImportResult>(
1649                (id, &mut capability),
1650                0x1f96157a29f4539b,
1651                fidl::encoding::DynamicFlags::FLEXIBLE,
1652                _decode,
1653            )
1654    }
1655
1656    type ConnectorCreateResponseFut = fidl::client::QueryResponseFut<
1657        CapabilityStoreConnectorCreateResult,
1658        fidl::encoding::DefaultFuchsiaResourceDialect,
1659    >;
1660    fn r#connector_create(
1661        &self,
1662        mut id: u64,
1663        mut receiver: fidl::endpoints::ClientEnd<ReceiverMarker>,
1664    ) -> Self::ConnectorCreateResponseFut {
1665        fn _decode(
1666            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1667        ) -> Result<CapabilityStoreConnectorCreateResult, fidl::Error> {
1668            let _response = fidl::client::decode_transaction_body::<
1669                fidl::encoding::FlexibleResultType<
1670                    fidl::encoding::EmptyStruct,
1671                    CapabilityStoreError,
1672                >,
1673                fidl::encoding::DefaultFuchsiaResourceDialect,
1674                0x29592c5d63e91c25,
1675            >(_buf?)?
1676            .into_result::<CapabilityStoreMarker>("connector_create")?;
1677            Ok(_response.map(|x| x))
1678        }
1679        self.client.send_query_and_decode::<
1680            CapabilityStoreConnectorCreateRequest,
1681            CapabilityStoreConnectorCreateResult,
1682        >(
1683            (id, receiver,),
1684            0x29592c5d63e91c25,
1685            fidl::encoding::DynamicFlags::FLEXIBLE,
1686            _decode,
1687        )
1688    }
1689
1690    type ConnectorOpenResponseFut = fidl::client::QueryResponseFut<
1691        CapabilityStoreConnectorOpenResult,
1692        fidl::encoding::DefaultFuchsiaResourceDialect,
1693    >;
1694    fn r#connector_open(
1695        &self,
1696        mut id: u64,
1697        mut server_end: fidl::Channel,
1698    ) -> Self::ConnectorOpenResponseFut {
1699        fn _decode(
1700            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1701        ) -> Result<CapabilityStoreConnectorOpenResult, fidl::Error> {
1702            let _response = fidl::client::decode_transaction_body::<
1703                fidl::encoding::FlexibleResultType<
1704                    fidl::encoding::EmptyStruct,
1705                    CapabilityStoreError,
1706                >,
1707                fidl::encoding::DefaultFuchsiaResourceDialect,
1708                0x537e69ab40563b9f,
1709            >(_buf?)?
1710            .into_result::<CapabilityStoreMarker>("connector_open")?;
1711            Ok(_response.map(|x| x))
1712        }
1713        self.client.send_query_and_decode::<
1714            CapabilityStoreConnectorOpenRequest,
1715            CapabilityStoreConnectorOpenResult,
1716        >(
1717            (id, server_end,),
1718            0x537e69ab40563b9f,
1719            fidl::encoding::DynamicFlags::FLEXIBLE,
1720            _decode,
1721        )
1722    }
1723
1724    type DirConnectorCreateResponseFut = fidl::client::QueryResponseFut<
1725        CapabilityStoreDirConnectorCreateResult,
1726        fidl::encoding::DefaultFuchsiaResourceDialect,
1727    >;
1728    fn r#dir_connector_create(
1729        &self,
1730        mut id: u64,
1731        mut receiver: fidl::endpoints::ClientEnd<DirReceiverMarker>,
1732    ) -> Self::DirConnectorCreateResponseFut {
1733        fn _decode(
1734            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1735        ) -> Result<CapabilityStoreDirConnectorCreateResult, fidl::Error> {
1736            let _response = fidl::client::decode_transaction_body::<
1737                fidl::encoding::FlexibleResultType<
1738                    fidl::encoding::EmptyStruct,
1739                    CapabilityStoreError,
1740                >,
1741                fidl::encoding::DefaultFuchsiaResourceDialect,
1742                0x186138a11ccf19bb,
1743            >(_buf?)?
1744            .into_result::<CapabilityStoreMarker>("dir_connector_create")?;
1745            Ok(_response.map(|x| x))
1746        }
1747        self.client.send_query_and_decode::<
1748            CapabilityStoreDirConnectorCreateRequest,
1749            CapabilityStoreDirConnectorCreateResult,
1750        >(
1751            (id, receiver,),
1752            0x186138a11ccf19bb,
1753            fidl::encoding::DynamicFlags::FLEXIBLE,
1754            _decode,
1755        )
1756    }
1757
1758    type DirConnectorOpenResponseFut = fidl::client::QueryResponseFut<
1759        CapabilityStoreDirConnectorOpenResult,
1760        fidl::encoding::DefaultFuchsiaResourceDialect,
1761    >;
1762    fn r#dir_connector_open(
1763        &self,
1764        mut payload: CapabilityStoreDirConnectorOpenRequest,
1765    ) -> Self::DirConnectorOpenResponseFut {
1766        fn _decode(
1767            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1768        ) -> Result<CapabilityStoreDirConnectorOpenResult, fidl::Error> {
1769            let _response = fidl::client::decode_transaction_body::<
1770                fidl::encoding::FlexibleResultType<
1771                    fidl::encoding::EmptyStruct,
1772                    CapabilityStoreError,
1773                >,
1774                fidl::encoding::DefaultFuchsiaResourceDialect,
1775                0x5650d3d6a3a13901,
1776            >(_buf?)?
1777            .into_result::<CapabilityStoreMarker>("dir_connector_open")?;
1778            Ok(_response.map(|x| x))
1779        }
1780        self.client.send_query_and_decode::<
1781            CapabilityStoreDirConnectorOpenRequest,
1782            CapabilityStoreDirConnectorOpenResult,
1783        >(
1784            &mut payload,
1785            0x5650d3d6a3a13901,
1786            fidl::encoding::DynamicFlags::FLEXIBLE,
1787            _decode,
1788        )
1789    }
1790
1791    type DictionaryCreateResponseFut = fidl::client::QueryResponseFut<
1792        CapabilityStoreDictionaryCreateResult,
1793        fidl::encoding::DefaultFuchsiaResourceDialect,
1794    >;
1795    fn r#dictionary_create(&self, mut id: u64) -> Self::DictionaryCreateResponseFut {
1796        fn _decode(
1797            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1798        ) -> Result<CapabilityStoreDictionaryCreateResult, fidl::Error> {
1799            let _response = fidl::client::decode_transaction_body::<
1800                fidl::encoding::FlexibleResultType<
1801                    fidl::encoding::EmptyStruct,
1802                    CapabilityStoreError,
1803                >,
1804                fidl::encoding::DefaultFuchsiaResourceDialect,
1805                0x6997c8dfc63de093,
1806            >(_buf?)?
1807            .into_result::<CapabilityStoreMarker>("dictionary_create")?;
1808            Ok(_response.map(|x| x))
1809        }
1810        self.client.send_query_and_decode::<
1811            CapabilityStoreDictionaryCreateRequest,
1812            CapabilityStoreDictionaryCreateResult,
1813        >(
1814            (id,),
1815            0x6997c8dfc63de093,
1816            fidl::encoding::DynamicFlags::FLEXIBLE,
1817            _decode,
1818        )
1819    }
1820
1821    type DictionaryLegacyImportResponseFut = fidl::client::QueryResponseFut<
1822        CapabilityStoreDictionaryLegacyImportResult,
1823        fidl::encoding::DefaultFuchsiaResourceDialect,
1824    >;
1825    fn r#dictionary_legacy_import(
1826        &self,
1827        mut id: u64,
1828        mut client_end: fidl::Channel,
1829    ) -> Self::DictionaryLegacyImportResponseFut {
1830        fn _decode(
1831            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1832        ) -> Result<CapabilityStoreDictionaryLegacyImportResult, fidl::Error> {
1833            let _response = fidl::client::decode_transaction_body::<
1834                fidl::encoding::FlexibleResultType<
1835                    fidl::encoding::EmptyStruct,
1836                    CapabilityStoreError,
1837                >,
1838                fidl::encoding::DefaultFuchsiaResourceDialect,
1839                0x72fd686c37b6025f,
1840            >(_buf?)?
1841            .into_result::<CapabilityStoreMarker>("dictionary_legacy_import")?;
1842            Ok(_response.map(|x| x))
1843        }
1844        self.client.send_query_and_decode::<
1845            CapabilityStoreDictionaryLegacyImportRequest,
1846            CapabilityStoreDictionaryLegacyImportResult,
1847        >(
1848            (id, client_end,),
1849            0x72fd686c37b6025f,
1850            fidl::encoding::DynamicFlags::FLEXIBLE,
1851            _decode,
1852        )
1853    }
1854
1855    type DictionaryLegacyExportResponseFut = fidl::client::QueryResponseFut<
1856        CapabilityStoreDictionaryLegacyExportResult,
1857        fidl::encoding::DefaultFuchsiaResourceDialect,
1858    >;
1859    fn r#dictionary_legacy_export(
1860        &self,
1861        mut id: u64,
1862        mut server_end: fidl::Channel,
1863    ) -> Self::DictionaryLegacyExportResponseFut {
1864        fn _decode(
1865            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1866        ) -> Result<CapabilityStoreDictionaryLegacyExportResult, fidl::Error> {
1867            let _response = fidl::client::decode_transaction_body::<
1868                fidl::encoding::FlexibleResultType<
1869                    fidl::encoding::EmptyStruct,
1870                    CapabilityStoreError,
1871                >,
1872                fidl::encoding::DefaultFuchsiaResourceDialect,
1873                0x407e15cc4bde5dcd,
1874            >(_buf?)?
1875            .into_result::<CapabilityStoreMarker>("dictionary_legacy_export")?;
1876            Ok(_response.map(|x| x))
1877        }
1878        self.client.send_query_and_decode::<
1879            CapabilityStoreDictionaryLegacyExportRequest,
1880            CapabilityStoreDictionaryLegacyExportResult,
1881        >(
1882            (id, server_end,),
1883            0x407e15cc4bde5dcd,
1884            fidl::encoding::DynamicFlags::FLEXIBLE,
1885            _decode,
1886        )
1887    }
1888
1889    type DictionaryInsertResponseFut = fidl::client::QueryResponseFut<
1890        CapabilityStoreDictionaryInsertResult,
1891        fidl::encoding::DefaultFuchsiaResourceDialect,
1892    >;
1893    fn r#dictionary_insert(
1894        &self,
1895        mut id: u64,
1896        mut item: &DictionaryItem,
1897    ) -> Self::DictionaryInsertResponseFut {
1898        fn _decode(
1899            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1900        ) -> Result<CapabilityStoreDictionaryInsertResult, fidl::Error> {
1901            let _response = fidl::client::decode_transaction_body::<
1902                fidl::encoding::FlexibleResultType<
1903                    fidl::encoding::EmptyStruct,
1904                    CapabilityStoreError,
1905                >,
1906                fidl::encoding::DefaultFuchsiaResourceDialect,
1907                0x7702183689d44c27,
1908            >(_buf?)?
1909            .into_result::<CapabilityStoreMarker>("dictionary_insert")?;
1910            Ok(_response.map(|x| x))
1911        }
1912        self.client.send_query_and_decode::<
1913            CapabilityStoreDictionaryInsertRequest,
1914            CapabilityStoreDictionaryInsertResult,
1915        >(
1916            (id, item,),
1917            0x7702183689d44c27,
1918            fidl::encoding::DynamicFlags::FLEXIBLE,
1919            _decode,
1920        )
1921    }
1922
1923    type DictionaryGetResponseFut = fidl::client::QueryResponseFut<
1924        CapabilityStoreDictionaryGetResult,
1925        fidl::encoding::DefaultFuchsiaResourceDialect,
1926    >;
1927    fn r#dictionary_get(
1928        &self,
1929        mut id: u64,
1930        mut key: &str,
1931        mut dest_id: u64,
1932    ) -> Self::DictionaryGetResponseFut {
1933        fn _decode(
1934            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1935        ) -> Result<CapabilityStoreDictionaryGetResult, fidl::Error> {
1936            let _response = fidl::client::decode_transaction_body::<
1937                fidl::encoding::FlexibleResultType<
1938                    fidl::encoding::EmptyStruct,
1939                    CapabilityStoreError,
1940                >,
1941                fidl::encoding::DefaultFuchsiaResourceDialect,
1942                0x4d9e27538284add2,
1943            >(_buf?)?
1944            .into_result::<CapabilityStoreMarker>("dictionary_get")?;
1945            Ok(_response.map(|x| x))
1946        }
1947        self.client.send_query_and_decode::<
1948            CapabilityStoreDictionaryGetRequest,
1949            CapabilityStoreDictionaryGetResult,
1950        >(
1951            (id, key, dest_id,),
1952            0x4d9e27538284add2,
1953            fidl::encoding::DynamicFlags::FLEXIBLE,
1954            _decode,
1955        )
1956    }
1957
1958    type DictionaryRemoveResponseFut = fidl::client::QueryResponseFut<
1959        CapabilityStoreDictionaryRemoveResult,
1960        fidl::encoding::DefaultFuchsiaResourceDialect,
1961    >;
1962    fn r#dictionary_remove(
1963        &self,
1964        mut id: u64,
1965        mut key: &str,
1966        mut dest_id: Option<&WrappedCapabilityId>,
1967    ) -> Self::DictionaryRemoveResponseFut {
1968        fn _decode(
1969            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1970        ) -> Result<CapabilityStoreDictionaryRemoveResult, fidl::Error> {
1971            let _response = fidl::client::decode_transaction_body::<
1972                fidl::encoding::FlexibleResultType<
1973                    fidl::encoding::EmptyStruct,
1974                    CapabilityStoreError,
1975                >,
1976                fidl::encoding::DefaultFuchsiaResourceDialect,
1977                0x4c5c025ab05d4f3,
1978            >(_buf?)?
1979            .into_result::<CapabilityStoreMarker>("dictionary_remove")?;
1980            Ok(_response.map(|x| x))
1981        }
1982        self.client.send_query_and_decode::<
1983            CapabilityStoreDictionaryRemoveRequest,
1984            CapabilityStoreDictionaryRemoveResult,
1985        >(
1986            (id, key, dest_id,),
1987            0x4c5c025ab05d4f3,
1988            fidl::encoding::DynamicFlags::FLEXIBLE,
1989            _decode,
1990        )
1991    }
1992
1993    type DictionaryCopyResponseFut = fidl::client::QueryResponseFut<
1994        CapabilityStoreDictionaryCopyResult,
1995        fidl::encoding::DefaultFuchsiaResourceDialect,
1996    >;
1997    fn r#dictionary_copy(&self, mut id: u64, mut dest_id: u64) -> Self::DictionaryCopyResponseFut {
1998        fn _decode(
1999            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2000        ) -> Result<CapabilityStoreDictionaryCopyResult, fidl::Error> {
2001            let _response = fidl::client::decode_transaction_body::<
2002                fidl::encoding::FlexibleResultType<
2003                    fidl::encoding::EmptyStruct,
2004                    CapabilityStoreError,
2005                >,
2006                fidl::encoding::DefaultFuchsiaResourceDialect,
2007                0x3733ecdf4ea1b44f,
2008            >(_buf?)?
2009            .into_result::<CapabilityStoreMarker>("dictionary_copy")?;
2010            Ok(_response.map(|x| x))
2011        }
2012        self.client.send_query_and_decode::<
2013            CapabilityStoreDictionaryCopyRequest,
2014            CapabilityStoreDictionaryCopyResult,
2015        >(
2016            (id, dest_id,),
2017            0x3733ecdf4ea1b44f,
2018            fidl::encoding::DynamicFlags::FLEXIBLE,
2019            _decode,
2020        )
2021    }
2022
2023    type DictionaryKeysResponseFut = fidl::client::QueryResponseFut<
2024        CapabilityStoreDictionaryKeysResult,
2025        fidl::encoding::DefaultFuchsiaResourceDialect,
2026    >;
2027    fn r#dictionary_keys(
2028        &self,
2029        mut id: u64,
2030        mut iterator: fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>,
2031    ) -> Self::DictionaryKeysResponseFut {
2032        fn _decode(
2033            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2034        ) -> Result<CapabilityStoreDictionaryKeysResult, fidl::Error> {
2035            let _response = fidl::client::decode_transaction_body::<
2036                fidl::encoding::FlexibleResultType<
2037                    fidl::encoding::EmptyStruct,
2038                    CapabilityStoreError,
2039                >,
2040                fidl::encoding::DefaultFuchsiaResourceDialect,
2041                0x84b05577ceaec9e,
2042            >(_buf?)?
2043            .into_result::<CapabilityStoreMarker>("dictionary_keys")?;
2044            Ok(_response.map(|x| x))
2045        }
2046        self.client.send_query_and_decode::<
2047            CapabilityStoreDictionaryKeysRequest,
2048            CapabilityStoreDictionaryKeysResult,
2049        >(
2050            (id, iterator,),
2051            0x84b05577ceaec9e,
2052            fidl::encoding::DynamicFlags::FLEXIBLE,
2053            _decode,
2054        )
2055    }
2056
2057    type DictionaryEnumerateResponseFut = fidl::client::QueryResponseFut<
2058        CapabilityStoreDictionaryEnumerateResult,
2059        fidl::encoding::DefaultFuchsiaResourceDialect,
2060    >;
2061    fn r#dictionary_enumerate(
2062        &self,
2063        mut id: u64,
2064        mut iterator: fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
2065    ) -> Self::DictionaryEnumerateResponseFut {
2066        fn _decode(
2067            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2068        ) -> Result<CapabilityStoreDictionaryEnumerateResult, fidl::Error> {
2069            let _response = fidl::client::decode_transaction_body::<
2070                fidl::encoding::FlexibleResultType<
2071                    fidl::encoding::EmptyStruct,
2072                    CapabilityStoreError,
2073                >,
2074                fidl::encoding::DefaultFuchsiaResourceDialect,
2075                0xd6279b6ced04641,
2076            >(_buf?)?
2077            .into_result::<CapabilityStoreMarker>("dictionary_enumerate")?;
2078            Ok(_response.map(|x| x))
2079        }
2080        self.client.send_query_and_decode::<
2081            CapabilityStoreDictionaryEnumerateRequest,
2082            CapabilityStoreDictionaryEnumerateResult,
2083        >(
2084            (id, iterator,),
2085            0xd6279b6ced04641,
2086            fidl::encoding::DynamicFlags::FLEXIBLE,
2087            _decode,
2088        )
2089    }
2090
2091    type DictionaryDrainResponseFut = fidl::client::QueryResponseFut<
2092        CapabilityStoreDictionaryDrainResult,
2093        fidl::encoding::DefaultFuchsiaResourceDialect,
2094    >;
2095    fn r#dictionary_drain(
2096        &self,
2097        mut id: u64,
2098        mut iterator: Option<fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>>,
2099    ) -> Self::DictionaryDrainResponseFut {
2100        fn _decode(
2101            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2102        ) -> Result<CapabilityStoreDictionaryDrainResult, fidl::Error> {
2103            let _response = fidl::client::decode_transaction_body::<
2104                fidl::encoding::FlexibleResultType<
2105                    fidl::encoding::EmptyStruct,
2106                    CapabilityStoreError,
2107                >,
2108                fidl::encoding::DefaultFuchsiaResourceDialect,
2109                0x28a3a3f84d928cd8,
2110            >(_buf?)?
2111            .into_result::<CapabilityStoreMarker>("dictionary_drain")?;
2112            Ok(_response.map(|x| x))
2113        }
2114        self.client.send_query_and_decode::<
2115            CapabilityStoreDictionaryDrainRequest,
2116            CapabilityStoreDictionaryDrainResult,
2117        >(
2118            (id, iterator,),
2119            0x28a3a3f84d928cd8,
2120            fidl::encoding::DynamicFlags::FLEXIBLE,
2121            _decode,
2122        )
2123    }
2124}
2125
2126pub struct CapabilityStoreEventStream {
2127    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2128}
2129
2130impl std::marker::Unpin for CapabilityStoreEventStream {}
2131
2132impl futures::stream::FusedStream for CapabilityStoreEventStream {
2133    fn is_terminated(&self) -> bool {
2134        self.event_receiver.is_terminated()
2135    }
2136}
2137
2138impl futures::Stream for CapabilityStoreEventStream {
2139    type Item = Result<CapabilityStoreEvent, fidl::Error>;
2140
2141    fn poll_next(
2142        mut self: std::pin::Pin<&mut Self>,
2143        cx: &mut std::task::Context<'_>,
2144    ) -> std::task::Poll<Option<Self::Item>> {
2145        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2146            &mut self.event_receiver,
2147            cx
2148        )?) {
2149            Some(buf) => std::task::Poll::Ready(Some(CapabilityStoreEvent::decode(buf))),
2150            None => std::task::Poll::Ready(None),
2151        }
2152    }
2153}
2154
2155#[derive(Debug)]
2156pub enum CapabilityStoreEvent {
2157    #[non_exhaustive]
2158    _UnknownEvent {
2159        /// Ordinal of the event that was sent.
2160        ordinal: u64,
2161    },
2162}
2163
2164impl CapabilityStoreEvent {
2165    /// Decodes a message buffer as a [`CapabilityStoreEvent`].
2166    fn decode(
2167        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2168    ) -> Result<CapabilityStoreEvent, fidl::Error> {
2169        let (bytes, _handles) = buf.split_mut();
2170        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2171        debug_assert_eq!(tx_header.tx_id, 0);
2172        match tx_header.ordinal {
2173            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2174                Ok(CapabilityStoreEvent::_UnknownEvent { ordinal: tx_header.ordinal })
2175            }
2176            _ => Err(fidl::Error::UnknownOrdinal {
2177                ordinal: tx_header.ordinal,
2178                protocol_name:
2179                    <CapabilityStoreMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2180            }),
2181        }
2182    }
2183}
2184
2185/// A Stream of incoming requests for fuchsia.component.sandbox/CapabilityStore.
2186pub struct CapabilityStoreRequestStream {
2187    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2188    is_terminated: bool,
2189}
2190
2191impl std::marker::Unpin for CapabilityStoreRequestStream {}
2192
2193impl futures::stream::FusedStream for CapabilityStoreRequestStream {
2194    fn is_terminated(&self) -> bool {
2195        self.is_terminated
2196    }
2197}
2198
2199impl fidl::endpoints::RequestStream for CapabilityStoreRequestStream {
2200    type Protocol = CapabilityStoreMarker;
2201    type ControlHandle = CapabilityStoreControlHandle;
2202
2203    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2204        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2205    }
2206
2207    fn control_handle(&self) -> Self::ControlHandle {
2208        CapabilityStoreControlHandle { inner: self.inner.clone() }
2209    }
2210
2211    fn into_inner(
2212        self,
2213    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2214    {
2215        (self.inner, self.is_terminated)
2216    }
2217
2218    fn from_inner(
2219        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2220        is_terminated: bool,
2221    ) -> Self {
2222        Self { inner, is_terminated }
2223    }
2224}
2225
2226impl futures::Stream for CapabilityStoreRequestStream {
2227    type Item = Result<CapabilityStoreRequest, fidl::Error>;
2228
2229    fn poll_next(
2230        mut self: std::pin::Pin<&mut Self>,
2231        cx: &mut std::task::Context<'_>,
2232    ) -> std::task::Poll<Option<Self::Item>> {
2233        let this = &mut *self;
2234        if this.inner.check_shutdown(cx) {
2235            this.is_terminated = true;
2236            return std::task::Poll::Ready(None);
2237        }
2238        if this.is_terminated {
2239            panic!("polled CapabilityStoreRequestStream after completion");
2240        }
2241        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2242            |bytes, handles| {
2243                match this.inner.channel().read_etc(cx, bytes, handles) {
2244                    std::task::Poll::Ready(Ok(())) => {}
2245                    std::task::Poll::Pending => return std::task::Poll::Pending,
2246                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2247                        this.is_terminated = true;
2248                        return std::task::Poll::Ready(None);
2249                    }
2250                    std::task::Poll::Ready(Err(e)) => {
2251                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2252                            e.into(),
2253                        ))));
2254                    }
2255                }
2256
2257                // A message has been received from the channel
2258                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2259
2260                std::task::Poll::Ready(Some(match header.ordinal {
2261                    0x5d5d35d9c20a2184 => {
2262                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2263                        let mut req = fidl::new_empty!(
2264                            CapabilityStoreDuplicateRequest,
2265                            fidl::encoding::DefaultFuchsiaResourceDialect
2266                        );
2267                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDuplicateRequest>(&header, _body_bytes, handles, &mut req)?;
2268                        let control_handle =
2269                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2270                        Ok(CapabilityStoreRequest::Duplicate {
2271                            id: req.id,
2272                            dest_id: req.dest_id,
2273
2274                            responder: CapabilityStoreDuplicateResponder {
2275                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2276                                tx_id: header.tx_id,
2277                            },
2278                        })
2279                    }
2280                    0xa745c0990fc2559 => {
2281                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2282                        let mut req = fidl::new_empty!(
2283                            CapabilityStoreDropRequest,
2284                            fidl::encoding::DefaultFuchsiaResourceDialect
2285                        );
2286                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDropRequest>(&header, _body_bytes, handles, &mut req)?;
2287                        let control_handle =
2288                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2289                        Ok(CapabilityStoreRequest::Drop {
2290                            id: req.id,
2291
2292                            responder: CapabilityStoreDropResponder {
2293                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2294                                tx_id: header.tx_id,
2295                            },
2296                        })
2297                    }
2298                    0x3237a8f4748faff => {
2299                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2300                        let mut req = fidl::new_empty!(
2301                            CapabilityStoreExportRequest,
2302                            fidl::encoding::DefaultFuchsiaResourceDialect
2303                        );
2304                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreExportRequest>(&header, _body_bytes, handles, &mut req)?;
2305                        let control_handle =
2306                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2307                        Ok(CapabilityStoreRequest::Export {
2308                            id: req.id,
2309
2310                            responder: CapabilityStoreExportResponder {
2311                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2312                                tx_id: header.tx_id,
2313                            },
2314                        })
2315                    }
2316                    0x1f96157a29f4539b => {
2317                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2318                        let mut req = fidl::new_empty!(
2319                            CapabilityStoreImportRequest,
2320                            fidl::encoding::DefaultFuchsiaResourceDialect
2321                        );
2322                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreImportRequest>(&header, _body_bytes, handles, &mut req)?;
2323                        let control_handle =
2324                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2325                        Ok(CapabilityStoreRequest::Import {
2326                            id: req.id,
2327                            capability: req.capability,
2328
2329                            responder: CapabilityStoreImportResponder {
2330                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2331                                tx_id: header.tx_id,
2332                            },
2333                        })
2334                    }
2335                    0x29592c5d63e91c25 => {
2336                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2337                        let mut req = fidl::new_empty!(
2338                            CapabilityStoreConnectorCreateRequest,
2339                            fidl::encoding::DefaultFuchsiaResourceDialect
2340                        );
2341                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreConnectorCreateRequest>(&header, _body_bytes, handles, &mut req)?;
2342                        let control_handle =
2343                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2344                        Ok(CapabilityStoreRequest::ConnectorCreate {
2345                            id: req.id,
2346                            receiver: req.receiver,
2347
2348                            responder: CapabilityStoreConnectorCreateResponder {
2349                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2350                                tx_id: header.tx_id,
2351                            },
2352                        })
2353                    }
2354                    0x537e69ab40563b9f => {
2355                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2356                        let mut req = fidl::new_empty!(
2357                            CapabilityStoreConnectorOpenRequest,
2358                            fidl::encoding::DefaultFuchsiaResourceDialect
2359                        );
2360                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreConnectorOpenRequest>(&header, _body_bytes, handles, &mut req)?;
2361                        let control_handle =
2362                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2363                        Ok(CapabilityStoreRequest::ConnectorOpen {
2364                            id: req.id,
2365                            server_end: req.server_end,
2366
2367                            responder: CapabilityStoreConnectorOpenResponder {
2368                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2369                                tx_id: header.tx_id,
2370                            },
2371                        })
2372                    }
2373                    0x186138a11ccf19bb => {
2374                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2375                        let mut req = fidl::new_empty!(
2376                            CapabilityStoreDirConnectorCreateRequest,
2377                            fidl::encoding::DefaultFuchsiaResourceDialect
2378                        );
2379                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDirConnectorCreateRequest>(&header, _body_bytes, handles, &mut req)?;
2380                        let control_handle =
2381                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2382                        Ok(CapabilityStoreRequest::DirConnectorCreate {
2383                            id: req.id,
2384                            receiver: req.receiver,
2385
2386                            responder: CapabilityStoreDirConnectorCreateResponder {
2387                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2388                                tx_id: header.tx_id,
2389                            },
2390                        })
2391                    }
2392                    0x5650d3d6a3a13901 => {
2393                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2394                        let mut req = fidl::new_empty!(
2395                            CapabilityStoreDirConnectorOpenRequest,
2396                            fidl::encoding::DefaultFuchsiaResourceDialect
2397                        );
2398                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDirConnectorOpenRequest>(&header, _body_bytes, handles, &mut req)?;
2399                        let control_handle =
2400                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2401                        Ok(CapabilityStoreRequest::DirConnectorOpen {
2402                            payload: req,
2403                            responder: CapabilityStoreDirConnectorOpenResponder {
2404                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2405                                tx_id: header.tx_id,
2406                            },
2407                        })
2408                    }
2409                    0x6997c8dfc63de093 => {
2410                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2411                        let mut req = fidl::new_empty!(
2412                            CapabilityStoreDictionaryCreateRequest,
2413                            fidl::encoding::DefaultFuchsiaResourceDialect
2414                        );
2415                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryCreateRequest>(&header, _body_bytes, handles, &mut req)?;
2416                        let control_handle =
2417                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2418                        Ok(CapabilityStoreRequest::DictionaryCreate {
2419                            id: req.id,
2420
2421                            responder: CapabilityStoreDictionaryCreateResponder {
2422                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2423                                tx_id: header.tx_id,
2424                            },
2425                        })
2426                    }
2427                    0x72fd686c37b6025f => {
2428                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2429                        let mut req = fidl::new_empty!(
2430                            CapabilityStoreDictionaryLegacyImportRequest,
2431                            fidl::encoding::DefaultFuchsiaResourceDialect
2432                        );
2433                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryLegacyImportRequest>(&header, _body_bytes, handles, &mut req)?;
2434                        let control_handle =
2435                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2436                        Ok(CapabilityStoreRequest::DictionaryLegacyImport {
2437                            id: req.id,
2438                            client_end: req.client_end,
2439
2440                            responder: CapabilityStoreDictionaryLegacyImportResponder {
2441                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2442                                tx_id: header.tx_id,
2443                            },
2444                        })
2445                    }
2446                    0x407e15cc4bde5dcd => {
2447                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2448                        let mut req = fidl::new_empty!(
2449                            CapabilityStoreDictionaryLegacyExportRequest,
2450                            fidl::encoding::DefaultFuchsiaResourceDialect
2451                        );
2452                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryLegacyExportRequest>(&header, _body_bytes, handles, &mut req)?;
2453                        let control_handle =
2454                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2455                        Ok(CapabilityStoreRequest::DictionaryLegacyExport {
2456                            id: req.id,
2457                            server_end: req.server_end,
2458
2459                            responder: CapabilityStoreDictionaryLegacyExportResponder {
2460                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2461                                tx_id: header.tx_id,
2462                            },
2463                        })
2464                    }
2465                    0x7702183689d44c27 => {
2466                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2467                        let mut req = fidl::new_empty!(
2468                            CapabilityStoreDictionaryInsertRequest,
2469                            fidl::encoding::DefaultFuchsiaResourceDialect
2470                        );
2471                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryInsertRequest>(&header, _body_bytes, handles, &mut req)?;
2472                        let control_handle =
2473                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2474                        Ok(CapabilityStoreRequest::DictionaryInsert {
2475                            id: req.id,
2476                            item: req.item,
2477
2478                            responder: CapabilityStoreDictionaryInsertResponder {
2479                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2480                                tx_id: header.tx_id,
2481                            },
2482                        })
2483                    }
2484                    0x4d9e27538284add2 => {
2485                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2486                        let mut req = fidl::new_empty!(
2487                            CapabilityStoreDictionaryGetRequest,
2488                            fidl::encoding::DefaultFuchsiaResourceDialect
2489                        );
2490                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryGetRequest>(&header, _body_bytes, handles, &mut req)?;
2491                        let control_handle =
2492                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2493                        Ok(CapabilityStoreRequest::DictionaryGet {
2494                            id: req.id,
2495                            key: req.key,
2496                            dest_id: req.dest_id,
2497
2498                            responder: CapabilityStoreDictionaryGetResponder {
2499                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2500                                tx_id: header.tx_id,
2501                            },
2502                        })
2503                    }
2504                    0x4c5c025ab05d4f3 => {
2505                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2506                        let mut req = fidl::new_empty!(
2507                            CapabilityStoreDictionaryRemoveRequest,
2508                            fidl::encoding::DefaultFuchsiaResourceDialect
2509                        );
2510                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryRemoveRequest>(&header, _body_bytes, handles, &mut req)?;
2511                        let control_handle =
2512                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2513                        Ok(CapabilityStoreRequest::DictionaryRemove {
2514                            id: req.id,
2515                            key: req.key,
2516                            dest_id: req.dest_id,
2517
2518                            responder: CapabilityStoreDictionaryRemoveResponder {
2519                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2520                                tx_id: header.tx_id,
2521                            },
2522                        })
2523                    }
2524                    0x3733ecdf4ea1b44f => {
2525                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2526                        let mut req = fidl::new_empty!(
2527                            CapabilityStoreDictionaryCopyRequest,
2528                            fidl::encoding::DefaultFuchsiaResourceDialect
2529                        );
2530                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryCopyRequest>(&header, _body_bytes, handles, &mut req)?;
2531                        let control_handle =
2532                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2533                        Ok(CapabilityStoreRequest::DictionaryCopy {
2534                            id: req.id,
2535                            dest_id: req.dest_id,
2536
2537                            responder: CapabilityStoreDictionaryCopyResponder {
2538                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2539                                tx_id: header.tx_id,
2540                            },
2541                        })
2542                    }
2543                    0x84b05577ceaec9e => {
2544                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2545                        let mut req = fidl::new_empty!(
2546                            CapabilityStoreDictionaryKeysRequest,
2547                            fidl::encoding::DefaultFuchsiaResourceDialect
2548                        );
2549                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryKeysRequest>(&header, _body_bytes, handles, &mut req)?;
2550                        let control_handle =
2551                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2552                        Ok(CapabilityStoreRequest::DictionaryKeys {
2553                            id: req.id,
2554                            iterator: req.iterator,
2555
2556                            responder: CapabilityStoreDictionaryKeysResponder {
2557                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2558                                tx_id: header.tx_id,
2559                            },
2560                        })
2561                    }
2562                    0xd6279b6ced04641 => {
2563                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2564                        let mut req = fidl::new_empty!(
2565                            CapabilityStoreDictionaryEnumerateRequest,
2566                            fidl::encoding::DefaultFuchsiaResourceDialect
2567                        );
2568                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryEnumerateRequest>(&header, _body_bytes, handles, &mut req)?;
2569                        let control_handle =
2570                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2571                        Ok(CapabilityStoreRequest::DictionaryEnumerate {
2572                            id: req.id,
2573                            iterator: req.iterator,
2574
2575                            responder: CapabilityStoreDictionaryEnumerateResponder {
2576                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2577                                tx_id: header.tx_id,
2578                            },
2579                        })
2580                    }
2581                    0x28a3a3f84d928cd8 => {
2582                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2583                        let mut req = fidl::new_empty!(
2584                            CapabilityStoreDictionaryDrainRequest,
2585                            fidl::encoding::DefaultFuchsiaResourceDialect
2586                        );
2587                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryDrainRequest>(&header, _body_bytes, handles, &mut req)?;
2588                        let control_handle =
2589                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2590                        Ok(CapabilityStoreRequest::DictionaryDrain {
2591                            id: req.id,
2592                            iterator: req.iterator,
2593
2594                            responder: CapabilityStoreDictionaryDrainResponder {
2595                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2596                                tx_id: header.tx_id,
2597                            },
2598                        })
2599                    }
2600                    _ if header.tx_id == 0
2601                        && header
2602                            .dynamic_flags()
2603                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2604                    {
2605                        Ok(CapabilityStoreRequest::_UnknownMethod {
2606                            ordinal: header.ordinal,
2607                            control_handle: CapabilityStoreControlHandle {
2608                                inner: this.inner.clone(),
2609                            },
2610                            method_type: fidl::MethodType::OneWay,
2611                        })
2612                    }
2613                    _ if header
2614                        .dynamic_flags()
2615                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2616                    {
2617                        this.inner.send_framework_err(
2618                            fidl::encoding::FrameworkErr::UnknownMethod,
2619                            header.tx_id,
2620                            header.ordinal,
2621                            header.dynamic_flags(),
2622                            (bytes, handles),
2623                        )?;
2624                        Ok(CapabilityStoreRequest::_UnknownMethod {
2625                            ordinal: header.ordinal,
2626                            control_handle: CapabilityStoreControlHandle {
2627                                inner: this.inner.clone(),
2628                            },
2629                            method_type: fidl::MethodType::TwoWay,
2630                        })
2631                    }
2632                    _ => Err(fidl::Error::UnknownOrdinal {
2633                        ordinal: header.ordinal,
2634                        protocol_name:
2635                            <CapabilityStoreMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2636                    }),
2637                }))
2638            },
2639        )
2640    }
2641}
2642
2643/// Protocol that represents the concept of a "capability store", a repository
2644/// for [Capability]s that are held by the component framework runtime.
2645///
2646/// [CapabilityStore] serves as the main bridge between the component runtime and clients
2647/// that enables them to operate on and exchange [Capability]s. A [CapabilityStore] instance
2648/// contains a set of [Capability]s, each of which has a [CapabilityId] assigned by the client.
2649///
2650/// Normally, a program would not exchange a [CapabilityStore] or [CapabilityId] with other
2651/// programs -- a [CapabilityStore] connection and its enclosed capabilities are intended to
2652/// be "local" to a program. Instead, if a program wishes to exchange a [Capability] with other
2653/// programs, it should [Export] the [Capability] out of the store, send the [Capability] to the
2654/// target program, which can then [Import] the capability into its own store.
2655///
2656/// [CapabilityStore] is also used to manage capability lifetimes. The lifetime of a capability is
2657/// scoped to the [CapabilityStore] in which it resides; i.e. to drop the [CapabilityStore]
2658/// connections to release the capabilities instead it. In addition, [CapabilityStore] supports a
2659/// [Drop] API to drop an individual [Capability] reference. (Note that it is possible for a
2660/// some capabilities, like [DictionaryRef], to have multiple references, in which case all of
2661/// the references must be dropped for the underlying resource to be released.)
2662///
2663/// A note about semantics: the [CapabilityStore] APIs do not return [CapabilityId]s, because
2664/// [CapabilityId]s are assigned by the client. Instead, when a method would semantically return
2665/// a capability, this is expressed by taking the destination [CapabilityId] as an output parameter.
2666#[derive(Debug)]
2667pub enum CapabilityStoreRequest {
2668    /// Duplicates the capability with `id` to `dest_id`.
2669    ///
2670    /// Errors:
2671    ///
2672    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2673    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
2674    /// - `NOT_DUPLICATABLE` if `id` could not be duplicated.
2675    Duplicate { id: u64, dest_id: u64, responder: CapabilityStoreDuplicateResponder },
2676    /// Drops the capability with `id` from this [`CapabilityStore`].
2677    ///
2678    /// Errors:
2679    ///
2680    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2681    Drop { id: u64, responder: CapabilityStoreDropResponder },
2682    /// Exports the capability with the client-assigned identifier `id` to
2683    /// `capability`. This operation removes the capability from the store. If
2684    /// this is not desired, [Duplicate] the capability first.
2685    ///
2686    /// Errors:
2687    ///
2688    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2689    Export { id: u64, responder: CapabilityStoreExportResponder },
2690    /// Imports `capability` into this store with the client-assigned `id`.
2691    ///
2692    /// Errors:
2693    ///
2694    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
2695    /// - `BAD_CAPABILITY` if `capability` was not a valid [Capability].
2696    Import { id: u64, capability: Capability, responder: CapabilityStoreImportResponder },
2697    /// Creates a [Connector] from a [Receiver]. Incoming connections to the [Connector] will be
2698    /// dispatched to this [Receiver].
2699    ///
2700    /// Errors:
2701    ///
2702    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
2703    ConnectorCreate {
2704        id: u64,
2705        receiver: fidl::endpoints::ClientEnd<ReceiverMarker>,
2706        responder: CapabilityStoreConnectorCreateResponder,
2707    },
2708    /// Open a connection from the provided [Connector] capability that will be dispatched to
2709    /// the [Receiver] on the other end.
2710    ///
2711    /// If there is an error, it will be reported as a zx.Status epitaph on `server_end`.
2712    ///
2713    /// Errors:
2714    ///
2715    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2716    /// - `WRONG_TYPE` if `id` was not a connector capability.
2717    ConnectorOpen {
2718        id: u64,
2719        server_end: fidl::Channel,
2720        responder: CapabilityStoreConnectorOpenResponder,
2721    },
2722    /// Creates a [DirConnector] from a [DirReceiver]. Incoming connections to the [DirConnector]
2723    /// will be dispatched to this [DirReceiver].
2724    ///
2725    /// Errors:
2726    ///
2727    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
2728    DirConnectorCreate {
2729        id: u64,
2730        receiver: fidl::endpoints::ClientEnd<DirReceiverMarker>,
2731        responder: CapabilityStoreDirConnectorCreateResponder,
2732    },
2733    /// Open a connection from the provided [DirConnector] capability that will
2734    /// be dispatched to the [DirReceiver] on the other end. The `id` and
2735    /// `server_end` arguments are required, and the `flags` and `path`
2736    /// arguments are optional (a path of `.` will be used if one is not
2737    /// otherwise set).
2738    ///
2739    /// If there was an error making the connection, it will be reported as a zx.Status
2740    /// epitaph on `server_end`.
2741    ///
2742    /// Errors:
2743    ///
2744    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2745    /// - `WRONG_TYPE` if `id` was not a connector capability.
2746    DirConnectorOpen {
2747        payload: CapabilityStoreDirConnectorOpenRequest,
2748        responder: CapabilityStoreDirConnectorOpenResponder,
2749    },
2750    /// Creates a new empty dictionary in this [`CapabilityStore`] with client-assigned `id`.
2751    ///
2752    /// Errors:
2753    ///
2754    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
2755    DictionaryCreate { id: u64, responder: CapabilityStoreDictionaryCreateResponder },
2756    /// Imports a dictionary in the form of a channel.
2757    ///
2758    /// This is a legacy API to support backward compatibility with APIs that take a [Dictionary]
2759    /// channel.
2760    ///
2761    /// Errors:
2762    ///
2763    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
2764    /// - `BAD_CAPABILITY` if `client_end` was not a valid dictionary channel.
2765    DictionaryLegacyImport {
2766        id: u64,
2767        client_end: fidl::Channel,
2768        responder: CapabilityStoreDictionaryLegacyImportResponder,
2769    },
2770    /// Binds a channel to the dictionary with `id`. The channel can
2771    /// be re-imported into a [CapabilityStore] with [DictionaryImportLegacy].
2772    ///
2773    /// This is a legacy API to support backward compatibility with APIs that take a [Dictionary]
2774    /// channel.
2775    ///
2776    /// Errors:
2777    ///
2778    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2779    DictionaryLegacyExport {
2780        id: u64,
2781        server_end: fidl::Channel,
2782        responder: CapabilityStoreDictionaryLegacyExportResponder,
2783    },
2784    /// Inserts `item` into the dictionary with `id`. `item.value` is moved into the dictionary and
2785    /// its id is released if this call succeeds.
2786    ///
2787    /// Errors:
2788    ///
2789    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2790    /// - `WRONG_TYPE` if `id` was not a dictionary.
2791    /// - `INVALID_KEY` if `item.key` was invalid.
2792    /// - `ITEM_ALREADY_EXISTS` if the dictionary already contains an item with `item.key`.
2793    DictionaryInsert {
2794        id: u64,
2795        item: DictionaryItem,
2796        responder: CapabilityStoreDictionaryInsertResponder,
2797    },
2798    /// Get a duplicate of a capability from the dictionary with `id`, which is
2799    /// loaded into `dest_id`.
2800    ///
2801    /// Errors:
2802    ///
2803    /// - `ID_NOT_FOUND` if `id` was not a recognized capability id in this store.
2804    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
2805    /// - `WRONG_TYPE` if `id` was not a dictionary.
2806    /// - `INVALID_KEY` if `item.key` was invalid.
2807    /// - `ITEM_NOT_FOUND` if the dictionary does not contain `key`.
2808    /// - `NOT_DUPLICATABLE` if the capability could not be duplicated.
2809    DictionaryGet {
2810        id: u64,
2811        key: String,
2812        dest_id: u64,
2813        responder: CapabilityStoreDictionaryGetResponder,
2814    },
2815    /// Removes a key from the dictionary with `id`. If `dest_id` is present, loads the value
2816    /// into it, otherwise discards the value.
2817    ///
2818    /// Errors:
2819    ///
2820    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2821    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
2822    /// - `WRONG_TYPE` if `id` was not a dictionary.
2823    /// - `INVALID_KEY` if `key` was invalid.
2824    /// - `ITEM_NOT_FOUND` if the dictionary does not contain the key.
2825    DictionaryRemove {
2826        id: u64,
2827        key: String,
2828        dest_id: Option<Box<WrappedCapabilityId>>,
2829        responder: CapabilityStoreDictionaryRemoveResponder,
2830    },
2831    /// Create a new dictionary that contains a duplicate of all the entries in
2832    /// the dictionary with `id`, assigning `dest_id` to the new dictionary.
2833    /// The runtime of this method is linear in the number of top-level entries
2834    /// in the dictionary.
2835    ///
2836    /// For example, if the dictionary contains nested dictionaries, the newly
2837    /// created dictionary will contain references to those same nested
2838    /// dictionaries because the entries are duplicated rather than deep-copied.
2839    ///
2840    /// Errors:
2841    ///
2842    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2843    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
2844    /// - `WRONG_TYPE` if `id` was not a dictionary.
2845    /// - `NOT_DUPLICATABLE` if one of the capabilities in `id` could not be duplicated.
2846    DictionaryCopy { id: u64, dest_id: u64, responder: CapabilityStoreDictionaryCopyResponder },
2847    /// Enumerates the keys in the dictionary with `id`.
2848    ///
2849    /// Errors:
2850    ///
2851    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2852    /// - `WRONG_TYPE` if `id` was not a dictionary.
2853    DictionaryKeys {
2854        id: u64,
2855        iterator: fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>,
2856        responder: CapabilityStoreDictionaryKeysResponder,
2857    },
2858    /// Enumerates the items (keys and values) in the dictionary with `id`.
2859    ///
2860    /// Creates a duplicate of each value (capability). If a value could not be duplicated,
2861    /// the value will be null.
2862    ///
2863    /// Errors:
2864    ///
2865    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2866    /// - `WRONG_TYPE` if `id` was not a dictionary.
2867    DictionaryEnumerate {
2868        id: u64,
2869        iterator: fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
2870        responder: CapabilityStoreDictionaryEnumerateResponder,
2871    },
2872    /// Removes all the entries in this dictionary, returning them in `contents` if provided.
2873    /// If `contents` is not provided, all the items are discarded without enumerating them.
2874    ///
2875    /// Errors:
2876    ///
2877    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2878    /// - `WRONG_TYPE` if `id` was not a dictionary.
2879    DictionaryDrain {
2880        id: u64,
2881        iterator: Option<fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>>,
2882        responder: CapabilityStoreDictionaryDrainResponder,
2883    },
2884    /// An interaction was received which does not match any known method.
2885    #[non_exhaustive]
2886    _UnknownMethod {
2887        /// Ordinal of the method that was called.
2888        ordinal: u64,
2889        control_handle: CapabilityStoreControlHandle,
2890        method_type: fidl::MethodType,
2891    },
2892}
2893
2894impl CapabilityStoreRequest {
2895    #[allow(irrefutable_let_patterns)]
2896    pub fn into_duplicate(self) -> Option<(u64, u64, CapabilityStoreDuplicateResponder)> {
2897        if let CapabilityStoreRequest::Duplicate { id, dest_id, responder } = self {
2898            Some((id, dest_id, responder))
2899        } else {
2900            None
2901        }
2902    }
2903
2904    #[allow(irrefutable_let_patterns)]
2905    pub fn into_drop(self) -> Option<(u64, CapabilityStoreDropResponder)> {
2906        if let CapabilityStoreRequest::Drop { id, responder } = self {
2907            Some((id, responder))
2908        } else {
2909            None
2910        }
2911    }
2912
2913    #[allow(irrefutable_let_patterns)]
2914    pub fn into_export(self) -> Option<(u64, CapabilityStoreExportResponder)> {
2915        if let CapabilityStoreRequest::Export { id, responder } = self {
2916            Some((id, responder))
2917        } else {
2918            None
2919        }
2920    }
2921
2922    #[allow(irrefutable_let_patterns)]
2923    pub fn into_import(self) -> Option<(u64, Capability, CapabilityStoreImportResponder)> {
2924        if let CapabilityStoreRequest::Import { id, capability, responder } = self {
2925            Some((id, capability, responder))
2926        } else {
2927            None
2928        }
2929    }
2930
2931    #[allow(irrefutable_let_patterns)]
2932    pub fn into_connector_create(
2933        self,
2934    ) -> Option<(
2935        u64,
2936        fidl::endpoints::ClientEnd<ReceiverMarker>,
2937        CapabilityStoreConnectorCreateResponder,
2938    )> {
2939        if let CapabilityStoreRequest::ConnectorCreate { id, receiver, responder } = self {
2940            Some((id, receiver, responder))
2941        } else {
2942            None
2943        }
2944    }
2945
2946    #[allow(irrefutable_let_patterns)]
2947    pub fn into_connector_open(
2948        self,
2949    ) -> Option<(u64, fidl::Channel, CapabilityStoreConnectorOpenResponder)> {
2950        if let CapabilityStoreRequest::ConnectorOpen { id, server_end, responder } = self {
2951            Some((id, server_end, responder))
2952        } else {
2953            None
2954        }
2955    }
2956
2957    #[allow(irrefutable_let_patterns)]
2958    pub fn into_dir_connector_create(
2959        self,
2960    ) -> Option<(
2961        u64,
2962        fidl::endpoints::ClientEnd<DirReceiverMarker>,
2963        CapabilityStoreDirConnectorCreateResponder,
2964    )> {
2965        if let CapabilityStoreRequest::DirConnectorCreate { id, receiver, responder } = self {
2966            Some((id, receiver, responder))
2967        } else {
2968            None
2969        }
2970    }
2971
2972    #[allow(irrefutable_let_patterns)]
2973    pub fn into_dir_connector_open(
2974        self,
2975    ) -> Option<(CapabilityStoreDirConnectorOpenRequest, CapabilityStoreDirConnectorOpenResponder)>
2976    {
2977        if let CapabilityStoreRequest::DirConnectorOpen { payload, responder } = self {
2978            Some((payload, responder))
2979        } else {
2980            None
2981        }
2982    }
2983
2984    #[allow(irrefutable_let_patterns)]
2985    pub fn into_dictionary_create(self) -> Option<(u64, CapabilityStoreDictionaryCreateResponder)> {
2986        if let CapabilityStoreRequest::DictionaryCreate { id, responder } = self {
2987            Some((id, responder))
2988        } else {
2989            None
2990        }
2991    }
2992
2993    #[allow(irrefutable_let_patterns)]
2994    pub fn into_dictionary_legacy_import(
2995        self,
2996    ) -> Option<(u64, fidl::Channel, CapabilityStoreDictionaryLegacyImportResponder)> {
2997        if let CapabilityStoreRequest::DictionaryLegacyImport { id, client_end, responder } = self {
2998            Some((id, client_end, responder))
2999        } else {
3000            None
3001        }
3002    }
3003
3004    #[allow(irrefutable_let_patterns)]
3005    pub fn into_dictionary_legacy_export(
3006        self,
3007    ) -> Option<(u64, fidl::Channel, CapabilityStoreDictionaryLegacyExportResponder)> {
3008        if let CapabilityStoreRequest::DictionaryLegacyExport { id, server_end, responder } = self {
3009            Some((id, server_end, responder))
3010        } else {
3011            None
3012        }
3013    }
3014
3015    #[allow(irrefutable_let_patterns)]
3016    pub fn into_dictionary_insert(
3017        self,
3018    ) -> Option<(u64, DictionaryItem, CapabilityStoreDictionaryInsertResponder)> {
3019        if let CapabilityStoreRequest::DictionaryInsert { id, item, responder } = self {
3020            Some((id, item, responder))
3021        } else {
3022            None
3023        }
3024    }
3025
3026    #[allow(irrefutable_let_patterns)]
3027    pub fn into_dictionary_get(
3028        self,
3029    ) -> Option<(u64, String, u64, CapabilityStoreDictionaryGetResponder)> {
3030        if let CapabilityStoreRequest::DictionaryGet { id, key, dest_id, responder } = self {
3031            Some((id, key, dest_id, responder))
3032        } else {
3033            None
3034        }
3035    }
3036
3037    #[allow(irrefutable_let_patterns)]
3038    pub fn into_dictionary_remove(
3039        self,
3040    ) -> Option<(
3041        u64,
3042        String,
3043        Option<Box<WrappedCapabilityId>>,
3044        CapabilityStoreDictionaryRemoveResponder,
3045    )> {
3046        if let CapabilityStoreRequest::DictionaryRemove { id, key, dest_id, responder } = self {
3047            Some((id, key, dest_id, responder))
3048        } else {
3049            None
3050        }
3051    }
3052
3053    #[allow(irrefutable_let_patterns)]
3054    pub fn into_dictionary_copy(
3055        self,
3056    ) -> Option<(u64, u64, CapabilityStoreDictionaryCopyResponder)> {
3057        if let CapabilityStoreRequest::DictionaryCopy { id, dest_id, responder } = self {
3058            Some((id, dest_id, responder))
3059        } else {
3060            None
3061        }
3062    }
3063
3064    #[allow(irrefutable_let_patterns)]
3065    pub fn into_dictionary_keys(
3066        self,
3067    ) -> Option<(
3068        u64,
3069        fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>,
3070        CapabilityStoreDictionaryKeysResponder,
3071    )> {
3072        if let CapabilityStoreRequest::DictionaryKeys { id, iterator, responder } = self {
3073            Some((id, iterator, responder))
3074        } else {
3075            None
3076        }
3077    }
3078
3079    #[allow(irrefutable_let_patterns)]
3080    pub fn into_dictionary_enumerate(
3081        self,
3082    ) -> Option<(
3083        u64,
3084        fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
3085        CapabilityStoreDictionaryEnumerateResponder,
3086    )> {
3087        if let CapabilityStoreRequest::DictionaryEnumerate { id, iterator, responder } = self {
3088            Some((id, iterator, responder))
3089        } else {
3090            None
3091        }
3092    }
3093
3094    #[allow(irrefutable_let_patterns)]
3095    pub fn into_dictionary_drain(
3096        self,
3097    ) -> Option<(
3098        u64,
3099        Option<fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>>,
3100        CapabilityStoreDictionaryDrainResponder,
3101    )> {
3102        if let CapabilityStoreRequest::DictionaryDrain { id, iterator, responder } = self {
3103            Some((id, iterator, responder))
3104        } else {
3105            None
3106        }
3107    }
3108
3109    /// Name of the method defined in FIDL
3110    pub fn method_name(&self) -> &'static str {
3111        match *self {
3112            CapabilityStoreRequest::Duplicate { .. } => "duplicate",
3113            CapabilityStoreRequest::Drop { .. } => "drop",
3114            CapabilityStoreRequest::Export { .. } => "export",
3115            CapabilityStoreRequest::Import { .. } => "import",
3116            CapabilityStoreRequest::ConnectorCreate { .. } => "connector_create",
3117            CapabilityStoreRequest::ConnectorOpen { .. } => "connector_open",
3118            CapabilityStoreRequest::DirConnectorCreate { .. } => "dir_connector_create",
3119            CapabilityStoreRequest::DirConnectorOpen { .. } => "dir_connector_open",
3120            CapabilityStoreRequest::DictionaryCreate { .. } => "dictionary_create",
3121            CapabilityStoreRequest::DictionaryLegacyImport { .. } => "dictionary_legacy_import",
3122            CapabilityStoreRequest::DictionaryLegacyExport { .. } => "dictionary_legacy_export",
3123            CapabilityStoreRequest::DictionaryInsert { .. } => "dictionary_insert",
3124            CapabilityStoreRequest::DictionaryGet { .. } => "dictionary_get",
3125            CapabilityStoreRequest::DictionaryRemove { .. } => "dictionary_remove",
3126            CapabilityStoreRequest::DictionaryCopy { .. } => "dictionary_copy",
3127            CapabilityStoreRequest::DictionaryKeys { .. } => "dictionary_keys",
3128            CapabilityStoreRequest::DictionaryEnumerate { .. } => "dictionary_enumerate",
3129            CapabilityStoreRequest::DictionaryDrain { .. } => "dictionary_drain",
3130            CapabilityStoreRequest::_UnknownMethod {
3131                method_type: fidl::MethodType::OneWay,
3132                ..
3133            } => "unknown one-way method",
3134            CapabilityStoreRequest::_UnknownMethod {
3135                method_type: fidl::MethodType::TwoWay,
3136                ..
3137            } => "unknown two-way method",
3138        }
3139    }
3140}
3141
3142#[derive(Debug, Clone)]
3143pub struct CapabilityStoreControlHandle {
3144    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3145}
3146
3147impl fidl::endpoints::ControlHandle for CapabilityStoreControlHandle {
3148    fn shutdown(&self) {
3149        self.inner.shutdown()
3150    }
3151    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3152        self.inner.shutdown_with_epitaph(status)
3153    }
3154
3155    fn is_closed(&self) -> bool {
3156        self.inner.channel().is_closed()
3157    }
3158    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3159        self.inner.channel().on_closed()
3160    }
3161
3162    #[cfg(target_os = "fuchsia")]
3163    fn signal_peer(
3164        &self,
3165        clear_mask: zx::Signals,
3166        set_mask: zx::Signals,
3167    ) -> Result<(), zx_status::Status> {
3168        use fidl::Peered;
3169        self.inner.channel().signal_peer(clear_mask, set_mask)
3170    }
3171}
3172
3173impl CapabilityStoreControlHandle {}
3174
3175#[must_use = "FIDL methods require a response to be sent"]
3176#[derive(Debug)]
3177pub struct CapabilityStoreDuplicateResponder {
3178    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3179    tx_id: u32,
3180}
3181
3182/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3183/// if the responder is dropped without sending a response, so that the client
3184/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3185impl std::ops::Drop for CapabilityStoreDuplicateResponder {
3186    fn drop(&mut self) {
3187        self.control_handle.shutdown();
3188        // Safety: drops once, never accessed again
3189        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3190    }
3191}
3192
3193impl fidl::endpoints::Responder for CapabilityStoreDuplicateResponder {
3194    type ControlHandle = CapabilityStoreControlHandle;
3195
3196    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3197        &self.control_handle
3198    }
3199
3200    fn drop_without_shutdown(mut self) {
3201        // Safety: drops once, never accessed again due to mem::forget
3202        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3203        // Prevent Drop from running (which would shut down the channel)
3204        std::mem::forget(self);
3205    }
3206}
3207
3208impl CapabilityStoreDuplicateResponder {
3209    /// Sends a response to the FIDL transaction.
3210    ///
3211    /// Sets the channel to shutdown if an error occurs.
3212    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3213        let _result = self.send_raw(result);
3214        if _result.is_err() {
3215            self.control_handle.shutdown();
3216        }
3217        self.drop_without_shutdown();
3218        _result
3219    }
3220
3221    /// Similar to "send" but does not shutdown the channel if an error occurs.
3222    pub fn send_no_shutdown_on_err(
3223        self,
3224        mut result: Result<(), CapabilityStoreError>,
3225    ) -> Result<(), fidl::Error> {
3226        let _result = self.send_raw(result);
3227        self.drop_without_shutdown();
3228        _result
3229    }
3230
3231    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3232        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3233            fidl::encoding::EmptyStruct,
3234            CapabilityStoreError,
3235        >>(
3236            fidl::encoding::FlexibleResult::new(result),
3237            self.tx_id,
3238            0x5d5d35d9c20a2184,
3239            fidl::encoding::DynamicFlags::FLEXIBLE,
3240        )
3241    }
3242}
3243
3244#[must_use = "FIDL methods require a response to be sent"]
3245#[derive(Debug)]
3246pub struct CapabilityStoreDropResponder {
3247    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3248    tx_id: u32,
3249}
3250
3251/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3252/// if the responder is dropped without sending a response, so that the client
3253/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3254impl std::ops::Drop for CapabilityStoreDropResponder {
3255    fn drop(&mut self) {
3256        self.control_handle.shutdown();
3257        // Safety: drops once, never accessed again
3258        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3259    }
3260}
3261
3262impl fidl::endpoints::Responder for CapabilityStoreDropResponder {
3263    type ControlHandle = CapabilityStoreControlHandle;
3264
3265    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3266        &self.control_handle
3267    }
3268
3269    fn drop_without_shutdown(mut self) {
3270        // Safety: drops once, never accessed again due to mem::forget
3271        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3272        // Prevent Drop from running (which would shut down the channel)
3273        std::mem::forget(self);
3274    }
3275}
3276
3277impl CapabilityStoreDropResponder {
3278    /// Sends a response to the FIDL transaction.
3279    ///
3280    /// Sets the channel to shutdown if an error occurs.
3281    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3282        let _result = self.send_raw(result);
3283        if _result.is_err() {
3284            self.control_handle.shutdown();
3285        }
3286        self.drop_without_shutdown();
3287        _result
3288    }
3289
3290    /// Similar to "send" but does not shutdown the channel if an error occurs.
3291    pub fn send_no_shutdown_on_err(
3292        self,
3293        mut result: Result<(), CapabilityStoreError>,
3294    ) -> Result<(), fidl::Error> {
3295        let _result = self.send_raw(result);
3296        self.drop_without_shutdown();
3297        _result
3298    }
3299
3300    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3301        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3302            fidl::encoding::EmptyStruct,
3303            CapabilityStoreError,
3304        >>(
3305            fidl::encoding::FlexibleResult::new(result),
3306            self.tx_id,
3307            0xa745c0990fc2559,
3308            fidl::encoding::DynamicFlags::FLEXIBLE,
3309        )
3310    }
3311}
3312
3313#[must_use = "FIDL methods require a response to be sent"]
3314#[derive(Debug)]
3315pub struct CapabilityStoreExportResponder {
3316    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3317    tx_id: u32,
3318}
3319
3320/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3321/// if the responder is dropped without sending a response, so that the client
3322/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3323impl std::ops::Drop for CapabilityStoreExportResponder {
3324    fn drop(&mut self) {
3325        self.control_handle.shutdown();
3326        // Safety: drops once, never accessed again
3327        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3328    }
3329}
3330
3331impl fidl::endpoints::Responder for CapabilityStoreExportResponder {
3332    type ControlHandle = CapabilityStoreControlHandle;
3333
3334    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3335        &self.control_handle
3336    }
3337
3338    fn drop_without_shutdown(mut self) {
3339        // Safety: drops once, never accessed again due to mem::forget
3340        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3341        // Prevent Drop from running (which would shut down the channel)
3342        std::mem::forget(self);
3343    }
3344}
3345
3346impl CapabilityStoreExportResponder {
3347    /// Sends a response to the FIDL transaction.
3348    ///
3349    /// Sets the channel to shutdown if an error occurs.
3350    pub fn send(
3351        self,
3352        mut result: Result<Capability, CapabilityStoreError>,
3353    ) -> Result<(), fidl::Error> {
3354        let _result = self.send_raw(result);
3355        if _result.is_err() {
3356            self.control_handle.shutdown();
3357        }
3358        self.drop_without_shutdown();
3359        _result
3360    }
3361
3362    /// Similar to "send" but does not shutdown the channel if an error occurs.
3363    pub fn send_no_shutdown_on_err(
3364        self,
3365        mut result: Result<Capability, CapabilityStoreError>,
3366    ) -> Result<(), fidl::Error> {
3367        let _result = self.send_raw(result);
3368        self.drop_without_shutdown();
3369        _result
3370    }
3371
3372    fn send_raw(
3373        &self,
3374        mut result: Result<Capability, CapabilityStoreError>,
3375    ) -> Result<(), fidl::Error> {
3376        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3377            CapabilityStoreExportResponse,
3378            CapabilityStoreError,
3379        >>(
3380            fidl::encoding::FlexibleResult::new(
3381                result.as_mut().map_err(|e| *e).map(|capability| (capability,)),
3382            ),
3383            self.tx_id,
3384            0x3237a8f4748faff,
3385            fidl::encoding::DynamicFlags::FLEXIBLE,
3386        )
3387    }
3388}
3389
3390#[must_use = "FIDL methods require a response to be sent"]
3391#[derive(Debug)]
3392pub struct CapabilityStoreImportResponder {
3393    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3394    tx_id: u32,
3395}
3396
3397/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3398/// if the responder is dropped without sending a response, so that the client
3399/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3400impl std::ops::Drop for CapabilityStoreImportResponder {
3401    fn drop(&mut self) {
3402        self.control_handle.shutdown();
3403        // Safety: drops once, never accessed again
3404        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3405    }
3406}
3407
3408impl fidl::endpoints::Responder for CapabilityStoreImportResponder {
3409    type ControlHandle = CapabilityStoreControlHandle;
3410
3411    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3412        &self.control_handle
3413    }
3414
3415    fn drop_without_shutdown(mut self) {
3416        // Safety: drops once, never accessed again due to mem::forget
3417        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3418        // Prevent Drop from running (which would shut down the channel)
3419        std::mem::forget(self);
3420    }
3421}
3422
3423impl CapabilityStoreImportResponder {
3424    /// Sends a response to the FIDL transaction.
3425    ///
3426    /// Sets the channel to shutdown if an error occurs.
3427    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3428        let _result = self.send_raw(result);
3429        if _result.is_err() {
3430            self.control_handle.shutdown();
3431        }
3432        self.drop_without_shutdown();
3433        _result
3434    }
3435
3436    /// Similar to "send" but does not shutdown the channel if an error occurs.
3437    pub fn send_no_shutdown_on_err(
3438        self,
3439        mut result: Result<(), CapabilityStoreError>,
3440    ) -> Result<(), fidl::Error> {
3441        let _result = self.send_raw(result);
3442        self.drop_without_shutdown();
3443        _result
3444    }
3445
3446    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3447        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3448            fidl::encoding::EmptyStruct,
3449            CapabilityStoreError,
3450        >>(
3451            fidl::encoding::FlexibleResult::new(result),
3452            self.tx_id,
3453            0x1f96157a29f4539b,
3454            fidl::encoding::DynamicFlags::FLEXIBLE,
3455        )
3456    }
3457}
3458
3459#[must_use = "FIDL methods require a response to be sent"]
3460#[derive(Debug)]
3461pub struct CapabilityStoreConnectorCreateResponder {
3462    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3463    tx_id: u32,
3464}
3465
3466/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3467/// if the responder is dropped without sending a response, so that the client
3468/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3469impl std::ops::Drop for CapabilityStoreConnectorCreateResponder {
3470    fn drop(&mut self) {
3471        self.control_handle.shutdown();
3472        // Safety: drops once, never accessed again
3473        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3474    }
3475}
3476
3477impl fidl::endpoints::Responder for CapabilityStoreConnectorCreateResponder {
3478    type ControlHandle = CapabilityStoreControlHandle;
3479
3480    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3481        &self.control_handle
3482    }
3483
3484    fn drop_without_shutdown(mut self) {
3485        // Safety: drops once, never accessed again due to mem::forget
3486        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3487        // Prevent Drop from running (which would shut down the channel)
3488        std::mem::forget(self);
3489    }
3490}
3491
3492impl CapabilityStoreConnectorCreateResponder {
3493    /// Sends a response to the FIDL transaction.
3494    ///
3495    /// Sets the channel to shutdown if an error occurs.
3496    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3497        let _result = self.send_raw(result);
3498        if _result.is_err() {
3499            self.control_handle.shutdown();
3500        }
3501        self.drop_without_shutdown();
3502        _result
3503    }
3504
3505    /// Similar to "send" but does not shutdown the channel if an error occurs.
3506    pub fn send_no_shutdown_on_err(
3507        self,
3508        mut result: Result<(), CapabilityStoreError>,
3509    ) -> Result<(), fidl::Error> {
3510        let _result = self.send_raw(result);
3511        self.drop_without_shutdown();
3512        _result
3513    }
3514
3515    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3516        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3517            fidl::encoding::EmptyStruct,
3518            CapabilityStoreError,
3519        >>(
3520            fidl::encoding::FlexibleResult::new(result),
3521            self.tx_id,
3522            0x29592c5d63e91c25,
3523            fidl::encoding::DynamicFlags::FLEXIBLE,
3524        )
3525    }
3526}
3527
3528#[must_use = "FIDL methods require a response to be sent"]
3529#[derive(Debug)]
3530pub struct CapabilityStoreConnectorOpenResponder {
3531    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3532    tx_id: u32,
3533}
3534
3535/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3536/// if the responder is dropped without sending a response, so that the client
3537/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3538impl std::ops::Drop for CapabilityStoreConnectorOpenResponder {
3539    fn drop(&mut self) {
3540        self.control_handle.shutdown();
3541        // Safety: drops once, never accessed again
3542        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3543    }
3544}
3545
3546impl fidl::endpoints::Responder for CapabilityStoreConnectorOpenResponder {
3547    type ControlHandle = CapabilityStoreControlHandle;
3548
3549    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3550        &self.control_handle
3551    }
3552
3553    fn drop_without_shutdown(mut self) {
3554        // Safety: drops once, never accessed again due to mem::forget
3555        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3556        // Prevent Drop from running (which would shut down the channel)
3557        std::mem::forget(self);
3558    }
3559}
3560
3561impl CapabilityStoreConnectorOpenResponder {
3562    /// Sends a response to the FIDL transaction.
3563    ///
3564    /// Sets the channel to shutdown if an error occurs.
3565    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3566        let _result = self.send_raw(result);
3567        if _result.is_err() {
3568            self.control_handle.shutdown();
3569        }
3570        self.drop_without_shutdown();
3571        _result
3572    }
3573
3574    /// Similar to "send" but does not shutdown the channel if an error occurs.
3575    pub fn send_no_shutdown_on_err(
3576        self,
3577        mut result: Result<(), CapabilityStoreError>,
3578    ) -> Result<(), fidl::Error> {
3579        let _result = self.send_raw(result);
3580        self.drop_without_shutdown();
3581        _result
3582    }
3583
3584    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3585        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3586            fidl::encoding::EmptyStruct,
3587            CapabilityStoreError,
3588        >>(
3589            fidl::encoding::FlexibleResult::new(result),
3590            self.tx_id,
3591            0x537e69ab40563b9f,
3592            fidl::encoding::DynamicFlags::FLEXIBLE,
3593        )
3594    }
3595}
3596
3597#[must_use = "FIDL methods require a response to be sent"]
3598#[derive(Debug)]
3599pub struct CapabilityStoreDirConnectorCreateResponder {
3600    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3601    tx_id: u32,
3602}
3603
3604/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3605/// if the responder is dropped without sending a response, so that the client
3606/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3607impl std::ops::Drop for CapabilityStoreDirConnectorCreateResponder {
3608    fn drop(&mut self) {
3609        self.control_handle.shutdown();
3610        // Safety: drops once, never accessed again
3611        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3612    }
3613}
3614
3615impl fidl::endpoints::Responder for CapabilityStoreDirConnectorCreateResponder {
3616    type ControlHandle = CapabilityStoreControlHandle;
3617
3618    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3619        &self.control_handle
3620    }
3621
3622    fn drop_without_shutdown(mut self) {
3623        // Safety: drops once, never accessed again due to mem::forget
3624        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3625        // Prevent Drop from running (which would shut down the channel)
3626        std::mem::forget(self);
3627    }
3628}
3629
3630impl CapabilityStoreDirConnectorCreateResponder {
3631    /// Sends a response to the FIDL transaction.
3632    ///
3633    /// Sets the channel to shutdown if an error occurs.
3634    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3635        let _result = self.send_raw(result);
3636        if _result.is_err() {
3637            self.control_handle.shutdown();
3638        }
3639        self.drop_without_shutdown();
3640        _result
3641    }
3642
3643    /// Similar to "send" but does not shutdown the channel if an error occurs.
3644    pub fn send_no_shutdown_on_err(
3645        self,
3646        mut result: Result<(), CapabilityStoreError>,
3647    ) -> Result<(), fidl::Error> {
3648        let _result = self.send_raw(result);
3649        self.drop_without_shutdown();
3650        _result
3651    }
3652
3653    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3654        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3655            fidl::encoding::EmptyStruct,
3656            CapabilityStoreError,
3657        >>(
3658            fidl::encoding::FlexibleResult::new(result),
3659            self.tx_id,
3660            0x186138a11ccf19bb,
3661            fidl::encoding::DynamicFlags::FLEXIBLE,
3662        )
3663    }
3664}
3665
3666#[must_use = "FIDL methods require a response to be sent"]
3667#[derive(Debug)]
3668pub struct CapabilityStoreDirConnectorOpenResponder {
3669    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3670    tx_id: u32,
3671}
3672
3673/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3674/// if the responder is dropped without sending a response, so that the client
3675/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3676impl std::ops::Drop for CapabilityStoreDirConnectorOpenResponder {
3677    fn drop(&mut self) {
3678        self.control_handle.shutdown();
3679        // Safety: drops once, never accessed again
3680        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3681    }
3682}
3683
3684impl fidl::endpoints::Responder for CapabilityStoreDirConnectorOpenResponder {
3685    type ControlHandle = CapabilityStoreControlHandle;
3686
3687    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3688        &self.control_handle
3689    }
3690
3691    fn drop_without_shutdown(mut self) {
3692        // Safety: drops once, never accessed again due to mem::forget
3693        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3694        // Prevent Drop from running (which would shut down the channel)
3695        std::mem::forget(self);
3696    }
3697}
3698
3699impl CapabilityStoreDirConnectorOpenResponder {
3700    /// Sends a response to the FIDL transaction.
3701    ///
3702    /// Sets the channel to shutdown if an error occurs.
3703    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3704        let _result = self.send_raw(result);
3705        if _result.is_err() {
3706            self.control_handle.shutdown();
3707        }
3708        self.drop_without_shutdown();
3709        _result
3710    }
3711
3712    /// Similar to "send" but does not shutdown the channel if an error occurs.
3713    pub fn send_no_shutdown_on_err(
3714        self,
3715        mut result: Result<(), CapabilityStoreError>,
3716    ) -> Result<(), fidl::Error> {
3717        let _result = self.send_raw(result);
3718        self.drop_without_shutdown();
3719        _result
3720    }
3721
3722    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3723        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3724            fidl::encoding::EmptyStruct,
3725            CapabilityStoreError,
3726        >>(
3727            fidl::encoding::FlexibleResult::new(result),
3728            self.tx_id,
3729            0x5650d3d6a3a13901,
3730            fidl::encoding::DynamicFlags::FLEXIBLE,
3731        )
3732    }
3733}
3734
3735#[must_use = "FIDL methods require a response to be sent"]
3736#[derive(Debug)]
3737pub struct CapabilityStoreDictionaryCreateResponder {
3738    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3739    tx_id: u32,
3740}
3741
3742/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3743/// if the responder is dropped without sending a response, so that the client
3744/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3745impl std::ops::Drop for CapabilityStoreDictionaryCreateResponder {
3746    fn drop(&mut self) {
3747        self.control_handle.shutdown();
3748        // Safety: drops once, never accessed again
3749        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3750    }
3751}
3752
3753impl fidl::endpoints::Responder for CapabilityStoreDictionaryCreateResponder {
3754    type ControlHandle = CapabilityStoreControlHandle;
3755
3756    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3757        &self.control_handle
3758    }
3759
3760    fn drop_without_shutdown(mut self) {
3761        // Safety: drops once, never accessed again due to mem::forget
3762        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3763        // Prevent Drop from running (which would shut down the channel)
3764        std::mem::forget(self);
3765    }
3766}
3767
3768impl CapabilityStoreDictionaryCreateResponder {
3769    /// Sends a response to the FIDL transaction.
3770    ///
3771    /// Sets the channel to shutdown if an error occurs.
3772    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3773        let _result = self.send_raw(result);
3774        if _result.is_err() {
3775            self.control_handle.shutdown();
3776        }
3777        self.drop_without_shutdown();
3778        _result
3779    }
3780
3781    /// Similar to "send" but does not shutdown the channel if an error occurs.
3782    pub fn send_no_shutdown_on_err(
3783        self,
3784        mut result: Result<(), CapabilityStoreError>,
3785    ) -> Result<(), fidl::Error> {
3786        let _result = self.send_raw(result);
3787        self.drop_without_shutdown();
3788        _result
3789    }
3790
3791    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3792        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3793            fidl::encoding::EmptyStruct,
3794            CapabilityStoreError,
3795        >>(
3796            fidl::encoding::FlexibleResult::new(result),
3797            self.tx_id,
3798            0x6997c8dfc63de093,
3799            fidl::encoding::DynamicFlags::FLEXIBLE,
3800        )
3801    }
3802}
3803
3804#[must_use = "FIDL methods require a response to be sent"]
3805#[derive(Debug)]
3806pub struct CapabilityStoreDictionaryLegacyImportResponder {
3807    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3808    tx_id: u32,
3809}
3810
3811/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3812/// if the responder is dropped without sending a response, so that the client
3813/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3814impl std::ops::Drop for CapabilityStoreDictionaryLegacyImportResponder {
3815    fn drop(&mut self) {
3816        self.control_handle.shutdown();
3817        // Safety: drops once, never accessed again
3818        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3819    }
3820}
3821
3822impl fidl::endpoints::Responder for CapabilityStoreDictionaryLegacyImportResponder {
3823    type ControlHandle = CapabilityStoreControlHandle;
3824
3825    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3826        &self.control_handle
3827    }
3828
3829    fn drop_without_shutdown(mut self) {
3830        // Safety: drops once, never accessed again due to mem::forget
3831        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3832        // Prevent Drop from running (which would shut down the channel)
3833        std::mem::forget(self);
3834    }
3835}
3836
3837impl CapabilityStoreDictionaryLegacyImportResponder {
3838    /// Sends a response to the FIDL transaction.
3839    ///
3840    /// Sets the channel to shutdown if an error occurs.
3841    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3842        let _result = self.send_raw(result);
3843        if _result.is_err() {
3844            self.control_handle.shutdown();
3845        }
3846        self.drop_without_shutdown();
3847        _result
3848    }
3849
3850    /// Similar to "send" but does not shutdown the channel if an error occurs.
3851    pub fn send_no_shutdown_on_err(
3852        self,
3853        mut result: Result<(), CapabilityStoreError>,
3854    ) -> Result<(), fidl::Error> {
3855        let _result = self.send_raw(result);
3856        self.drop_without_shutdown();
3857        _result
3858    }
3859
3860    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3861        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3862            fidl::encoding::EmptyStruct,
3863            CapabilityStoreError,
3864        >>(
3865            fidl::encoding::FlexibleResult::new(result),
3866            self.tx_id,
3867            0x72fd686c37b6025f,
3868            fidl::encoding::DynamicFlags::FLEXIBLE,
3869        )
3870    }
3871}
3872
3873#[must_use = "FIDL methods require a response to be sent"]
3874#[derive(Debug)]
3875pub struct CapabilityStoreDictionaryLegacyExportResponder {
3876    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3877    tx_id: u32,
3878}
3879
3880/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3881/// if the responder is dropped without sending a response, so that the client
3882/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3883impl std::ops::Drop for CapabilityStoreDictionaryLegacyExportResponder {
3884    fn drop(&mut self) {
3885        self.control_handle.shutdown();
3886        // Safety: drops once, never accessed again
3887        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3888    }
3889}
3890
3891impl fidl::endpoints::Responder for CapabilityStoreDictionaryLegacyExportResponder {
3892    type ControlHandle = CapabilityStoreControlHandle;
3893
3894    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3895        &self.control_handle
3896    }
3897
3898    fn drop_without_shutdown(mut self) {
3899        // Safety: drops once, never accessed again due to mem::forget
3900        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3901        // Prevent Drop from running (which would shut down the channel)
3902        std::mem::forget(self);
3903    }
3904}
3905
3906impl CapabilityStoreDictionaryLegacyExportResponder {
3907    /// Sends a response to the FIDL transaction.
3908    ///
3909    /// Sets the channel to shutdown if an error occurs.
3910    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3911        let _result = self.send_raw(result);
3912        if _result.is_err() {
3913            self.control_handle.shutdown();
3914        }
3915        self.drop_without_shutdown();
3916        _result
3917    }
3918
3919    /// Similar to "send" but does not shutdown the channel if an error occurs.
3920    pub fn send_no_shutdown_on_err(
3921        self,
3922        mut result: Result<(), CapabilityStoreError>,
3923    ) -> Result<(), fidl::Error> {
3924        let _result = self.send_raw(result);
3925        self.drop_without_shutdown();
3926        _result
3927    }
3928
3929    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3930        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3931            fidl::encoding::EmptyStruct,
3932            CapabilityStoreError,
3933        >>(
3934            fidl::encoding::FlexibleResult::new(result),
3935            self.tx_id,
3936            0x407e15cc4bde5dcd,
3937            fidl::encoding::DynamicFlags::FLEXIBLE,
3938        )
3939    }
3940}
3941
3942#[must_use = "FIDL methods require a response to be sent"]
3943#[derive(Debug)]
3944pub struct CapabilityStoreDictionaryInsertResponder {
3945    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3946    tx_id: u32,
3947}
3948
3949/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3950/// if the responder is dropped without sending a response, so that the client
3951/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3952impl std::ops::Drop for CapabilityStoreDictionaryInsertResponder {
3953    fn drop(&mut self) {
3954        self.control_handle.shutdown();
3955        // Safety: drops once, never accessed again
3956        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3957    }
3958}
3959
3960impl fidl::endpoints::Responder for CapabilityStoreDictionaryInsertResponder {
3961    type ControlHandle = CapabilityStoreControlHandle;
3962
3963    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3964        &self.control_handle
3965    }
3966
3967    fn drop_without_shutdown(mut self) {
3968        // Safety: drops once, never accessed again due to mem::forget
3969        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3970        // Prevent Drop from running (which would shut down the channel)
3971        std::mem::forget(self);
3972    }
3973}
3974
3975impl CapabilityStoreDictionaryInsertResponder {
3976    /// Sends a response to the FIDL transaction.
3977    ///
3978    /// Sets the channel to shutdown if an error occurs.
3979    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3980        let _result = self.send_raw(result);
3981        if _result.is_err() {
3982            self.control_handle.shutdown();
3983        }
3984        self.drop_without_shutdown();
3985        _result
3986    }
3987
3988    /// Similar to "send" but does not shutdown the channel if an error occurs.
3989    pub fn send_no_shutdown_on_err(
3990        self,
3991        mut result: Result<(), CapabilityStoreError>,
3992    ) -> Result<(), fidl::Error> {
3993        let _result = self.send_raw(result);
3994        self.drop_without_shutdown();
3995        _result
3996    }
3997
3998    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3999        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4000            fidl::encoding::EmptyStruct,
4001            CapabilityStoreError,
4002        >>(
4003            fidl::encoding::FlexibleResult::new(result),
4004            self.tx_id,
4005            0x7702183689d44c27,
4006            fidl::encoding::DynamicFlags::FLEXIBLE,
4007        )
4008    }
4009}
4010
4011#[must_use = "FIDL methods require a response to be sent"]
4012#[derive(Debug)]
4013pub struct CapabilityStoreDictionaryGetResponder {
4014    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
4015    tx_id: u32,
4016}
4017
4018/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
4019/// if the responder is dropped without sending a response, so that the client
4020/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4021impl std::ops::Drop for CapabilityStoreDictionaryGetResponder {
4022    fn drop(&mut self) {
4023        self.control_handle.shutdown();
4024        // Safety: drops once, never accessed again
4025        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4026    }
4027}
4028
4029impl fidl::endpoints::Responder for CapabilityStoreDictionaryGetResponder {
4030    type ControlHandle = CapabilityStoreControlHandle;
4031
4032    fn control_handle(&self) -> &CapabilityStoreControlHandle {
4033        &self.control_handle
4034    }
4035
4036    fn drop_without_shutdown(mut self) {
4037        // Safety: drops once, never accessed again due to mem::forget
4038        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4039        // Prevent Drop from running (which would shut down the channel)
4040        std::mem::forget(self);
4041    }
4042}
4043
4044impl CapabilityStoreDictionaryGetResponder {
4045    /// Sends a response to the FIDL transaction.
4046    ///
4047    /// Sets the channel to shutdown if an error occurs.
4048    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4049        let _result = self.send_raw(result);
4050        if _result.is_err() {
4051            self.control_handle.shutdown();
4052        }
4053        self.drop_without_shutdown();
4054        _result
4055    }
4056
4057    /// Similar to "send" but does not shutdown the channel if an error occurs.
4058    pub fn send_no_shutdown_on_err(
4059        self,
4060        mut result: Result<(), CapabilityStoreError>,
4061    ) -> Result<(), fidl::Error> {
4062        let _result = self.send_raw(result);
4063        self.drop_without_shutdown();
4064        _result
4065    }
4066
4067    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4068        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4069            fidl::encoding::EmptyStruct,
4070            CapabilityStoreError,
4071        >>(
4072            fidl::encoding::FlexibleResult::new(result),
4073            self.tx_id,
4074            0x4d9e27538284add2,
4075            fidl::encoding::DynamicFlags::FLEXIBLE,
4076        )
4077    }
4078}
4079
4080#[must_use = "FIDL methods require a response to be sent"]
4081#[derive(Debug)]
4082pub struct CapabilityStoreDictionaryRemoveResponder {
4083    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
4084    tx_id: u32,
4085}
4086
4087/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
4088/// if the responder is dropped without sending a response, so that the client
4089/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4090impl std::ops::Drop for CapabilityStoreDictionaryRemoveResponder {
4091    fn drop(&mut self) {
4092        self.control_handle.shutdown();
4093        // Safety: drops once, never accessed again
4094        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4095    }
4096}
4097
4098impl fidl::endpoints::Responder for CapabilityStoreDictionaryRemoveResponder {
4099    type ControlHandle = CapabilityStoreControlHandle;
4100
4101    fn control_handle(&self) -> &CapabilityStoreControlHandle {
4102        &self.control_handle
4103    }
4104
4105    fn drop_without_shutdown(mut self) {
4106        // Safety: drops once, never accessed again due to mem::forget
4107        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4108        // Prevent Drop from running (which would shut down the channel)
4109        std::mem::forget(self);
4110    }
4111}
4112
4113impl CapabilityStoreDictionaryRemoveResponder {
4114    /// Sends a response to the FIDL transaction.
4115    ///
4116    /// Sets the channel to shutdown if an error occurs.
4117    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4118        let _result = self.send_raw(result);
4119        if _result.is_err() {
4120            self.control_handle.shutdown();
4121        }
4122        self.drop_without_shutdown();
4123        _result
4124    }
4125
4126    /// Similar to "send" but does not shutdown the channel if an error occurs.
4127    pub fn send_no_shutdown_on_err(
4128        self,
4129        mut result: Result<(), CapabilityStoreError>,
4130    ) -> Result<(), fidl::Error> {
4131        let _result = self.send_raw(result);
4132        self.drop_without_shutdown();
4133        _result
4134    }
4135
4136    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4137        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4138            fidl::encoding::EmptyStruct,
4139            CapabilityStoreError,
4140        >>(
4141            fidl::encoding::FlexibleResult::new(result),
4142            self.tx_id,
4143            0x4c5c025ab05d4f3,
4144            fidl::encoding::DynamicFlags::FLEXIBLE,
4145        )
4146    }
4147}
4148
4149#[must_use = "FIDL methods require a response to be sent"]
4150#[derive(Debug)]
4151pub struct CapabilityStoreDictionaryCopyResponder {
4152    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
4153    tx_id: u32,
4154}
4155
4156/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
4157/// if the responder is dropped without sending a response, so that the client
4158/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4159impl std::ops::Drop for CapabilityStoreDictionaryCopyResponder {
4160    fn drop(&mut self) {
4161        self.control_handle.shutdown();
4162        // Safety: drops once, never accessed again
4163        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4164    }
4165}
4166
4167impl fidl::endpoints::Responder for CapabilityStoreDictionaryCopyResponder {
4168    type ControlHandle = CapabilityStoreControlHandle;
4169
4170    fn control_handle(&self) -> &CapabilityStoreControlHandle {
4171        &self.control_handle
4172    }
4173
4174    fn drop_without_shutdown(mut self) {
4175        // Safety: drops once, never accessed again due to mem::forget
4176        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4177        // Prevent Drop from running (which would shut down the channel)
4178        std::mem::forget(self);
4179    }
4180}
4181
4182impl CapabilityStoreDictionaryCopyResponder {
4183    /// Sends a response to the FIDL transaction.
4184    ///
4185    /// Sets the channel to shutdown if an error occurs.
4186    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4187        let _result = self.send_raw(result);
4188        if _result.is_err() {
4189            self.control_handle.shutdown();
4190        }
4191        self.drop_without_shutdown();
4192        _result
4193    }
4194
4195    /// Similar to "send" but does not shutdown the channel if an error occurs.
4196    pub fn send_no_shutdown_on_err(
4197        self,
4198        mut result: Result<(), CapabilityStoreError>,
4199    ) -> Result<(), fidl::Error> {
4200        let _result = self.send_raw(result);
4201        self.drop_without_shutdown();
4202        _result
4203    }
4204
4205    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4206        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4207            fidl::encoding::EmptyStruct,
4208            CapabilityStoreError,
4209        >>(
4210            fidl::encoding::FlexibleResult::new(result),
4211            self.tx_id,
4212            0x3733ecdf4ea1b44f,
4213            fidl::encoding::DynamicFlags::FLEXIBLE,
4214        )
4215    }
4216}
4217
4218#[must_use = "FIDL methods require a response to be sent"]
4219#[derive(Debug)]
4220pub struct CapabilityStoreDictionaryKeysResponder {
4221    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
4222    tx_id: u32,
4223}
4224
4225/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
4226/// if the responder is dropped without sending a response, so that the client
4227/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4228impl std::ops::Drop for CapabilityStoreDictionaryKeysResponder {
4229    fn drop(&mut self) {
4230        self.control_handle.shutdown();
4231        // Safety: drops once, never accessed again
4232        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4233    }
4234}
4235
4236impl fidl::endpoints::Responder for CapabilityStoreDictionaryKeysResponder {
4237    type ControlHandle = CapabilityStoreControlHandle;
4238
4239    fn control_handle(&self) -> &CapabilityStoreControlHandle {
4240        &self.control_handle
4241    }
4242
4243    fn drop_without_shutdown(mut self) {
4244        // Safety: drops once, never accessed again due to mem::forget
4245        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4246        // Prevent Drop from running (which would shut down the channel)
4247        std::mem::forget(self);
4248    }
4249}
4250
4251impl CapabilityStoreDictionaryKeysResponder {
4252    /// Sends a response to the FIDL transaction.
4253    ///
4254    /// Sets the channel to shutdown if an error occurs.
4255    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4256        let _result = self.send_raw(result);
4257        if _result.is_err() {
4258            self.control_handle.shutdown();
4259        }
4260        self.drop_without_shutdown();
4261        _result
4262    }
4263
4264    /// Similar to "send" but does not shutdown the channel if an error occurs.
4265    pub fn send_no_shutdown_on_err(
4266        self,
4267        mut result: Result<(), CapabilityStoreError>,
4268    ) -> Result<(), fidl::Error> {
4269        let _result = self.send_raw(result);
4270        self.drop_without_shutdown();
4271        _result
4272    }
4273
4274    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4275        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4276            fidl::encoding::EmptyStruct,
4277            CapabilityStoreError,
4278        >>(
4279            fidl::encoding::FlexibleResult::new(result),
4280            self.tx_id,
4281            0x84b05577ceaec9e,
4282            fidl::encoding::DynamicFlags::FLEXIBLE,
4283        )
4284    }
4285}
4286
4287#[must_use = "FIDL methods require a response to be sent"]
4288#[derive(Debug)]
4289pub struct CapabilityStoreDictionaryEnumerateResponder {
4290    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
4291    tx_id: u32,
4292}
4293
4294/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
4295/// if the responder is dropped without sending a response, so that the client
4296/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4297impl std::ops::Drop for CapabilityStoreDictionaryEnumerateResponder {
4298    fn drop(&mut self) {
4299        self.control_handle.shutdown();
4300        // Safety: drops once, never accessed again
4301        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4302    }
4303}
4304
4305impl fidl::endpoints::Responder for CapabilityStoreDictionaryEnumerateResponder {
4306    type ControlHandle = CapabilityStoreControlHandle;
4307
4308    fn control_handle(&self) -> &CapabilityStoreControlHandle {
4309        &self.control_handle
4310    }
4311
4312    fn drop_without_shutdown(mut self) {
4313        // Safety: drops once, never accessed again due to mem::forget
4314        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4315        // Prevent Drop from running (which would shut down the channel)
4316        std::mem::forget(self);
4317    }
4318}
4319
4320impl CapabilityStoreDictionaryEnumerateResponder {
4321    /// Sends a response to the FIDL transaction.
4322    ///
4323    /// Sets the channel to shutdown if an error occurs.
4324    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4325        let _result = self.send_raw(result);
4326        if _result.is_err() {
4327            self.control_handle.shutdown();
4328        }
4329        self.drop_without_shutdown();
4330        _result
4331    }
4332
4333    /// Similar to "send" but does not shutdown the channel if an error occurs.
4334    pub fn send_no_shutdown_on_err(
4335        self,
4336        mut result: Result<(), CapabilityStoreError>,
4337    ) -> Result<(), fidl::Error> {
4338        let _result = self.send_raw(result);
4339        self.drop_without_shutdown();
4340        _result
4341    }
4342
4343    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4344        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4345            fidl::encoding::EmptyStruct,
4346            CapabilityStoreError,
4347        >>(
4348            fidl::encoding::FlexibleResult::new(result),
4349            self.tx_id,
4350            0xd6279b6ced04641,
4351            fidl::encoding::DynamicFlags::FLEXIBLE,
4352        )
4353    }
4354}
4355
4356#[must_use = "FIDL methods require a response to be sent"]
4357#[derive(Debug)]
4358pub struct CapabilityStoreDictionaryDrainResponder {
4359    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
4360    tx_id: u32,
4361}
4362
4363/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
4364/// if the responder is dropped without sending a response, so that the client
4365/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4366impl std::ops::Drop for CapabilityStoreDictionaryDrainResponder {
4367    fn drop(&mut self) {
4368        self.control_handle.shutdown();
4369        // Safety: drops once, never accessed again
4370        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4371    }
4372}
4373
4374impl fidl::endpoints::Responder for CapabilityStoreDictionaryDrainResponder {
4375    type ControlHandle = CapabilityStoreControlHandle;
4376
4377    fn control_handle(&self) -> &CapabilityStoreControlHandle {
4378        &self.control_handle
4379    }
4380
4381    fn drop_without_shutdown(mut self) {
4382        // Safety: drops once, never accessed again due to mem::forget
4383        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4384        // Prevent Drop from running (which would shut down the channel)
4385        std::mem::forget(self);
4386    }
4387}
4388
4389impl CapabilityStoreDictionaryDrainResponder {
4390    /// Sends a response to the FIDL transaction.
4391    ///
4392    /// Sets the channel to shutdown if an error occurs.
4393    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4394        let _result = self.send_raw(result);
4395        if _result.is_err() {
4396            self.control_handle.shutdown();
4397        }
4398        self.drop_without_shutdown();
4399        _result
4400    }
4401
4402    /// Similar to "send" but does not shutdown the channel if an error occurs.
4403    pub fn send_no_shutdown_on_err(
4404        self,
4405        mut result: Result<(), CapabilityStoreError>,
4406    ) -> Result<(), fidl::Error> {
4407        let _result = self.send_raw(result);
4408        self.drop_without_shutdown();
4409        _result
4410    }
4411
4412    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4413        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4414            fidl::encoding::EmptyStruct,
4415            CapabilityStoreError,
4416        >>(
4417            fidl::encoding::FlexibleResult::new(result),
4418            self.tx_id,
4419            0x28a3a3f84d928cd8,
4420            fidl::encoding::DynamicFlags::FLEXIBLE,
4421        )
4422    }
4423}
4424
4425#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4426pub struct ConnectorRouterMarker;
4427
4428impl fidl::endpoints::ProtocolMarker for ConnectorRouterMarker {
4429    type Proxy = ConnectorRouterProxy;
4430    type RequestStream = ConnectorRouterRequestStream;
4431    #[cfg(target_os = "fuchsia")]
4432    type SynchronousProxy = ConnectorRouterSynchronousProxy;
4433
4434    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.ConnectorRouter";
4435}
4436impl fidl::endpoints::DiscoverableProtocolMarker for ConnectorRouterMarker {}
4437pub type ConnectorRouterRouteResult = Result<ConnectorRouterRouteResponse, RouterError>;
4438
4439pub trait ConnectorRouterProxyInterface: Send + Sync {
4440    type RouteResponseFut: std::future::Future<Output = Result<ConnectorRouterRouteResult, fidl::Error>>
4441        + Send;
4442    fn r#route(&self, payload: RouteRequest) -> Self::RouteResponseFut;
4443}
4444#[derive(Debug)]
4445#[cfg(target_os = "fuchsia")]
4446pub struct ConnectorRouterSynchronousProxy {
4447    client: fidl::client::sync::Client,
4448}
4449
4450#[cfg(target_os = "fuchsia")]
4451impl fidl::endpoints::SynchronousProxy for ConnectorRouterSynchronousProxy {
4452    type Proxy = ConnectorRouterProxy;
4453    type Protocol = ConnectorRouterMarker;
4454
4455    fn from_channel(inner: fidl::Channel) -> Self {
4456        Self::new(inner)
4457    }
4458
4459    fn into_channel(self) -> fidl::Channel {
4460        self.client.into_channel()
4461    }
4462
4463    fn as_channel(&self) -> &fidl::Channel {
4464        self.client.as_channel()
4465    }
4466}
4467
4468#[cfg(target_os = "fuchsia")]
4469impl ConnectorRouterSynchronousProxy {
4470    pub fn new(channel: fidl::Channel) -> Self {
4471        let protocol_name = <ConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4472        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
4473    }
4474
4475    pub fn into_channel(self) -> fidl::Channel {
4476        self.client.into_channel()
4477    }
4478
4479    /// Waits until an event arrives and returns it. It is safe for other
4480    /// threads to make concurrent requests while waiting for an event.
4481    pub fn wait_for_event(
4482        &self,
4483        deadline: zx::MonotonicInstant,
4484    ) -> Result<ConnectorRouterEvent, fidl::Error> {
4485        ConnectorRouterEvent::decode(self.client.wait_for_event(deadline)?)
4486    }
4487
4488    pub fn r#route(
4489        &self,
4490        mut payload: RouteRequest,
4491        ___deadline: zx::MonotonicInstant,
4492    ) -> Result<ConnectorRouterRouteResult, fidl::Error> {
4493        let _response = self.client.send_query::<
4494            RouteRequest,
4495            fidl::encoding::FlexibleResultType<ConnectorRouterRouteResponse, RouterError>,
4496        >(
4497            &mut payload,
4498            0x74dbb8bc13730766,
4499            fidl::encoding::DynamicFlags::FLEXIBLE,
4500            ___deadline,
4501        )?
4502        .into_result::<ConnectorRouterMarker>("route")?;
4503        Ok(_response.map(|x| x))
4504    }
4505}
4506
4507#[cfg(target_os = "fuchsia")]
4508impl From<ConnectorRouterSynchronousProxy> for zx::NullableHandle {
4509    fn from(value: ConnectorRouterSynchronousProxy) -> Self {
4510        value.into_channel().into()
4511    }
4512}
4513
4514#[cfg(target_os = "fuchsia")]
4515impl From<fidl::Channel> for ConnectorRouterSynchronousProxy {
4516    fn from(value: fidl::Channel) -> Self {
4517        Self::new(value)
4518    }
4519}
4520
4521#[cfg(target_os = "fuchsia")]
4522impl fidl::endpoints::FromClient for ConnectorRouterSynchronousProxy {
4523    type Protocol = ConnectorRouterMarker;
4524
4525    fn from_client(value: fidl::endpoints::ClientEnd<ConnectorRouterMarker>) -> Self {
4526        Self::new(value.into_channel())
4527    }
4528}
4529
4530#[derive(Debug, Clone)]
4531pub struct ConnectorRouterProxy {
4532    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
4533}
4534
4535impl fidl::endpoints::Proxy for ConnectorRouterProxy {
4536    type Protocol = ConnectorRouterMarker;
4537
4538    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
4539        Self::new(inner)
4540    }
4541
4542    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
4543        self.client.into_channel().map_err(|client| Self { client })
4544    }
4545
4546    fn as_channel(&self) -> &::fidl::AsyncChannel {
4547        self.client.as_channel()
4548    }
4549}
4550
4551impl ConnectorRouterProxy {
4552    /// Create a new Proxy for fuchsia.component.sandbox/ConnectorRouter.
4553    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
4554        let protocol_name = <ConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4555        Self { client: fidl::client::Client::new(channel, protocol_name) }
4556    }
4557
4558    /// Get a Stream of events from the remote end of the protocol.
4559    ///
4560    /// # Panics
4561    ///
4562    /// Panics if the event stream was already taken.
4563    pub fn take_event_stream(&self) -> ConnectorRouterEventStream {
4564        ConnectorRouterEventStream { event_receiver: self.client.take_event_receiver() }
4565    }
4566
4567    pub fn r#route(
4568        &self,
4569        mut payload: RouteRequest,
4570    ) -> fidl::client::QueryResponseFut<
4571        ConnectorRouterRouteResult,
4572        fidl::encoding::DefaultFuchsiaResourceDialect,
4573    > {
4574        ConnectorRouterProxyInterface::r#route(self, payload)
4575    }
4576}
4577
4578impl ConnectorRouterProxyInterface for ConnectorRouterProxy {
4579    type RouteResponseFut = fidl::client::QueryResponseFut<
4580        ConnectorRouterRouteResult,
4581        fidl::encoding::DefaultFuchsiaResourceDialect,
4582    >;
4583    fn r#route(&self, mut payload: RouteRequest) -> Self::RouteResponseFut {
4584        fn _decode(
4585            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4586        ) -> Result<ConnectorRouterRouteResult, fidl::Error> {
4587            let _response = fidl::client::decode_transaction_body::<
4588                fidl::encoding::FlexibleResultType<ConnectorRouterRouteResponse, RouterError>,
4589                fidl::encoding::DefaultFuchsiaResourceDialect,
4590                0x74dbb8bc13730766,
4591            >(_buf?)?
4592            .into_result::<ConnectorRouterMarker>("route")?;
4593            Ok(_response.map(|x| x))
4594        }
4595        self.client.send_query_and_decode::<RouteRequest, ConnectorRouterRouteResult>(
4596            &mut payload,
4597            0x74dbb8bc13730766,
4598            fidl::encoding::DynamicFlags::FLEXIBLE,
4599            _decode,
4600        )
4601    }
4602}
4603
4604pub struct ConnectorRouterEventStream {
4605    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
4606}
4607
4608impl std::marker::Unpin for ConnectorRouterEventStream {}
4609
4610impl futures::stream::FusedStream for ConnectorRouterEventStream {
4611    fn is_terminated(&self) -> bool {
4612        self.event_receiver.is_terminated()
4613    }
4614}
4615
4616impl futures::Stream for ConnectorRouterEventStream {
4617    type Item = Result<ConnectorRouterEvent, fidl::Error>;
4618
4619    fn poll_next(
4620        mut self: std::pin::Pin<&mut Self>,
4621        cx: &mut std::task::Context<'_>,
4622    ) -> std::task::Poll<Option<Self::Item>> {
4623        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4624            &mut self.event_receiver,
4625            cx
4626        )?) {
4627            Some(buf) => std::task::Poll::Ready(Some(ConnectorRouterEvent::decode(buf))),
4628            None => std::task::Poll::Ready(None),
4629        }
4630    }
4631}
4632
4633#[derive(Debug)]
4634pub enum ConnectorRouterEvent {
4635    #[non_exhaustive]
4636    _UnknownEvent {
4637        /// Ordinal of the event that was sent.
4638        ordinal: u64,
4639    },
4640}
4641
4642impl ConnectorRouterEvent {
4643    /// Decodes a message buffer as a [`ConnectorRouterEvent`].
4644    fn decode(
4645        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4646    ) -> Result<ConnectorRouterEvent, fidl::Error> {
4647        let (bytes, _handles) = buf.split_mut();
4648        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4649        debug_assert_eq!(tx_header.tx_id, 0);
4650        match tx_header.ordinal {
4651            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4652                Ok(ConnectorRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
4653            }
4654            _ => Err(fidl::Error::UnknownOrdinal {
4655                ordinal: tx_header.ordinal,
4656                protocol_name:
4657                    <ConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4658            }),
4659        }
4660    }
4661}
4662
4663/// A Stream of incoming requests for fuchsia.component.sandbox/ConnectorRouter.
4664pub struct ConnectorRouterRequestStream {
4665    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4666    is_terminated: bool,
4667}
4668
4669impl std::marker::Unpin for ConnectorRouterRequestStream {}
4670
4671impl futures::stream::FusedStream for ConnectorRouterRequestStream {
4672    fn is_terminated(&self) -> bool {
4673        self.is_terminated
4674    }
4675}
4676
4677impl fidl::endpoints::RequestStream for ConnectorRouterRequestStream {
4678    type Protocol = ConnectorRouterMarker;
4679    type ControlHandle = ConnectorRouterControlHandle;
4680
4681    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
4682        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4683    }
4684
4685    fn control_handle(&self) -> Self::ControlHandle {
4686        ConnectorRouterControlHandle { inner: self.inner.clone() }
4687    }
4688
4689    fn into_inner(
4690        self,
4691    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
4692    {
4693        (self.inner, self.is_terminated)
4694    }
4695
4696    fn from_inner(
4697        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4698        is_terminated: bool,
4699    ) -> Self {
4700        Self { inner, is_terminated }
4701    }
4702}
4703
4704impl futures::Stream for ConnectorRouterRequestStream {
4705    type Item = Result<ConnectorRouterRequest, fidl::Error>;
4706
4707    fn poll_next(
4708        mut self: std::pin::Pin<&mut Self>,
4709        cx: &mut std::task::Context<'_>,
4710    ) -> std::task::Poll<Option<Self::Item>> {
4711        let this = &mut *self;
4712        if this.inner.check_shutdown(cx) {
4713            this.is_terminated = true;
4714            return std::task::Poll::Ready(None);
4715        }
4716        if this.is_terminated {
4717            panic!("polled ConnectorRouterRequestStream after completion");
4718        }
4719        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4720            |bytes, handles| {
4721                match this.inner.channel().read_etc(cx, bytes, handles) {
4722                    std::task::Poll::Ready(Ok(())) => {}
4723                    std::task::Poll::Pending => return std::task::Poll::Pending,
4724                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4725                        this.is_terminated = true;
4726                        return std::task::Poll::Ready(None);
4727                    }
4728                    std::task::Poll::Ready(Err(e)) => {
4729                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4730                            e.into(),
4731                        ))));
4732                    }
4733                }
4734
4735                // A message has been received from the channel
4736                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4737
4738                std::task::Poll::Ready(Some(match header.ordinal {
4739                    0x74dbb8bc13730766 => {
4740                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4741                        let mut req = fidl::new_empty!(
4742                            RouteRequest,
4743                            fidl::encoding::DefaultFuchsiaResourceDialect
4744                        );
4745                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RouteRequest>(&header, _body_bytes, handles, &mut req)?;
4746                        let control_handle =
4747                            ConnectorRouterControlHandle { inner: this.inner.clone() };
4748                        Ok(ConnectorRouterRequest::Route {
4749                            payload: req,
4750                            responder: ConnectorRouterRouteResponder {
4751                                control_handle: std::mem::ManuallyDrop::new(control_handle),
4752                                tx_id: header.tx_id,
4753                            },
4754                        })
4755                    }
4756                    _ if header.tx_id == 0
4757                        && header
4758                            .dynamic_flags()
4759                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
4760                    {
4761                        Ok(ConnectorRouterRequest::_UnknownMethod {
4762                            ordinal: header.ordinal,
4763                            control_handle: ConnectorRouterControlHandle {
4764                                inner: this.inner.clone(),
4765                            },
4766                            method_type: fidl::MethodType::OneWay,
4767                        })
4768                    }
4769                    _ if header
4770                        .dynamic_flags()
4771                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
4772                    {
4773                        this.inner.send_framework_err(
4774                            fidl::encoding::FrameworkErr::UnknownMethod,
4775                            header.tx_id,
4776                            header.ordinal,
4777                            header.dynamic_flags(),
4778                            (bytes, handles),
4779                        )?;
4780                        Ok(ConnectorRouterRequest::_UnknownMethod {
4781                            ordinal: header.ordinal,
4782                            control_handle: ConnectorRouterControlHandle {
4783                                inner: this.inner.clone(),
4784                            },
4785                            method_type: fidl::MethodType::TwoWay,
4786                        })
4787                    }
4788                    _ => Err(fidl::Error::UnknownOrdinal {
4789                        ordinal: header.ordinal,
4790                        protocol_name:
4791                            <ConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4792                    }),
4793                }))
4794            },
4795        )
4796    }
4797}
4798
4799#[derive(Debug)]
4800pub enum ConnectorRouterRequest {
4801    Route {
4802        payload: RouteRequest,
4803        responder: ConnectorRouterRouteResponder,
4804    },
4805    /// An interaction was received which does not match any known method.
4806    #[non_exhaustive]
4807    _UnknownMethod {
4808        /// Ordinal of the method that was called.
4809        ordinal: u64,
4810        control_handle: ConnectorRouterControlHandle,
4811        method_type: fidl::MethodType,
4812    },
4813}
4814
4815impl ConnectorRouterRequest {
4816    #[allow(irrefutable_let_patterns)]
4817    pub fn into_route(self) -> Option<(RouteRequest, ConnectorRouterRouteResponder)> {
4818        if let ConnectorRouterRequest::Route { payload, responder } = self {
4819            Some((payload, responder))
4820        } else {
4821            None
4822        }
4823    }
4824
4825    /// Name of the method defined in FIDL
4826    pub fn method_name(&self) -> &'static str {
4827        match *self {
4828            ConnectorRouterRequest::Route { .. } => "route",
4829            ConnectorRouterRequest::_UnknownMethod {
4830                method_type: fidl::MethodType::OneWay,
4831                ..
4832            } => "unknown one-way method",
4833            ConnectorRouterRequest::_UnknownMethod {
4834                method_type: fidl::MethodType::TwoWay,
4835                ..
4836            } => "unknown two-way method",
4837        }
4838    }
4839}
4840
4841#[derive(Debug, Clone)]
4842pub struct ConnectorRouterControlHandle {
4843    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4844}
4845
4846impl fidl::endpoints::ControlHandle for ConnectorRouterControlHandle {
4847    fn shutdown(&self) {
4848        self.inner.shutdown()
4849    }
4850    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
4851        self.inner.shutdown_with_epitaph(status)
4852    }
4853
4854    fn is_closed(&self) -> bool {
4855        self.inner.channel().is_closed()
4856    }
4857    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4858        self.inner.channel().on_closed()
4859    }
4860
4861    #[cfg(target_os = "fuchsia")]
4862    fn signal_peer(
4863        &self,
4864        clear_mask: zx::Signals,
4865        set_mask: zx::Signals,
4866    ) -> Result<(), zx_status::Status> {
4867        use fidl::Peered;
4868        self.inner.channel().signal_peer(clear_mask, set_mask)
4869    }
4870}
4871
4872impl ConnectorRouterControlHandle {}
4873
4874#[must_use = "FIDL methods require a response to be sent"]
4875#[derive(Debug)]
4876pub struct ConnectorRouterRouteResponder {
4877    control_handle: std::mem::ManuallyDrop<ConnectorRouterControlHandle>,
4878    tx_id: u32,
4879}
4880
4881/// Set the the channel to be shutdown (see [`ConnectorRouterControlHandle::shutdown`])
4882/// if the responder is dropped without sending a response, so that the client
4883/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4884impl std::ops::Drop for ConnectorRouterRouteResponder {
4885    fn drop(&mut self) {
4886        self.control_handle.shutdown();
4887        // Safety: drops once, never accessed again
4888        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4889    }
4890}
4891
4892impl fidl::endpoints::Responder for ConnectorRouterRouteResponder {
4893    type ControlHandle = ConnectorRouterControlHandle;
4894
4895    fn control_handle(&self) -> &ConnectorRouterControlHandle {
4896        &self.control_handle
4897    }
4898
4899    fn drop_without_shutdown(mut self) {
4900        // Safety: drops once, never accessed again due to mem::forget
4901        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4902        // Prevent Drop from running (which would shut down the channel)
4903        std::mem::forget(self);
4904    }
4905}
4906
4907impl ConnectorRouterRouteResponder {
4908    /// Sends a response to the FIDL transaction.
4909    ///
4910    /// Sets the channel to shutdown if an error occurs.
4911    pub fn send(
4912        self,
4913        mut result: Result<ConnectorRouterRouteResponse, RouterError>,
4914    ) -> Result<(), fidl::Error> {
4915        let _result = self.send_raw(result);
4916        if _result.is_err() {
4917            self.control_handle.shutdown();
4918        }
4919        self.drop_without_shutdown();
4920        _result
4921    }
4922
4923    /// Similar to "send" but does not shutdown the channel if an error occurs.
4924    pub fn send_no_shutdown_on_err(
4925        self,
4926        mut result: Result<ConnectorRouterRouteResponse, RouterError>,
4927    ) -> Result<(), fidl::Error> {
4928        let _result = self.send_raw(result);
4929        self.drop_without_shutdown();
4930        _result
4931    }
4932
4933    fn send_raw(
4934        &self,
4935        mut result: Result<ConnectorRouterRouteResponse, RouterError>,
4936    ) -> Result<(), fidl::Error> {
4937        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4938            ConnectorRouterRouteResponse,
4939            RouterError,
4940        >>(
4941            fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
4942            self.tx_id,
4943            0x74dbb8bc13730766,
4944            fidl::encoding::DynamicFlags::FLEXIBLE,
4945        )
4946    }
4947}
4948
4949#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4950pub struct DataRouterMarker;
4951
4952impl fidl::endpoints::ProtocolMarker for DataRouterMarker {
4953    type Proxy = DataRouterProxy;
4954    type RequestStream = DataRouterRequestStream;
4955    #[cfg(target_os = "fuchsia")]
4956    type SynchronousProxy = DataRouterSynchronousProxy;
4957
4958    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.DataRouter";
4959}
4960impl fidl::endpoints::DiscoverableProtocolMarker for DataRouterMarker {}
4961pub type DataRouterRouteResult = Result<DataRouterRouteResponse, RouterError>;
4962
4963pub trait DataRouterProxyInterface: Send + Sync {
4964    type RouteResponseFut: std::future::Future<Output = Result<DataRouterRouteResult, fidl::Error>>
4965        + Send;
4966    fn r#route(&self, payload: RouteRequest) -> Self::RouteResponseFut;
4967}
4968#[derive(Debug)]
4969#[cfg(target_os = "fuchsia")]
4970pub struct DataRouterSynchronousProxy {
4971    client: fidl::client::sync::Client,
4972}
4973
4974#[cfg(target_os = "fuchsia")]
4975impl fidl::endpoints::SynchronousProxy for DataRouterSynchronousProxy {
4976    type Proxy = DataRouterProxy;
4977    type Protocol = DataRouterMarker;
4978
4979    fn from_channel(inner: fidl::Channel) -> Self {
4980        Self::new(inner)
4981    }
4982
4983    fn into_channel(self) -> fidl::Channel {
4984        self.client.into_channel()
4985    }
4986
4987    fn as_channel(&self) -> &fidl::Channel {
4988        self.client.as_channel()
4989    }
4990}
4991
4992#[cfg(target_os = "fuchsia")]
4993impl DataRouterSynchronousProxy {
4994    pub fn new(channel: fidl::Channel) -> Self {
4995        let protocol_name = <DataRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4996        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
4997    }
4998
4999    pub fn into_channel(self) -> fidl::Channel {
5000        self.client.into_channel()
5001    }
5002
5003    /// Waits until an event arrives and returns it. It is safe for other
5004    /// threads to make concurrent requests while waiting for an event.
5005    pub fn wait_for_event(
5006        &self,
5007        deadline: zx::MonotonicInstant,
5008    ) -> Result<DataRouterEvent, fidl::Error> {
5009        DataRouterEvent::decode(self.client.wait_for_event(deadline)?)
5010    }
5011
5012    pub fn r#route(
5013        &self,
5014        mut payload: RouteRequest,
5015        ___deadline: zx::MonotonicInstant,
5016    ) -> Result<DataRouterRouteResult, fidl::Error> {
5017        let _response = self.client.send_query::<
5018            RouteRequest,
5019            fidl::encoding::FlexibleResultType<DataRouterRouteResponse, RouterError>,
5020        >(
5021            &mut payload,
5022            0x2e87dc44dfc53804,
5023            fidl::encoding::DynamicFlags::FLEXIBLE,
5024            ___deadline,
5025        )?
5026        .into_result::<DataRouterMarker>("route")?;
5027        Ok(_response.map(|x| x))
5028    }
5029}
5030
5031#[cfg(target_os = "fuchsia")]
5032impl From<DataRouterSynchronousProxy> for zx::NullableHandle {
5033    fn from(value: DataRouterSynchronousProxy) -> Self {
5034        value.into_channel().into()
5035    }
5036}
5037
5038#[cfg(target_os = "fuchsia")]
5039impl From<fidl::Channel> for DataRouterSynchronousProxy {
5040    fn from(value: fidl::Channel) -> Self {
5041        Self::new(value)
5042    }
5043}
5044
5045#[cfg(target_os = "fuchsia")]
5046impl fidl::endpoints::FromClient for DataRouterSynchronousProxy {
5047    type Protocol = DataRouterMarker;
5048
5049    fn from_client(value: fidl::endpoints::ClientEnd<DataRouterMarker>) -> Self {
5050        Self::new(value.into_channel())
5051    }
5052}
5053
5054#[derive(Debug, Clone)]
5055pub struct DataRouterProxy {
5056    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
5057}
5058
5059impl fidl::endpoints::Proxy for DataRouterProxy {
5060    type Protocol = DataRouterMarker;
5061
5062    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
5063        Self::new(inner)
5064    }
5065
5066    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
5067        self.client.into_channel().map_err(|client| Self { client })
5068    }
5069
5070    fn as_channel(&self) -> &::fidl::AsyncChannel {
5071        self.client.as_channel()
5072    }
5073}
5074
5075impl DataRouterProxy {
5076    /// Create a new Proxy for fuchsia.component.sandbox/DataRouter.
5077    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5078        let protocol_name = <DataRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5079        Self { client: fidl::client::Client::new(channel, protocol_name) }
5080    }
5081
5082    /// Get a Stream of events from the remote end of the protocol.
5083    ///
5084    /// # Panics
5085    ///
5086    /// Panics if the event stream was already taken.
5087    pub fn take_event_stream(&self) -> DataRouterEventStream {
5088        DataRouterEventStream { event_receiver: self.client.take_event_receiver() }
5089    }
5090
5091    pub fn r#route(
5092        &self,
5093        mut payload: RouteRequest,
5094    ) -> fidl::client::QueryResponseFut<
5095        DataRouterRouteResult,
5096        fidl::encoding::DefaultFuchsiaResourceDialect,
5097    > {
5098        DataRouterProxyInterface::r#route(self, payload)
5099    }
5100}
5101
5102impl DataRouterProxyInterface for DataRouterProxy {
5103    type RouteResponseFut = fidl::client::QueryResponseFut<
5104        DataRouterRouteResult,
5105        fidl::encoding::DefaultFuchsiaResourceDialect,
5106    >;
5107    fn r#route(&self, mut payload: RouteRequest) -> Self::RouteResponseFut {
5108        fn _decode(
5109            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5110        ) -> Result<DataRouterRouteResult, fidl::Error> {
5111            let _response = fidl::client::decode_transaction_body::<
5112                fidl::encoding::FlexibleResultType<DataRouterRouteResponse, RouterError>,
5113                fidl::encoding::DefaultFuchsiaResourceDialect,
5114                0x2e87dc44dfc53804,
5115            >(_buf?)?
5116            .into_result::<DataRouterMarker>("route")?;
5117            Ok(_response.map(|x| x))
5118        }
5119        self.client.send_query_and_decode::<RouteRequest, DataRouterRouteResult>(
5120            &mut payload,
5121            0x2e87dc44dfc53804,
5122            fidl::encoding::DynamicFlags::FLEXIBLE,
5123            _decode,
5124        )
5125    }
5126}
5127
5128pub struct DataRouterEventStream {
5129    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
5130}
5131
5132impl std::marker::Unpin for DataRouterEventStream {}
5133
5134impl futures::stream::FusedStream for DataRouterEventStream {
5135    fn is_terminated(&self) -> bool {
5136        self.event_receiver.is_terminated()
5137    }
5138}
5139
5140impl futures::Stream for DataRouterEventStream {
5141    type Item = Result<DataRouterEvent, fidl::Error>;
5142
5143    fn poll_next(
5144        mut self: std::pin::Pin<&mut Self>,
5145        cx: &mut std::task::Context<'_>,
5146    ) -> std::task::Poll<Option<Self::Item>> {
5147        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5148            &mut self.event_receiver,
5149            cx
5150        )?) {
5151            Some(buf) => std::task::Poll::Ready(Some(DataRouterEvent::decode(buf))),
5152            None => std::task::Poll::Ready(None),
5153        }
5154    }
5155}
5156
5157#[derive(Debug)]
5158pub enum DataRouterEvent {
5159    #[non_exhaustive]
5160    _UnknownEvent {
5161        /// Ordinal of the event that was sent.
5162        ordinal: u64,
5163    },
5164}
5165
5166impl DataRouterEvent {
5167    /// Decodes a message buffer as a [`DataRouterEvent`].
5168    fn decode(
5169        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5170    ) -> Result<DataRouterEvent, fidl::Error> {
5171        let (bytes, _handles) = buf.split_mut();
5172        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5173        debug_assert_eq!(tx_header.tx_id, 0);
5174        match tx_header.ordinal {
5175            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
5176                Ok(DataRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
5177            }
5178            _ => Err(fidl::Error::UnknownOrdinal {
5179                ordinal: tx_header.ordinal,
5180                protocol_name: <DataRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5181            }),
5182        }
5183    }
5184}
5185
5186/// A Stream of incoming requests for fuchsia.component.sandbox/DataRouter.
5187pub struct DataRouterRequestStream {
5188    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5189    is_terminated: bool,
5190}
5191
5192impl std::marker::Unpin for DataRouterRequestStream {}
5193
5194impl futures::stream::FusedStream for DataRouterRequestStream {
5195    fn is_terminated(&self) -> bool {
5196        self.is_terminated
5197    }
5198}
5199
5200impl fidl::endpoints::RequestStream for DataRouterRequestStream {
5201    type Protocol = DataRouterMarker;
5202    type ControlHandle = DataRouterControlHandle;
5203
5204    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5205        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5206    }
5207
5208    fn control_handle(&self) -> Self::ControlHandle {
5209        DataRouterControlHandle { inner: self.inner.clone() }
5210    }
5211
5212    fn into_inner(
5213        self,
5214    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5215    {
5216        (self.inner, self.is_terminated)
5217    }
5218
5219    fn from_inner(
5220        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5221        is_terminated: bool,
5222    ) -> Self {
5223        Self { inner, is_terminated }
5224    }
5225}
5226
5227impl futures::Stream for DataRouterRequestStream {
5228    type Item = Result<DataRouterRequest, fidl::Error>;
5229
5230    fn poll_next(
5231        mut self: std::pin::Pin<&mut Self>,
5232        cx: &mut std::task::Context<'_>,
5233    ) -> std::task::Poll<Option<Self::Item>> {
5234        let this = &mut *self;
5235        if this.inner.check_shutdown(cx) {
5236            this.is_terminated = true;
5237            return std::task::Poll::Ready(None);
5238        }
5239        if this.is_terminated {
5240            panic!("polled DataRouterRequestStream after completion");
5241        }
5242        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
5243            |bytes, handles| {
5244                match this.inner.channel().read_etc(cx, bytes, handles) {
5245                    std::task::Poll::Ready(Ok(())) => {}
5246                    std::task::Poll::Pending => return std::task::Poll::Pending,
5247                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
5248                        this.is_terminated = true;
5249                        return std::task::Poll::Ready(None);
5250                    }
5251                    std::task::Poll::Ready(Err(e)) => {
5252                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5253                            e.into(),
5254                        ))));
5255                    }
5256                }
5257
5258                // A message has been received from the channel
5259                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5260
5261                std::task::Poll::Ready(Some(match header.ordinal {
5262                    0x2e87dc44dfc53804 => {
5263                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5264                        let mut req = fidl::new_empty!(
5265                            RouteRequest,
5266                            fidl::encoding::DefaultFuchsiaResourceDialect
5267                        );
5268                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RouteRequest>(&header, _body_bytes, handles, &mut req)?;
5269                        let control_handle = DataRouterControlHandle { inner: this.inner.clone() };
5270                        Ok(DataRouterRequest::Route {
5271                            payload: req,
5272                            responder: DataRouterRouteResponder {
5273                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5274                                tx_id: header.tx_id,
5275                            },
5276                        })
5277                    }
5278                    _ if header.tx_id == 0
5279                        && header
5280                            .dynamic_flags()
5281                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5282                    {
5283                        Ok(DataRouterRequest::_UnknownMethod {
5284                            ordinal: header.ordinal,
5285                            control_handle: DataRouterControlHandle { inner: this.inner.clone() },
5286                            method_type: fidl::MethodType::OneWay,
5287                        })
5288                    }
5289                    _ if header
5290                        .dynamic_flags()
5291                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5292                    {
5293                        this.inner.send_framework_err(
5294                            fidl::encoding::FrameworkErr::UnknownMethod,
5295                            header.tx_id,
5296                            header.ordinal,
5297                            header.dynamic_flags(),
5298                            (bytes, handles),
5299                        )?;
5300                        Ok(DataRouterRequest::_UnknownMethod {
5301                            ordinal: header.ordinal,
5302                            control_handle: DataRouterControlHandle { inner: this.inner.clone() },
5303                            method_type: fidl::MethodType::TwoWay,
5304                        })
5305                    }
5306                    _ => Err(fidl::Error::UnknownOrdinal {
5307                        ordinal: header.ordinal,
5308                        protocol_name:
5309                            <DataRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5310                    }),
5311                }))
5312            },
5313        )
5314    }
5315}
5316
5317#[derive(Debug)]
5318pub enum DataRouterRequest {
5319    Route {
5320        payload: RouteRequest,
5321        responder: DataRouterRouteResponder,
5322    },
5323    /// An interaction was received which does not match any known method.
5324    #[non_exhaustive]
5325    _UnknownMethod {
5326        /// Ordinal of the method that was called.
5327        ordinal: u64,
5328        control_handle: DataRouterControlHandle,
5329        method_type: fidl::MethodType,
5330    },
5331}
5332
5333impl DataRouterRequest {
5334    #[allow(irrefutable_let_patterns)]
5335    pub fn into_route(self) -> Option<(RouteRequest, DataRouterRouteResponder)> {
5336        if let DataRouterRequest::Route { payload, responder } = self {
5337            Some((payload, responder))
5338        } else {
5339            None
5340        }
5341    }
5342
5343    /// Name of the method defined in FIDL
5344    pub fn method_name(&self) -> &'static str {
5345        match *self {
5346            DataRouterRequest::Route { .. } => "route",
5347            DataRouterRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
5348                "unknown one-way method"
5349            }
5350            DataRouterRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
5351                "unknown two-way method"
5352            }
5353        }
5354    }
5355}
5356
5357#[derive(Debug, Clone)]
5358pub struct DataRouterControlHandle {
5359    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5360}
5361
5362impl fidl::endpoints::ControlHandle for DataRouterControlHandle {
5363    fn shutdown(&self) {
5364        self.inner.shutdown()
5365    }
5366    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
5367        self.inner.shutdown_with_epitaph(status)
5368    }
5369
5370    fn is_closed(&self) -> bool {
5371        self.inner.channel().is_closed()
5372    }
5373    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
5374        self.inner.channel().on_closed()
5375    }
5376
5377    #[cfg(target_os = "fuchsia")]
5378    fn signal_peer(
5379        &self,
5380        clear_mask: zx::Signals,
5381        set_mask: zx::Signals,
5382    ) -> Result<(), zx_status::Status> {
5383        use fidl::Peered;
5384        self.inner.channel().signal_peer(clear_mask, set_mask)
5385    }
5386}
5387
5388impl DataRouterControlHandle {}
5389
5390#[must_use = "FIDL methods require a response to be sent"]
5391#[derive(Debug)]
5392pub struct DataRouterRouteResponder {
5393    control_handle: std::mem::ManuallyDrop<DataRouterControlHandle>,
5394    tx_id: u32,
5395}
5396
5397/// Set the the channel to be shutdown (see [`DataRouterControlHandle::shutdown`])
5398/// if the responder is dropped without sending a response, so that the client
5399/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5400impl std::ops::Drop for DataRouterRouteResponder {
5401    fn drop(&mut self) {
5402        self.control_handle.shutdown();
5403        // Safety: drops once, never accessed again
5404        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5405    }
5406}
5407
5408impl fidl::endpoints::Responder for DataRouterRouteResponder {
5409    type ControlHandle = DataRouterControlHandle;
5410
5411    fn control_handle(&self) -> &DataRouterControlHandle {
5412        &self.control_handle
5413    }
5414
5415    fn drop_without_shutdown(mut self) {
5416        // Safety: drops once, never accessed again due to mem::forget
5417        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5418        // Prevent Drop from running (which would shut down the channel)
5419        std::mem::forget(self);
5420    }
5421}
5422
5423impl DataRouterRouteResponder {
5424    /// Sends a response to the FIDL transaction.
5425    ///
5426    /// Sets the channel to shutdown if an error occurs.
5427    pub fn send(
5428        self,
5429        mut result: Result<DataRouterRouteResponse, RouterError>,
5430    ) -> Result<(), fidl::Error> {
5431        let _result = self.send_raw(result);
5432        if _result.is_err() {
5433            self.control_handle.shutdown();
5434        }
5435        self.drop_without_shutdown();
5436        _result
5437    }
5438
5439    /// Similar to "send" but does not shutdown the channel if an error occurs.
5440    pub fn send_no_shutdown_on_err(
5441        self,
5442        mut result: Result<DataRouterRouteResponse, RouterError>,
5443    ) -> Result<(), fidl::Error> {
5444        let _result = self.send_raw(result);
5445        self.drop_without_shutdown();
5446        _result
5447    }
5448
5449    fn send_raw(
5450        &self,
5451        mut result: Result<DataRouterRouteResponse, RouterError>,
5452    ) -> Result<(), fidl::Error> {
5453        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
5454            DataRouterRouteResponse,
5455            RouterError,
5456        >>(
5457            fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
5458            self.tx_id,
5459            0x2e87dc44dfc53804,
5460            fidl::encoding::DynamicFlags::FLEXIBLE,
5461        )
5462    }
5463}
5464
5465#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5466pub struct DictionaryMarker;
5467
5468impl fidl::endpoints::ProtocolMarker for DictionaryMarker {
5469    type Proxy = DictionaryProxy;
5470    type RequestStream = DictionaryRequestStream;
5471    #[cfg(target_os = "fuchsia")]
5472    type SynchronousProxy = DictionarySynchronousProxy;
5473
5474    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.Dictionary";
5475}
5476impl fidl::endpoints::DiscoverableProtocolMarker for DictionaryMarker {}
5477
5478pub trait DictionaryProxyInterface: Send + Sync {}
5479#[derive(Debug)]
5480#[cfg(target_os = "fuchsia")]
5481pub struct DictionarySynchronousProxy {
5482    client: fidl::client::sync::Client,
5483}
5484
5485#[cfg(target_os = "fuchsia")]
5486impl fidl::endpoints::SynchronousProxy for DictionarySynchronousProxy {
5487    type Proxy = DictionaryProxy;
5488    type Protocol = DictionaryMarker;
5489
5490    fn from_channel(inner: fidl::Channel) -> Self {
5491        Self::new(inner)
5492    }
5493
5494    fn into_channel(self) -> fidl::Channel {
5495        self.client.into_channel()
5496    }
5497
5498    fn as_channel(&self) -> &fidl::Channel {
5499        self.client.as_channel()
5500    }
5501}
5502
5503#[cfg(target_os = "fuchsia")]
5504impl DictionarySynchronousProxy {
5505    pub fn new(channel: fidl::Channel) -> Self {
5506        let protocol_name = <DictionaryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5507        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
5508    }
5509
5510    pub fn into_channel(self) -> fidl::Channel {
5511        self.client.into_channel()
5512    }
5513
5514    /// Waits until an event arrives and returns it. It is safe for other
5515    /// threads to make concurrent requests while waiting for an event.
5516    pub fn wait_for_event(
5517        &self,
5518        deadline: zx::MonotonicInstant,
5519    ) -> Result<DictionaryEvent, fidl::Error> {
5520        DictionaryEvent::decode(self.client.wait_for_event(deadline)?)
5521    }
5522}
5523
5524#[cfg(target_os = "fuchsia")]
5525impl From<DictionarySynchronousProxy> for zx::NullableHandle {
5526    fn from(value: DictionarySynchronousProxy) -> Self {
5527        value.into_channel().into()
5528    }
5529}
5530
5531#[cfg(target_os = "fuchsia")]
5532impl From<fidl::Channel> for DictionarySynchronousProxy {
5533    fn from(value: fidl::Channel) -> Self {
5534        Self::new(value)
5535    }
5536}
5537
5538#[cfg(target_os = "fuchsia")]
5539impl fidl::endpoints::FromClient for DictionarySynchronousProxy {
5540    type Protocol = DictionaryMarker;
5541
5542    fn from_client(value: fidl::endpoints::ClientEnd<DictionaryMarker>) -> Self {
5543        Self::new(value.into_channel())
5544    }
5545}
5546
5547#[derive(Debug, Clone)]
5548pub struct DictionaryProxy {
5549    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
5550}
5551
5552impl fidl::endpoints::Proxy for DictionaryProxy {
5553    type Protocol = DictionaryMarker;
5554
5555    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
5556        Self::new(inner)
5557    }
5558
5559    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
5560        self.client.into_channel().map_err(|client| Self { client })
5561    }
5562
5563    fn as_channel(&self) -> &::fidl::AsyncChannel {
5564        self.client.as_channel()
5565    }
5566}
5567
5568impl DictionaryProxy {
5569    /// Create a new Proxy for fuchsia.component.sandbox/Dictionary.
5570    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5571        let protocol_name = <DictionaryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5572        Self { client: fidl::client::Client::new(channel, protocol_name) }
5573    }
5574
5575    /// Get a Stream of events from the remote end of the protocol.
5576    ///
5577    /// # Panics
5578    ///
5579    /// Panics if the event stream was already taken.
5580    pub fn take_event_stream(&self) -> DictionaryEventStream {
5581        DictionaryEventStream { event_receiver: self.client.take_event_receiver() }
5582    }
5583}
5584
5585impl DictionaryProxyInterface for DictionaryProxy {}
5586
5587pub struct DictionaryEventStream {
5588    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
5589}
5590
5591impl std::marker::Unpin for DictionaryEventStream {}
5592
5593impl futures::stream::FusedStream for DictionaryEventStream {
5594    fn is_terminated(&self) -> bool {
5595        self.event_receiver.is_terminated()
5596    }
5597}
5598
5599impl futures::Stream for DictionaryEventStream {
5600    type Item = Result<DictionaryEvent, fidl::Error>;
5601
5602    fn poll_next(
5603        mut self: std::pin::Pin<&mut Self>,
5604        cx: &mut std::task::Context<'_>,
5605    ) -> std::task::Poll<Option<Self::Item>> {
5606        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5607            &mut self.event_receiver,
5608            cx
5609        )?) {
5610            Some(buf) => std::task::Poll::Ready(Some(DictionaryEvent::decode(buf))),
5611            None => std::task::Poll::Ready(None),
5612        }
5613    }
5614}
5615
5616#[derive(Debug)]
5617pub enum DictionaryEvent {
5618    #[non_exhaustive]
5619    _UnknownEvent {
5620        /// Ordinal of the event that was sent.
5621        ordinal: u64,
5622    },
5623}
5624
5625impl DictionaryEvent {
5626    /// Decodes a message buffer as a [`DictionaryEvent`].
5627    fn decode(
5628        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5629    ) -> Result<DictionaryEvent, fidl::Error> {
5630        let (bytes, _handles) = buf.split_mut();
5631        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5632        debug_assert_eq!(tx_header.tx_id, 0);
5633        match tx_header.ordinal {
5634            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
5635                Ok(DictionaryEvent::_UnknownEvent { ordinal: tx_header.ordinal })
5636            }
5637            _ => Err(fidl::Error::UnknownOrdinal {
5638                ordinal: tx_header.ordinal,
5639                protocol_name: <DictionaryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5640            }),
5641        }
5642    }
5643}
5644
5645/// A Stream of incoming requests for fuchsia.component.sandbox/Dictionary.
5646pub struct DictionaryRequestStream {
5647    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5648    is_terminated: bool,
5649}
5650
5651impl std::marker::Unpin for DictionaryRequestStream {}
5652
5653impl futures::stream::FusedStream for DictionaryRequestStream {
5654    fn is_terminated(&self) -> bool {
5655        self.is_terminated
5656    }
5657}
5658
5659impl fidl::endpoints::RequestStream for DictionaryRequestStream {
5660    type Protocol = DictionaryMarker;
5661    type ControlHandle = DictionaryControlHandle;
5662
5663    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5664        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5665    }
5666
5667    fn control_handle(&self) -> Self::ControlHandle {
5668        DictionaryControlHandle { inner: self.inner.clone() }
5669    }
5670
5671    fn into_inner(
5672        self,
5673    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5674    {
5675        (self.inner, self.is_terminated)
5676    }
5677
5678    fn from_inner(
5679        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5680        is_terminated: bool,
5681    ) -> Self {
5682        Self { inner, is_terminated }
5683    }
5684}
5685
5686impl futures::Stream for DictionaryRequestStream {
5687    type Item = Result<DictionaryRequest, fidl::Error>;
5688
5689    fn poll_next(
5690        mut self: std::pin::Pin<&mut Self>,
5691        cx: &mut std::task::Context<'_>,
5692    ) -> std::task::Poll<Option<Self::Item>> {
5693        let this = &mut *self;
5694        if this.inner.check_shutdown(cx) {
5695            this.is_terminated = true;
5696            return std::task::Poll::Ready(None);
5697        }
5698        if this.is_terminated {
5699            panic!("polled DictionaryRequestStream after completion");
5700        }
5701        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
5702            |bytes, handles| {
5703                match this.inner.channel().read_etc(cx, bytes, handles) {
5704                    std::task::Poll::Ready(Ok(())) => {}
5705                    std::task::Poll::Pending => return std::task::Poll::Pending,
5706                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
5707                        this.is_terminated = true;
5708                        return std::task::Poll::Ready(None);
5709                    }
5710                    std::task::Poll::Ready(Err(e)) => {
5711                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5712                            e.into(),
5713                        ))));
5714                    }
5715                }
5716
5717                // A message has been received from the channel
5718                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5719
5720                std::task::Poll::Ready(Some(match header.ordinal {
5721                    _ if header.tx_id == 0
5722                        && header
5723                            .dynamic_flags()
5724                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5725                    {
5726                        Ok(DictionaryRequest::_UnknownMethod {
5727                            ordinal: header.ordinal,
5728                            control_handle: DictionaryControlHandle { inner: this.inner.clone() },
5729                            method_type: fidl::MethodType::OneWay,
5730                        })
5731                    }
5732                    _ if header
5733                        .dynamic_flags()
5734                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5735                    {
5736                        this.inner.send_framework_err(
5737                            fidl::encoding::FrameworkErr::UnknownMethod,
5738                            header.tx_id,
5739                            header.ordinal,
5740                            header.dynamic_flags(),
5741                            (bytes, handles),
5742                        )?;
5743                        Ok(DictionaryRequest::_UnknownMethod {
5744                            ordinal: header.ordinal,
5745                            control_handle: DictionaryControlHandle { inner: this.inner.clone() },
5746                            method_type: fidl::MethodType::TwoWay,
5747                        })
5748                    }
5749                    _ => Err(fidl::Error::UnknownOrdinal {
5750                        ordinal: header.ordinal,
5751                        protocol_name:
5752                            <DictionaryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5753                    }),
5754                }))
5755            },
5756        )
5757    }
5758}
5759
5760#[derive(Debug)]
5761pub enum DictionaryRequest {
5762    /// An interaction was received which does not match any known method.
5763    #[non_exhaustive]
5764    _UnknownMethod {
5765        /// Ordinal of the method that was called.
5766        ordinal: u64,
5767        control_handle: DictionaryControlHandle,
5768        method_type: fidl::MethodType,
5769    },
5770}
5771
5772impl DictionaryRequest {
5773    /// Name of the method defined in FIDL
5774    pub fn method_name(&self) -> &'static str {
5775        match *self {
5776            DictionaryRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
5777                "unknown one-way method"
5778            }
5779            DictionaryRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
5780                "unknown two-way method"
5781            }
5782        }
5783    }
5784}
5785
5786#[derive(Debug, Clone)]
5787pub struct DictionaryControlHandle {
5788    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5789}
5790
5791impl fidl::endpoints::ControlHandle for DictionaryControlHandle {
5792    fn shutdown(&self) {
5793        self.inner.shutdown()
5794    }
5795    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
5796        self.inner.shutdown_with_epitaph(status)
5797    }
5798
5799    fn is_closed(&self) -> bool {
5800        self.inner.channel().is_closed()
5801    }
5802    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
5803        self.inner.channel().on_closed()
5804    }
5805
5806    #[cfg(target_os = "fuchsia")]
5807    fn signal_peer(
5808        &self,
5809        clear_mask: zx::Signals,
5810        set_mask: zx::Signals,
5811    ) -> Result<(), zx_status::Status> {
5812        use fidl::Peered;
5813        self.inner.channel().signal_peer(clear_mask, set_mask)
5814    }
5815}
5816
5817impl DictionaryControlHandle {}
5818
5819#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5820pub struct DictionaryDrainIteratorMarker;
5821
5822impl fidl::endpoints::ProtocolMarker for DictionaryDrainIteratorMarker {
5823    type Proxy = DictionaryDrainIteratorProxy;
5824    type RequestStream = DictionaryDrainIteratorRequestStream;
5825    #[cfg(target_os = "fuchsia")]
5826    type SynchronousProxy = DictionaryDrainIteratorSynchronousProxy;
5827
5828    const DEBUG_NAME: &'static str = "(anonymous) DictionaryDrainIterator";
5829}
5830pub type DictionaryDrainIteratorGetNextResult =
5831    Result<(Vec<DictionaryItem>, u64), CapabilityStoreError>;
5832
5833pub trait DictionaryDrainIteratorProxyInterface: Send + Sync {
5834    type GetNextResponseFut: std::future::Future<Output = Result<DictionaryDrainIteratorGetNextResult, fidl::Error>>
5835        + Send;
5836    fn r#get_next(&self, start_id: u64, limit: u32) -> Self::GetNextResponseFut;
5837}
5838#[derive(Debug)]
5839#[cfg(target_os = "fuchsia")]
5840pub struct DictionaryDrainIteratorSynchronousProxy {
5841    client: fidl::client::sync::Client,
5842}
5843
5844#[cfg(target_os = "fuchsia")]
5845impl fidl::endpoints::SynchronousProxy for DictionaryDrainIteratorSynchronousProxy {
5846    type Proxy = DictionaryDrainIteratorProxy;
5847    type Protocol = DictionaryDrainIteratorMarker;
5848
5849    fn from_channel(inner: fidl::Channel) -> Self {
5850        Self::new(inner)
5851    }
5852
5853    fn into_channel(self) -> fidl::Channel {
5854        self.client.into_channel()
5855    }
5856
5857    fn as_channel(&self) -> &fidl::Channel {
5858        self.client.as_channel()
5859    }
5860}
5861
5862#[cfg(target_os = "fuchsia")]
5863impl DictionaryDrainIteratorSynchronousProxy {
5864    pub fn new(channel: fidl::Channel) -> Self {
5865        let protocol_name =
5866            <DictionaryDrainIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5867        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
5868    }
5869
5870    pub fn into_channel(self) -> fidl::Channel {
5871        self.client.into_channel()
5872    }
5873
5874    /// Waits until an event arrives and returns it. It is safe for other
5875    /// threads to make concurrent requests while waiting for an event.
5876    pub fn wait_for_event(
5877        &self,
5878        deadline: zx::MonotonicInstant,
5879    ) -> Result<DictionaryDrainIteratorEvent, fidl::Error> {
5880        DictionaryDrainIteratorEvent::decode(self.client.wait_for_event(deadline)?)
5881    }
5882
5883    /// Returns the next batch of results for a [Dictionary.Drain] call, returning up to
5884    /// `limit` results. `limit` can be at most [MAX_DICTIONARY_ITERATOR_CHUNK].
5885    ///
5886    /// Each returned capability will be assigned a monotonically increasing [CapabilityId] starting
5887    /// from `start_id`.
5888    ///
5889    /// In addition to the `items`, returns `end_id`, which is one more than the highest id reserved
5890    /// by [GetNext]. `end_id` can be used as the `start_id` for the next call to [GetNext].
5891    ///
5892    /// If [GetNext] returns an error, the server will also close the channel.
5893    ///
5894    /// Errors:
5895    ///
5896    /// - `ID_ALREADY_EXISTS` if some id in the range `[start_id, limit)` already exists in this
5897    ///   store.
5898    /// - `INVALID_ARGS` if `limit` was `0` or greater than `MAX_DICTIONARY_ITERATOR_CHUNK`.
5899    pub fn r#get_next(
5900        &self,
5901        mut start_id: u64,
5902        mut limit: u32,
5903        ___deadline: zx::MonotonicInstant,
5904    ) -> Result<DictionaryDrainIteratorGetNextResult, fidl::Error> {
5905        let _response = self
5906            .client
5907            .send_query::<DictionaryDrainIteratorGetNextRequest, fidl::encoding::FlexibleResultType<
5908                DictionaryDrainIteratorGetNextResponse,
5909                CapabilityStoreError,
5910            >>(
5911                (start_id, limit),
5912                0x4f8082ca1ee26061,
5913                fidl::encoding::DynamicFlags::FLEXIBLE,
5914                ___deadline,
5915            )?
5916            .into_result::<DictionaryDrainIteratorMarker>("get_next")?;
5917        Ok(_response.map(|x| (x.items, x.end_id)))
5918    }
5919}
5920
5921#[cfg(target_os = "fuchsia")]
5922impl From<DictionaryDrainIteratorSynchronousProxy> for zx::NullableHandle {
5923    fn from(value: DictionaryDrainIteratorSynchronousProxy) -> Self {
5924        value.into_channel().into()
5925    }
5926}
5927
5928#[cfg(target_os = "fuchsia")]
5929impl From<fidl::Channel> for DictionaryDrainIteratorSynchronousProxy {
5930    fn from(value: fidl::Channel) -> Self {
5931        Self::new(value)
5932    }
5933}
5934
5935#[cfg(target_os = "fuchsia")]
5936impl fidl::endpoints::FromClient for DictionaryDrainIteratorSynchronousProxy {
5937    type Protocol = DictionaryDrainIteratorMarker;
5938
5939    fn from_client(value: fidl::endpoints::ClientEnd<DictionaryDrainIteratorMarker>) -> Self {
5940        Self::new(value.into_channel())
5941    }
5942}
5943
5944#[derive(Debug, Clone)]
5945pub struct DictionaryDrainIteratorProxy {
5946    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
5947}
5948
5949impl fidl::endpoints::Proxy for DictionaryDrainIteratorProxy {
5950    type Protocol = DictionaryDrainIteratorMarker;
5951
5952    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
5953        Self::new(inner)
5954    }
5955
5956    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
5957        self.client.into_channel().map_err(|client| Self { client })
5958    }
5959
5960    fn as_channel(&self) -> &::fidl::AsyncChannel {
5961        self.client.as_channel()
5962    }
5963}
5964
5965impl DictionaryDrainIteratorProxy {
5966    /// Create a new Proxy for fuchsia.component.sandbox/DictionaryDrainIterator.
5967    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5968        let protocol_name =
5969            <DictionaryDrainIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5970        Self { client: fidl::client::Client::new(channel, protocol_name) }
5971    }
5972
5973    /// Get a Stream of events from the remote end of the protocol.
5974    ///
5975    /// # Panics
5976    ///
5977    /// Panics if the event stream was already taken.
5978    pub fn take_event_stream(&self) -> DictionaryDrainIteratorEventStream {
5979        DictionaryDrainIteratorEventStream { event_receiver: self.client.take_event_receiver() }
5980    }
5981
5982    /// Returns the next batch of results for a [Dictionary.Drain] call, returning up to
5983    /// `limit` results. `limit` can be at most [MAX_DICTIONARY_ITERATOR_CHUNK].
5984    ///
5985    /// Each returned capability will be assigned a monotonically increasing [CapabilityId] starting
5986    /// from `start_id`.
5987    ///
5988    /// In addition to the `items`, returns `end_id`, which is one more than the highest id reserved
5989    /// by [GetNext]. `end_id` can be used as the `start_id` for the next call to [GetNext].
5990    ///
5991    /// If [GetNext] returns an error, the server will also close the channel.
5992    ///
5993    /// Errors:
5994    ///
5995    /// - `ID_ALREADY_EXISTS` if some id in the range `[start_id, limit)` already exists in this
5996    ///   store.
5997    /// - `INVALID_ARGS` if `limit` was `0` or greater than `MAX_DICTIONARY_ITERATOR_CHUNK`.
5998    pub fn r#get_next(
5999        &self,
6000        mut start_id: u64,
6001        mut limit: u32,
6002    ) -> fidl::client::QueryResponseFut<
6003        DictionaryDrainIteratorGetNextResult,
6004        fidl::encoding::DefaultFuchsiaResourceDialect,
6005    > {
6006        DictionaryDrainIteratorProxyInterface::r#get_next(self, start_id, limit)
6007    }
6008}
6009
6010impl DictionaryDrainIteratorProxyInterface for DictionaryDrainIteratorProxy {
6011    type GetNextResponseFut = fidl::client::QueryResponseFut<
6012        DictionaryDrainIteratorGetNextResult,
6013        fidl::encoding::DefaultFuchsiaResourceDialect,
6014    >;
6015    fn r#get_next(&self, mut start_id: u64, mut limit: u32) -> Self::GetNextResponseFut {
6016        fn _decode(
6017            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6018        ) -> Result<DictionaryDrainIteratorGetNextResult, fidl::Error> {
6019            let _response = fidl::client::decode_transaction_body::<
6020                fidl::encoding::FlexibleResultType<
6021                    DictionaryDrainIteratorGetNextResponse,
6022                    CapabilityStoreError,
6023                >,
6024                fidl::encoding::DefaultFuchsiaResourceDialect,
6025                0x4f8082ca1ee26061,
6026            >(_buf?)?
6027            .into_result::<DictionaryDrainIteratorMarker>("get_next")?;
6028            Ok(_response.map(|x| (x.items, x.end_id)))
6029        }
6030        self.client.send_query_and_decode::<
6031            DictionaryDrainIteratorGetNextRequest,
6032            DictionaryDrainIteratorGetNextResult,
6033        >(
6034            (start_id, limit,),
6035            0x4f8082ca1ee26061,
6036            fidl::encoding::DynamicFlags::FLEXIBLE,
6037            _decode,
6038        )
6039    }
6040}
6041
6042pub struct DictionaryDrainIteratorEventStream {
6043    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6044}
6045
6046impl std::marker::Unpin for DictionaryDrainIteratorEventStream {}
6047
6048impl futures::stream::FusedStream for DictionaryDrainIteratorEventStream {
6049    fn is_terminated(&self) -> bool {
6050        self.event_receiver.is_terminated()
6051    }
6052}
6053
6054impl futures::Stream for DictionaryDrainIteratorEventStream {
6055    type Item = Result<DictionaryDrainIteratorEvent, fidl::Error>;
6056
6057    fn poll_next(
6058        mut self: std::pin::Pin<&mut Self>,
6059        cx: &mut std::task::Context<'_>,
6060    ) -> std::task::Poll<Option<Self::Item>> {
6061        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6062            &mut self.event_receiver,
6063            cx
6064        )?) {
6065            Some(buf) => std::task::Poll::Ready(Some(DictionaryDrainIteratorEvent::decode(buf))),
6066            None => std::task::Poll::Ready(None),
6067        }
6068    }
6069}
6070
6071#[derive(Debug)]
6072pub enum DictionaryDrainIteratorEvent {
6073    #[non_exhaustive]
6074    _UnknownEvent {
6075        /// Ordinal of the event that was sent.
6076        ordinal: u64,
6077    },
6078}
6079
6080impl DictionaryDrainIteratorEvent {
6081    /// Decodes a message buffer as a [`DictionaryDrainIteratorEvent`].
6082    fn decode(
6083        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6084    ) -> Result<DictionaryDrainIteratorEvent, fidl::Error> {
6085        let (bytes, _handles) = buf.split_mut();
6086        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6087        debug_assert_eq!(tx_header.tx_id, 0);
6088        match tx_header.ordinal {
6089            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6090                Ok(DictionaryDrainIteratorEvent::_UnknownEvent { ordinal: tx_header.ordinal })
6091            }
6092            _ => Err(fidl::Error::UnknownOrdinal {
6093                ordinal: tx_header.ordinal,
6094                protocol_name:
6095                    <DictionaryDrainIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6096            }),
6097        }
6098    }
6099}
6100
6101/// A Stream of incoming requests for fuchsia.component.sandbox/DictionaryDrainIterator.
6102pub struct DictionaryDrainIteratorRequestStream {
6103    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6104    is_terminated: bool,
6105}
6106
6107impl std::marker::Unpin for DictionaryDrainIteratorRequestStream {}
6108
6109impl futures::stream::FusedStream for DictionaryDrainIteratorRequestStream {
6110    fn is_terminated(&self) -> bool {
6111        self.is_terminated
6112    }
6113}
6114
6115impl fidl::endpoints::RequestStream for DictionaryDrainIteratorRequestStream {
6116    type Protocol = DictionaryDrainIteratorMarker;
6117    type ControlHandle = DictionaryDrainIteratorControlHandle;
6118
6119    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6120        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6121    }
6122
6123    fn control_handle(&self) -> Self::ControlHandle {
6124        DictionaryDrainIteratorControlHandle { inner: self.inner.clone() }
6125    }
6126
6127    fn into_inner(
6128        self,
6129    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6130    {
6131        (self.inner, self.is_terminated)
6132    }
6133
6134    fn from_inner(
6135        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6136        is_terminated: bool,
6137    ) -> Self {
6138        Self { inner, is_terminated }
6139    }
6140}
6141
6142impl futures::Stream for DictionaryDrainIteratorRequestStream {
6143    type Item = Result<DictionaryDrainIteratorRequest, fidl::Error>;
6144
6145    fn poll_next(
6146        mut self: std::pin::Pin<&mut Self>,
6147        cx: &mut std::task::Context<'_>,
6148    ) -> std::task::Poll<Option<Self::Item>> {
6149        let this = &mut *self;
6150        if this.inner.check_shutdown(cx) {
6151            this.is_terminated = true;
6152            return std::task::Poll::Ready(None);
6153        }
6154        if this.is_terminated {
6155            panic!("polled DictionaryDrainIteratorRequestStream after completion");
6156        }
6157        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
6158            |bytes, handles| {
6159                match this.inner.channel().read_etc(cx, bytes, handles) {
6160                    std::task::Poll::Ready(Ok(())) => {}
6161                    std::task::Poll::Pending => return std::task::Poll::Pending,
6162                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
6163                        this.is_terminated = true;
6164                        return std::task::Poll::Ready(None);
6165                    }
6166                    std::task::Poll::Ready(Err(e)) => {
6167                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6168                            e.into(),
6169                        ))));
6170                    }
6171                }
6172
6173                // A message has been received from the channel
6174                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6175
6176                std::task::Poll::Ready(Some(match header.ordinal {
6177                0x4f8082ca1ee26061 => {
6178                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6179                    let mut req = fidl::new_empty!(DictionaryDrainIteratorGetNextRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
6180                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DictionaryDrainIteratorGetNextRequest>(&header, _body_bytes, handles, &mut req)?;
6181                    let control_handle = DictionaryDrainIteratorControlHandle {
6182                        inner: this.inner.clone(),
6183                    };
6184                    Ok(DictionaryDrainIteratorRequest::GetNext {start_id: req.start_id,
6185limit: req.limit,
6186
6187                        responder: DictionaryDrainIteratorGetNextResponder {
6188                            control_handle: std::mem::ManuallyDrop::new(control_handle),
6189                            tx_id: header.tx_id,
6190                        },
6191                    })
6192                }
6193                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6194                    Ok(DictionaryDrainIteratorRequest::_UnknownMethod {
6195                        ordinal: header.ordinal,
6196                        control_handle: DictionaryDrainIteratorControlHandle { inner: this.inner.clone() },
6197                        method_type: fidl::MethodType::OneWay,
6198                    })
6199                }
6200                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6201                    this.inner.send_framework_err(
6202                        fidl::encoding::FrameworkErr::UnknownMethod,
6203                        header.tx_id,
6204                        header.ordinal,
6205                        header.dynamic_flags(),
6206                        (bytes, handles),
6207                    )?;
6208                    Ok(DictionaryDrainIteratorRequest::_UnknownMethod {
6209                        ordinal: header.ordinal,
6210                        control_handle: DictionaryDrainIteratorControlHandle { inner: this.inner.clone() },
6211                        method_type: fidl::MethodType::TwoWay,
6212                    })
6213                }
6214                _ => Err(fidl::Error::UnknownOrdinal {
6215                    ordinal: header.ordinal,
6216                    protocol_name: <DictionaryDrainIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6217                }),
6218            }))
6219            },
6220        )
6221    }
6222}
6223
6224#[derive(Debug)]
6225pub enum DictionaryDrainIteratorRequest {
6226    /// Returns the next batch of results for a [Dictionary.Drain] call, returning up to
6227    /// `limit` results. `limit` can be at most [MAX_DICTIONARY_ITERATOR_CHUNK].
6228    ///
6229    /// Each returned capability will be assigned a monotonically increasing [CapabilityId] starting
6230    /// from `start_id`.
6231    ///
6232    /// In addition to the `items`, returns `end_id`, which is one more than the highest id reserved
6233    /// by [GetNext]. `end_id` can be used as the `start_id` for the next call to [GetNext].
6234    ///
6235    /// If [GetNext] returns an error, the server will also close the channel.
6236    ///
6237    /// Errors:
6238    ///
6239    /// - `ID_ALREADY_EXISTS` if some id in the range `[start_id, limit)` already exists in this
6240    ///   store.
6241    /// - `INVALID_ARGS` if `limit` was `0` or greater than `MAX_DICTIONARY_ITERATOR_CHUNK`.
6242    GetNext { start_id: u64, limit: u32, responder: DictionaryDrainIteratorGetNextResponder },
6243    /// An interaction was received which does not match any known method.
6244    #[non_exhaustive]
6245    _UnknownMethod {
6246        /// Ordinal of the method that was called.
6247        ordinal: u64,
6248        control_handle: DictionaryDrainIteratorControlHandle,
6249        method_type: fidl::MethodType,
6250    },
6251}
6252
6253impl DictionaryDrainIteratorRequest {
6254    #[allow(irrefutable_let_patterns)]
6255    pub fn into_get_next(self) -> Option<(u64, u32, DictionaryDrainIteratorGetNextResponder)> {
6256        if let DictionaryDrainIteratorRequest::GetNext { start_id, limit, responder } = self {
6257            Some((start_id, limit, responder))
6258        } else {
6259            None
6260        }
6261    }
6262
6263    /// Name of the method defined in FIDL
6264    pub fn method_name(&self) -> &'static str {
6265        match *self {
6266            DictionaryDrainIteratorRequest::GetNext { .. } => "get_next",
6267            DictionaryDrainIteratorRequest::_UnknownMethod {
6268                method_type: fidl::MethodType::OneWay,
6269                ..
6270            } => "unknown one-way method",
6271            DictionaryDrainIteratorRequest::_UnknownMethod {
6272                method_type: fidl::MethodType::TwoWay,
6273                ..
6274            } => "unknown two-way method",
6275        }
6276    }
6277}
6278
6279#[derive(Debug, Clone)]
6280pub struct DictionaryDrainIteratorControlHandle {
6281    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6282}
6283
6284impl fidl::endpoints::ControlHandle for DictionaryDrainIteratorControlHandle {
6285    fn shutdown(&self) {
6286        self.inner.shutdown()
6287    }
6288    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
6289        self.inner.shutdown_with_epitaph(status)
6290    }
6291
6292    fn is_closed(&self) -> bool {
6293        self.inner.channel().is_closed()
6294    }
6295    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6296        self.inner.channel().on_closed()
6297    }
6298
6299    #[cfg(target_os = "fuchsia")]
6300    fn signal_peer(
6301        &self,
6302        clear_mask: zx::Signals,
6303        set_mask: zx::Signals,
6304    ) -> Result<(), zx_status::Status> {
6305        use fidl::Peered;
6306        self.inner.channel().signal_peer(clear_mask, set_mask)
6307    }
6308}
6309
6310impl DictionaryDrainIteratorControlHandle {}
6311
6312#[must_use = "FIDL methods require a response to be sent"]
6313#[derive(Debug)]
6314pub struct DictionaryDrainIteratorGetNextResponder {
6315    control_handle: std::mem::ManuallyDrop<DictionaryDrainIteratorControlHandle>,
6316    tx_id: u32,
6317}
6318
6319/// Set the the channel to be shutdown (see [`DictionaryDrainIteratorControlHandle::shutdown`])
6320/// if the responder is dropped without sending a response, so that the client
6321/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6322impl std::ops::Drop for DictionaryDrainIteratorGetNextResponder {
6323    fn drop(&mut self) {
6324        self.control_handle.shutdown();
6325        // Safety: drops once, never accessed again
6326        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6327    }
6328}
6329
6330impl fidl::endpoints::Responder for DictionaryDrainIteratorGetNextResponder {
6331    type ControlHandle = DictionaryDrainIteratorControlHandle;
6332
6333    fn control_handle(&self) -> &DictionaryDrainIteratorControlHandle {
6334        &self.control_handle
6335    }
6336
6337    fn drop_without_shutdown(mut self) {
6338        // Safety: drops once, never accessed again due to mem::forget
6339        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6340        // Prevent Drop from running (which would shut down the channel)
6341        std::mem::forget(self);
6342    }
6343}
6344
6345impl DictionaryDrainIteratorGetNextResponder {
6346    /// Sends a response to the FIDL transaction.
6347    ///
6348    /// Sets the channel to shutdown if an error occurs.
6349    pub fn send(
6350        self,
6351        mut result: Result<(&[DictionaryItem], u64), CapabilityStoreError>,
6352    ) -> Result<(), fidl::Error> {
6353        let _result = self.send_raw(result);
6354        if _result.is_err() {
6355            self.control_handle.shutdown();
6356        }
6357        self.drop_without_shutdown();
6358        _result
6359    }
6360
6361    /// Similar to "send" but does not shutdown the channel if an error occurs.
6362    pub fn send_no_shutdown_on_err(
6363        self,
6364        mut result: Result<(&[DictionaryItem], u64), CapabilityStoreError>,
6365    ) -> Result<(), fidl::Error> {
6366        let _result = self.send_raw(result);
6367        self.drop_without_shutdown();
6368        _result
6369    }
6370
6371    fn send_raw(
6372        &self,
6373        mut result: Result<(&[DictionaryItem], u64), CapabilityStoreError>,
6374    ) -> Result<(), fidl::Error> {
6375        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
6376            DictionaryDrainIteratorGetNextResponse,
6377            CapabilityStoreError,
6378        >>(
6379            fidl::encoding::FlexibleResult::new(result),
6380            self.tx_id,
6381            0x4f8082ca1ee26061,
6382            fidl::encoding::DynamicFlags::FLEXIBLE,
6383        )
6384    }
6385}
6386
6387#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6388pub struct DictionaryEnumerateIteratorMarker;
6389
6390impl fidl::endpoints::ProtocolMarker for DictionaryEnumerateIteratorMarker {
6391    type Proxy = DictionaryEnumerateIteratorProxy;
6392    type RequestStream = DictionaryEnumerateIteratorRequestStream;
6393    #[cfg(target_os = "fuchsia")]
6394    type SynchronousProxy = DictionaryEnumerateIteratorSynchronousProxy;
6395
6396    const DEBUG_NAME: &'static str = "(anonymous) DictionaryEnumerateIterator";
6397}
6398pub type DictionaryEnumerateIteratorGetNextResult =
6399    Result<(Vec<DictionaryOptionalItem>, u64), CapabilityStoreError>;
6400
6401pub trait DictionaryEnumerateIteratorProxyInterface: Send + Sync {
6402    type GetNextResponseFut: std::future::Future<Output = Result<DictionaryEnumerateIteratorGetNextResult, fidl::Error>>
6403        + Send;
6404    fn r#get_next(&self, start_id: u64, limit: u32) -> Self::GetNextResponseFut;
6405}
6406#[derive(Debug)]
6407#[cfg(target_os = "fuchsia")]
6408pub struct DictionaryEnumerateIteratorSynchronousProxy {
6409    client: fidl::client::sync::Client,
6410}
6411
6412#[cfg(target_os = "fuchsia")]
6413impl fidl::endpoints::SynchronousProxy for DictionaryEnumerateIteratorSynchronousProxy {
6414    type Proxy = DictionaryEnumerateIteratorProxy;
6415    type Protocol = DictionaryEnumerateIteratorMarker;
6416
6417    fn from_channel(inner: fidl::Channel) -> Self {
6418        Self::new(inner)
6419    }
6420
6421    fn into_channel(self) -> fidl::Channel {
6422        self.client.into_channel()
6423    }
6424
6425    fn as_channel(&self) -> &fidl::Channel {
6426        self.client.as_channel()
6427    }
6428}
6429
6430#[cfg(target_os = "fuchsia")]
6431impl DictionaryEnumerateIteratorSynchronousProxy {
6432    pub fn new(channel: fidl::Channel) -> Self {
6433        let protocol_name =
6434            <DictionaryEnumerateIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6435        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
6436    }
6437
6438    pub fn into_channel(self) -> fidl::Channel {
6439        self.client.into_channel()
6440    }
6441
6442    /// Waits until an event arrives and returns it. It is safe for other
6443    /// threads to make concurrent requests while waiting for an event.
6444    pub fn wait_for_event(
6445        &self,
6446        deadline: zx::MonotonicInstant,
6447    ) -> Result<DictionaryEnumerateIteratorEvent, fidl::Error> {
6448        DictionaryEnumerateIteratorEvent::decode(self.client.wait_for_event(deadline)?)
6449    }
6450
6451    /// Returns the next batch of results for a [Dictionary.Enumerate] call, returning up to
6452    /// `limit` results. `limit` can be at most [MAX_DICTIONARY_ITERATOR_CHUNK].
6453    ///
6454    /// The value of each of `items` is a duplicate of the original capability
6455    /// ([CapabilityStore.Duplicate]), unless it could not be duplicated, it which case it will
6456    /// be null.
6457    ///
6458    /// Each returned capability will be assigned a monotonically increasing [CapabilityId] starting
6459    /// from `start_id`.
6460    ///
6461    /// In addition to the `items`, returns `end_id`, which is one more than the highest id reserved
6462    /// by [GetNext]. `end_id` can be used as the `start_id` for the next call to [GetNext].
6463    ///
6464    /// If [GetNext] returns an error, the server will also close the channel.
6465    ///
6466    /// Errors:
6467    ///
6468    /// - `ID_ALREADY_EXISTS` if some id in the range `[start_id, limit)` already exists in this
6469    ///   store.
6470    /// - `INVALID_ARGS` if `limit` was `0` or greater than `MAX_DICTIONARY_ITERATOR_CHUNK`.
6471    pub fn r#get_next(
6472        &self,
6473        mut start_id: u64,
6474        mut limit: u32,
6475        ___deadline: zx::MonotonicInstant,
6476    ) -> Result<DictionaryEnumerateIteratorGetNextResult, fidl::Error> {
6477        let _response = self.client.send_query::<
6478            DictionaryEnumerateIteratorGetNextRequest,
6479            fidl::encoding::FlexibleResultType<DictionaryEnumerateIteratorGetNextResponse, CapabilityStoreError>,
6480        >(
6481            (start_id, limit,),
6482            0x14f8bc286512f5cf,
6483            fidl::encoding::DynamicFlags::FLEXIBLE,
6484            ___deadline,
6485        )?
6486        .into_result::<DictionaryEnumerateIteratorMarker>("get_next")?;
6487        Ok(_response.map(|x| (x.items, x.end_id)))
6488    }
6489}
6490
6491#[cfg(target_os = "fuchsia")]
6492impl From<DictionaryEnumerateIteratorSynchronousProxy> for zx::NullableHandle {
6493    fn from(value: DictionaryEnumerateIteratorSynchronousProxy) -> Self {
6494        value.into_channel().into()
6495    }
6496}
6497
6498#[cfg(target_os = "fuchsia")]
6499impl From<fidl::Channel> for DictionaryEnumerateIteratorSynchronousProxy {
6500    fn from(value: fidl::Channel) -> Self {
6501        Self::new(value)
6502    }
6503}
6504
6505#[cfg(target_os = "fuchsia")]
6506impl fidl::endpoints::FromClient for DictionaryEnumerateIteratorSynchronousProxy {
6507    type Protocol = DictionaryEnumerateIteratorMarker;
6508
6509    fn from_client(value: fidl::endpoints::ClientEnd<DictionaryEnumerateIteratorMarker>) -> Self {
6510        Self::new(value.into_channel())
6511    }
6512}
6513
6514#[derive(Debug, Clone)]
6515pub struct DictionaryEnumerateIteratorProxy {
6516    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6517}
6518
6519impl fidl::endpoints::Proxy for DictionaryEnumerateIteratorProxy {
6520    type Protocol = DictionaryEnumerateIteratorMarker;
6521
6522    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6523        Self::new(inner)
6524    }
6525
6526    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6527        self.client.into_channel().map_err(|client| Self { client })
6528    }
6529
6530    fn as_channel(&self) -> &::fidl::AsyncChannel {
6531        self.client.as_channel()
6532    }
6533}
6534
6535impl DictionaryEnumerateIteratorProxy {
6536    /// Create a new Proxy for fuchsia.component.sandbox/DictionaryEnumerateIterator.
6537    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6538        let protocol_name =
6539            <DictionaryEnumerateIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6540        Self { client: fidl::client::Client::new(channel, protocol_name) }
6541    }
6542
6543    /// Get a Stream of events from the remote end of the protocol.
6544    ///
6545    /// # Panics
6546    ///
6547    /// Panics if the event stream was already taken.
6548    pub fn take_event_stream(&self) -> DictionaryEnumerateIteratorEventStream {
6549        DictionaryEnumerateIteratorEventStream { event_receiver: self.client.take_event_receiver() }
6550    }
6551
6552    /// Returns the next batch of results for a [Dictionary.Enumerate] call, returning up to
6553    /// `limit` results. `limit` can be at most [MAX_DICTIONARY_ITERATOR_CHUNK].
6554    ///
6555    /// The value of each of `items` is a duplicate of the original capability
6556    /// ([CapabilityStore.Duplicate]), unless it could not be duplicated, it which case it will
6557    /// be null.
6558    ///
6559    /// Each returned capability will be assigned a monotonically increasing [CapabilityId] starting
6560    /// from `start_id`.
6561    ///
6562    /// In addition to the `items`, returns `end_id`, which is one more than the highest id reserved
6563    /// by [GetNext]. `end_id` can be used as the `start_id` for the next call to [GetNext].
6564    ///
6565    /// If [GetNext] returns an error, the server will also close the channel.
6566    ///
6567    /// Errors:
6568    ///
6569    /// - `ID_ALREADY_EXISTS` if some id in the range `[start_id, limit)` already exists in this
6570    ///   store.
6571    /// - `INVALID_ARGS` if `limit` was `0` or greater than `MAX_DICTIONARY_ITERATOR_CHUNK`.
6572    pub fn r#get_next(
6573        &self,
6574        mut start_id: u64,
6575        mut limit: u32,
6576    ) -> fidl::client::QueryResponseFut<
6577        DictionaryEnumerateIteratorGetNextResult,
6578        fidl::encoding::DefaultFuchsiaResourceDialect,
6579    > {
6580        DictionaryEnumerateIteratorProxyInterface::r#get_next(self, start_id, limit)
6581    }
6582}
6583
6584impl DictionaryEnumerateIteratorProxyInterface for DictionaryEnumerateIteratorProxy {
6585    type GetNextResponseFut = fidl::client::QueryResponseFut<
6586        DictionaryEnumerateIteratorGetNextResult,
6587        fidl::encoding::DefaultFuchsiaResourceDialect,
6588    >;
6589    fn r#get_next(&self, mut start_id: u64, mut limit: u32) -> Self::GetNextResponseFut {
6590        fn _decode(
6591            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6592        ) -> Result<DictionaryEnumerateIteratorGetNextResult, fidl::Error> {
6593            let _response = fidl::client::decode_transaction_body::<
6594                fidl::encoding::FlexibleResultType<
6595                    DictionaryEnumerateIteratorGetNextResponse,
6596                    CapabilityStoreError,
6597                >,
6598                fidl::encoding::DefaultFuchsiaResourceDialect,
6599                0x14f8bc286512f5cf,
6600            >(_buf?)?
6601            .into_result::<DictionaryEnumerateIteratorMarker>("get_next")?;
6602            Ok(_response.map(|x| (x.items, x.end_id)))
6603        }
6604        self.client.send_query_and_decode::<
6605            DictionaryEnumerateIteratorGetNextRequest,
6606            DictionaryEnumerateIteratorGetNextResult,
6607        >(
6608            (start_id, limit,),
6609            0x14f8bc286512f5cf,
6610            fidl::encoding::DynamicFlags::FLEXIBLE,
6611            _decode,
6612        )
6613    }
6614}
6615
6616pub struct DictionaryEnumerateIteratorEventStream {
6617    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6618}
6619
6620impl std::marker::Unpin for DictionaryEnumerateIteratorEventStream {}
6621
6622impl futures::stream::FusedStream for DictionaryEnumerateIteratorEventStream {
6623    fn is_terminated(&self) -> bool {
6624        self.event_receiver.is_terminated()
6625    }
6626}
6627
6628impl futures::Stream for DictionaryEnumerateIteratorEventStream {
6629    type Item = Result<DictionaryEnumerateIteratorEvent, fidl::Error>;
6630
6631    fn poll_next(
6632        mut self: std::pin::Pin<&mut Self>,
6633        cx: &mut std::task::Context<'_>,
6634    ) -> std::task::Poll<Option<Self::Item>> {
6635        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6636            &mut self.event_receiver,
6637            cx
6638        )?) {
6639            Some(buf) => {
6640                std::task::Poll::Ready(Some(DictionaryEnumerateIteratorEvent::decode(buf)))
6641            }
6642            None => std::task::Poll::Ready(None),
6643        }
6644    }
6645}
6646
6647#[derive(Debug)]
6648pub enum DictionaryEnumerateIteratorEvent {
6649    #[non_exhaustive]
6650    _UnknownEvent {
6651        /// Ordinal of the event that was sent.
6652        ordinal: u64,
6653    },
6654}
6655
6656impl DictionaryEnumerateIteratorEvent {
6657    /// Decodes a message buffer as a [`DictionaryEnumerateIteratorEvent`].
6658    fn decode(
6659        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6660    ) -> Result<DictionaryEnumerateIteratorEvent, fidl::Error> {
6661        let (bytes, _handles) = buf.split_mut();
6662        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6663        debug_assert_eq!(tx_header.tx_id, 0);
6664        match tx_header.ordinal {
6665            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6666                Ok(DictionaryEnumerateIteratorEvent::_UnknownEvent {
6667                    ordinal: tx_header.ordinal,
6668                })
6669            }
6670            _ => Err(fidl::Error::UnknownOrdinal {
6671                ordinal: tx_header.ordinal,
6672                protocol_name: <DictionaryEnumerateIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6673            })
6674        }
6675    }
6676}
6677
6678/// A Stream of incoming requests for fuchsia.component.sandbox/DictionaryEnumerateIterator.
6679pub struct DictionaryEnumerateIteratorRequestStream {
6680    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6681    is_terminated: bool,
6682}
6683
6684impl std::marker::Unpin for DictionaryEnumerateIteratorRequestStream {}
6685
6686impl futures::stream::FusedStream for DictionaryEnumerateIteratorRequestStream {
6687    fn is_terminated(&self) -> bool {
6688        self.is_terminated
6689    }
6690}
6691
6692impl fidl::endpoints::RequestStream for DictionaryEnumerateIteratorRequestStream {
6693    type Protocol = DictionaryEnumerateIteratorMarker;
6694    type ControlHandle = DictionaryEnumerateIteratorControlHandle;
6695
6696    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6697        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6698    }
6699
6700    fn control_handle(&self) -> Self::ControlHandle {
6701        DictionaryEnumerateIteratorControlHandle { inner: self.inner.clone() }
6702    }
6703
6704    fn into_inner(
6705        self,
6706    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6707    {
6708        (self.inner, self.is_terminated)
6709    }
6710
6711    fn from_inner(
6712        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6713        is_terminated: bool,
6714    ) -> Self {
6715        Self { inner, is_terminated }
6716    }
6717}
6718
6719impl futures::Stream for DictionaryEnumerateIteratorRequestStream {
6720    type Item = Result<DictionaryEnumerateIteratorRequest, fidl::Error>;
6721
6722    fn poll_next(
6723        mut self: std::pin::Pin<&mut Self>,
6724        cx: &mut std::task::Context<'_>,
6725    ) -> std::task::Poll<Option<Self::Item>> {
6726        let this = &mut *self;
6727        if this.inner.check_shutdown(cx) {
6728            this.is_terminated = true;
6729            return std::task::Poll::Ready(None);
6730        }
6731        if this.is_terminated {
6732            panic!("polled DictionaryEnumerateIteratorRequestStream after completion");
6733        }
6734        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
6735            |bytes, handles| {
6736                match this.inner.channel().read_etc(cx, bytes, handles) {
6737                    std::task::Poll::Ready(Ok(())) => {}
6738                    std::task::Poll::Pending => return std::task::Poll::Pending,
6739                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
6740                        this.is_terminated = true;
6741                        return std::task::Poll::Ready(None);
6742                    }
6743                    std::task::Poll::Ready(Err(e)) => {
6744                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6745                            e.into(),
6746                        ))));
6747                    }
6748                }
6749
6750                // A message has been received from the channel
6751                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6752
6753                std::task::Poll::Ready(Some(match header.ordinal {
6754                0x14f8bc286512f5cf => {
6755                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6756                    let mut req = fidl::new_empty!(DictionaryEnumerateIteratorGetNextRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
6757                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DictionaryEnumerateIteratorGetNextRequest>(&header, _body_bytes, handles, &mut req)?;
6758                    let control_handle = DictionaryEnumerateIteratorControlHandle {
6759                        inner: this.inner.clone(),
6760                    };
6761                    Ok(DictionaryEnumerateIteratorRequest::GetNext {start_id: req.start_id,
6762limit: req.limit,
6763
6764                        responder: DictionaryEnumerateIteratorGetNextResponder {
6765                            control_handle: std::mem::ManuallyDrop::new(control_handle),
6766                            tx_id: header.tx_id,
6767                        },
6768                    })
6769                }
6770                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6771                    Ok(DictionaryEnumerateIteratorRequest::_UnknownMethod {
6772                        ordinal: header.ordinal,
6773                        control_handle: DictionaryEnumerateIteratorControlHandle { inner: this.inner.clone() },
6774                        method_type: fidl::MethodType::OneWay,
6775                    })
6776                }
6777                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6778                    this.inner.send_framework_err(
6779                        fidl::encoding::FrameworkErr::UnknownMethod,
6780                        header.tx_id,
6781                        header.ordinal,
6782                        header.dynamic_flags(),
6783                        (bytes, handles),
6784                    )?;
6785                    Ok(DictionaryEnumerateIteratorRequest::_UnknownMethod {
6786                        ordinal: header.ordinal,
6787                        control_handle: DictionaryEnumerateIteratorControlHandle { inner: this.inner.clone() },
6788                        method_type: fidl::MethodType::TwoWay,
6789                    })
6790                }
6791                _ => Err(fidl::Error::UnknownOrdinal {
6792                    ordinal: header.ordinal,
6793                    protocol_name: <DictionaryEnumerateIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6794                }),
6795            }))
6796            },
6797        )
6798    }
6799}
6800
6801#[derive(Debug)]
6802pub enum DictionaryEnumerateIteratorRequest {
6803    /// Returns the next batch of results for a [Dictionary.Enumerate] call, returning up to
6804    /// `limit` results. `limit` can be at most [MAX_DICTIONARY_ITERATOR_CHUNK].
6805    ///
6806    /// The value of each of `items` is a duplicate of the original capability
6807    /// ([CapabilityStore.Duplicate]), unless it could not be duplicated, it which case it will
6808    /// be null.
6809    ///
6810    /// Each returned capability will be assigned a monotonically increasing [CapabilityId] starting
6811    /// from `start_id`.
6812    ///
6813    /// In addition to the `items`, returns `end_id`, which is one more than the highest id reserved
6814    /// by [GetNext]. `end_id` can be used as the `start_id` for the next call to [GetNext].
6815    ///
6816    /// If [GetNext] returns an error, the server will also close the channel.
6817    ///
6818    /// Errors:
6819    ///
6820    /// - `ID_ALREADY_EXISTS` if some id in the range `[start_id, limit)` already exists in this
6821    ///   store.
6822    /// - `INVALID_ARGS` if `limit` was `0` or greater than `MAX_DICTIONARY_ITERATOR_CHUNK`.
6823    GetNext { start_id: u64, limit: u32, responder: DictionaryEnumerateIteratorGetNextResponder },
6824    /// An interaction was received which does not match any known method.
6825    #[non_exhaustive]
6826    _UnknownMethod {
6827        /// Ordinal of the method that was called.
6828        ordinal: u64,
6829        control_handle: DictionaryEnumerateIteratorControlHandle,
6830        method_type: fidl::MethodType,
6831    },
6832}
6833
6834impl DictionaryEnumerateIteratorRequest {
6835    #[allow(irrefutable_let_patterns)]
6836    pub fn into_get_next(self) -> Option<(u64, u32, DictionaryEnumerateIteratorGetNextResponder)> {
6837        if let DictionaryEnumerateIteratorRequest::GetNext { start_id, limit, responder } = self {
6838            Some((start_id, limit, responder))
6839        } else {
6840            None
6841        }
6842    }
6843
6844    /// Name of the method defined in FIDL
6845    pub fn method_name(&self) -> &'static str {
6846        match *self {
6847            DictionaryEnumerateIteratorRequest::GetNext { .. } => "get_next",
6848            DictionaryEnumerateIteratorRequest::_UnknownMethod {
6849                method_type: fidl::MethodType::OneWay,
6850                ..
6851            } => "unknown one-way method",
6852            DictionaryEnumerateIteratorRequest::_UnknownMethod {
6853                method_type: fidl::MethodType::TwoWay,
6854                ..
6855            } => "unknown two-way method",
6856        }
6857    }
6858}
6859
6860#[derive(Debug, Clone)]
6861pub struct DictionaryEnumerateIteratorControlHandle {
6862    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6863}
6864
6865impl fidl::endpoints::ControlHandle for DictionaryEnumerateIteratorControlHandle {
6866    fn shutdown(&self) {
6867        self.inner.shutdown()
6868    }
6869    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
6870        self.inner.shutdown_with_epitaph(status)
6871    }
6872
6873    fn is_closed(&self) -> bool {
6874        self.inner.channel().is_closed()
6875    }
6876    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6877        self.inner.channel().on_closed()
6878    }
6879
6880    #[cfg(target_os = "fuchsia")]
6881    fn signal_peer(
6882        &self,
6883        clear_mask: zx::Signals,
6884        set_mask: zx::Signals,
6885    ) -> Result<(), zx_status::Status> {
6886        use fidl::Peered;
6887        self.inner.channel().signal_peer(clear_mask, set_mask)
6888    }
6889}
6890
6891impl DictionaryEnumerateIteratorControlHandle {}
6892
6893#[must_use = "FIDL methods require a response to be sent"]
6894#[derive(Debug)]
6895pub struct DictionaryEnumerateIteratorGetNextResponder {
6896    control_handle: std::mem::ManuallyDrop<DictionaryEnumerateIteratorControlHandle>,
6897    tx_id: u32,
6898}
6899
6900/// Set the the channel to be shutdown (see [`DictionaryEnumerateIteratorControlHandle::shutdown`])
6901/// if the responder is dropped without sending a response, so that the client
6902/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6903impl std::ops::Drop for DictionaryEnumerateIteratorGetNextResponder {
6904    fn drop(&mut self) {
6905        self.control_handle.shutdown();
6906        // Safety: drops once, never accessed again
6907        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6908    }
6909}
6910
6911impl fidl::endpoints::Responder for DictionaryEnumerateIteratorGetNextResponder {
6912    type ControlHandle = DictionaryEnumerateIteratorControlHandle;
6913
6914    fn control_handle(&self) -> &DictionaryEnumerateIteratorControlHandle {
6915        &self.control_handle
6916    }
6917
6918    fn drop_without_shutdown(mut self) {
6919        // Safety: drops once, never accessed again due to mem::forget
6920        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6921        // Prevent Drop from running (which would shut down the channel)
6922        std::mem::forget(self);
6923    }
6924}
6925
6926impl DictionaryEnumerateIteratorGetNextResponder {
6927    /// Sends a response to the FIDL transaction.
6928    ///
6929    /// Sets the channel to shutdown if an error occurs.
6930    pub fn send(
6931        self,
6932        mut result: Result<(Vec<DictionaryOptionalItem>, u64), CapabilityStoreError>,
6933    ) -> Result<(), fidl::Error> {
6934        let _result = self.send_raw(result);
6935        if _result.is_err() {
6936            self.control_handle.shutdown();
6937        }
6938        self.drop_without_shutdown();
6939        _result
6940    }
6941
6942    /// Similar to "send" but does not shutdown the channel if an error occurs.
6943    pub fn send_no_shutdown_on_err(
6944        self,
6945        mut result: Result<(Vec<DictionaryOptionalItem>, u64), CapabilityStoreError>,
6946    ) -> Result<(), fidl::Error> {
6947        let _result = self.send_raw(result);
6948        self.drop_without_shutdown();
6949        _result
6950    }
6951
6952    fn send_raw(
6953        &self,
6954        mut result: Result<(Vec<DictionaryOptionalItem>, u64), CapabilityStoreError>,
6955    ) -> Result<(), fidl::Error> {
6956        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
6957            DictionaryEnumerateIteratorGetNextResponse,
6958            CapabilityStoreError,
6959        >>(
6960            fidl::encoding::FlexibleResult::new(
6961                result
6962                    .as_mut()
6963                    .map_err(|e| *e)
6964                    .map(|(items, end_id)| (items.as_mut_slice(), *end_id)),
6965            ),
6966            self.tx_id,
6967            0x14f8bc286512f5cf,
6968            fidl::encoding::DynamicFlags::FLEXIBLE,
6969        )
6970    }
6971}
6972
6973#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6974pub struct DictionaryKeysIteratorMarker;
6975
6976impl fidl::endpoints::ProtocolMarker for DictionaryKeysIteratorMarker {
6977    type Proxy = DictionaryKeysIteratorProxy;
6978    type RequestStream = DictionaryKeysIteratorRequestStream;
6979    #[cfg(target_os = "fuchsia")]
6980    type SynchronousProxy = DictionaryKeysIteratorSynchronousProxy;
6981
6982    const DEBUG_NAME: &'static str = "(anonymous) DictionaryKeysIterator";
6983}
6984
6985pub trait DictionaryKeysIteratorProxyInterface: Send + Sync {
6986    type GetNextResponseFut: std::future::Future<Output = Result<Vec<String>, fidl::Error>> + Send;
6987    fn r#get_next(&self) -> Self::GetNextResponseFut;
6988}
6989#[derive(Debug)]
6990#[cfg(target_os = "fuchsia")]
6991pub struct DictionaryKeysIteratorSynchronousProxy {
6992    client: fidl::client::sync::Client,
6993}
6994
6995#[cfg(target_os = "fuchsia")]
6996impl fidl::endpoints::SynchronousProxy for DictionaryKeysIteratorSynchronousProxy {
6997    type Proxy = DictionaryKeysIteratorProxy;
6998    type Protocol = DictionaryKeysIteratorMarker;
6999
7000    fn from_channel(inner: fidl::Channel) -> Self {
7001        Self::new(inner)
7002    }
7003
7004    fn into_channel(self) -> fidl::Channel {
7005        self.client.into_channel()
7006    }
7007
7008    fn as_channel(&self) -> &fidl::Channel {
7009        self.client.as_channel()
7010    }
7011}
7012
7013#[cfg(target_os = "fuchsia")]
7014impl DictionaryKeysIteratorSynchronousProxy {
7015    pub fn new(channel: fidl::Channel) -> Self {
7016        let protocol_name =
7017            <DictionaryKeysIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7018        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
7019    }
7020
7021    pub fn into_channel(self) -> fidl::Channel {
7022        self.client.into_channel()
7023    }
7024
7025    /// Waits until an event arrives and returns it. It is safe for other
7026    /// threads to make concurrent requests while waiting for an event.
7027    pub fn wait_for_event(
7028        &self,
7029        deadline: zx::MonotonicInstant,
7030    ) -> Result<DictionaryKeysIteratorEvent, fidl::Error> {
7031        DictionaryKeysIteratorEvent::decode(self.client.wait_for_event(deadline)?)
7032    }
7033
7034    pub fn r#get_next(
7035        &self,
7036        ___deadline: zx::MonotonicInstant,
7037    ) -> Result<Vec<String>, fidl::Error> {
7038        let _response = self.client.send_query::<
7039            fidl::encoding::EmptyPayload,
7040            fidl::encoding::FlexibleType<DictionaryKeysIteratorGetNextResponse>,
7041        >(
7042            (),
7043            0x453828cbacca7d53,
7044            fidl::encoding::DynamicFlags::FLEXIBLE,
7045            ___deadline,
7046        )?
7047        .into_result::<DictionaryKeysIteratorMarker>("get_next")?;
7048        Ok(_response.keys)
7049    }
7050}
7051
7052#[cfg(target_os = "fuchsia")]
7053impl From<DictionaryKeysIteratorSynchronousProxy> for zx::NullableHandle {
7054    fn from(value: DictionaryKeysIteratorSynchronousProxy) -> Self {
7055        value.into_channel().into()
7056    }
7057}
7058
7059#[cfg(target_os = "fuchsia")]
7060impl From<fidl::Channel> for DictionaryKeysIteratorSynchronousProxy {
7061    fn from(value: fidl::Channel) -> Self {
7062        Self::new(value)
7063    }
7064}
7065
7066#[cfg(target_os = "fuchsia")]
7067impl fidl::endpoints::FromClient for DictionaryKeysIteratorSynchronousProxy {
7068    type Protocol = DictionaryKeysIteratorMarker;
7069
7070    fn from_client(value: fidl::endpoints::ClientEnd<DictionaryKeysIteratorMarker>) -> Self {
7071        Self::new(value.into_channel())
7072    }
7073}
7074
7075#[derive(Debug, Clone)]
7076pub struct DictionaryKeysIteratorProxy {
7077    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
7078}
7079
7080impl fidl::endpoints::Proxy for DictionaryKeysIteratorProxy {
7081    type Protocol = DictionaryKeysIteratorMarker;
7082
7083    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
7084        Self::new(inner)
7085    }
7086
7087    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
7088        self.client.into_channel().map_err(|client| Self { client })
7089    }
7090
7091    fn as_channel(&self) -> &::fidl::AsyncChannel {
7092        self.client.as_channel()
7093    }
7094}
7095
7096impl DictionaryKeysIteratorProxy {
7097    /// Create a new Proxy for fuchsia.component.sandbox/DictionaryKeysIterator.
7098    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
7099        let protocol_name =
7100            <DictionaryKeysIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7101        Self { client: fidl::client::Client::new(channel, protocol_name) }
7102    }
7103
7104    /// Get a Stream of events from the remote end of the protocol.
7105    ///
7106    /// # Panics
7107    ///
7108    /// Panics if the event stream was already taken.
7109    pub fn take_event_stream(&self) -> DictionaryKeysIteratorEventStream {
7110        DictionaryKeysIteratorEventStream { event_receiver: self.client.take_event_receiver() }
7111    }
7112
7113    pub fn r#get_next(
7114        &self,
7115    ) -> fidl::client::QueryResponseFut<Vec<String>, fidl::encoding::DefaultFuchsiaResourceDialect>
7116    {
7117        DictionaryKeysIteratorProxyInterface::r#get_next(self)
7118    }
7119}
7120
7121impl DictionaryKeysIteratorProxyInterface for DictionaryKeysIteratorProxy {
7122    type GetNextResponseFut =
7123        fidl::client::QueryResponseFut<Vec<String>, fidl::encoding::DefaultFuchsiaResourceDialect>;
7124    fn r#get_next(&self) -> Self::GetNextResponseFut {
7125        fn _decode(
7126            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7127        ) -> Result<Vec<String>, fidl::Error> {
7128            let _response = fidl::client::decode_transaction_body::<
7129                fidl::encoding::FlexibleType<DictionaryKeysIteratorGetNextResponse>,
7130                fidl::encoding::DefaultFuchsiaResourceDialect,
7131                0x453828cbacca7d53,
7132            >(_buf?)?
7133            .into_result::<DictionaryKeysIteratorMarker>("get_next")?;
7134            Ok(_response.keys)
7135        }
7136        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<String>>(
7137            (),
7138            0x453828cbacca7d53,
7139            fidl::encoding::DynamicFlags::FLEXIBLE,
7140            _decode,
7141        )
7142    }
7143}
7144
7145pub struct DictionaryKeysIteratorEventStream {
7146    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
7147}
7148
7149impl std::marker::Unpin for DictionaryKeysIteratorEventStream {}
7150
7151impl futures::stream::FusedStream for DictionaryKeysIteratorEventStream {
7152    fn is_terminated(&self) -> bool {
7153        self.event_receiver.is_terminated()
7154    }
7155}
7156
7157impl futures::Stream for DictionaryKeysIteratorEventStream {
7158    type Item = Result<DictionaryKeysIteratorEvent, fidl::Error>;
7159
7160    fn poll_next(
7161        mut self: std::pin::Pin<&mut Self>,
7162        cx: &mut std::task::Context<'_>,
7163    ) -> std::task::Poll<Option<Self::Item>> {
7164        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7165            &mut self.event_receiver,
7166            cx
7167        )?) {
7168            Some(buf) => std::task::Poll::Ready(Some(DictionaryKeysIteratorEvent::decode(buf))),
7169            None => std::task::Poll::Ready(None),
7170        }
7171    }
7172}
7173
7174#[derive(Debug)]
7175pub enum DictionaryKeysIteratorEvent {
7176    #[non_exhaustive]
7177    _UnknownEvent {
7178        /// Ordinal of the event that was sent.
7179        ordinal: u64,
7180    },
7181}
7182
7183impl DictionaryKeysIteratorEvent {
7184    /// Decodes a message buffer as a [`DictionaryKeysIteratorEvent`].
7185    fn decode(
7186        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7187    ) -> Result<DictionaryKeysIteratorEvent, fidl::Error> {
7188        let (bytes, _handles) = buf.split_mut();
7189        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7190        debug_assert_eq!(tx_header.tx_id, 0);
7191        match tx_header.ordinal {
7192            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7193                Ok(DictionaryKeysIteratorEvent::_UnknownEvent { ordinal: tx_header.ordinal })
7194            }
7195            _ => Err(fidl::Error::UnknownOrdinal {
7196                ordinal: tx_header.ordinal,
7197                protocol_name:
7198                    <DictionaryKeysIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7199            }),
7200        }
7201    }
7202}
7203
7204/// A Stream of incoming requests for fuchsia.component.sandbox/DictionaryKeysIterator.
7205pub struct DictionaryKeysIteratorRequestStream {
7206    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7207    is_terminated: bool,
7208}
7209
7210impl std::marker::Unpin for DictionaryKeysIteratorRequestStream {}
7211
7212impl futures::stream::FusedStream for DictionaryKeysIteratorRequestStream {
7213    fn is_terminated(&self) -> bool {
7214        self.is_terminated
7215    }
7216}
7217
7218impl fidl::endpoints::RequestStream for DictionaryKeysIteratorRequestStream {
7219    type Protocol = DictionaryKeysIteratorMarker;
7220    type ControlHandle = DictionaryKeysIteratorControlHandle;
7221
7222    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
7223        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7224    }
7225
7226    fn control_handle(&self) -> Self::ControlHandle {
7227        DictionaryKeysIteratorControlHandle { inner: self.inner.clone() }
7228    }
7229
7230    fn into_inner(
7231        self,
7232    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
7233    {
7234        (self.inner, self.is_terminated)
7235    }
7236
7237    fn from_inner(
7238        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7239        is_terminated: bool,
7240    ) -> Self {
7241        Self { inner, is_terminated }
7242    }
7243}
7244
7245impl futures::Stream for DictionaryKeysIteratorRequestStream {
7246    type Item = Result<DictionaryKeysIteratorRequest, fidl::Error>;
7247
7248    fn poll_next(
7249        mut self: std::pin::Pin<&mut Self>,
7250        cx: &mut std::task::Context<'_>,
7251    ) -> std::task::Poll<Option<Self::Item>> {
7252        let this = &mut *self;
7253        if this.inner.check_shutdown(cx) {
7254            this.is_terminated = true;
7255            return std::task::Poll::Ready(None);
7256        }
7257        if this.is_terminated {
7258            panic!("polled DictionaryKeysIteratorRequestStream after completion");
7259        }
7260        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
7261            |bytes, handles| {
7262                match this.inner.channel().read_etc(cx, bytes, handles) {
7263                    std::task::Poll::Ready(Ok(())) => {}
7264                    std::task::Poll::Pending => return std::task::Poll::Pending,
7265                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
7266                        this.is_terminated = true;
7267                        return std::task::Poll::Ready(None);
7268                    }
7269                    std::task::Poll::Ready(Err(e)) => {
7270                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7271                            e.into(),
7272                        ))));
7273                    }
7274                }
7275
7276                // A message has been received from the channel
7277                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7278
7279                std::task::Poll::Ready(Some(match header.ordinal {
7280                0x453828cbacca7d53 => {
7281                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7282                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
7283                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7284                    let control_handle = DictionaryKeysIteratorControlHandle {
7285                        inner: this.inner.clone(),
7286                    };
7287                    Ok(DictionaryKeysIteratorRequest::GetNext {
7288                        responder: DictionaryKeysIteratorGetNextResponder {
7289                            control_handle: std::mem::ManuallyDrop::new(control_handle),
7290                            tx_id: header.tx_id,
7291                        },
7292                    })
7293                }
7294                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7295                    Ok(DictionaryKeysIteratorRequest::_UnknownMethod {
7296                        ordinal: header.ordinal,
7297                        control_handle: DictionaryKeysIteratorControlHandle { inner: this.inner.clone() },
7298                        method_type: fidl::MethodType::OneWay,
7299                    })
7300                }
7301                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7302                    this.inner.send_framework_err(
7303                        fidl::encoding::FrameworkErr::UnknownMethod,
7304                        header.tx_id,
7305                        header.ordinal,
7306                        header.dynamic_flags(),
7307                        (bytes, handles),
7308                    )?;
7309                    Ok(DictionaryKeysIteratorRequest::_UnknownMethod {
7310                        ordinal: header.ordinal,
7311                        control_handle: DictionaryKeysIteratorControlHandle { inner: this.inner.clone() },
7312                        method_type: fidl::MethodType::TwoWay,
7313                    })
7314                }
7315                _ => Err(fidl::Error::UnknownOrdinal {
7316                    ordinal: header.ordinal,
7317                    protocol_name: <DictionaryKeysIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7318                }),
7319            }))
7320            },
7321        )
7322    }
7323}
7324
7325#[derive(Debug)]
7326pub enum DictionaryKeysIteratorRequest {
7327    GetNext {
7328        responder: DictionaryKeysIteratorGetNextResponder,
7329    },
7330    /// An interaction was received which does not match any known method.
7331    #[non_exhaustive]
7332    _UnknownMethod {
7333        /// Ordinal of the method that was called.
7334        ordinal: u64,
7335        control_handle: DictionaryKeysIteratorControlHandle,
7336        method_type: fidl::MethodType,
7337    },
7338}
7339
7340impl DictionaryKeysIteratorRequest {
7341    #[allow(irrefutable_let_patterns)]
7342    pub fn into_get_next(self) -> Option<(DictionaryKeysIteratorGetNextResponder)> {
7343        if let DictionaryKeysIteratorRequest::GetNext { responder } = self {
7344            Some((responder))
7345        } else {
7346            None
7347        }
7348    }
7349
7350    /// Name of the method defined in FIDL
7351    pub fn method_name(&self) -> &'static str {
7352        match *self {
7353            DictionaryKeysIteratorRequest::GetNext { .. } => "get_next",
7354            DictionaryKeysIteratorRequest::_UnknownMethod {
7355                method_type: fidl::MethodType::OneWay,
7356                ..
7357            } => "unknown one-way method",
7358            DictionaryKeysIteratorRequest::_UnknownMethod {
7359                method_type: fidl::MethodType::TwoWay,
7360                ..
7361            } => "unknown two-way method",
7362        }
7363    }
7364}
7365
7366#[derive(Debug, Clone)]
7367pub struct DictionaryKeysIteratorControlHandle {
7368    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7369}
7370
7371impl fidl::endpoints::ControlHandle for DictionaryKeysIteratorControlHandle {
7372    fn shutdown(&self) {
7373        self.inner.shutdown()
7374    }
7375    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
7376        self.inner.shutdown_with_epitaph(status)
7377    }
7378
7379    fn is_closed(&self) -> bool {
7380        self.inner.channel().is_closed()
7381    }
7382    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
7383        self.inner.channel().on_closed()
7384    }
7385
7386    #[cfg(target_os = "fuchsia")]
7387    fn signal_peer(
7388        &self,
7389        clear_mask: zx::Signals,
7390        set_mask: zx::Signals,
7391    ) -> Result<(), zx_status::Status> {
7392        use fidl::Peered;
7393        self.inner.channel().signal_peer(clear_mask, set_mask)
7394    }
7395}
7396
7397impl DictionaryKeysIteratorControlHandle {}
7398
7399#[must_use = "FIDL methods require a response to be sent"]
7400#[derive(Debug)]
7401pub struct DictionaryKeysIteratorGetNextResponder {
7402    control_handle: std::mem::ManuallyDrop<DictionaryKeysIteratorControlHandle>,
7403    tx_id: u32,
7404}
7405
7406/// Set the the channel to be shutdown (see [`DictionaryKeysIteratorControlHandle::shutdown`])
7407/// if the responder is dropped without sending a response, so that the client
7408/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7409impl std::ops::Drop for DictionaryKeysIteratorGetNextResponder {
7410    fn drop(&mut self) {
7411        self.control_handle.shutdown();
7412        // Safety: drops once, never accessed again
7413        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7414    }
7415}
7416
7417impl fidl::endpoints::Responder for DictionaryKeysIteratorGetNextResponder {
7418    type ControlHandle = DictionaryKeysIteratorControlHandle;
7419
7420    fn control_handle(&self) -> &DictionaryKeysIteratorControlHandle {
7421        &self.control_handle
7422    }
7423
7424    fn drop_without_shutdown(mut self) {
7425        // Safety: drops once, never accessed again due to mem::forget
7426        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7427        // Prevent Drop from running (which would shut down the channel)
7428        std::mem::forget(self);
7429    }
7430}
7431
7432impl DictionaryKeysIteratorGetNextResponder {
7433    /// Sends a response to the FIDL transaction.
7434    ///
7435    /// Sets the channel to shutdown if an error occurs.
7436    pub fn send(self, mut keys: &[String]) -> Result<(), fidl::Error> {
7437        let _result = self.send_raw(keys);
7438        if _result.is_err() {
7439            self.control_handle.shutdown();
7440        }
7441        self.drop_without_shutdown();
7442        _result
7443    }
7444
7445    /// Similar to "send" but does not shutdown the channel if an error occurs.
7446    pub fn send_no_shutdown_on_err(self, mut keys: &[String]) -> Result<(), fidl::Error> {
7447        let _result = self.send_raw(keys);
7448        self.drop_without_shutdown();
7449        _result
7450    }
7451
7452    fn send_raw(&self, mut keys: &[String]) -> Result<(), fidl::Error> {
7453        self.control_handle
7454            .inner
7455            .send::<fidl::encoding::FlexibleType<DictionaryKeysIteratorGetNextResponse>>(
7456                fidl::encoding::Flexible::new((keys,)),
7457                self.tx_id,
7458                0x453828cbacca7d53,
7459                fidl::encoding::DynamicFlags::FLEXIBLE,
7460            )
7461    }
7462}
7463
7464#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
7465pub struct DictionaryRouterMarker;
7466
7467impl fidl::endpoints::ProtocolMarker for DictionaryRouterMarker {
7468    type Proxy = DictionaryRouterProxy;
7469    type RequestStream = DictionaryRouterRequestStream;
7470    #[cfg(target_os = "fuchsia")]
7471    type SynchronousProxy = DictionaryRouterSynchronousProxy;
7472
7473    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.DictionaryRouter";
7474}
7475impl fidl::endpoints::DiscoverableProtocolMarker for DictionaryRouterMarker {}
7476pub type DictionaryRouterRouteResult = Result<DictionaryRouterRouteResponse, RouterError>;
7477
7478pub trait DictionaryRouterProxyInterface: Send + Sync {
7479    type RouteResponseFut: std::future::Future<Output = Result<DictionaryRouterRouteResult, fidl::Error>>
7480        + Send;
7481    fn r#route(&self, payload: RouteRequest) -> Self::RouteResponseFut;
7482}
7483#[derive(Debug)]
7484#[cfg(target_os = "fuchsia")]
7485pub struct DictionaryRouterSynchronousProxy {
7486    client: fidl::client::sync::Client,
7487}
7488
7489#[cfg(target_os = "fuchsia")]
7490impl fidl::endpoints::SynchronousProxy for DictionaryRouterSynchronousProxy {
7491    type Proxy = DictionaryRouterProxy;
7492    type Protocol = DictionaryRouterMarker;
7493
7494    fn from_channel(inner: fidl::Channel) -> Self {
7495        Self::new(inner)
7496    }
7497
7498    fn into_channel(self) -> fidl::Channel {
7499        self.client.into_channel()
7500    }
7501
7502    fn as_channel(&self) -> &fidl::Channel {
7503        self.client.as_channel()
7504    }
7505}
7506
7507#[cfg(target_os = "fuchsia")]
7508impl DictionaryRouterSynchronousProxy {
7509    pub fn new(channel: fidl::Channel) -> Self {
7510        let protocol_name = <DictionaryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7511        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
7512    }
7513
7514    pub fn into_channel(self) -> fidl::Channel {
7515        self.client.into_channel()
7516    }
7517
7518    /// Waits until an event arrives and returns it. It is safe for other
7519    /// threads to make concurrent requests while waiting for an event.
7520    pub fn wait_for_event(
7521        &self,
7522        deadline: zx::MonotonicInstant,
7523    ) -> Result<DictionaryRouterEvent, fidl::Error> {
7524        DictionaryRouterEvent::decode(self.client.wait_for_event(deadline)?)
7525    }
7526
7527    pub fn r#route(
7528        &self,
7529        mut payload: RouteRequest,
7530        ___deadline: zx::MonotonicInstant,
7531    ) -> Result<DictionaryRouterRouteResult, fidl::Error> {
7532        let _response = self.client.send_query::<
7533            RouteRequest,
7534            fidl::encoding::FlexibleResultType<DictionaryRouterRouteResponse, RouterError>,
7535        >(
7536            &mut payload,
7537            0x714c65bfe54bd79f,
7538            fidl::encoding::DynamicFlags::FLEXIBLE,
7539            ___deadline,
7540        )?
7541        .into_result::<DictionaryRouterMarker>("route")?;
7542        Ok(_response.map(|x| x))
7543    }
7544}
7545
7546#[cfg(target_os = "fuchsia")]
7547impl From<DictionaryRouterSynchronousProxy> for zx::NullableHandle {
7548    fn from(value: DictionaryRouterSynchronousProxy) -> Self {
7549        value.into_channel().into()
7550    }
7551}
7552
7553#[cfg(target_os = "fuchsia")]
7554impl From<fidl::Channel> for DictionaryRouterSynchronousProxy {
7555    fn from(value: fidl::Channel) -> Self {
7556        Self::new(value)
7557    }
7558}
7559
7560#[cfg(target_os = "fuchsia")]
7561impl fidl::endpoints::FromClient for DictionaryRouterSynchronousProxy {
7562    type Protocol = DictionaryRouterMarker;
7563
7564    fn from_client(value: fidl::endpoints::ClientEnd<DictionaryRouterMarker>) -> Self {
7565        Self::new(value.into_channel())
7566    }
7567}
7568
7569#[derive(Debug, Clone)]
7570pub struct DictionaryRouterProxy {
7571    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
7572}
7573
7574impl fidl::endpoints::Proxy for DictionaryRouterProxy {
7575    type Protocol = DictionaryRouterMarker;
7576
7577    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
7578        Self::new(inner)
7579    }
7580
7581    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
7582        self.client.into_channel().map_err(|client| Self { client })
7583    }
7584
7585    fn as_channel(&self) -> &::fidl::AsyncChannel {
7586        self.client.as_channel()
7587    }
7588}
7589
7590impl DictionaryRouterProxy {
7591    /// Create a new Proxy for fuchsia.component.sandbox/DictionaryRouter.
7592    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
7593        let protocol_name = <DictionaryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7594        Self { client: fidl::client::Client::new(channel, protocol_name) }
7595    }
7596
7597    /// Get a Stream of events from the remote end of the protocol.
7598    ///
7599    /// # Panics
7600    ///
7601    /// Panics if the event stream was already taken.
7602    pub fn take_event_stream(&self) -> DictionaryRouterEventStream {
7603        DictionaryRouterEventStream { event_receiver: self.client.take_event_receiver() }
7604    }
7605
7606    pub fn r#route(
7607        &self,
7608        mut payload: RouteRequest,
7609    ) -> fidl::client::QueryResponseFut<
7610        DictionaryRouterRouteResult,
7611        fidl::encoding::DefaultFuchsiaResourceDialect,
7612    > {
7613        DictionaryRouterProxyInterface::r#route(self, payload)
7614    }
7615}
7616
7617impl DictionaryRouterProxyInterface for DictionaryRouterProxy {
7618    type RouteResponseFut = fidl::client::QueryResponseFut<
7619        DictionaryRouterRouteResult,
7620        fidl::encoding::DefaultFuchsiaResourceDialect,
7621    >;
7622    fn r#route(&self, mut payload: RouteRequest) -> Self::RouteResponseFut {
7623        fn _decode(
7624            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7625        ) -> Result<DictionaryRouterRouteResult, fidl::Error> {
7626            let _response = fidl::client::decode_transaction_body::<
7627                fidl::encoding::FlexibleResultType<DictionaryRouterRouteResponse, RouterError>,
7628                fidl::encoding::DefaultFuchsiaResourceDialect,
7629                0x714c65bfe54bd79f,
7630            >(_buf?)?
7631            .into_result::<DictionaryRouterMarker>("route")?;
7632            Ok(_response.map(|x| x))
7633        }
7634        self.client.send_query_and_decode::<RouteRequest, DictionaryRouterRouteResult>(
7635            &mut payload,
7636            0x714c65bfe54bd79f,
7637            fidl::encoding::DynamicFlags::FLEXIBLE,
7638            _decode,
7639        )
7640    }
7641}
7642
7643pub struct DictionaryRouterEventStream {
7644    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
7645}
7646
7647impl std::marker::Unpin for DictionaryRouterEventStream {}
7648
7649impl futures::stream::FusedStream for DictionaryRouterEventStream {
7650    fn is_terminated(&self) -> bool {
7651        self.event_receiver.is_terminated()
7652    }
7653}
7654
7655impl futures::Stream for DictionaryRouterEventStream {
7656    type Item = Result<DictionaryRouterEvent, fidl::Error>;
7657
7658    fn poll_next(
7659        mut self: std::pin::Pin<&mut Self>,
7660        cx: &mut std::task::Context<'_>,
7661    ) -> std::task::Poll<Option<Self::Item>> {
7662        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7663            &mut self.event_receiver,
7664            cx
7665        )?) {
7666            Some(buf) => std::task::Poll::Ready(Some(DictionaryRouterEvent::decode(buf))),
7667            None => std::task::Poll::Ready(None),
7668        }
7669    }
7670}
7671
7672#[derive(Debug)]
7673pub enum DictionaryRouterEvent {
7674    #[non_exhaustive]
7675    _UnknownEvent {
7676        /// Ordinal of the event that was sent.
7677        ordinal: u64,
7678    },
7679}
7680
7681impl DictionaryRouterEvent {
7682    /// Decodes a message buffer as a [`DictionaryRouterEvent`].
7683    fn decode(
7684        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7685    ) -> Result<DictionaryRouterEvent, fidl::Error> {
7686        let (bytes, _handles) = buf.split_mut();
7687        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7688        debug_assert_eq!(tx_header.tx_id, 0);
7689        match tx_header.ordinal {
7690            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7691                Ok(DictionaryRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
7692            }
7693            _ => Err(fidl::Error::UnknownOrdinal {
7694                ordinal: tx_header.ordinal,
7695                protocol_name:
7696                    <DictionaryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7697            }),
7698        }
7699    }
7700}
7701
7702/// A Stream of incoming requests for fuchsia.component.sandbox/DictionaryRouter.
7703pub struct DictionaryRouterRequestStream {
7704    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7705    is_terminated: bool,
7706}
7707
7708impl std::marker::Unpin for DictionaryRouterRequestStream {}
7709
7710impl futures::stream::FusedStream for DictionaryRouterRequestStream {
7711    fn is_terminated(&self) -> bool {
7712        self.is_terminated
7713    }
7714}
7715
7716impl fidl::endpoints::RequestStream for DictionaryRouterRequestStream {
7717    type Protocol = DictionaryRouterMarker;
7718    type ControlHandle = DictionaryRouterControlHandle;
7719
7720    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
7721        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7722    }
7723
7724    fn control_handle(&self) -> Self::ControlHandle {
7725        DictionaryRouterControlHandle { inner: self.inner.clone() }
7726    }
7727
7728    fn into_inner(
7729        self,
7730    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
7731    {
7732        (self.inner, self.is_terminated)
7733    }
7734
7735    fn from_inner(
7736        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7737        is_terminated: bool,
7738    ) -> Self {
7739        Self { inner, is_terminated }
7740    }
7741}
7742
7743impl futures::Stream for DictionaryRouterRequestStream {
7744    type Item = Result<DictionaryRouterRequest, fidl::Error>;
7745
7746    fn poll_next(
7747        mut self: std::pin::Pin<&mut Self>,
7748        cx: &mut std::task::Context<'_>,
7749    ) -> std::task::Poll<Option<Self::Item>> {
7750        let this = &mut *self;
7751        if this.inner.check_shutdown(cx) {
7752            this.is_terminated = true;
7753            return std::task::Poll::Ready(None);
7754        }
7755        if this.is_terminated {
7756            panic!("polled DictionaryRouterRequestStream after completion");
7757        }
7758        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
7759            |bytes, handles| {
7760                match this.inner.channel().read_etc(cx, bytes, handles) {
7761                    std::task::Poll::Ready(Ok(())) => {}
7762                    std::task::Poll::Pending => return std::task::Poll::Pending,
7763                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
7764                        this.is_terminated = true;
7765                        return std::task::Poll::Ready(None);
7766                    }
7767                    std::task::Poll::Ready(Err(e)) => {
7768                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7769                            e.into(),
7770                        ))));
7771                    }
7772                }
7773
7774                // A message has been received from the channel
7775                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7776
7777                std::task::Poll::Ready(Some(match header.ordinal {
7778                    0x714c65bfe54bd79f => {
7779                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7780                        let mut req = fidl::new_empty!(
7781                            RouteRequest,
7782                            fidl::encoding::DefaultFuchsiaResourceDialect
7783                        );
7784                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RouteRequest>(&header, _body_bytes, handles, &mut req)?;
7785                        let control_handle =
7786                            DictionaryRouterControlHandle { inner: this.inner.clone() };
7787                        Ok(DictionaryRouterRequest::Route {
7788                            payload: req,
7789                            responder: DictionaryRouterRouteResponder {
7790                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7791                                tx_id: header.tx_id,
7792                            },
7793                        })
7794                    }
7795                    _ if header.tx_id == 0
7796                        && header
7797                            .dynamic_flags()
7798                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
7799                    {
7800                        Ok(DictionaryRouterRequest::_UnknownMethod {
7801                            ordinal: header.ordinal,
7802                            control_handle: DictionaryRouterControlHandle {
7803                                inner: this.inner.clone(),
7804                            },
7805                            method_type: fidl::MethodType::OneWay,
7806                        })
7807                    }
7808                    _ if header
7809                        .dynamic_flags()
7810                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
7811                    {
7812                        this.inner.send_framework_err(
7813                            fidl::encoding::FrameworkErr::UnknownMethod,
7814                            header.tx_id,
7815                            header.ordinal,
7816                            header.dynamic_flags(),
7817                            (bytes, handles),
7818                        )?;
7819                        Ok(DictionaryRouterRequest::_UnknownMethod {
7820                            ordinal: header.ordinal,
7821                            control_handle: DictionaryRouterControlHandle {
7822                                inner: this.inner.clone(),
7823                            },
7824                            method_type: fidl::MethodType::TwoWay,
7825                        })
7826                    }
7827                    _ => Err(fidl::Error::UnknownOrdinal {
7828                        ordinal: header.ordinal,
7829                        protocol_name:
7830                            <DictionaryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7831                    }),
7832                }))
7833            },
7834        )
7835    }
7836}
7837
7838#[derive(Debug)]
7839pub enum DictionaryRouterRequest {
7840    Route {
7841        payload: RouteRequest,
7842        responder: DictionaryRouterRouteResponder,
7843    },
7844    /// An interaction was received which does not match any known method.
7845    #[non_exhaustive]
7846    _UnknownMethod {
7847        /// Ordinal of the method that was called.
7848        ordinal: u64,
7849        control_handle: DictionaryRouterControlHandle,
7850        method_type: fidl::MethodType,
7851    },
7852}
7853
7854impl DictionaryRouterRequest {
7855    #[allow(irrefutable_let_patterns)]
7856    pub fn into_route(self) -> Option<(RouteRequest, DictionaryRouterRouteResponder)> {
7857        if let DictionaryRouterRequest::Route { payload, responder } = self {
7858            Some((payload, responder))
7859        } else {
7860            None
7861        }
7862    }
7863
7864    /// Name of the method defined in FIDL
7865    pub fn method_name(&self) -> &'static str {
7866        match *self {
7867            DictionaryRouterRequest::Route { .. } => "route",
7868            DictionaryRouterRequest::_UnknownMethod {
7869                method_type: fidl::MethodType::OneWay,
7870                ..
7871            } => "unknown one-way method",
7872            DictionaryRouterRequest::_UnknownMethod {
7873                method_type: fidl::MethodType::TwoWay,
7874                ..
7875            } => "unknown two-way method",
7876        }
7877    }
7878}
7879
7880#[derive(Debug, Clone)]
7881pub struct DictionaryRouterControlHandle {
7882    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7883}
7884
7885impl fidl::endpoints::ControlHandle for DictionaryRouterControlHandle {
7886    fn shutdown(&self) {
7887        self.inner.shutdown()
7888    }
7889    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
7890        self.inner.shutdown_with_epitaph(status)
7891    }
7892
7893    fn is_closed(&self) -> bool {
7894        self.inner.channel().is_closed()
7895    }
7896    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
7897        self.inner.channel().on_closed()
7898    }
7899
7900    #[cfg(target_os = "fuchsia")]
7901    fn signal_peer(
7902        &self,
7903        clear_mask: zx::Signals,
7904        set_mask: zx::Signals,
7905    ) -> Result<(), zx_status::Status> {
7906        use fidl::Peered;
7907        self.inner.channel().signal_peer(clear_mask, set_mask)
7908    }
7909}
7910
7911impl DictionaryRouterControlHandle {}
7912
7913#[must_use = "FIDL methods require a response to be sent"]
7914#[derive(Debug)]
7915pub struct DictionaryRouterRouteResponder {
7916    control_handle: std::mem::ManuallyDrop<DictionaryRouterControlHandle>,
7917    tx_id: u32,
7918}
7919
7920/// Set the the channel to be shutdown (see [`DictionaryRouterControlHandle::shutdown`])
7921/// if the responder is dropped without sending a response, so that the client
7922/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7923impl std::ops::Drop for DictionaryRouterRouteResponder {
7924    fn drop(&mut self) {
7925        self.control_handle.shutdown();
7926        // Safety: drops once, never accessed again
7927        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7928    }
7929}
7930
7931impl fidl::endpoints::Responder for DictionaryRouterRouteResponder {
7932    type ControlHandle = DictionaryRouterControlHandle;
7933
7934    fn control_handle(&self) -> &DictionaryRouterControlHandle {
7935        &self.control_handle
7936    }
7937
7938    fn drop_without_shutdown(mut self) {
7939        // Safety: drops once, never accessed again due to mem::forget
7940        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7941        // Prevent Drop from running (which would shut down the channel)
7942        std::mem::forget(self);
7943    }
7944}
7945
7946impl DictionaryRouterRouteResponder {
7947    /// Sends a response to the FIDL transaction.
7948    ///
7949    /// Sets the channel to shutdown if an error occurs.
7950    pub fn send(
7951        self,
7952        mut result: Result<DictionaryRouterRouteResponse, RouterError>,
7953    ) -> Result<(), fidl::Error> {
7954        let _result = self.send_raw(result);
7955        if _result.is_err() {
7956            self.control_handle.shutdown();
7957        }
7958        self.drop_without_shutdown();
7959        _result
7960    }
7961
7962    /// Similar to "send" but does not shutdown the channel if an error occurs.
7963    pub fn send_no_shutdown_on_err(
7964        self,
7965        mut result: Result<DictionaryRouterRouteResponse, RouterError>,
7966    ) -> Result<(), fidl::Error> {
7967        let _result = self.send_raw(result);
7968        self.drop_without_shutdown();
7969        _result
7970    }
7971
7972    fn send_raw(
7973        &self,
7974        mut result: Result<DictionaryRouterRouteResponse, RouterError>,
7975    ) -> Result<(), fidl::Error> {
7976        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
7977            DictionaryRouterRouteResponse,
7978            RouterError,
7979        >>(
7980            fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
7981            self.tx_id,
7982            0x714c65bfe54bd79f,
7983            fidl::encoding::DynamicFlags::FLEXIBLE,
7984        )
7985    }
7986}
7987
7988#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
7989pub struct DirConnectorRouterMarker;
7990
7991impl fidl::endpoints::ProtocolMarker for DirConnectorRouterMarker {
7992    type Proxy = DirConnectorRouterProxy;
7993    type RequestStream = DirConnectorRouterRequestStream;
7994    #[cfg(target_os = "fuchsia")]
7995    type SynchronousProxy = DirConnectorRouterSynchronousProxy;
7996
7997    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.DirConnectorRouter";
7998}
7999impl fidl::endpoints::DiscoverableProtocolMarker for DirConnectorRouterMarker {}
8000pub type DirConnectorRouterRouteResult = Result<DirConnectorRouterRouteResponse, RouterError>;
8001
8002pub trait DirConnectorRouterProxyInterface: Send + Sync {
8003    type RouteResponseFut: std::future::Future<Output = Result<DirConnectorRouterRouteResult, fidl::Error>>
8004        + Send;
8005    fn r#route(&self, payload: RouteRequest) -> Self::RouteResponseFut;
8006}
8007#[derive(Debug)]
8008#[cfg(target_os = "fuchsia")]
8009pub struct DirConnectorRouterSynchronousProxy {
8010    client: fidl::client::sync::Client,
8011}
8012
8013#[cfg(target_os = "fuchsia")]
8014impl fidl::endpoints::SynchronousProxy for DirConnectorRouterSynchronousProxy {
8015    type Proxy = DirConnectorRouterProxy;
8016    type Protocol = DirConnectorRouterMarker;
8017
8018    fn from_channel(inner: fidl::Channel) -> Self {
8019        Self::new(inner)
8020    }
8021
8022    fn into_channel(self) -> fidl::Channel {
8023        self.client.into_channel()
8024    }
8025
8026    fn as_channel(&self) -> &fidl::Channel {
8027        self.client.as_channel()
8028    }
8029}
8030
8031#[cfg(target_os = "fuchsia")]
8032impl DirConnectorRouterSynchronousProxy {
8033    pub fn new(channel: fidl::Channel) -> Self {
8034        let protocol_name =
8035            <DirConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8036        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
8037    }
8038
8039    pub fn into_channel(self) -> fidl::Channel {
8040        self.client.into_channel()
8041    }
8042
8043    /// Waits until an event arrives and returns it. It is safe for other
8044    /// threads to make concurrent requests while waiting for an event.
8045    pub fn wait_for_event(
8046        &self,
8047        deadline: zx::MonotonicInstant,
8048    ) -> Result<DirConnectorRouterEvent, fidl::Error> {
8049        DirConnectorRouterEvent::decode(self.client.wait_for_event(deadline)?)
8050    }
8051
8052    pub fn r#route(
8053        &self,
8054        mut payload: RouteRequest,
8055        ___deadline: zx::MonotonicInstant,
8056    ) -> Result<DirConnectorRouterRouteResult, fidl::Error> {
8057        let _response = self.client.send_query::<
8058            RouteRequest,
8059            fidl::encoding::FlexibleResultType<DirConnectorRouterRouteResponse, RouterError>,
8060        >(
8061            &mut payload,
8062            0xd7e0f01da2c8e40,
8063            fidl::encoding::DynamicFlags::FLEXIBLE,
8064            ___deadline,
8065        )?
8066        .into_result::<DirConnectorRouterMarker>("route")?;
8067        Ok(_response.map(|x| x))
8068    }
8069}
8070
8071#[cfg(target_os = "fuchsia")]
8072impl From<DirConnectorRouterSynchronousProxy> for zx::NullableHandle {
8073    fn from(value: DirConnectorRouterSynchronousProxy) -> Self {
8074        value.into_channel().into()
8075    }
8076}
8077
8078#[cfg(target_os = "fuchsia")]
8079impl From<fidl::Channel> for DirConnectorRouterSynchronousProxy {
8080    fn from(value: fidl::Channel) -> Self {
8081        Self::new(value)
8082    }
8083}
8084
8085#[cfg(target_os = "fuchsia")]
8086impl fidl::endpoints::FromClient for DirConnectorRouterSynchronousProxy {
8087    type Protocol = DirConnectorRouterMarker;
8088
8089    fn from_client(value: fidl::endpoints::ClientEnd<DirConnectorRouterMarker>) -> Self {
8090        Self::new(value.into_channel())
8091    }
8092}
8093
8094#[derive(Debug, Clone)]
8095pub struct DirConnectorRouterProxy {
8096    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
8097}
8098
8099impl fidl::endpoints::Proxy for DirConnectorRouterProxy {
8100    type Protocol = DirConnectorRouterMarker;
8101
8102    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
8103        Self::new(inner)
8104    }
8105
8106    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
8107        self.client.into_channel().map_err(|client| Self { client })
8108    }
8109
8110    fn as_channel(&self) -> &::fidl::AsyncChannel {
8111        self.client.as_channel()
8112    }
8113}
8114
8115impl DirConnectorRouterProxy {
8116    /// Create a new Proxy for fuchsia.component.sandbox/DirConnectorRouter.
8117    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
8118        let protocol_name =
8119            <DirConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8120        Self { client: fidl::client::Client::new(channel, protocol_name) }
8121    }
8122
8123    /// Get a Stream of events from the remote end of the protocol.
8124    ///
8125    /// # Panics
8126    ///
8127    /// Panics if the event stream was already taken.
8128    pub fn take_event_stream(&self) -> DirConnectorRouterEventStream {
8129        DirConnectorRouterEventStream { event_receiver: self.client.take_event_receiver() }
8130    }
8131
8132    pub fn r#route(
8133        &self,
8134        mut payload: RouteRequest,
8135    ) -> fidl::client::QueryResponseFut<
8136        DirConnectorRouterRouteResult,
8137        fidl::encoding::DefaultFuchsiaResourceDialect,
8138    > {
8139        DirConnectorRouterProxyInterface::r#route(self, payload)
8140    }
8141}
8142
8143impl DirConnectorRouterProxyInterface for DirConnectorRouterProxy {
8144    type RouteResponseFut = fidl::client::QueryResponseFut<
8145        DirConnectorRouterRouteResult,
8146        fidl::encoding::DefaultFuchsiaResourceDialect,
8147    >;
8148    fn r#route(&self, mut payload: RouteRequest) -> Self::RouteResponseFut {
8149        fn _decode(
8150            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8151        ) -> Result<DirConnectorRouterRouteResult, fidl::Error> {
8152            let _response = fidl::client::decode_transaction_body::<
8153                fidl::encoding::FlexibleResultType<DirConnectorRouterRouteResponse, RouterError>,
8154                fidl::encoding::DefaultFuchsiaResourceDialect,
8155                0xd7e0f01da2c8e40,
8156            >(_buf?)?
8157            .into_result::<DirConnectorRouterMarker>("route")?;
8158            Ok(_response.map(|x| x))
8159        }
8160        self.client.send_query_and_decode::<RouteRequest, DirConnectorRouterRouteResult>(
8161            &mut payload,
8162            0xd7e0f01da2c8e40,
8163            fidl::encoding::DynamicFlags::FLEXIBLE,
8164            _decode,
8165        )
8166    }
8167}
8168
8169pub struct DirConnectorRouterEventStream {
8170    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
8171}
8172
8173impl std::marker::Unpin for DirConnectorRouterEventStream {}
8174
8175impl futures::stream::FusedStream for DirConnectorRouterEventStream {
8176    fn is_terminated(&self) -> bool {
8177        self.event_receiver.is_terminated()
8178    }
8179}
8180
8181impl futures::Stream for DirConnectorRouterEventStream {
8182    type Item = Result<DirConnectorRouterEvent, fidl::Error>;
8183
8184    fn poll_next(
8185        mut self: std::pin::Pin<&mut Self>,
8186        cx: &mut std::task::Context<'_>,
8187    ) -> std::task::Poll<Option<Self::Item>> {
8188        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
8189            &mut self.event_receiver,
8190            cx
8191        )?) {
8192            Some(buf) => std::task::Poll::Ready(Some(DirConnectorRouterEvent::decode(buf))),
8193            None => std::task::Poll::Ready(None),
8194        }
8195    }
8196}
8197
8198#[derive(Debug)]
8199pub enum DirConnectorRouterEvent {
8200    #[non_exhaustive]
8201    _UnknownEvent {
8202        /// Ordinal of the event that was sent.
8203        ordinal: u64,
8204    },
8205}
8206
8207impl DirConnectorRouterEvent {
8208    /// Decodes a message buffer as a [`DirConnectorRouterEvent`].
8209    fn decode(
8210        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
8211    ) -> Result<DirConnectorRouterEvent, fidl::Error> {
8212        let (bytes, _handles) = buf.split_mut();
8213        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8214        debug_assert_eq!(tx_header.tx_id, 0);
8215        match tx_header.ordinal {
8216            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
8217                Ok(DirConnectorRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
8218            }
8219            _ => Err(fidl::Error::UnknownOrdinal {
8220                ordinal: tx_header.ordinal,
8221                protocol_name:
8222                    <DirConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8223            }),
8224        }
8225    }
8226}
8227
8228/// A Stream of incoming requests for fuchsia.component.sandbox/DirConnectorRouter.
8229pub struct DirConnectorRouterRequestStream {
8230    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8231    is_terminated: bool,
8232}
8233
8234impl std::marker::Unpin for DirConnectorRouterRequestStream {}
8235
8236impl futures::stream::FusedStream for DirConnectorRouterRequestStream {
8237    fn is_terminated(&self) -> bool {
8238        self.is_terminated
8239    }
8240}
8241
8242impl fidl::endpoints::RequestStream for DirConnectorRouterRequestStream {
8243    type Protocol = DirConnectorRouterMarker;
8244    type ControlHandle = DirConnectorRouterControlHandle;
8245
8246    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
8247        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
8248    }
8249
8250    fn control_handle(&self) -> Self::ControlHandle {
8251        DirConnectorRouterControlHandle { inner: self.inner.clone() }
8252    }
8253
8254    fn into_inner(
8255        self,
8256    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
8257    {
8258        (self.inner, self.is_terminated)
8259    }
8260
8261    fn from_inner(
8262        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8263        is_terminated: bool,
8264    ) -> Self {
8265        Self { inner, is_terminated }
8266    }
8267}
8268
8269impl futures::Stream for DirConnectorRouterRequestStream {
8270    type Item = Result<DirConnectorRouterRequest, fidl::Error>;
8271
8272    fn poll_next(
8273        mut self: std::pin::Pin<&mut Self>,
8274        cx: &mut std::task::Context<'_>,
8275    ) -> std::task::Poll<Option<Self::Item>> {
8276        let this = &mut *self;
8277        if this.inner.check_shutdown(cx) {
8278            this.is_terminated = true;
8279            return std::task::Poll::Ready(None);
8280        }
8281        if this.is_terminated {
8282            panic!("polled DirConnectorRouterRequestStream after completion");
8283        }
8284        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
8285            |bytes, handles| {
8286                match this.inner.channel().read_etc(cx, bytes, handles) {
8287                    std::task::Poll::Ready(Ok(())) => {}
8288                    std::task::Poll::Pending => return std::task::Poll::Pending,
8289                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
8290                        this.is_terminated = true;
8291                        return std::task::Poll::Ready(None);
8292                    }
8293                    std::task::Poll::Ready(Err(e)) => {
8294                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
8295                            e.into(),
8296                        ))));
8297                    }
8298                }
8299
8300                // A message has been received from the channel
8301                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8302
8303                std::task::Poll::Ready(Some(match header.ordinal {
8304                0xd7e0f01da2c8e40 => {
8305                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
8306                    let mut req = fidl::new_empty!(RouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
8307                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RouteRequest>(&header, _body_bytes, handles, &mut req)?;
8308                    let control_handle = DirConnectorRouterControlHandle {
8309                        inner: this.inner.clone(),
8310                    };
8311                    Ok(DirConnectorRouterRequest::Route {payload: req,
8312                        responder: DirConnectorRouterRouteResponder {
8313                            control_handle: std::mem::ManuallyDrop::new(control_handle),
8314                            tx_id: header.tx_id,
8315                        },
8316                    })
8317                }
8318                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
8319                    Ok(DirConnectorRouterRequest::_UnknownMethod {
8320                        ordinal: header.ordinal,
8321                        control_handle: DirConnectorRouterControlHandle { inner: this.inner.clone() },
8322                        method_type: fidl::MethodType::OneWay,
8323                    })
8324                }
8325                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
8326                    this.inner.send_framework_err(
8327                        fidl::encoding::FrameworkErr::UnknownMethod,
8328                        header.tx_id,
8329                        header.ordinal,
8330                        header.dynamic_flags(),
8331                        (bytes, handles),
8332                    )?;
8333                    Ok(DirConnectorRouterRequest::_UnknownMethod {
8334                        ordinal: header.ordinal,
8335                        control_handle: DirConnectorRouterControlHandle { inner: this.inner.clone() },
8336                        method_type: fidl::MethodType::TwoWay,
8337                    })
8338                }
8339                _ => Err(fidl::Error::UnknownOrdinal {
8340                    ordinal: header.ordinal,
8341                    protocol_name: <DirConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8342                }),
8343            }))
8344            },
8345        )
8346    }
8347}
8348
8349#[derive(Debug)]
8350pub enum DirConnectorRouterRequest {
8351    Route {
8352        payload: RouteRequest,
8353        responder: DirConnectorRouterRouteResponder,
8354    },
8355    /// An interaction was received which does not match any known method.
8356    #[non_exhaustive]
8357    _UnknownMethod {
8358        /// Ordinal of the method that was called.
8359        ordinal: u64,
8360        control_handle: DirConnectorRouterControlHandle,
8361        method_type: fidl::MethodType,
8362    },
8363}
8364
8365impl DirConnectorRouterRequest {
8366    #[allow(irrefutable_let_patterns)]
8367    pub fn into_route(self) -> Option<(RouteRequest, DirConnectorRouterRouteResponder)> {
8368        if let DirConnectorRouterRequest::Route { payload, responder } = self {
8369            Some((payload, responder))
8370        } else {
8371            None
8372        }
8373    }
8374
8375    /// Name of the method defined in FIDL
8376    pub fn method_name(&self) -> &'static str {
8377        match *self {
8378            DirConnectorRouterRequest::Route { .. } => "route",
8379            DirConnectorRouterRequest::_UnknownMethod {
8380                method_type: fidl::MethodType::OneWay,
8381                ..
8382            } => "unknown one-way method",
8383            DirConnectorRouterRequest::_UnknownMethod {
8384                method_type: fidl::MethodType::TwoWay,
8385                ..
8386            } => "unknown two-way method",
8387        }
8388    }
8389}
8390
8391#[derive(Debug, Clone)]
8392pub struct DirConnectorRouterControlHandle {
8393    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8394}
8395
8396impl fidl::endpoints::ControlHandle for DirConnectorRouterControlHandle {
8397    fn shutdown(&self) {
8398        self.inner.shutdown()
8399    }
8400    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
8401        self.inner.shutdown_with_epitaph(status)
8402    }
8403
8404    fn is_closed(&self) -> bool {
8405        self.inner.channel().is_closed()
8406    }
8407    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
8408        self.inner.channel().on_closed()
8409    }
8410
8411    #[cfg(target_os = "fuchsia")]
8412    fn signal_peer(
8413        &self,
8414        clear_mask: zx::Signals,
8415        set_mask: zx::Signals,
8416    ) -> Result<(), zx_status::Status> {
8417        use fidl::Peered;
8418        self.inner.channel().signal_peer(clear_mask, set_mask)
8419    }
8420}
8421
8422impl DirConnectorRouterControlHandle {}
8423
8424#[must_use = "FIDL methods require a response to be sent"]
8425#[derive(Debug)]
8426pub struct DirConnectorRouterRouteResponder {
8427    control_handle: std::mem::ManuallyDrop<DirConnectorRouterControlHandle>,
8428    tx_id: u32,
8429}
8430
8431/// Set the the channel to be shutdown (see [`DirConnectorRouterControlHandle::shutdown`])
8432/// if the responder is dropped without sending a response, so that the client
8433/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8434impl std::ops::Drop for DirConnectorRouterRouteResponder {
8435    fn drop(&mut self) {
8436        self.control_handle.shutdown();
8437        // Safety: drops once, never accessed again
8438        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8439    }
8440}
8441
8442impl fidl::endpoints::Responder for DirConnectorRouterRouteResponder {
8443    type ControlHandle = DirConnectorRouterControlHandle;
8444
8445    fn control_handle(&self) -> &DirConnectorRouterControlHandle {
8446        &self.control_handle
8447    }
8448
8449    fn drop_without_shutdown(mut self) {
8450        // Safety: drops once, never accessed again due to mem::forget
8451        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8452        // Prevent Drop from running (which would shut down the channel)
8453        std::mem::forget(self);
8454    }
8455}
8456
8457impl DirConnectorRouterRouteResponder {
8458    /// Sends a response to the FIDL transaction.
8459    ///
8460    /// Sets the channel to shutdown if an error occurs.
8461    pub fn send(
8462        self,
8463        mut result: Result<DirConnectorRouterRouteResponse, RouterError>,
8464    ) -> Result<(), fidl::Error> {
8465        let _result = self.send_raw(result);
8466        if _result.is_err() {
8467            self.control_handle.shutdown();
8468        }
8469        self.drop_without_shutdown();
8470        _result
8471    }
8472
8473    /// Similar to "send" but does not shutdown the channel if an error occurs.
8474    pub fn send_no_shutdown_on_err(
8475        self,
8476        mut result: Result<DirConnectorRouterRouteResponse, RouterError>,
8477    ) -> Result<(), fidl::Error> {
8478        let _result = self.send_raw(result);
8479        self.drop_without_shutdown();
8480        _result
8481    }
8482
8483    fn send_raw(
8484        &self,
8485        mut result: Result<DirConnectorRouterRouteResponse, RouterError>,
8486    ) -> Result<(), fidl::Error> {
8487        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
8488            DirConnectorRouterRouteResponse,
8489            RouterError,
8490        >>(
8491            fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
8492            self.tx_id,
8493            0xd7e0f01da2c8e40,
8494            fidl::encoding::DynamicFlags::FLEXIBLE,
8495        )
8496    }
8497}
8498
8499#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
8500pub struct DirEntryRouterMarker;
8501
8502impl fidl::endpoints::ProtocolMarker for DirEntryRouterMarker {
8503    type Proxy = DirEntryRouterProxy;
8504    type RequestStream = DirEntryRouterRequestStream;
8505    #[cfg(target_os = "fuchsia")]
8506    type SynchronousProxy = DirEntryRouterSynchronousProxy;
8507
8508    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.DirEntryRouter";
8509}
8510impl fidl::endpoints::DiscoverableProtocolMarker for DirEntryRouterMarker {}
8511pub type DirEntryRouterRouteResult = Result<DirEntryRouterRouteResponse, RouterError>;
8512
8513pub trait DirEntryRouterProxyInterface: Send + Sync {
8514    type RouteResponseFut: std::future::Future<Output = Result<DirEntryRouterRouteResult, fidl::Error>>
8515        + Send;
8516    fn r#route(&self, payload: RouteRequest) -> Self::RouteResponseFut;
8517}
8518#[derive(Debug)]
8519#[cfg(target_os = "fuchsia")]
8520pub struct DirEntryRouterSynchronousProxy {
8521    client: fidl::client::sync::Client,
8522}
8523
8524#[cfg(target_os = "fuchsia")]
8525impl fidl::endpoints::SynchronousProxy for DirEntryRouterSynchronousProxy {
8526    type Proxy = DirEntryRouterProxy;
8527    type Protocol = DirEntryRouterMarker;
8528
8529    fn from_channel(inner: fidl::Channel) -> Self {
8530        Self::new(inner)
8531    }
8532
8533    fn into_channel(self) -> fidl::Channel {
8534        self.client.into_channel()
8535    }
8536
8537    fn as_channel(&self) -> &fidl::Channel {
8538        self.client.as_channel()
8539    }
8540}
8541
8542#[cfg(target_os = "fuchsia")]
8543impl DirEntryRouterSynchronousProxy {
8544    pub fn new(channel: fidl::Channel) -> Self {
8545        let protocol_name = <DirEntryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8546        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
8547    }
8548
8549    pub fn into_channel(self) -> fidl::Channel {
8550        self.client.into_channel()
8551    }
8552
8553    /// Waits until an event arrives and returns it. It is safe for other
8554    /// threads to make concurrent requests while waiting for an event.
8555    pub fn wait_for_event(
8556        &self,
8557        deadline: zx::MonotonicInstant,
8558    ) -> Result<DirEntryRouterEvent, fidl::Error> {
8559        DirEntryRouterEvent::decode(self.client.wait_for_event(deadline)?)
8560    }
8561
8562    pub fn r#route(
8563        &self,
8564        mut payload: RouteRequest,
8565        ___deadline: zx::MonotonicInstant,
8566    ) -> Result<DirEntryRouterRouteResult, fidl::Error> {
8567        let _response = self.client.send_query::<
8568            RouteRequest,
8569            fidl::encoding::FlexibleResultType<DirEntryRouterRouteResponse, RouterError>,
8570        >(
8571            &mut payload,
8572            0x1ac694001c208bd2,
8573            fidl::encoding::DynamicFlags::FLEXIBLE,
8574            ___deadline,
8575        )?
8576        .into_result::<DirEntryRouterMarker>("route")?;
8577        Ok(_response.map(|x| x))
8578    }
8579}
8580
8581#[cfg(target_os = "fuchsia")]
8582impl From<DirEntryRouterSynchronousProxy> for zx::NullableHandle {
8583    fn from(value: DirEntryRouterSynchronousProxy) -> Self {
8584        value.into_channel().into()
8585    }
8586}
8587
8588#[cfg(target_os = "fuchsia")]
8589impl From<fidl::Channel> for DirEntryRouterSynchronousProxy {
8590    fn from(value: fidl::Channel) -> Self {
8591        Self::new(value)
8592    }
8593}
8594
8595#[cfg(target_os = "fuchsia")]
8596impl fidl::endpoints::FromClient for DirEntryRouterSynchronousProxy {
8597    type Protocol = DirEntryRouterMarker;
8598
8599    fn from_client(value: fidl::endpoints::ClientEnd<DirEntryRouterMarker>) -> Self {
8600        Self::new(value.into_channel())
8601    }
8602}
8603
8604#[derive(Debug, Clone)]
8605pub struct DirEntryRouterProxy {
8606    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
8607}
8608
8609impl fidl::endpoints::Proxy for DirEntryRouterProxy {
8610    type Protocol = DirEntryRouterMarker;
8611
8612    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
8613        Self::new(inner)
8614    }
8615
8616    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
8617        self.client.into_channel().map_err(|client| Self { client })
8618    }
8619
8620    fn as_channel(&self) -> &::fidl::AsyncChannel {
8621        self.client.as_channel()
8622    }
8623}
8624
8625impl DirEntryRouterProxy {
8626    /// Create a new Proxy for fuchsia.component.sandbox/DirEntryRouter.
8627    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
8628        let protocol_name = <DirEntryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8629        Self { client: fidl::client::Client::new(channel, protocol_name) }
8630    }
8631
8632    /// Get a Stream of events from the remote end of the protocol.
8633    ///
8634    /// # Panics
8635    ///
8636    /// Panics if the event stream was already taken.
8637    pub fn take_event_stream(&self) -> DirEntryRouterEventStream {
8638        DirEntryRouterEventStream { event_receiver: self.client.take_event_receiver() }
8639    }
8640
8641    pub fn r#route(
8642        &self,
8643        mut payload: RouteRequest,
8644    ) -> fidl::client::QueryResponseFut<
8645        DirEntryRouterRouteResult,
8646        fidl::encoding::DefaultFuchsiaResourceDialect,
8647    > {
8648        DirEntryRouterProxyInterface::r#route(self, payload)
8649    }
8650}
8651
8652impl DirEntryRouterProxyInterface for DirEntryRouterProxy {
8653    type RouteResponseFut = fidl::client::QueryResponseFut<
8654        DirEntryRouterRouteResult,
8655        fidl::encoding::DefaultFuchsiaResourceDialect,
8656    >;
8657    fn r#route(&self, mut payload: RouteRequest) -> Self::RouteResponseFut {
8658        fn _decode(
8659            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8660        ) -> Result<DirEntryRouterRouteResult, fidl::Error> {
8661            let _response = fidl::client::decode_transaction_body::<
8662                fidl::encoding::FlexibleResultType<DirEntryRouterRouteResponse, RouterError>,
8663                fidl::encoding::DefaultFuchsiaResourceDialect,
8664                0x1ac694001c208bd2,
8665            >(_buf?)?
8666            .into_result::<DirEntryRouterMarker>("route")?;
8667            Ok(_response.map(|x| x))
8668        }
8669        self.client.send_query_and_decode::<RouteRequest, DirEntryRouterRouteResult>(
8670            &mut payload,
8671            0x1ac694001c208bd2,
8672            fidl::encoding::DynamicFlags::FLEXIBLE,
8673            _decode,
8674        )
8675    }
8676}
8677
8678pub struct DirEntryRouterEventStream {
8679    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
8680}
8681
8682impl std::marker::Unpin for DirEntryRouterEventStream {}
8683
8684impl futures::stream::FusedStream for DirEntryRouterEventStream {
8685    fn is_terminated(&self) -> bool {
8686        self.event_receiver.is_terminated()
8687    }
8688}
8689
8690impl futures::Stream for DirEntryRouterEventStream {
8691    type Item = Result<DirEntryRouterEvent, fidl::Error>;
8692
8693    fn poll_next(
8694        mut self: std::pin::Pin<&mut Self>,
8695        cx: &mut std::task::Context<'_>,
8696    ) -> std::task::Poll<Option<Self::Item>> {
8697        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
8698            &mut self.event_receiver,
8699            cx
8700        )?) {
8701            Some(buf) => std::task::Poll::Ready(Some(DirEntryRouterEvent::decode(buf))),
8702            None => std::task::Poll::Ready(None),
8703        }
8704    }
8705}
8706
8707#[derive(Debug)]
8708pub enum DirEntryRouterEvent {
8709    #[non_exhaustive]
8710    _UnknownEvent {
8711        /// Ordinal of the event that was sent.
8712        ordinal: u64,
8713    },
8714}
8715
8716impl DirEntryRouterEvent {
8717    /// Decodes a message buffer as a [`DirEntryRouterEvent`].
8718    fn decode(
8719        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
8720    ) -> Result<DirEntryRouterEvent, fidl::Error> {
8721        let (bytes, _handles) = buf.split_mut();
8722        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8723        debug_assert_eq!(tx_header.tx_id, 0);
8724        match tx_header.ordinal {
8725            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
8726                Ok(DirEntryRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
8727            }
8728            _ => Err(fidl::Error::UnknownOrdinal {
8729                ordinal: tx_header.ordinal,
8730                protocol_name:
8731                    <DirEntryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8732            }),
8733        }
8734    }
8735}
8736
8737/// A Stream of incoming requests for fuchsia.component.sandbox/DirEntryRouter.
8738pub struct DirEntryRouterRequestStream {
8739    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8740    is_terminated: bool,
8741}
8742
8743impl std::marker::Unpin for DirEntryRouterRequestStream {}
8744
8745impl futures::stream::FusedStream for DirEntryRouterRequestStream {
8746    fn is_terminated(&self) -> bool {
8747        self.is_terminated
8748    }
8749}
8750
8751impl fidl::endpoints::RequestStream for DirEntryRouterRequestStream {
8752    type Protocol = DirEntryRouterMarker;
8753    type ControlHandle = DirEntryRouterControlHandle;
8754
8755    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
8756        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
8757    }
8758
8759    fn control_handle(&self) -> Self::ControlHandle {
8760        DirEntryRouterControlHandle { inner: self.inner.clone() }
8761    }
8762
8763    fn into_inner(
8764        self,
8765    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
8766    {
8767        (self.inner, self.is_terminated)
8768    }
8769
8770    fn from_inner(
8771        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8772        is_terminated: bool,
8773    ) -> Self {
8774        Self { inner, is_terminated }
8775    }
8776}
8777
8778impl futures::Stream for DirEntryRouterRequestStream {
8779    type Item = Result<DirEntryRouterRequest, fidl::Error>;
8780
8781    fn poll_next(
8782        mut self: std::pin::Pin<&mut Self>,
8783        cx: &mut std::task::Context<'_>,
8784    ) -> std::task::Poll<Option<Self::Item>> {
8785        let this = &mut *self;
8786        if this.inner.check_shutdown(cx) {
8787            this.is_terminated = true;
8788            return std::task::Poll::Ready(None);
8789        }
8790        if this.is_terminated {
8791            panic!("polled DirEntryRouterRequestStream after completion");
8792        }
8793        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
8794            |bytes, handles| {
8795                match this.inner.channel().read_etc(cx, bytes, handles) {
8796                    std::task::Poll::Ready(Ok(())) => {}
8797                    std::task::Poll::Pending => return std::task::Poll::Pending,
8798                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
8799                        this.is_terminated = true;
8800                        return std::task::Poll::Ready(None);
8801                    }
8802                    std::task::Poll::Ready(Err(e)) => {
8803                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
8804                            e.into(),
8805                        ))));
8806                    }
8807                }
8808
8809                // A message has been received from the channel
8810                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8811
8812                std::task::Poll::Ready(Some(match header.ordinal {
8813                    0x1ac694001c208bd2 => {
8814                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
8815                        let mut req = fidl::new_empty!(
8816                            RouteRequest,
8817                            fidl::encoding::DefaultFuchsiaResourceDialect
8818                        );
8819                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RouteRequest>(&header, _body_bytes, handles, &mut req)?;
8820                        let control_handle =
8821                            DirEntryRouterControlHandle { inner: this.inner.clone() };
8822                        Ok(DirEntryRouterRequest::Route {
8823                            payload: req,
8824                            responder: DirEntryRouterRouteResponder {
8825                                control_handle: std::mem::ManuallyDrop::new(control_handle),
8826                                tx_id: header.tx_id,
8827                            },
8828                        })
8829                    }
8830                    _ if header.tx_id == 0
8831                        && header
8832                            .dynamic_flags()
8833                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
8834                    {
8835                        Ok(DirEntryRouterRequest::_UnknownMethod {
8836                            ordinal: header.ordinal,
8837                            control_handle: DirEntryRouterControlHandle {
8838                                inner: this.inner.clone(),
8839                            },
8840                            method_type: fidl::MethodType::OneWay,
8841                        })
8842                    }
8843                    _ if header
8844                        .dynamic_flags()
8845                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
8846                    {
8847                        this.inner.send_framework_err(
8848                            fidl::encoding::FrameworkErr::UnknownMethod,
8849                            header.tx_id,
8850                            header.ordinal,
8851                            header.dynamic_flags(),
8852                            (bytes, handles),
8853                        )?;
8854                        Ok(DirEntryRouterRequest::_UnknownMethod {
8855                            ordinal: header.ordinal,
8856                            control_handle: DirEntryRouterControlHandle {
8857                                inner: this.inner.clone(),
8858                            },
8859                            method_type: fidl::MethodType::TwoWay,
8860                        })
8861                    }
8862                    _ => Err(fidl::Error::UnknownOrdinal {
8863                        ordinal: header.ordinal,
8864                        protocol_name:
8865                            <DirEntryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8866                    }),
8867                }))
8868            },
8869        )
8870    }
8871}
8872
8873#[derive(Debug)]
8874pub enum DirEntryRouterRequest {
8875    Route {
8876        payload: RouteRequest,
8877        responder: DirEntryRouterRouteResponder,
8878    },
8879    /// An interaction was received which does not match any known method.
8880    #[non_exhaustive]
8881    _UnknownMethod {
8882        /// Ordinal of the method that was called.
8883        ordinal: u64,
8884        control_handle: DirEntryRouterControlHandle,
8885        method_type: fidl::MethodType,
8886    },
8887}
8888
8889impl DirEntryRouterRequest {
8890    #[allow(irrefutable_let_patterns)]
8891    pub fn into_route(self) -> Option<(RouteRequest, DirEntryRouterRouteResponder)> {
8892        if let DirEntryRouterRequest::Route { payload, responder } = self {
8893            Some((payload, responder))
8894        } else {
8895            None
8896        }
8897    }
8898
8899    /// Name of the method defined in FIDL
8900    pub fn method_name(&self) -> &'static str {
8901        match *self {
8902            DirEntryRouterRequest::Route { .. } => "route",
8903            DirEntryRouterRequest::_UnknownMethod {
8904                method_type: fidl::MethodType::OneWay, ..
8905            } => "unknown one-way method",
8906            DirEntryRouterRequest::_UnknownMethod {
8907                method_type: fidl::MethodType::TwoWay, ..
8908            } => "unknown two-way method",
8909        }
8910    }
8911}
8912
8913#[derive(Debug, Clone)]
8914pub struct DirEntryRouterControlHandle {
8915    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8916}
8917
8918impl fidl::endpoints::ControlHandle for DirEntryRouterControlHandle {
8919    fn shutdown(&self) {
8920        self.inner.shutdown()
8921    }
8922    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
8923        self.inner.shutdown_with_epitaph(status)
8924    }
8925
8926    fn is_closed(&self) -> bool {
8927        self.inner.channel().is_closed()
8928    }
8929    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
8930        self.inner.channel().on_closed()
8931    }
8932
8933    #[cfg(target_os = "fuchsia")]
8934    fn signal_peer(
8935        &self,
8936        clear_mask: zx::Signals,
8937        set_mask: zx::Signals,
8938    ) -> Result<(), zx_status::Status> {
8939        use fidl::Peered;
8940        self.inner.channel().signal_peer(clear_mask, set_mask)
8941    }
8942}
8943
8944impl DirEntryRouterControlHandle {}
8945
8946#[must_use = "FIDL methods require a response to be sent"]
8947#[derive(Debug)]
8948pub struct DirEntryRouterRouteResponder {
8949    control_handle: std::mem::ManuallyDrop<DirEntryRouterControlHandle>,
8950    tx_id: u32,
8951}
8952
8953/// Set the the channel to be shutdown (see [`DirEntryRouterControlHandle::shutdown`])
8954/// if the responder is dropped without sending a response, so that the client
8955/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8956impl std::ops::Drop for DirEntryRouterRouteResponder {
8957    fn drop(&mut self) {
8958        self.control_handle.shutdown();
8959        // Safety: drops once, never accessed again
8960        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8961    }
8962}
8963
8964impl fidl::endpoints::Responder for DirEntryRouterRouteResponder {
8965    type ControlHandle = DirEntryRouterControlHandle;
8966
8967    fn control_handle(&self) -> &DirEntryRouterControlHandle {
8968        &self.control_handle
8969    }
8970
8971    fn drop_without_shutdown(mut self) {
8972        // Safety: drops once, never accessed again due to mem::forget
8973        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8974        // Prevent Drop from running (which would shut down the channel)
8975        std::mem::forget(self);
8976    }
8977}
8978
8979impl DirEntryRouterRouteResponder {
8980    /// Sends a response to the FIDL transaction.
8981    ///
8982    /// Sets the channel to shutdown if an error occurs.
8983    pub fn send(
8984        self,
8985        mut result: Result<DirEntryRouterRouteResponse, RouterError>,
8986    ) -> Result<(), fidl::Error> {
8987        let _result = self.send_raw(result);
8988        if _result.is_err() {
8989            self.control_handle.shutdown();
8990        }
8991        self.drop_without_shutdown();
8992        _result
8993    }
8994
8995    /// Similar to "send" but does not shutdown the channel if an error occurs.
8996    pub fn send_no_shutdown_on_err(
8997        self,
8998        mut result: Result<DirEntryRouterRouteResponse, RouterError>,
8999    ) -> Result<(), fidl::Error> {
9000        let _result = self.send_raw(result);
9001        self.drop_without_shutdown();
9002        _result
9003    }
9004
9005    fn send_raw(
9006        &self,
9007        mut result: Result<DirEntryRouterRouteResponse, RouterError>,
9008    ) -> Result<(), fidl::Error> {
9009        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
9010            DirEntryRouterRouteResponse,
9011            RouterError,
9012        >>(
9013            fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
9014            self.tx_id,
9015            0x1ac694001c208bd2,
9016            fidl::encoding::DynamicFlags::FLEXIBLE,
9017        )
9018    }
9019}
9020
9021#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
9022pub struct DirReceiverMarker;
9023
9024impl fidl::endpoints::ProtocolMarker for DirReceiverMarker {
9025    type Proxy = DirReceiverProxy;
9026    type RequestStream = DirReceiverRequestStream;
9027    #[cfg(target_os = "fuchsia")]
9028    type SynchronousProxy = DirReceiverSynchronousProxy;
9029
9030    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.DirReceiver";
9031}
9032impl fidl::endpoints::DiscoverableProtocolMarker for DirReceiverMarker {}
9033
9034pub trait DirReceiverProxyInterface: Send + Sync {
9035    fn r#receive(&self, payload: DirReceiverReceiveRequest) -> Result<(), fidl::Error>;
9036}
9037#[derive(Debug)]
9038#[cfg(target_os = "fuchsia")]
9039pub struct DirReceiverSynchronousProxy {
9040    client: fidl::client::sync::Client,
9041}
9042
9043#[cfg(target_os = "fuchsia")]
9044impl fidl::endpoints::SynchronousProxy for DirReceiverSynchronousProxy {
9045    type Proxy = DirReceiverProxy;
9046    type Protocol = DirReceiverMarker;
9047
9048    fn from_channel(inner: fidl::Channel) -> Self {
9049        Self::new(inner)
9050    }
9051
9052    fn into_channel(self) -> fidl::Channel {
9053        self.client.into_channel()
9054    }
9055
9056    fn as_channel(&self) -> &fidl::Channel {
9057        self.client.as_channel()
9058    }
9059}
9060
9061#[cfg(target_os = "fuchsia")]
9062impl DirReceiverSynchronousProxy {
9063    pub fn new(channel: fidl::Channel) -> Self {
9064        let protocol_name = <DirReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
9065        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
9066    }
9067
9068    pub fn into_channel(self) -> fidl::Channel {
9069        self.client.into_channel()
9070    }
9071
9072    /// Waits until an event arrives and returns it. It is safe for other
9073    /// threads to make concurrent requests while waiting for an event.
9074    pub fn wait_for_event(
9075        &self,
9076        deadline: zx::MonotonicInstant,
9077    ) -> Result<DirReceiverEvent, fidl::Error> {
9078        DirReceiverEvent::decode(self.client.wait_for_event(deadline)?)
9079    }
9080
9081    /// Sends a directory channel to this receiver.
9082    ///
9083    /// The server should implement this method by forwarding `channel` to a vfs instance
9084    /// of the language appropriate `vfs` library.
9085    pub fn r#receive(&self, mut payload: DirReceiverReceiveRequest) -> Result<(), fidl::Error> {
9086        self.client.send::<DirReceiverReceiveRequest>(
9087            &mut payload,
9088            0xcdc3e9b89fe7bb4,
9089            fidl::encoding::DynamicFlags::FLEXIBLE,
9090        )
9091    }
9092}
9093
9094#[cfg(target_os = "fuchsia")]
9095impl From<DirReceiverSynchronousProxy> for zx::NullableHandle {
9096    fn from(value: DirReceiverSynchronousProxy) -> Self {
9097        value.into_channel().into()
9098    }
9099}
9100
9101#[cfg(target_os = "fuchsia")]
9102impl From<fidl::Channel> for DirReceiverSynchronousProxy {
9103    fn from(value: fidl::Channel) -> Self {
9104        Self::new(value)
9105    }
9106}
9107
9108#[cfg(target_os = "fuchsia")]
9109impl fidl::endpoints::FromClient for DirReceiverSynchronousProxy {
9110    type Protocol = DirReceiverMarker;
9111
9112    fn from_client(value: fidl::endpoints::ClientEnd<DirReceiverMarker>) -> Self {
9113        Self::new(value.into_channel())
9114    }
9115}
9116
9117#[derive(Debug, Clone)]
9118pub struct DirReceiverProxy {
9119    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
9120}
9121
9122impl fidl::endpoints::Proxy for DirReceiverProxy {
9123    type Protocol = DirReceiverMarker;
9124
9125    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
9126        Self::new(inner)
9127    }
9128
9129    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
9130        self.client.into_channel().map_err(|client| Self { client })
9131    }
9132
9133    fn as_channel(&self) -> &::fidl::AsyncChannel {
9134        self.client.as_channel()
9135    }
9136}
9137
9138impl DirReceiverProxy {
9139    /// Create a new Proxy for fuchsia.component.sandbox/DirReceiver.
9140    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
9141        let protocol_name = <DirReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
9142        Self { client: fidl::client::Client::new(channel, protocol_name) }
9143    }
9144
9145    /// Get a Stream of events from the remote end of the protocol.
9146    ///
9147    /// # Panics
9148    ///
9149    /// Panics if the event stream was already taken.
9150    pub fn take_event_stream(&self) -> DirReceiverEventStream {
9151        DirReceiverEventStream { event_receiver: self.client.take_event_receiver() }
9152    }
9153
9154    /// Sends a directory channel to this receiver.
9155    ///
9156    /// The server should implement this method by forwarding `channel` to a vfs instance
9157    /// of the language appropriate `vfs` library.
9158    pub fn r#receive(&self, mut payload: DirReceiverReceiveRequest) -> Result<(), fidl::Error> {
9159        DirReceiverProxyInterface::r#receive(self, payload)
9160    }
9161}
9162
9163impl DirReceiverProxyInterface for DirReceiverProxy {
9164    fn r#receive(&self, mut payload: DirReceiverReceiveRequest) -> Result<(), fidl::Error> {
9165        self.client.send::<DirReceiverReceiveRequest>(
9166            &mut payload,
9167            0xcdc3e9b89fe7bb4,
9168            fidl::encoding::DynamicFlags::FLEXIBLE,
9169        )
9170    }
9171}
9172
9173pub struct DirReceiverEventStream {
9174    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
9175}
9176
9177impl std::marker::Unpin for DirReceiverEventStream {}
9178
9179impl futures::stream::FusedStream for DirReceiverEventStream {
9180    fn is_terminated(&self) -> bool {
9181        self.event_receiver.is_terminated()
9182    }
9183}
9184
9185impl futures::Stream for DirReceiverEventStream {
9186    type Item = Result<DirReceiverEvent, fidl::Error>;
9187
9188    fn poll_next(
9189        mut self: std::pin::Pin<&mut Self>,
9190        cx: &mut std::task::Context<'_>,
9191    ) -> std::task::Poll<Option<Self::Item>> {
9192        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
9193            &mut self.event_receiver,
9194            cx
9195        )?) {
9196            Some(buf) => std::task::Poll::Ready(Some(DirReceiverEvent::decode(buf))),
9197            None => std::task::Poll::Ready(None),
9198        }
9199    }
9200}
9201
9202#[derive(Debug)]
9203pub enum DirReceiverEvent {
9204    #[non_exhaustive]
9205    _UnknownEvent {
9206        /// Ordinal of the event that was sent.
9207        ordinal: u64,
9208    },
9209}
9210
9211impl DirReceiverEvent {
9212    /// Decodes a message buffer as a [`DirReceiverEvent`].
9213    fn decode(
9214        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
9215    ) -> Result<DirReceiverEvent, fidl::Error> {
9216        let (bytes, _handles) = buf.split_mut();
9217        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9218        debug_assert_eq!(tx_header.tx_id, 0);
9219        match tx_header.ordinal {
9220            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
9221                Ok(DirReceiverEvent::_UnknownEvent { ordinal: tx_header.ordinal })
9222            }
9223            _ => Err(fidl::Error::UnknownOrdinal {
9224                ordinal: tx_header.ordinal,
9225                protocol_name: <DirReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9226            }),
9227        }
9228    }
9229}
9230
9231/// A Stream of incoming requests for fuchsia.component.sandbox/DirReceiver.
9232pub struct DirReceiverRequestStream {
9233    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9234    is_terminated: bool,
9235}
9236
9237impl std::marker::Unpin for DirReceiverRequestStream {}
9238
9239impl futures::stream::FusedStream for DirReceiverRequestStream {
9240    fn is_terminated(&self) -> bool {
9241        self.is_terminated
9242    }
9243}
9244
9245impl fidl::endpoints::RequestStream for DirReceiverRequestStream {
9246    type Protocol = DirReceiverMarker;
9247    type ControlHandle = DirReceiverControlHandle;
9248
9249    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
9250        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
9251    }
9252
9253    fn control_handle(&self) -> Self::ControlHandle {
9254        DirReceiverControlHandle { inner: self.inner.clone() }
9255    }
9256
9257    fn into_inner(
9258        self,
9259    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
9260    {
9261        (self.inner, self.is_terminated)
9262    }
9263
9264    fn from_inner(
9265        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9266        is_terminated: bool,
9267    ) -> Self {
9268        Self { inner, is_terminated }
9269    }
9270}
9271
9272impl futures::Stream for DirReceiverRequestStream {
9273    type Item = Result<DirReceiverRequest, fidl::Error>;
9274
9275    fn poll_next(
9276        mut self: std::pin::Pin<&mut Self>,
9277        cx: &mut std::task::Context<'_>,
9278    ) -> std::task::Poll<Option<Self::Item>> {
9279        let this = &mut *self;
9280        if this.inner.check_shutdown(cx) {
9281            this.is_terminated = true;
9282            return std::task::Poll::Ready(None);
9283        }
9284        if this.is_terminated {
9285            panic!("polled DirReceiverRequestStream after completion");
9286        }
9287        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
9288            |bytes, handles| {
9289                match this.inner.channel().read_etc(cx, bytes, handles) {
9290                    std::task::Poll::Ready(Ok(())) => {}
9291                    std::task::Poll::Pending => return std::task::Poll::Pending,
9292                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
9293                        this.is_terminated = true;
9294                        return std::task::Poll::Ready(None);
9295                    }
9296                    std::task::Poll::Ready(Err(e)) => {
9297                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
9298                            e.into(),
9299                        ))));
9300                    }
9301                }
9302
9303                // A message has been received from the channel
9304                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9305
9306                std::task::Poll::Ready(Some(match header.ordinal {
9307                    0xcdc3e9b89fe7bb4 => {
9308                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
9309                        let mut req = fidl::new_empty!(
9310                            DirReceiverReceiveRequest,
9311                            fidl::encoding::DefaultFuchsiaResourceDialect
9312                        );
9313                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirReceiverReceiveRequest>(&header, _body_bytes, handles, &mut req)?;
9314                        let control_handle = DirReceiverControlHandle { inner: this.inner.clone() };
9315                        Ok(DirReceiverRequest::Receive { payload: req, control_handle })
9316                    }
9317                    _ if header.tx_id == 0
9318                        && header
9319                            .dynamic_flags()
9320                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
9321                    {
9322                        Ok(DirReceiverRequest::_UnknownMethod {
9323                            ordinal: header.ordinal,
9324                            control_handle: DirReceiverControlHandle { inner: this.inner.clone() },
9325                            method_type: fidl::MethodType::OneWay,
9326                        })
9327                    }
9328                    _ if header
9329                        .dynamic_flags()
9330                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
9331                    {
9332                        this.inner.send_framework_err(
9333                            fidl::encoding::FrameworkErr::UnknownMethod,
9334                            header.tx_id,
9335                            header.ordinal,
9336                            header.dynamic_flags(),
9337                            (bytes, handles),
9338                        )?;
9339                        Ok(DirReceiverRequest::_UnknownMethod {
9340                            ordinal: header.ordinal,
9341                            control_handle: DirReceiverControlHandle { inner: this.inner.clone() },
9342                            method_type: fidl::MethodType::TwoWay,
9343                        })
9344                    }
9345                    _ => Err(fidl::Error::UnknownOrdinal {
9346                        ordinal: header.ordinal,
9347                        protocol_name:
9348                            <DirReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9349                    }),
9350                }))
9351            },
9352        )
9353    }
9354}
9355
9356/// A receiver is served by components and allows them to receive directory channels
9357/// framework.
9358#[derive(Debug)]
9359pub enum DirReceiverRequest {
9360    /// Sends a directory channel to this receiver.
9361    ///
9362    /// The server should implement this method by forwarding `channel` to a vfs instance
9363    /// of the language appropriate `vfs` library.
9364    Receive { payload: DirReceiverReceiveRequest, control_handle: DirReceiverControlHandle },
9365    /// An interaction was received which does not match any known method.
9366    #[non_exhaustive]
9367    _UnknownMethod {
9368        /// Ordinal of the method that was called.
9369        ordinal: u64,
9370        control_handle: DirReceiverControlHandle,
9371        method_type: fidl::MethodType,
9372    },
9373}
9374
9375impl DirReceiverRequest {
9376    #[allow(irrefutable_let_patterns)]
9377    pub fn into_receive(self) -> Option<(DirReceiverReceiveRequest, DirReceiverControlHandle)> {
9378        if let DirReceiverRequest::Receive { payload, control_handle } = self {
9379            Some((payload, control_handle))
9380        } else {
9381            None
9382        }
9383    }
9384
9385    /// Name of the method defined in FIDL
9386    pub fn method_name(&self) -> &'static str {
9387        match *self {
9388            DirReceiverRequest::Receive { .. } => "receive",
9389            DirReceiverRequest::_UnknownMethod {
9390                method_type: fidl::MethodType::OneWay, ..
9391            } => "unknown one-way method",
9392            DirReceiverRequest::_UnknownMethod {
9393                method_type: fidl::MethodType::TwoWay, ..
9394            } => "unknown two-way method",
9395        }
9396    }
9397}
9398
9399#[derive(Debug, Clone)]
9400pub struct DirReceiverControlHandle {
9401    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9402}
9403
9404impl fidl::endpoints::ControlHandle for DirReceiverControlHandle {
9405    fn shutdown(&self) {
9406        self.inner.shutdown()
9407    }
9408    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
9409        self.inner.shutdown_with_epitaph(status)
9410    }
9411
9412    fn is_closed(&self) -> bool {
9413        self.inner.channel().is_closed()
9414    }
9415    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
9416        self.inner.channel().on_closed()
9417    }
9418
9419    #[cfg(target_os = "fuchsia")]
9420    fn signal_peer(
9421        &self,
9422        clear_mask: zx::Signals,
9423        set_mask: zx::Signals,
9424    ) -> Result<(), zx_status::Status> {
9425        use fidl::Peered;
9426        self.inner.channel().signal_peer(clear_mask, set_mask)
9427    }
9428}
9429
9430impl DirReceiverControlHandle {}
9431
9432#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
9433pub struct DirectoryRouterMarker;
9434
9435impl fidl::endpoints::ProtocolMarker for DirectoryRouterMarker {
9436    type Proxy = DirectoryRouterProxy;
9437    type RequestStream = DirectoryRouterRequestStream;
9438    #[cfg(target_os = "fuchsia")]
9439    type SynchronousProxy = DirectoryRouterSynchronousProxy;
9440
9441    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.DirectoryRouter";
9442}
9443impl fidl::endpoints::DiscoverableProtocolMarker for DirectoryRouterMarker {}
9444pub type DirectoryRouterRouteResult = Result<DirectoryRouterRouteResponse, RouterError>;
9445
9446pub trait DirectoryRouterProxyInterface: Send + Sync {
9447    type RouteResponseFut: std::future::Future<Output = Result<DirectoryRouterRouteResult, fidl::Error>>
9448        + Send;
9449    fn r#route(&self, payload: RouteRequest) -> Self::RouteResponseFut;
9450}
9451#[derive(Debug)]
9452#[cfg(target_os = "fuchsia")]
9453pub struct DirectoryRouterSynchronousProxy {
9454    client: fidl::client::sync::Client,
9455}
9456
9457#[cfg(target_os = "fuchsia")]
9458impl fidl::endpoints::SynchronousProxy for DirectoryRouterSynchronousProxy {
9459    type Proxy = DirectoryRouterProxy;
9460    type Protocol = DirectoryRouterMarker;
9461
9462    fn from_channel(inner: fidl::Channel) -> Self {
9463        Self::new(inner)
9464    }
9465
9466    fn into_channel(self) -> fidl::Channel {
9467        self.client.into_channel()
9468    }
9469
9470    fn as_channel(&self) -> &fidl::Channel {
9471        self.client.as_channel()
9472    }
9473}
9474
9475#[cfg(target_os = "fuchsia")]
9476impl DirectoryRouterSynchronousProxy {
9477    pub fn new(channel: fidl::Channel) -> Self {
9478        let protocol_name = <DirectoryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
9479        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
9480    }
9481
9482    pub fn into_channel(self) -> fidl::Channel {
9483        self.client.into_channel()
9484    }
9485
9486    /// Waits until an event arrives and returns it. It is safe for other
9487    /// threads to make concurrent requests while waiting for an event.
9488    pub fn wait_for_event(
9489        &self,
9490        deadline: zx::MonotonicInstant,
9491    ) -> Result<DirectoryRouterEvent, fidl::Error> {
9492        DirectoryRouterEvent::decode(self.client.wait_for_event(deadline)?)
9493    }
9494
9495    pub fn r#route(
9496        &self,
9497        mut payload: RouteRequest,
9498        ___deadline: zx::MonotonicInstant,
9499    ) -> Result<DirectoryRouterRouteResult, fidl::Error> {
9500        let _response = self.client.send_query::<
9501            RouteRequest,
9502            fidl::encoding::FlexibleResultType<DirectoryRouterRouteResponse, RouterError>,
9503        >(
9504            &mut payload,
9505            0x683b6c6be21b0f21,
9506            fidl::encoding::DynamicFlags::FLEXIBLE,
9507            ___deadline,
9508        )?
9509        .into_result::<DirectoryRouterMarker>("route")?;
9510        Ok(_response.map(|x| x))
9511    }
9512}
9513
9514#[cfg(target_os = "fuchsia")]
9515impl From<DirectoryRouterSynchronousProxy> for zx::NullableHandle {
9516    fn from(value: DirectoryRouterSynchronousProxy) -> Self {
9517        value.into_channel().into()
9518    }
9519}
9520
9521#[cfg(target_os = "fuchsia")]
9522impl From<fidl::Channel> for DirectoryRouterSynchronousProxy {
9523    fn from(value: fidl::Channel) -> Self {
9524        Self::new(value)
9525    }
9526}
9527
9528#[cfg(target_os = "fuchsia")]
9529impl fidl::endpoints::FromClient for DirectoryRouterSynchronousProxy {
9530    type Protocol = DirectoryRouterMarker;
9531
9532    fn from_client(value: fidl::endpoints::ClientEnd<DirectoryRouterMarker>) -> Self {
9533        Self::new(value.into_channel())
9534    }
9535}
9536
9537#[derive(Debug, Clone)]
9538pub struct DirectoryRouterProxy {
9539    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
9540}
9541
9542impl fidl::endpoints::Proxy for DirectoryRouterProxy {
9543    type Protocol = DirectoryRouterMarker;
9544
9545    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
9546        Self::new(inner)
9547    }
9548
9549    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
9550        self.client.into_channel().map_err(|client| Self { client })
9551    }
9552
9553    fn as_channel(&self) -> &::fidl::AsyncChannel {
9554        self.client.as_channel()
9555    }
9556}
9557
9558impl DirectoryRouterProxy {
9559    /// Create a new Proxy for fuchsia.component.sandbox/DirectoryRouter.
9560    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
9561        let protocol_name = <DirectoryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
9562        Self { client: fidl::client::Client::new(channel, protocol_name) }
9563    }
9564
9565    /// Get a Stream of events from the remote end of the protocol.
9566    ///
9567    /// # Panics
9568    ///
9569    /// Panics if the event stream was already taken.
9570    pub fn take_event_stream(&self) -> DirectoryRouterEventStream {
9571        DirectoryRouterEventStream { event_receiver: self.client.take_event_receiver() }
9572    }
9573
9574    pub fn r#route(
9575        &self,
9576        mut payload: RouteRequest,
9577    ) -> fidl::client::QueryResponseFut<
9578        DirectoryRouterRouteResult,
9579        fidl::encoding::DefaultFuchsiaResourceDialect,
9580    > {
9581        DirectoryRouterProxyInterface::r#route(self, payload)
9582    }
9583}
9584
9585impl DirectoryRouterProxyInterface for DirectoryRouterProxy {
9586    type RouteResponseFut = fidl::client::QueryResponseFut<
9587        DirectoryRouterRouteResult,
9588        fidl::encoding::DefaultFuchsiaResourceDialect,
9589    >;
9590    fn r#route(&self, mut payload: RouteRequest) -> Self::RouteResponseFut {
9591        fn _decode(
9592            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9593        ) -> Result<DirectoryRouterRouteResult, fidl::Error> {
9594            let _response = fidl::client::decode_transaction_body::<
9595                fidl::encoding::FlexibleResultType<DirectoryRouterRouteResponse, RouterError>,
9596                fidl::encoding::DefaultFuchsiaResourceDialect,
9597                0x683b6c6be21b0f21,
9598            >(_buf?)?
9599            .into_result::<DirectoryRouterMarker>("route")?;
9600            Ok(_response.map(|x| x))
9601        }
9602        self.client.send_query_and_decode::<RouteRequest, DirectoryRouterRouteResult>(
9603            &mut payload,
9604            0x683b6c6be21b0f21,
9605            fidl::encoding::DynamicFlags::FLEXIBLE,
9606            _decode,
9607        )
9608    }
9609}
9610
9611pub struct DirectoryRouterEventStream {
9612    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
9613}
9614
9615impl std::marker::Unpin for DirectoryRouterEventStream {}
9616
9617impl futures::stream::FusedStream for DirectoryRouterEventStream {
9618    fn is_terminated(&self) -> bool {
9619        self.event_receiver.is_terminated()
9620    }
9621}
9622
9623impl futures::Stream for DirectoryRouterEventStream {
9624    type Item = Result<DirectoryRouterEvent, fidl::Error>;
9625
9626    fn poll_next(
9627        mut self: std::pin::Pin<&mut Self>,
9628        cx: &mut std::task::Context<'_>,
9629    ) -> std::task::Poll<Option<Self::Item>> {
9630        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
9631            &mut self.event_receiver,
9632            cx
9633        )?) {
9634            Some(buf) => std::task::Poll::Ready(Some(DirectoryRouterEvent::decode(buf))),
9635            None => std::task::Poll::Ready(None),
9636        }
9637    }
9638}
9639
9640#[derive(Debug)]
9641pub enum DirectoryRouterEvent {
9642    #[non_exhaustive]
9643    _UnknownEvent {
9644        /// Ordinal of the event that was sent.
9645        ordinal: u64,
9646    },
9647}
9648
9649impl DirectoryRouterEvent {
9650    /// Decodes a message buffer as a [`DirectoryRouterEvent`].
9651    fn decode(
9652        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
9653    ) -> Result<DirectoryRouterEvent, fidl::Error> {
9654        let (bytes, _handles) = buf.split_mut();
9655        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9656        debug_assert_eq!(tx_header.tx_id, 0);
9657        match tx_header.ordinal {
9658            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
9659                Ok(DirectoryRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
9660            }
9661            _ => Err(fidl::Error::UnknownOrdinal {
9662                ordinal: tx_header.ordinal,
9663                protocol_name:
9664                    <DirectoryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9665            }),
9666        }
9667    }
9668}
9669
9670/// A Stream of incoming requests for fuchsia.component.sandbox/DirectoryRouter.
9671pub struct DirectoryRouterRequestStream {
9672    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9673    is_terminated: bool,
9674}
9675
9676impl std::marker::Unpin for DirectoryRouterRequestStream {}
9677
9678impl futures::stream::FusedStream for DirectoryRouterRequestStream {
9679    fn is_terminated(&self) -> bool {
9680        self.is_terminated
9681    }
9682}
9683
9684impl fidl::endpoints::RequestStream for DirectoryRouterRequestStream {
9685    type Protocol = DirectoryRouterMarker;
9686    type ControlHandle = DirectoryRouterControlHandle;
9687
9688    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
9689        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
9690    }
9691
9692    fn control_handle(&self) -> Self::ControlHandle {
9693        DirectoryRouterControlHandle { inner: self.inner.clone() }
9694    }
9695
9696    fn into_inner(
9697        self,
9698    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
9699    {
9700        (self.inner, self.is_terminated)
9701    }
9702
9703    fn from_inner(
9704        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9705        is_terminated: bool,
9706    ) -> Self {
9707        Self { inner, is_terminated }
9708    }
9709}
9710
9711impl futures::Stream for DirectoryRouterRequestStream {
9712    type Item = Result<DirectoryRouterRequest, fidl::Error>;
9713
9714    fn poll_next(
9715        mut self: std::pin::Pin<&mut Self>,
9716        cx: &mut std::task::Context<'_>,
9717    ) -> std::task::Poll<Option<Self::Item>> {
9718        let this = &mut *self;
9719        if this.inner.check_shutdown(cx) {
9720            this.is_terminated = true;
9721            return std::task::Poll::Ready(None);
9722        }
9723        if this.is_terminated {
9724            panic!("polled DirectoryRouterRequestStream after completion");
9725        }
9726        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
9727            |bytes, handles| {
9728                match this.inner.channel().read_etc(cx, bytes, handles) {
9729                    std::task::Poll::Ready(Ok(())) => {}
9730                    std::task::Poll::Pending => return std::task::Poll::Pending,
9731                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
9732                        this.is_terminated = true;
9733                        return std::task::Poll::Ready(None);
9734                    }
9735                    std::task::Poll::Ready(Err(e)) => {
9736                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
9737                            e.into(),
9738                        ))));
9739                    }
9740                }
9741
9742                // A message has been received from the channel
9743                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9744
9745                std::task::Poll::Ready(Some(match header.ordinal {
9746                    0x683b6c6be21b0f21 => {
9747                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9748                        let mut req = fidl::new_empty!(
9749                            RouteRequest,
9750                            fidl::encoding::DefaultFuchsiaResourceDialect
9751                        );
9752                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RouteRequest>(&header, _body_bytes, handles, &mut req)?;
9753                        let control_handle =
9754                            DirectoryRouterControlHandle { inner: this.inner.clone() };
9755                        Ok(DirectoryRouterRequest::Route {
9756                            payload: req,
9757                            responder: DirectoryRouterRouteResponder {
9758                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9759                                tx_id: header.tx_id,
9760                            },
9761                        })
9762                    }
9763                    _ if header.tx_id == 0
9764                        && header
9765                            .dynamic_flags()
9766                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
9767                    {
9768                        Ok(DirectoryRouterRequest::_UnknownMethod {
9769                            ordinal: header.ordinal,
9770                            control_handle: DirectoryRouterControlHandle {
9771                                inner: this.inner.clone(),
9772                            },
9773                            method_type: fidl::MethodType::OneWay,
9774                        })
9775                    }
9776                    _ if header
9777                        .dynamic_flags()
9778                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
9779                    {
9780                        this.inner.send_framework_err(
9781                            fidl::encoding::FrameworkErr::UnknownMethod,
9782                            header.tx_id,
9783                            header.ordinal,
9784                            header.dynamic_flags(),
9785                            (bytes, handles),
9786                        )?;
9787                        Ok(DirectoryRouterRequest::_UnknownMethod {
9788                            ordinal: header.ordinal,
9789                            control_handle: DirectoryRouterControlHandle {
9790                                inner: this.inner.clone(),
9791                            },
9792                            method_type: fidl::MethodType::TwoWay,
9793                        })
9794                    }
9795                    _ => Err(fidl::Error::UnknownOrdinal {
9796                        ordinal: header.ordinal,
9797                        protocol_name:
9798                            <DirectoryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9799                    }),
9800                }))
9801            },
9802        )
9803    }
9804}
9805
9806#[derive(Debug)]
9807pub enum DirectoryRouterRequest {
9808    Route {
9809        payload: RouteRequest,
9810        responder: DirectoryRouterRouteResponder,
9811    },
9812    /// An interaction was received which does not match any known method.
9813    #[non_exhaustive]
9814    _UnknownMethod {
9815        /// Ordinal of the method that was called.
9816        ordinal: u64,
9817        control_handle: DirectoryRouterControlHandle,
9818        method_type: fidl::MethodType,
9819    },
9820}
9821
9822impl DirectoryRouterRequest {
9823    #[allow(irrefutable_let_patterns)]
9824    pub fn into_route(self) -> Option<(RouteRequest, DirectoryRouterRouteResponder)> {
9825        if let DirectoryRouterRequest::Route { payload, responder } = self {
9826            Some((payload, responder))
9827        } else {
9828            None
9829        }
9830    }
9831
9832    /// Name of the method defined in FIDL
9833    pub fn method_name(&self) -> &'static str {
9834        match *self {
9835            DirectoryRouterRequest::Route { .. } => "route",
9836            DirectoryRouterRequest::_UnknownMethod {
9837                method_type: fidl::MethodType::OneWay,
9838                ..
9839            } => "unknown one-way method",
9840            DirectoryRouterRequest::_UnknownMethod {
9841                method_type: fidl::MethodType::TwoWay,
9842                ..
9843            } => "unknown two-way method",
9844        }
9845    }
9846}
9847
9848#[derive(Debug, Clone)]
9849pub struct DirectoryRouterControlHandle {
9850    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9851}
9852
9853impl fidl::endpoints::ControlHandle for DirectoryRouterControlHandle {
9854    fn shutdown(&self) {
9855        self.inner.shutdown()
9856    }
9857    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
9858        self.inner.shutdown_with_epitaph(status)
9859    }
9860
9861    fn is_closed(&self) -> bool {
9862        self.inner.channel().is_closed()
9863    }
9864    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
9865        self.inner.channel().on_closed()
9866    }
9867
9868    #[cfg(target_os = "fuchsia")]
9869    fn signal_peer(
9870        &self,
9871        clear_mask: zx::Signals,
9872        set_mask: zx::Signals,
9873    ) -> Result<(), zx_status::Status> {
9874        use fidl::Peered;
9875        self.inner.channel().signal_peer(clear_mask, set_mask)
9876    }
9877}
9878
9879impl DirectoryRouterControlHandle {}
9880
9881#[must_use = "FIDL methods require a response to be sent"]
9882#[derive(Debug)]
9883pub struct DirectoryRouterRouteResponder {
9884    control_handle: std::mem::ManuallyDrop<DirectoryRouterControlHandle>,
9885    tx_id: u32,
9886}
9887
9888/// Set the the channel to be shutdown (see [`DirectoryRouterControlHandle::shutdown`])
9889/// if the responder is dropped without sending a response, so that the client
9890/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9891impl std::ops::Drop for DirectoryRouterRouteResponder {
9892    fn drop(&mut self) {
9893        self.control_handle.shutdown();
9894        // Safety: drops once, never accessed again
9895        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9896    }
9897}
9898
9899impl fidl::endpoints::Responder for DirectoryRouterRouteResponder {
9900    type ControlHandle = DirectoryRouterControlHandle;
9901
9902    fn control_handle(&self) -> &DirectoryRouterControlHandle {
9903        &self.control_handle
9904    }
9905
9906    fn drop_without_shutdown(mut self) {
9907        // Safety: drops once, never accessed again due to mem::forget
9908        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9909        // Prevent Drop from running (which would shut down the channel)
9910        std::mem::forget(self);
9911    }
9912}
9913
9914impl DirectoryRouterRouteResponder {
9915    /// Sends a response to the FIDL transaction.
9916    ///
9917    /// Sets the channel to shutdown if an error occurs.
9918    pub fn send(
9919        self,
9920        mut result: Result<DirectoryRouterRouteResponse, RouterError>,
9921    ) -> Result<(), fidl::Error> {
9922        let _result = self.send_raw(result);
9923        if _result.is_err() {
9924            self.control_handle.shutdown();
9925        }
9926        self.drop_without_shutdown();
9927        _result
9928    }
9929
9930    /// Similar to "send" but does not shutdown the channel if an error occurs.
9931    pub fn send_no_shutdown_on_err(
9932        self,
9933        mut result: Result<DirectoryRouterRouteResponse, RouterError>,
9934    ) -> Result<(), fidl::Error> {
9935        let _result = self.send_raw(result);
9936        self.drop_without_shutdown();
9937        _result
9938    }
9939
9940    fn send_raw(
9941        &self,
9942        mut result: Result<DirectoryRouterRouteResponse, RouterError>,
9943    ) -> Result<(), fidl::Error> {
9944        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
9945            DirectoryRouterRouteResponse,
9946            RouterError,
9947        >>(
9948            fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
9949            self.tx_id,
9950            0x683b6c6be21b0f21,
9951            fidl::encoding::DynamicFlags::FLEXIBLE,
9952        )
9953    }
9954}
9955
9956#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
9957pub struct ReceiverMarker;
9958
9959impl fidl::endpoints::ProtocolMarker for ReceiverMarker {
9960    type Proxy = ReceiverProxy;
9961    type RequestStream = ReceiverRequestStream;
9962    #[cfg(target_os = "fuchsia")]
9963    type SynchronousProxy = ReceiverSynchronousProxy;
9964
9965    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.Receiver";
9966}
9967impl fidl::endpoints::DiscoverableProtocolMarker for ReceiverMarker {}
9968
9969pub trait ReceiverProxyInterface: Send + Sync {
9970    fn r#receive(&self, channel: fidl::Channel) -> Result<(), fidl::Error>;
9971}
9972#[derive(Debug)]
9973#[cfg(target_os = "fuchsia")]
9974pub struct ReceiverSynchronousProxy {
9975    client: fidl::client::sync::Client,
9976}
9977
9978#[cfg(target_os = "fuchsia")]
9979impl fidl::endpoints::SynchronousProxy for ReceiverSynchronousProxy {
9980    type Proxy = ReceiverProxy;
9981    type Protocol = ReceiverMarker;
9982
9983    fn from_channel(inner: fidl::Channel) -> Self {
9984        Self::new(inner)
9985    }
9986
9987    fn into_channel(self) -> fidl::Channel {
9988        self.client.into_channel()
9989    }
9990
9991    fn as_channel(&self) -> &fidl::Channel {
9992        self.client.as_channel()
9993    }
9994}
9995
9996#[cfg(target_os = "fuchsia")]
9997impl ReceiverSynchronousProxy {
9998    pub fn new(channel: fidl::Channel) -> Self {
9999        let protocol_name = <ReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
10000        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
10001    }
10002
10003    pub fn into_channel(self) -> fidl::Channel {
10004        self.client.into_channel()
10005    }
10006
10007    /// Waits until an event arrives and returns it. It is safe for other
10008    /// threads to make concurrent requests while waiting for an event.
10009    pub fn wait_for_event(
10010        &self,
10011        deadline: zx::MonotonicInstant,
10012    ) -> Result<ReceiverEvent, fidl::Error> {
10013        ReceiverEvent::decode(self.client.wait_for_event(deadline)?)
10014    }
10015
10016    /// Sends a channel to this receiver.
10017    pub fn r#receive(&self, mut channel: fidl::Channel) -> Result<(), fidl::Error> {
10018        self.client.send::<ProtocolPayload>(
10019            (channel,),
10020            0x4bae18ab7aa1a94,
10021            fidl::encoding::DynamicFlags::FLEXIBLE,
10022        )
10023    }
10024}
10025
10026#[cfg(target_os = "fuchsia")]
10027impl From<ReceiverSynchronousProxy> for zx::NullableHandle {
10028    fn from(value: ReceiverSynchronousProxy) -> Self {
10029        value.into_channel().into()
10030    }
10031}
10032
10033#[cfg(target_os = "fuchsia")]
10034impl From<fidl::Channel> for ReceiverSynchronousProxy {
10035    fn from(value: fidl::Channel) -> Self {
10036        Self::new(value)
10037    }
10038}
10039
10040#[cfg(target_os = "fuchsia")]
10041impl fidl::endpoints::FromClient for ReceiverSynchronousProxy {
10042    type Protocol = ReceiverMarker;
10043
10044    fn from_client(value: fidl::endpoints::ClientEnd<ReceiverMarker>) -> Self {
10045        Self::new(value.into_channel())
10046    }
10047}
10048
10049#[derive(Debug, Clone)]
10050pub struct ReceiverProxy {
10051    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
10052}
10053
10054impl fidl::endpoints::Proxy for ReceiverProxy {
10055    type Protocol = ReceiverMarker;
10056
10057    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
10058        Self::new(inner)
10059    }
10060
10061    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
10062        self.client.into_channel().map_err(|client| Self { client })
10063    }
10064
10065    fn as_channel(&self) -> &::fidl::AsyncChannel {
10066        self.client.as_channel()
10067    }
10068}
10069
10070impl ReceiverProxy {
10071    /// Create a new Proxy for fuchsia.component.sandbox/Receiver.
10072    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
10073        let protocol_name = <ReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
10074        Self { client: fidl::client::Client::new(channel, protocol_name) }
10075    }
10076
10077    /// Get a Stream of events from the remote end of the protocol.
10078    ///
10079    /// # Panics
10080    ///
10081    /// Panics if the event stream was already taken.
10082    pub fn take_event_stream(&self) -> ReceiverEventStream {
10083        ReceiverEventStream { event_receiver: self.client.take_event_receiver() }
10084    }
10085
10086    /// Sends a channel to this receiver.
10087    pub fn r#receive(&self, mut channel: fidl::Channel) -> Result<(), fidl::Error> {
10088        ReceiverProxyInterface::r#receive(self, channel)
10089    }
10090}
10091
10092impl ReceiverProxyInterface for ReceiverProxy {
10093    fn r#receive(&self, mut channel: fidl::Channel) -> Result<(), fidl::Error> {
10094        self.client.send::<ProtocolPayload>(
10095            (channel,),
10096            0x4bae18ab7aa1a94,
10097            fidl::encoding::DynamicFlags::FLEXIBLE,
10098        )
10099    }
10100}
10101
10102pub struct ReceiverEventStream {
10103    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
10104}
10105
10106impl std::marker::Unpin for ReceiverEventStream {}
10107
10108impl futures::stream::FusedStream for ReceiverEventStream {
10109    fn is_terminated(&self) -> bool {
10110        self.event_receiver.is_terminated()
10111    }
10112}
10113
10114impl futures::Stream for ReceiverEventStream {
10115    type Item = Result<ReceiverEvent, fidl::Error>;
10116
10117    fn poll_next(
10118        mut self: std::pin::Pin<&mut Self>,
10119        cx: &mut std::task::Context<'_>,
10120    ) -> std::task::Poll<Option<Self::Item>> {
10121        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
10122            &mut self.event_receiver,
10123            cx
10124        )?) {
10125            Some(buf) => std::task::Poll::Ready(Some(ReceiverEvent::decode(buf))),
10126            None => std::task::Poll::Ready(None),
10127        }
10128    }
10129}
10130
10131#[derive(Debug)]
10132pub enum ReceiverEvent {
10133    #[non_exhaustive]
10134    _UnknownEvent {
10135        /// Ordinal of the event that was sent.
10136        ordinal: u64,
10137    },
10138}
10139
10140impl ReceiverEvent {
10141    /// Decodes a message buffer as a [`ReceiverEvent`].
10142    fn decode(
10143        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
10144    ) -> Result<ReceiverEvent, fidl::Error> {
10145        let (bytes, _handles) = buf.split_mut();
10146        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
10147        debug_assert_eq!(tx_header.tx_id, 0);
10148        match tx_header.ordinal {
10149            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
10150                Ok(ReceiverEvent::_UnknownEvent { ordinal: tx_header.ordinal })
10151            }
10152            _ => Err(fidl::Error::UnknownOrdinal {
10153                ordinal: tx_header.ordinal,
10154                protocol_name: <ReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
10155            }),
10156        }
10157    }
10158}
10159
10160/// A Stream of incoming requests for fuchsia.component.sandbox/Receiver.
10161pub struct ReceiverRequestStream {
10162    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10163    is_terminated: bool,
10164}
10165
10166impl std::marker::Unpin for ReceiverRequestStream {}
10167
10168impl futures::stream::FusedStream for ReceiverRequestStream {
10169    fn is_terminated(&self) -> bool {
10170        self.is_terminated
10171    }
10172}
10173
10174impl fidl::endpoints::RequestStream for ReceiverRequestStream {
10175    type Protocol = ReceiverMarker;
10176    type ControlHandle = ReceiverControlHandle;
10177
10178    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
10179        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
10180    }
10181
10182    fn control_handle(&self) -> Self::ControlHandle {
10183        ReceiverControlHandle { inner: self.inner.clone() }
10184    }
10185
10186    fn into_inner(
10187        self,
10188    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
10189    {
10190        (self.inner, self.is_terminated)
10191    }
10192
10193    fn from_inner(
10194        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10195        is_terminated: bool,
10196    ) -> Self {
10197        Self { inner, is_terminated }
10198    }
10199}
10200
10201impl futures::Stream for ReceiverRequestStream {
10202    type Item = Result<ReceiverRequest, fidl::Error>;
10203
10204    fn poll_next(
10205        mut self: std::pin::Pin<&mut Self>,
10206        cx: &mut std::task::Context<'_>,
10207    ) -> std::task::Poll<Option<Self::Item>> {
10208        let this = &mut *self;
10209        if this.inner.check_shutdown(cx) {
10210            this.is_terminated = true;
10211            return std::task::Poll::Ready(None);
10212        }
10213        if this.is_terminated {
10214            panic!("polled ReceiverRequestStream after completion");
10215        }
10216        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
10217            |bytes, handles| {
10218                match this.inner.channel().read_etc(cx, bytes, handles) {
10219                    std::task::Poll::Ready(Ok(())) => {}
10220                    std::task::Poll::Pending => return std::task::Poll::Pending,
10221                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
10222                        this.is_terminated = true;
10223                        return std::task::Poll::Ready(None);
10224                    }
10225                    std::task::Poll::Ready(Err(e)) => {
10226                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
10227                            e.into(),
10228                        ))));
10229                    }
10230                }
10231
10232                // A message has been received from the channel
10233                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
10234
10235                std::task::Poll::Ready(Some(match header.ordinal {
10236                    0x4bae18ab7aa1a94 => {
10237                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
10238                        let mut req = fidl::new_empty!(
10239                            ProtocolPayload,
10240                            fidl::encoding::DefaultFuchsiaResourceDialect
10241                        );
10242                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ProtocolPayload>(&header, _body_bytes, handles, &mut req)?;
10243                        let control_handle = ReceiverControlHandle { inner: this.inner.clone() };
10244                        Ok(ReceiverRequest::Receive { channel: req.channel, control_handle })
10245                    }
10246                    _ if header.tx_id == 0
10247                        && header
10248                            .dynamic_flags()
10249                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
10250                    {
10251                        Ok(ReceiverRequest::_UnknownMethod {
10252                            ordinal: header.ordinal,
10253                            control_handle: ReceiverControlHandle { inner: this.inner.clone() },
10254                            method_type: fidl::MethodType::OneWay,
10255                        })
10256                    }
10257                    _ if header
10258                        .dynamic_flags()
10259                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
10260                    {
10261                        this.inner.send_framework_err(
10262                            fidl::encoding::FrameworkErr::UnknownMethod,
10263                            header.tx_id,
10264                            header.ordinal,
10265                            header.dynamic_flags(),
10266                            (bytes, handles),
10267                        )?;
10268                        Ok(ReceiverRequest::_UnknownMethod {
10269                            ordinal: header.ordinal,
10270                            control_handle: ReceiverControlHandle { inner: this.inner.clone() },
10271                            method_type: fidl::MethodType::TwoWay,
10272                        })
10273                    }
10274                    _ => Err(fidl::Error::UnknownOrdinal {
10275                        ordinal: header.ordinal,
10276                        protocol_name:
10277                            <ReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
10278                    }),
10279                }))
10280            },
10281        )
10282    }
10283}
10284
10285/// A receiver is served by components and allows them to receive channels
10286/// from the framework.
10287#[derive(Debug)]
10288pub enum ReceiverRequest {
10289    /// Sends a channel to this receiver.
10290    Receive { channel: fidl::Channel, control_handle: ReceiverControlHandle },
10291    /// An interaction was received which does not match any known method.
10292    #[non_exhaustive]
10293    _UnknownMethod {
10294        /// Ordinal of the method that was called.
10295        ordinal: u64,
10296        control_handle: ReceiverControlHandle,
10297        method_type: fidl::MethodType,
10298    },
10299}
10300
10301impl ReceiverRequest {
10302    #[allow(irrefutable_let_patterns)]
10303    pub fn into_receive(self) -> Option<(fidl::Channel, ReceiverControlHandle)> {
10304        if let ReceiverRequest::Receive { channel, control_handle } = self {
10305            Some((channel, control_handle))
10306        } else {
10307            None
10308        }
10309    }
10310
10311    /// Name of the method defined in FIDL
10312    pub fn method_name(&self) -> &'static str {
10313        match *self {
10314            ReceiverRequest::Receive { .. } => "receive",
10315            ReceiverRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
10316                "unknown one-way method"
10317            }
10318            ReceiverRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
10319                "unknown two-way method"
10320            }
10321        }
10322    }
10323}
10324
10325#[derive(Debug, Clone)]
10326pub struct ReceiverControlHandle {
10327    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10328}
10329
10330impl fidl::endpoints::ControlHandle for ReceiverControlHandle {
10331    fn shutdown(&self) {
10332        self.inner.shutdown()
10333    }
10334    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
10335        self.inner.shutdown_with_epitaph(status)
10336    }
10337
10338    fn is_closed(&self) -> bool {
10339        self.inner.channel().is_closed()
10340    }
10341    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
10342        self.inner.channel().on_closed()
10343    }
10344
10345    #[cfg(target_os = "fuchsia")]
10346    fn signal_peer(
10347        &self,
10348        clear_mask: zx::Signals,
10349        set_mask: zx::Signals,
10350    ) -> Result<(), zx_status::Status> {
10351        use fidl::Peered;
10352        self.inner.channel().signal_peer(clear_mask, set_mask)
10353    }
10354}
10355
10356impl ReceiverControlHandle {}
10357
10358mod internal {
10359    use super::*;
10360
10361    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreConnectorCreateRequest {
10362        type Borrowed<'a> = &'a mut Self;
10363        fn take_or_borrow<'a>(
10364            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10365        ) -> Self::Borrowed<'a> {
10366            value
10367        }
10368    }
10369
10370    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreConnectorCreateRequest {
10371        type Owned = Self;
10372
10373        #[inline(always)]
10374        fn inline_align(_context: fidl::encoding::Context) -> usize {
10375            8
10376        }
10377
10378        #[inline(always)]
10379        fn inline_size(_context: fidl::encoding::Context) -> usize {
10380            16
10381        }
10382    }
10383
10384    unsafe impl
10385        fidl::encoding::Encode<
10386            CapabilityStoreConnectorCreateRequest,
10387            fidl::encoding::DefaultFuchsiaResourceDialect,
10388        > for &mut CapabilityStoreConnectorCreateRequest
10389    {
10390        #[inline]
10391        unsafe fn encode(
10392            self,
10393            encoder: &mut fidl::encoding::Encoder<
10394                '_,
10395                fidl::encoding::DefaultFuchsiaResourceDialect,
10396            >,
10397            offset: usize,
10398            _depth: fidl::encoding::Depth,
10399        ) -> fidl::Result<()> {
10400            encoder.debug_check_bounds::<CapabilityStoreConnectorCreateRequest>(offset);
10401            // Delegate to tuple encoding.
10402            fidl::encoding::Encode::<CapabilityStoreConnectorCreateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10403                (
10404                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
10405                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ReceiverMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.receiver),
10406                ),
10407                encoder, offset, _depth
10408            )
10409        }
10410    }
10411    unsafe impl<
10412        T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
10413        T1: fidl::encoding::Encode<
10414                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ReceiverMarker>>,
10415                fidl::encoding::DefaultFuchsiaResourceDialect,
10416            >,
10417    >
10418        fidl::encoding::Encode<
10419            CapabilityStoreConnectorCreateRequest,
10420            fidl::encoding::DefaultFuchsiaResourceDialect,
10421        > for (T0, T1)
10422    {
10423        #[inline]
10424        unsafe fn encode(
10425            self,
10426            encoder: &mut fidl::encoding::Encoder<
10427                '_,
10428                fidl::encoding::DefaultFuchsiaResourceDialect,
10429            >,
10430            offset: usize,
10431            depth: fidl::encoding::Depth,
10432        ) -> fidl::Result<()> {
10433            encoder.debug_check_bounds::<CapabilityStoreConnectorCreateRequest>(offset);
10434            // Zero out padding regions. There's no need to apply masks
10435            // because the unmasked parts will be overwritten by fields.
10436            unsafe {
10437                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
10438                (ptr as *mut u64).write_unaligned(0);
10439            }
10440            // Write the fields.
10441            self.0.encode(encoder, offset + 0, depth)?;
10442            self.1.encode(encoder, offset + 8, depth)?;
10443            Ok(())
10444        }
10445    }
10446
10447    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10448        for CapabilityStoreConnectorCreateRequest
10449    {
10450        #[inline(always)]
10451        fn new_empty() -> Self {
10452            Self {
10453                id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
10454                receiver: fidl::new_empty!(
10455                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ReceiverMarker>>,
10456                    fidl::encoding::DefaultFuchsiaResourceDialect
10457                ),
10458            }
10459        }
10460
10461        #[inline]
10462        unsafe fn decode(
10463            &mut self,
10464            decoder: &mut fidl::encoding::Decoder<
10465                '_,
10466                fidl::encoding::DefaultFuchsiaResourceDialect,
10467            >,
10468            offset: usize,
10469            _depth: fidl::encoding::Depth,
10470        ) -> fidl::Result<()> {
10471            decoder.debug_check_bounds::<Self>(offset);
10472            // Verify that padding bytes are zero.
10473            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
10474            let padval = unsafe { (ptr as *const u64).read_unaligned() };
10475            let mask = 0xffffffff00000000u64;
10476            let maskedval = padval & mask;
10477            if maskedval != 0 {
10478                return Err(fidl::Error::NonZeroPadding {
10479                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
10480                });
10481            }
10482            fidl::decode!(
10483                u64,
10484                fidl::encoding::DefaultFuchsiaResourceDialect,
10485                &mut self.id,
10486                decoder,
10487                offset + 0,
10488                _depth
10489            )?;
10490            fidl::decode!(
10491                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ReceiverMarker>>,
10492                fidl::encoding::DefaultFuchsiaResourceDialect,
10493                &mut self.receiver,
10494                decoder,
10495                offset + 8,
10496                _depth
10497            )?;
10498            Ok(())
10499        }
10500    }
10501
10502    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreConnectorOpenRequest {
10503        type Borrowed<'a> = &'a mut Self;
10504        fn take_or_borrow<'a>(
10505            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10506        ) -> Self::Borrowed<'a> {
10507            value
10508        }
10509    }
10510
10511    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreConnectorOpenRequest {
10512        type Owned = Self;
10513
10514        #[inline(always)]
10515        fn inline_align(_context: fidl::encoding::Context) -> usize {
10516            8
10517        }
10518
10519        #[inline(always)]
10520        fn inline_size(_context: fidl::encoding::Context) -> usize {
10521            16
10522        }
10523    }
10524
10525    unsafe impl
10526        fidl::encoding::Encode<
10527            CapabilityStoreConnectorOpenRequest,
10528            fidl::encoding::DefaultFuchsiaResourceDialect,
10529        > for &mut CapabilityStoreConnectorOpenRequest
10530    {
10531        #[inline]
10532        unsafe fn encode(
10533            self,
10534            encoder: &mut fidl::encoding::Encoder<
10535                '_,
10536                fidl::encoding::DefaultFuchsiaResourceDialect,
10537            >,
10538            offset: usize,
10539            _depth: fidl::encoding::Depth,
10540        ) -> fidl::Result<()> {
10541            encoder.debug_check_bounds::<CapabilityStoreConnectorOpenRequest>(offset);
10542            // Delegate to tuple encoding.
10543            fidl::encoding::Encode::<
10544                CapabilityStoreConnectorOpenRequest,
10545                fidl::encoding::DefaultFuchsiaResourceDialect,
10546            >::encode(
10547                (
10548                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
10549                    <fidl::encoding::HandleType<
10550                        fidl::Channel,
10551                        { fidl::ObjectType::CHANNEL.into_raw() },
10552                        2147483648,
10553                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10554                        &mut self.server_end
10555                    ),
10556                ),
10557                encoder,
10558                offset,
10559                _depth,
10560            )
10561        }
10562    }
10563    unsafe impl<
10564        T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
10565        T1: fidl::encoding::Encode<
10566                fidl::encoding::HandleType<
10567                    fidl::Channel,
10568                    { fidl::ObjectType::CHANNEL.into_raw() },
10569                    2147483648,
10570                >,
10571                fidl::encoding::DefaultFuchsiaResourceDialect,
10572            >,
10573    >
10574        fidl::encoding::Encode<
10575            CapabilityStoreConnectorOpenRequest,
10576            fidl::encoding::DefaultFuchsiaResourceDialect,
10577        > for (T0, T1)
10578    {
10579        #[inline]
10580        unsafe fn encode(
10581            self,
10582            encoder: &mut fidl::encoding::Encoder<
10583                '_,
10584                fidl::encoding::DefaultFuchsiaResourceDialect,
10585            >,
10586            offset: usize,
10587            depth: fidl::encoding::Depth,
10588        ) -> fidl::Result<()> {
10589            encoder.debug_check_bounds::<CapabilityStoreConnectorOpenRequest>(offset);
10590            // Zero out padding regions. There's no need to apply masks
10591            // because the unmasked parts will be overwritten by fields.
10592            unsafe {
10593                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
10594                (ptr as *mut u64).write_unaligned(0);
10595            }
10596            // Write the fields.
10597            self.0.encode(encoder, offset + 0, depth)?;
10598            self.1.encode(encoder, offset + 8, depth)?;
10599            Ok(())
10600        }
10601    }
10602
10603    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10604        for CapabilityStoreConnectorOpenRequest
10605    {
10606        #[inline(always)]
10607        fn new_empty() -> Self {
10608            Self {
10609                id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
10610                server_end: fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
10611            }
10612        }
10613
10614        #[inline]
10615        unsafe fn decode(
10616            &mut self,
10617            decoder: &mut fidl::encoding::Decoder<
10618                '_,
10619                fidl::encoding::DefaultFuchsiaResourceDialect,
10620            >,
10621            offset: usize,
10622            _depth: fidl::encoding::Depth,
10623        ) -> fidl::Result<()> {
10624            decoder.debug_check_bounds::<Self>(offset);
10625            // Verify that padding bytes are zero.
10626            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
10627            let padval = unsafe { (ptr as *const u64).read_unaligned() };
10628            let mask = 0xffffffff00000000u64;
10629            let maskedval = padval & mask;
10630            if maskedval != 0 {
10631                return Err(fidl::Error::NonZeroPadding {
10632                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
10633                });
10634            }
10635            fidl::decode!(
10636                u64,
10637                fidl::encoding::DefaultFuchsiaResourceDialect,
10638                &mut self.id,
10639                decoder,
10640                offset + 0,
10641                _depth
10642            )?;
10643            fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.server_end, decoder, offset + 8, _depth)?;
10644            Ok(())
10645        }
10646    }
10647
10648    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDictionaryDrainRequest {
10649        type Borrowed<'a> = &'a mut Self;
10650        fn take_or_borrow<'a>(
10651            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10652        ) -> Self::Borrowed<'a> {
10653            value
10654        }
10655    }
10656
10657    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDictionaryDrainRequest {
10658        type Owned = Self;
10659
10660        #[inline(always)]
10661        fn inline_align(_context: fidl::encoding::Context) -> usize {
10662            8
10663        }
10664
10665        #[inline(always)]
10666        fn inline_size(_context: fidl::encoding::Context) -> usize {
10667            16
10668        }
10669    }
10670
10671    unsafe impl
10672        fidl::encoding::Encode<
10673            CapabilityStoreDictionaryDrainRequest,
10674            fidl::encoding::DefaultFuchsiaResourceDialect,
10675        > for &mut CapabilityStoreDictionaryDrainRequest
10676    {
10677        #[inline]
10678        unsafe fn encode(
10679            self,
10680            encoder: &mut fidl::encoding::Encoder<
10681                '_,
10682                fidl::encoding::DefaultFuchsiaResourceDialect,
10683            >,
10684            offset: usize,
10685            _depth: fidl::encoding::Depth,
10686        ) -> fidl::Result<()> {
10687            encoder.debug_check_bounds::<CapabilityStoreDictionaryDrainRequest>(offset);
10688            // Delegate to tuple encoding.
10689            fidl::encoding::Encode::<
10690                CapabilityStoreDictionaryDrainRequest,
10691                fidl::encoding::DefaultFuchsiaResourceDialect,
10692            >::encode(
10693                (
10694                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
10695                    <fidl::encoding::Optional<
10696                        fidl::encoding::Endpoint<
10697                            fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>,
10698                        >,
10699                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10700                        &mut self.iterator
10701                    ),
10702                ),
10703                encoder,
10704                offset,
10705                _depth,
10706            )
10707        }
10708    }
10709    unsafe impl<
10710        T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
10711        T1: fidl::encoding::Encode<
10712                fidl::encoding::Optional<
10713                    fidl::encoding::Endpoint<
10714                        fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>,
10715                    >,
10716                >,
10717                fidl::encoding::DefaultFuchsiaResourceDialect,
10718            >,
10719    >
10720        fidl::encoding::Encode<
10721            CapabilityStoreDictionaryDrainRequest,
10722            fidl::encoding::DefaultFuchsiaResourceDialect,
10723        > for (T0, T1)
10724    {
10725        #[inline]
10726        unsafe fn encode(
10727            self,
10728            encoder: &mut fidl::encoding::Encoder<
10729                '_,
10730                fidl::encoding::DefaultFuchsiaResourceDialect,
10731            >,
10732            offset: usize,
10733            depth: fidl::encoding::Depth,
10734        ) -> fidl::Result<()> {
10735            encoder.debug_check_bounds::<CapabilityStoreDictionaryDrainRequest>(offset);
10736            // Zero out padding regions. There's no need to apply masks
10737            // because the unmasked parts will be overwritten by fields.
10738            unsafe {
10739                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
10740                (ptr as *mut u64).write_unaligned(0);
10741            }
10742            // Write the fields.
10743            self.0.encode(encoder, offset + 0, depth)?;
10744            self.1.encode(encoder, offset + 8, depth)?;
10745            Ok(())
10746        }
10747    }
10748
10749    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10750        for CapabilityStoreDictionaryDrainRequest
10751    {
10752        #[inline(always)]
10753        fn new_empty() -> Self {
10754            Self {
10755                id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
10756                iterator: fidl::new_empty!(
10757                    fidl::encoding::Optional<
10758                        fidl::encoding::Endpoint<
10759                            fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>,
10760                        >,
10761                    >,
10762                    fidl::encoding::DefaultFuchsiaResourceDialect
10763                ),
10764            }
10765        }
10766
10767        #[inline]
10768        unsafe fn decode(
10769            &mut self,
10770            decoder: &mut fidl::encoding::Decoder<
10771                '_,
10772                fidl::encoding::DefaultFuchsiaResourceDialect,
10773            >,
10774            offset: usize,
10775            _depth: fidl::encoding::Depth,
10776        ) -> fidl::Result<()> {
10777            decoder.debug_check_bounds::<Self>(offset);
10778            // Verify that padding bytes are zero.
10779            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
10780            let padval = unsafe { (ptr as *const u64).read_unaligned() };
10781            let mask = 0xffffffff00000000u64;
10782            let maskedval = padval & mask;
10783            if maskedval != 0 {
10784                return Err(fidl::Error::NonZeroPadding {
10785                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
10786                });
10787            }
10788            fidl::decode!(
10789                u64,
10790                fidl::encoding::DefaultFuchsiaResourceDialect,
10791                &mut self.id,
10792                decoder,
10793                offset + 0,
10794                _depth
10795            )?;
10796            fidl::decode!(
10797                fidl::encoding::Optional<
10798                    fidl::encoding::Endpoint<
10799                        fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>,
10800                    >,
10801                >,
10802                fidl::encoding::DefaultFuchsiaResourceDialect,
10803                &mut self.iterator,
10804                decoder,
10805                offset + 8,
10806                _depth
10807            )?;
10808            Ok(())
10809        }
10810    }
10811
10812    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDictionaryEnumerateRequest {
10813        type Borrowed<'a> = &'a mut Self;
10814        fn take_or_borrow<'a>(
10815            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10816        ) -> Self::Borrowed<'a> {
10817            value
10818        }
10819    }
10820
10821    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDictionaryEnumerateRequest {
10822        type Owned = Self;
10823
10824        #[inline(always)]
10825        fn inline_align(_context: fidl::encoding::Context) -> usize {
10826            8
10827        }
10828
10829        #[inline(always)]
10830        fn inline_size(_context: fidl::encoding::Context) -> usize {
10831            16
10832        }
10833    }
10834
10835    unsafe impl
10836        fidl::encoding::Encode<
10837            CapabilityStoreDictionaryEnumerateRequest,
10838            fidl::encoding::DefaultFuchsiaResourceDialect,
10839        > for &mut CapabilityStoreDictionaryEnumerateRequest
10840    {
10841        #[inline]
10842        unsafe fn encode(
10843            self,
10844            encoder: &mut fidl::encoding::Encoder<
10845                '_,
10846                fidl::encoding::DefaultFuchsiaResourceDialect,
10847            >,
10848            offset: usize,
10849            _depth: fidl::encoding::Depth,
10850        ) -> fidl::Result<()> {
10851            encoder.debug_check_bounds::<CapabilityStoreDictionaryEnumerateRequest>(offset);
10852            // Delegate to tuple encoding.
10853            fidl::encoding::Encode::<
10854                CapabilityStoreDictionaryEnumerateRequest,
10855                fidl::encoding::DefaultFuchsiaResourceDialect,
10856            >::encode(
10857                (
10858                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
10859                    <fidl::encoding::Endpoint<
10860                        fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
10861                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10862                        &mut self.iterator
10863                    ),
10864                ),
10865                encoder,
10866                offset,
10867                _depth,
10868            )
10869        }
10870    }
10871    unsafe impl<
10872        T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
10873        T1: fidl::encoding::Encode<
10874                fidl::encoding::Endpoint<
10875                    fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
10876                >,
10877                fidl::encoding::DefaultFuchsiaResourceDialect,
10878            >,
10879    >
10880        fidl::encoding::Encode<
10881            CapabilityStoreDictionaryEnumerateRequest,
10882            fidl::encoding::DefaultFuchsiaResourceDialect,
10883        > for (T0, T1)
10884    {
10885        #[inline]
10886        unsafe fn encode(
10887            self,
10888            encoder: &mut fidl::encoding::Encoder<
10889                '_,
10890                fidl::encoding::DefaultFuchsiaResourceDialect,
10891            >,
10892            offset: usize,
10893            depth: fidl::encoding::Depth,
10894        ) -> fidl::Result<()> {
10895            encoder.debug_check_bounds::<CapabilityStoreDictionaryEnumerateRequest>(offset);
10896            // Zero out padding regions. There's no need to apply masks
10897            // because the unmasked parts will be overwritten by fields.
10898            unsafe {
10899                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
10900                (ptr as *mut u64).write_unaligned(0);
10901            }
10902            // Write the fields.
10903            self.0.encode(encoder, offset + 0, depth)?;
10904            self.1.encode(encoder, offset + 8, depth)?;
10905            Ok(())
10906        }
10907    }
10908
10909    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10910        for CapabilityStoreDictionaryEnumerateRequest
10911    {
10912        #[inline(always)]
10913        fn new_empty() -> Self {
10914            Self {
10915                id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
10916                iterator: fidl::new_empty!(
10917                    fidl::encoding::Endpoint<
10918                        fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
10919                    >,
10920                    fidl::encoding::DefaultFuchsiaResourceDialect
10921                ),
10922            }
10923        }
10924
10925        #[inline]
10926        unsafe fn decode(
10927            &mut self,
10928            decoder: &mut fidl::encoding::Decoder<
10929                '_,
10930                fidl::encoding::DefaultFuchsiaResourceDialect,
10931            >,
10932            offset: usize,
10933            _depth: fidl::encoding::Depth,
10934        ) -> fidl::Result<()> {
10935            decoder.debug_check_bounds::<Self>(offset);
10936            // Verify that padding bytes are zero.
10937            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
10938            let padval = unsafe { (ptr as *const u64).read_unaligned() };
10939            let mask = 0xffffffff00000000u64;
10940            let maskedval = padval & mask;
10941            if maskedval != 0 {
10942                return Err(fidl::Error::NonZeroPadding {
10943                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
10944                });
10945            }
10946            fidl::decode!(
10947                u64,
10948                fidl::encoding::DefaultFuchsiaResourceDialect,
10949                &mut self.id,
10950                decoder,
10951                offset + 0,
10952                _depth
10953            )?;
10954            fidl::decode!(
10955                fidl::encoding::Endpoint<
10956                    fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
10957                >,
10958                fidl::encoding::DefaultFuchsiaResourceDialect,
10959                &mut self.iterator,
10960                decoder,
10961                offset + 8,
10962                _depth
10963            )?;
10964            Ok(())
10965        }
10966    }
10967
10968    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDictionaryKeysRequest {
10969        type Borrowed<'a> = &'a mut Self;
10970        fn take_or_borrow<'a>(
10971            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10972        ) -> Self::Borrowed<'a> {
10973            value
10974        }
10975    }
10976
10977    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDictionaryKeysRequest {
10978        type Owned = Self;
10979
10980        #[inline(always)]
10981        fn inline_align(_context: fidl::encoding::Context) -> usize {
10982            8
10983        }
10984
10985        #[inline(always)]
10986        fn inline_size(_context: fidl::encoding::Context) -> usize {
10987            16
10988        }
10989    }
10990
10991    unsafe impl
10992        fidl::encoding::Encode<
10993            CapabilityStoreDictionaryKeysRequest,
10994            fidl::encoding::DefaultFuchsiaResourceDialect,
10995        > for &mut CapabilityStoreDictionaryKeysRequest
10996    {
10997        #[inline]
10998        unsafe fn encode(
10999            self,
11000            encoder: &mut fidl::encoding::Encoder<
11001                '_,
11002                fidl::encoding::DefaultFuchsiaResourceDialect,
11003            >,
11004            offset: usize,
11005            _depth: fidl::encoding::Depth,
11006        ) -> fidl::Result<()> {
11007            encoder.debug_check_bounds::<CapabilityStoreDictionaryKeysRequest>(offset);
11008            // Delegate to tuple encoding.
11009            fidl::encoding::Encode::<
11010                CapabilityStoreDictionaryKeysRequest,
11011                fidl::encoding::DefaultFuchsiaResourceDialect,
11012            >::encode(
11013                (
11014                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
11015                    <fidl::encoding::Endpoint<
11016                        fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>,
11017                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11018                        &mut self.iterator
11019                    ),
11020                ),
11021                encoder,
11022                offset,
11023                _depth,
11024            )
11025        }
11026    }
11027    unsafe impl<
11028        T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
11029        T1: fidl::encoding::Encode<
11030                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>>,
11031                fidl::encoding::DefaultFuchsiaResourceDialect,
11032            >,
11033    >
11034        fidl::encoding::Encode<
11035            CapabilityStoreDictionaryKeysRequest,
11036            fidl::encoding::DefaultFuchsiaResourceDialect,
11037        > for (T0, T1)
11038    {
11039        #[inline]
11040        unsafe fn encode(
11041            self,
11042            encoder: &mut fidl::encoding::Encoder<
11043                '_,
11044                fidl::encoding::DefaultFuchsiaResourceDialect,
11045            >,
11046            offset: usize,
11047            depth: fidl::encoding::Depth,
11048        ) -> fidl::Result<()> {
11049            encoder.debug_check_bounds::<CapabilityStoreDictionaryKeysRequest>(offset);
11050            // Zero out padding regions. There's no need to apply masks
11051            // because the unmasked parts will be overwritten by fields.
11052            unsafe {
11053                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
11054                (ptr as *mut u64).write_unaligned(0);
11055            }
11056            // Write the fields.
11057            self.0.encode(encoder, offset + 0, depth)?;
11058            self.1.encode(encoder, offset + 8, depth)?;
11059            Ok(())
11060        }
11061    }
11062
11063    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11064        for CapabilityStoreDictionaryKeysRequest
11065    {
11066        #[inline(always)]
11067        fn new_empty() -> Self {
11068            Self {
11069                id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
11070                iterator: fidl::new_empty!(
11071                    fidl::encoding::Endpoint<
11072                        fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>,
11073                    >,
11074                    fidl::encoding::DefaultFuchsiaResourceDialect
11075                ),
11076            }
11077        }
11078
11079        #[inline]
11080        unsafe fn decode(
11081            &mut self,
11082            decoder: &mut fidl::encoding::Decoder<
11083                '_,
11084                fidl::encoding::DefaultFuchsiaResourceDialect,
11085            >,
11086            offset: usize,
11087            _depth: fidl::encoding::Depth,
11088        ) -> fidl::Result<()> {
11089            decoder.debug_check_bounds::<Self>(offset);
11090            // Verify that padding bytes are zero.
11091            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
11092            let padval = unsafe { (ptr as *const u64).read_unaligned() };
11093            let mask = 0xffffffff00000000u64;
11094            let maskedval = padval & mask;
11095            if maskedval != 0 {
11096                return Err(fidl::Error::NonZeroPadding {
11097                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
11098                });
11099            }
11100            fidl::decode!(
11101                u64,
11102                fidl::encoding::DefaultFuchsiaResourceDialect,
11103                &mut self.id,
11104                decoder,
11105                offset + 0,
11106                _depth
11107            )?;
11108            fidl::decode!(
11109                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>>,
11110                fidl::encoding::DefaultFuchsiaResourceDialect,
11111                &mut self.iterator,
11112                decoder,
11113                offset + 8,
11114                _depth
11115            )?;
11116            Ok(())
11117        }
11118    }
11119
11120    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDictionaryLegacyExportRequest {
11121        type Borrowed<'a> = &'a mut Self;
11122        fn take_or_borrow<'a>(
11123            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11124        ) -> Self::Borrowed<'a> {
11125            value
11126        }
11127    }
11128
11129    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDictionaryLegacyExportRequest {
11130        type Owned = Self;
11131
11132        #[inline(always)]
11133        fn inline_align(_context: fidl::encoding::Context) -> usize {
11134            8
11135        }
11136
11137        #[inline(always)]
11138        fn inline_size(_context: fidl::encoding::Context) -> usize {
11139            16
11140        }
11141    }
11142
11143    unsafe impl
11144        fidl::encoding::Encode<
11145            CapabilityStoreDictionaryLegacyExportRequest,
11146            fidl::encoding::DefaultFuchsiaResourceDialect,
11147        > for &mut CapabilityStoreDictionaryLegacyExportRequest
11148    {
11149        #[inline]
11150        unsafe fn encode(
11151            self,
11152            encoder: &mut fidl::encoding::Encoder<
11153                '_,
11154                fidl::encoding::DefaultFuchsiaResourceDialect,
11155            >,
11156            offset: usize,
11157            _depth: fidl::encoding::Depth,
11158        ) -> fidl::Result<()> {
11159            encoder.debug_check_bounds::<CapabilityStoreDictionaryLegacyExportRequest>(offset);
11160            // Delegate to tuple encoding.
11161            fidl::encoding::Encode::<
11162                CapabilityStoreDictionaryLegacyExportRequest,
11163                fidl::encoding::DefaultFuchsiaResourceDialect,
11164            >::encode(
11165                (
11166                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
11167                    <fidl::encoding::HandleType<
11168                        fidl::Channel,
11169                        { fidl::ObjectType::CHANNEL.into_raw() },
11170                        2147483648,
11171                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11172                        &mut self.server_end
11173                    ),
11174                ),
11175                encoder,
11176                offset,
11177                _depth,
11178            )
11179        }
11180    }
11181    unsafe impl<
11182        T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
11183        T1: fidl::encoding::Encode<
11184                fidl::encoding::HandleType<
11185                    fidl::Channel,
11186                    { fidl::ObjectType::CHANNEL.into_raw() },
11187                    2147483648,
11188                >,
11189                fidl::encoding::DefaultFuchsiaResourceDialect,
11190            >,
11191    >
11192        fidl::encoding::Encode<
11193            CapabilityStoreDictionaryLegacyExportRequest,
11194            fidl::encoding::DefaultFuchsiaResourceDialect,
11195        > for (T0, T1)
11196    {
11197        #[inline]
11198        unsafe fn encode(
11199            self,
11200            encoder: &mut fidl::encoding::Encoder<
11201                '_,
11202                fidl::encoding::DefaultFuchsiaResourceDialect,
11203            >,
11204            offset: usize,
11205            depth: fidl::encoding::Depth,
11206        ) -> fidl::Result<()> {
11207            encoder.debug_check_bounds::<CapabilityStoreDictionaryLegacyExportRequest>(offset);
11208            // Zero out padding regions. There's no need to apply masks
11209            // because the unmasked parts will be overwritten by fields.
11210            unsafe {
11211                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
11212                (ptr as *mut u64).write_unaligned(0);
11213            }
11214            // Write the fields.
11215            self.0.encode(encoder, offset + 0, depth)?;
11216            self.1.encode(encoder, offset + 8, depth)?;
11217            Ok(())
11218        }
11219    }
11220
11221    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11222        for CapabilityStoreDictionaryLegacyExportRequest
11223    {
11224        #[inline(always)]
11225        fn new_empty() -> Self {
11226            Self {
11227                id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
11228                server_end: fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11229            }
11230        }
11231
11232        #[inline]
11233        unsafe fn decode(
11234            &mut self,
11235            decoder: &mut fidl::encoding::Decoder<
11236                '_,
11237                fidl::encoding::DefaultFuchsiaResourceDialect,
11238            >,
11239            offset: usize,
11240            _depth: fidl::encoding::Depth,
11241        ) -> fidl::Result<()> {
11242            decoder.debug_check_bounds::<Self>(offset);
11243            // Verify that padding bytes are zero.
11244            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
11245            let padval = unsafe { (ptr as *const u64).read_unaligned() };
11246            let mask = 0xffffffff00000000u64;
11247            let maskedval = padval & mask;
11248            if maskedval != 0 {
11249                return Err(fidl::Error::NonZeroPadding {
11250                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
11251                });
11252            }
11253            fidl::decode!(
11254                u64,
11255                fidl::encoding::DefaultFuchsiaResourceDialect,
11256                &mut self.id,
11257                decoder,
11258                offset + 0,
11259                _depth
11260            )?;
11261            fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.server_end, decoder, offset + 8, _depth)?;
11262            Ok(())
11263        }
11264    }
11265
11266    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDictionaryLegacyImportRequest {
11267        type Borrowed<'a> = &'a mut Self;
11268        fn take_or_borrow<'a>(
11269            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11270        ) -> Self::Borrowed<'a> {
11271            value
11272        }
11273    }
11274
11275    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDictionaryLegacyImportRequest {
11276        type Owned = Self;
11277
11278        #[inline(always)]
11279        fn inline_align(_context: fidl::encoding::Context) -> usize {
11280            8
11281        }
11282
11283        #[inline(always)]
11284        fn inline_size(_context: fidl::encoding::Context) -> usize {
11285            16
11286        }
11287    }
11288
11289    unsafe impl
11290        fidl::encoding::Encode<
11291            CapabilityStoreDictionaryLegacyImportRequest,
11292            fidl::encoding::DefaultFuchsiaResourceDialect,
11293        > for &mut CapabilityStoreDictionaryLegacyImportRequest
11294    {
11295        #[inline]
11296        unsafe fn encode(
11297            self,
11298            encoder: &mut fidl::encoding::Encoder<
11299                '_,
11300                fidl::encoding::DefaultFuchsiaResourceDialect,
11301            >,
11302            offset: usize,
11303            _depth: fidl::encoding::Depth,
11304        ) -> fidl::Result<()> {
11305            encoder.debug_check_bounds::<CapabilityStoreDictionaryLegacyImportRequest>(offset);
11306            // Delegate to tuple encoding.
11307            fidl::encoding::Encode::<
11308                CapabilityStoreDictionaryLegacyImportRequest,
11309                fidl::encoding::DefaultFuchsiaResourceDialect,
11310            >::encode(
11311                (
11312                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
11313                    <fidl::encoding::HandleType<
11314                        fidl::Channel,
11315                        { fidl::ObjectType::CHANNEL.into_raw() },
11316                        2147483648,
11317                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11318                        &mut self.client_end
11319                    ),
11320                ),
11321                encoder,
11322                offset,
11323                _depth,
11324            )
11325        }
11326    }
11327    unsafe impl<
11328        T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
11329        T1: fidl::encoding::Encode<
11330                fidl::encoding::HandleType<
11331                    fidl::Channel,
11332                    { fidl::ObjectType::CHANNEL.into_raw() },
11333                    2147483648,
11334                >,
11335                fidl::encoding::DefaultFuchsiaResourceDialect,
11336            >,
11337    >
11338        fidl::encoding::Encode<
11339            CapabilityStoreDictionaryLegacyImportRequest,
11340            fidl::encoding::DefaultFuchsiaResourceDialect,
11341        > for (T0, T1)
11342    {
11343        #[inline]
11344        unsafe fn encode(
11345            self,
11346            encoder: &mut fidl::encoding::Encoder<
11347                '_,
11348                fidl::encoding::DefaultFuchsiaResourceDialect,
11349            >,
11350            offset: usize,
11351            depth: fidl::encoding::Depth,
11352        ) -> fidl::Result<()> {
11353            encoder.debug_check_bounds::<CapabilityStoreDictionaryLegacyImportRequest>(offset);
11354            // Zero out padding regions. There's no need to apply masks
11355            // because the unmasked parts will be overwritten by fields.
11356            unsafe {
11357                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
11358                (ptr as *mut u64).write_unaligned(0);
11359            }
11360            // Write the fields.
11361            self.0.encode(encoder, offset + 0, depth)?;
11362            self.1.encode(encoder, offset + 8, depth)?;
11363            Ok(())
11364        }
11365    }
11366
11367    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11368        for CapabilityStoreDictionaryLegacyImportRequest
11369    {
11370        #[inline(always)]
11371        fn new_empty() -> Self {
11372            Self {
11373                id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
11374                client_end: fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11375            }
11376        }
11377
11378        #[inline]
11379        unsafe fn decode(
11380            &mut self,
11381            decoder: &mut fidl::encoding::Decoder<
11382                '_,
11383                fidl::encoding::DefaultFuchsiaResourceDialect,
11384            >,
11385            offset: usize,
11386            _depth: fidl::encoding::Depth,
11387        ) -> fidl::Result<()> {
11388            decoder.debug_check_bounds::<Self>(offset);
11389            // Verify that padding bytes are zero.
11390            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
11391            let padval = unsafe { (ptr as *const u64).read_unaligned() };
11392            let mask = 0xffffffff00000000u64;
11393            let maskedval = padval & mask;
11394            if maskedval != 0 {
11395                return Err(fidl::Error::NonZeroPadding {
11396                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
11397                });
11398            }
11399            fidl::decode!(
11400                u64,
11401                fidl::encoding::DefaultFuchsiaResourceDialect,
11402                &mut self.id,
11403                decoder,
11404                offset + 0,
11405                _depth
11406            )?;
11407            fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.client_end, decoder, offset + 8, _depth)?;
11408            Ok(())
11409        }
11410    }
11411
11412    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDirConnectorCreateRequest {
11413        type Borrowed<'a> = &'a mut Self;
11414        fn take_or_borrow<'a>(
11415            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11416        ) -> Self::Borrowed<'a> {
11417            value
11418        }
11419    }
11420
11421    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDirConnectorCreateRequest {
11422        type Owned = Self;
11423
11424        #[inline(always)]
11425        fn inline_align(_context: fidl::encoding::Context) -> usize {
11426            8
11427        }
11428
11429        #[inline(always)]
11430        fn inline_size(_context: fidl::encoding::Context) -> usize {
11431            16
11432        }
11433    }
11434
11435    unsafe impl
11436        fidl::encoding::Encode<
11437            CapabilityStoreDirConnectorCreateRequest,
11438            fidl::encoding::DefaultFuchsiaResourceDialect,
11439        > for &mut CapabilityStoreDirConnectorCreateRequest
11440    {
11441        #[inline]
11442        unsafe fn encode(
11443            self,
11444            encoder: &mut fidl::encoding::Encoder<
11445                '_,
11446                fidl::encoding::DefaultFuchsiaResourceDialect,
11447            >,
11448            offset: usize,
11449            _depth: fidl::encoding::Depth,
11450        ) -> fidl::Result<()> {
11451            encoder.debug_check_bounds::<CapabilityStoreDirConnectorCreateRequest>(offset);
11452            // Delegate to tuple encoding.
11453            fidl::encoding::Encode::<CapabilityStoreDirConnectorCreateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
11454                (
11455                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
11456                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirReceiverMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.receiver),
11457                ),
11458                encoder, offset, _depth
11459            )
11460        }
11461    }
11462    unsafe impl<
11463        T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
11464        T1: fidl::encoding::Encode<
11465                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirReceiverMarker>>,
11466                fidl::encoding::DefaultFuchsiaResourceDialect,
11467            >,
11468    >
11469        fidl::encoding::Encode<
11470            CapabilityStoreDirConnectorCreateRequest,
11471            fidl::encoding::DefaultFuchsiaResourceDialect,
11472        > for (T0, T1)
11473    {
11474        #[inline]
11475        unsafe fn encode(
11476            self,
11477            encoder: &mut fidl::encoding::Encoder<
11478                '_,
11479                fidl::encoding::DefaultFuchsiaResourceDialect,
11480            >,
11481            offset: usize,
11482            depth: fidl::encoding::Depth,
11483        ) -> fidl::Result<()> {
11484            encoder.debug_check_bounds::<CapabilityStoreDirConnectorCreateRequest>(offset);
11485            // Zero out padding regions. There's no need to apply masks
11486            // because the unmasked parts will be overwritten by fields.
11487            unsafe {
11488                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
11489                (ptr as *mut u64).write_unaligned(0);
11490            }
11491            // Write the fields.
11492            self.0.encode(encoder, offset + 0, depth)?;
11493            self.1.encode(encoder, offset + 8, depth)?;
11494            Ok(())
11495        }
11496    }
11497
11498    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11499        for CapabilityStoreDirConnectorCreateRequest
11500    {
11501        #[inline(always)]
11502        fn new_empty() -> Self {
11503            Self {
11504                id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
11505                receiver: fidl::new_empty!(
11506                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirReceiverMarker>>,
11507                    fidl::encoding::DefaultFuchsiaResourceDialect
11508                ),
11509            }
11510        }
11511
11512        #[inline]
11513        unsafe fn decode(
11514            &mut self,
11515            decoder: &mut fidl::encoding::Decoder<
11516                '_,
11517                fidl::encoding::DefaultFuchsiaResourceDialect,
11518            >,
11519            offset: usize,
11520            _depth: fidl::encoding::Depth,
11521        ) -> fidl::Result<()> {
11522            decoder.debug_check_bounds::<Self>(offset);
11523            // Verify that padding bytes are zero.
11524            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
11525            let padval = unsafe { (ptr as *const u64).read_unaligned() };
11526            let mask = 0xffffffff00000000u64;
11527            let maskedval = padval & mask;
11528            if maskedval != 0 {
11529                return Err(fidl::Error::NonZeroPadding {
11530                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
11531                });
11532            }
11533            fidl::decode!(
11534                u64,
11535                fidl::encoding::DefaultFuchsiaResourceDialect,
11536                &mut self.id,
11537                decoder,
11538                offset + 0,
11539                _depth
11540            )?;
11541            fidl::decode!(
11542                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirReceiverMarker>>,
11543                fidl::encoding::DefaultFuchsiaResourceDialect,
11544                &mut self.receiver,
11545                decoder,
11546                offset + 8,
11547                _depth
11548            )?;
11549            Ok(())
11550        }
11551    }
11552
11553    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreImportRequest {
11554        type Borrowed<'a> = &'a mut Self;
11555        fn take_or_borrow<'a>(
11556            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11557        ) -> Self::Borrowed<'a> {
11558            value
11559        }
11560    }
11561
11562    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreImportRequest {
11563        type Owned = Self;
11564
11565        #[inline(always)]
11566        fn inline_align(_context: fidl::encoding::Context) -> usize {
11567            8
11568        }
11569
11570        #[inline(always)]
11571        fn inline_size(_context: fidl::encoding::Context) -> usize {
11572            24
11573        }
11574    }
11575
11576    unsafe impl
11577        fidl::encoding::Encode<
11578            CapabilityStoreImportRequest,
11579            fidl::encoding::DefaultFuchsiaResourceDialect,
11580        > for &mut CapabilityStoreImportRequest
11581    {
11582        #[inline]
11583        unsafe fn encode(
11584            self,
11585            encoder: &mut fidl::encoding::Encoder<
11586                '_,
11587                fidl::encoding::DefaultFuchsiaResourceDialect,
11588            >,
11589            offset: usize,
11590            _depth: fidl::encoding::Depth,
11591        ) -> fidl::Result<()> {
11592            encoder.debug_check_bounds::<CapabilityStoreImportRequest>(offset);
11593            // Delegate to tuple encoding.
11594            fidl::encoding::Encode::<
11595                CapabilityStoreImportRequest,
11596                fidl::encoding::DefaultFuchsiaResourceDialect,
11597            >::encode(
11598                (
11599                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
11600                    <Capability as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11601                        &mut self.capability,
11602                    ),
11603                ),
11604                encoder,
11605                offset,
11606                _depth,
11607            )
11608        }
11609    }
11610    unsafe impl<
11611        T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
11612        T1: fidl::encoding::Encode<Capability, fidl::encoding::DefaultFuchsiaResourceDialect>,
11613    >
11614        fidl::encoding::Encode<
11615            CapabilityStoreImportRequest,
11616            fidl::encoding::DefaultFuchsiaResourceDialect,
11617        > for (T0, T1)
11618    {
11619        #[inline]
11620        unsafe fn encode(
11621            self,
11622            encoder: &mut fidl::encoding::Encoder<
11623                '_,
11624                fidl::encoding::DefaultFuchsiaResourceDialect,
11625            >,
11626            offset: usize,
11627            depth: fidl::encoding::Depth,
11628        ) -> fidl::Result<()> {
11629            encoder.debug_check_bounds::<CapabilityStoreImportRequest>(offset);
11630            // Zero out padding regions. There's no need to apply masks
11631            // because the unmasked parts will be overwritten by fields.
11632            // Write the fields.
11633            self.0.encode(encoder, offset + 0, depth)?;
11634            self.1.encode(encoder, offset + 8, depth)?;
11635            Ok(())
11636        }
11637    }
11638
11639    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11640        for CapabilityStoreImportRequest
11641    {
11642        #[inline(always)]
11643        fn new_empty() -> Self {
11644            Self {
11645                id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
11646                capability: fidl::new_empty!(
11647                    Capability,
11648                    fidl::encoding::DefaultFuchsiaResourceDialect
11649                ),
11650            }
11651        }
11652
11653        #[inline]
11654        unsafe fn decode(
11655            &mut self,
11656            decoder: &mut fidl::encoding::Decoder<
11657                '_,
11658                fidl::encoding::DefaultFuchsiaResourceDialect,
11659            >,
11660            offset: usize,
11661            _depth: fidl::encoding::Depth,
11662        ) -> fidl::Result<()> {
11663            decoder.debug_check_bounds::<Self>(offset);
11664            // Verify that padding bytes are zero.
11665            fidl::decode!(
11666                u64,
11667                fidl::encoding::DefaultFuchsiaResourceDialect,
11668                &mut self.id,
11669                decoder,
11670                offset + 0,
11671                _depth
11672            )?;
11673            fidl::decode!(
11674                Capability,
11675                fidl::encoding::DefaultFuchsiaResourceDialect,
11676                &mut self.capability,
11677                decoder,
11678                offset + 8,
11679                _depth
11680            )?;
11681            Ok(())
11682        }
11683    }
11684
11685    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreExportResponse {
11686        type Borrowed<'a> = &'a mut Self;
11687        fn take_or_borrow<'a>(
11688            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11689        ) -> Self::Borrowed<'a> {
11690            value
11691        }
11692    }
11693
11694    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreExportResponse {
11695        type Owned = Self;
11696
11697        #[inline(always)]
11698        fn inline_align(_context: fidl::encoding::Context) -> usize {
11699            8
11700        }
11701
11702        #[inline(always)]
11703        fn inline_size(_context: fidl::encoding::Context) -> usize {
11704            16
11705        }
11706    }
11707
11708    unsafe impl
11709        fidl::encoding::Encode<
11710            CapabilityStoreExportResponse,
11711            fidl::encoding::DefaultFuchsiaResourceDialect,
11712        > for &mut CapabilityStoreExportResponse
11713    {
11714        #[inline]
11715        unsafe fn encode(
11716            self,
11717            encoder: &mut fidl::encoding::Encoder<
11718                '_,
11719                fidl::encoding::DefaultFuchsiaResourceDialect,
11720            >,
11721            offset: usize,
11722            _depth: fidl::encoding::Depth,
11723        ) -> fidl::Result<()> {
11724            encoder.debug_check_bounds::<CapabilityStoreExportResponse>(offset);
11725            // Delegate to tuple encoding.
11726            fidl::encoding::Encode::<
11727                CapabilityStoreExportResponse,
11728                fidl::encoding::DefaultFuchsiaResourceDialect,
11729            >::encode(
11730                (<Capability as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11731                    &mut self.capability,
11732                ),),
11733                encoder,
11734                offset,
11735                _depth,
11736            )
11737        }
11738    }
11739    unsafe impl<
11740        T0: fidl::encoding::Encode<Capability, fidl::encoding::DefaultFuchsiaResourceDialect>,
11741    >
11742        fidl::encoding::Encode<
11743            CapabilityStoreExportResponse,
11744            fidl::encoding::DefaultFuchsiaResourceDialect,
11745        > for (T0,)
11746    {
11747        #[inline]
11748        unsafe fn encode(
11749            self,
11750            encoder: &mut fidl::encoding::Encoder<
11751                '_,
11752                fidl::encoding::DefaultFuchsiaResourceDialect,
11753            >,
11754            offset: usize,
11755            depth: fidl::encoding::Depth,
11756        ) -> fidl::Result<()> {
11757            encoder.debug_check_bounds::<CapabilityStoreExportResponse>(offset);
11758            // Zero out padding regions. There's no need to apply masks
11759            // because the unmasked parts will be overwritten by fields.
11760            // Write the fields.
11761            self.0.encode(encoder, offset + 0, depth)?;
11762            Ok(())
11763        }
11764    }
11765
11766    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11767        for CapabilityStoreExportResponse
11768    {
11769        #[inline(always)]
11770        fn new_empty() -> Self {
11771            Self {
11772                capability: fidl::new_empty!(
11773                    Capability,
11774                    fidl::encoding::DefaultFuchsiaResourceDialect
11775                ),
11776            }
11777        }
11778
11779        #[inline]
11780        unsafe fn decode(
11781            &mut self,
11782            decoder: &mut fidl::encoding::Decoder<
11783                '_,
11784                fidl::encoding::DefaultFuchsiaResourceDialect,
11785            >,
11786            offset: usize,
11787            _depth: fidl::encoding::Depth,
11788        ) -> fidl::Result<()> {
11789            decoder.debug_check_bounds::<Self>(offset);
11790            // Verify that padding bytes are zero.
11791            fidl::decode!(
11792                Capability,
11793                fidl::encoding::DefaultFuchsiaResourceDialect,
11794                &mut self.capability,
11795                decoder,
11796                offset + 0,
11797                _depth
11798            )?;
11799            Ok(())
11800        }
11801    }
11802
11803    impl fidl::encoding::ResourceTypeMarker for Connector {
11804        type Borrowed<'a> = &'a mut Self;
11805        fn take_or_borrow<'a>(
11806            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11807        ) -> Self::Borrowed<'a> {
11808            value
11809        }
11810    }
11811
11812    unsafe impl fidl::encoding::TypeMarker for Connector {
11813        type Owned = Self;
11814
11815        #[inline(always)]
11816        fn inline_align(_context: fidl::encoding::Context) -> usize {
11817            4
11818        }
11819
11820        #[inline(always)]
11821        fn inline_size(_context: fidl::encoding::Context) -> usize {
11822            4
11823        }
11824    }
11825
11826    unsafe impl fidl::encoding::Encode<Connector, fidl::encoding::DefaultFuchsiaResourceDialect>
11827        for &mut Connector
11828    {
11829        #[inline]
11830        unsafe fn encode(
11831            self,
11832            encoder: &mut fidl::encoding::Encoder<
11833                '_,
11834                fidl::encoding::DefaultFuchsiaResourceDialect,
11835            >,
11836            offset: usize,
11837            _depth: fidl::encoding::Depth,
11838        ) -> fidl::Result<()> {
11839            encoder.debug_check_bounds::<Connector>(offset);
11840            // Delegate to tuple encoding.
11841            fidl::encoding::Encode::<Connector, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
11842                (
11843                    <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.token),
11844                ),
11845                encoder, offset, _depth
11846            )
11847        }
11848    }
11849    unsafe impl<
11850        T0: fidl::encoding::Encode<
11851                fidl::encoding::HandleType<
11852                    fidl::EventPair,
11853                    { fidl::ObjectType::EVENTPAIR.into_raw() },
11854                    2147483648,
11855                >,
11856                fidl::encoding::DefaultFuchsiaResourceDialect,
11857            >,
11858    > fidl::encoding::Encode<Connector, fidl::encoding::DefaultFuchsiaResourceDialect> for (T0,)
11859    {
11860        #[inline]
11861        unsafe fn encode(
11862            self,
11863            encoder: &mut fidl::encoding::Encoder<
11864                '_,
11865                fidl::encoding::DefaultFuchsiaResourceDialect,
11866            >,
11867            offset: usize,
11868            depth: fidl::encoding::Depth,
11869        ) -> fidl::Result<()> {
11870            encoder.debug_check_bounds::<Connector>(offset);
11871            // Zero out padding regions. There's no need to apply masks
11872            // because the unmasked parts will be overwritten by fields.
11873            // Write the fields.
11874            self.0.encode(encoder, offset + 0, depth)?;
11875            Ok(())
11876        }
11877    }
11878
11879    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Connector {
11880        #[inline(always)]
11881        fn new_empty() -> Self {
11882            Self {
11883                token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11884            }
11885        }
11886
11887        #[inline]
11888        unsafe fn decode(
11889            &mut self,
11890            decoder: &mut fidl::encoding::Decoder<
11891                '_,
11892                fidl::encoding::DefaultFuchsiaResourceDialect,
11893            >,
11894            offset: usize,
11895            _depth: fidl::encoding::Depth,
11896        ) -> fidl::Result<()> {
11897            decoder.debug_check_bounds::<Self>(offset);
11898            // Verify that padding bytes are zero.
11899            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.token, decoder, offset + 0, _depth)?;
11900            Ok(())
11901        }
11902    }
11903
11904    impl fidl::encoding::ResourceTypeMarker for DictionaryDrainIteratorGetNextResponse {
11905        type Borrowed<'a> = &'a mut Self;
11906        fn take_or_borrow<'a>(
11907            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11908        ) -> Self::Borrowed<'a> {
11909            value
11910        }
11911    }
11912
11913    unsafe impl fidl::encoding::TypeMarker for DictionaryDrainIteratorGetNextResponse {
11914        type Owned = Self;
11915
11916        #[inline(always)]
11917        fn inline_align(_context: fidl::encoding::Context) -> usize {
11918            8
11919        }
11920
11921        #[inline(always)]
11922        fn inline_size(_context: fidl::encoding::Context) -> usize {
11923            24
11924        }
11925    }
11926
11927    unsafe impl
11928        fidl::encoding::Encode<
11929            DictionaryDrainIteratorGetNextResponse,
11930            fidl::encoding::DefaultFuchsiaResourceDialect,
11931        > for &mut DictionaryDrainIteratorGetNextResponse
11932    {
11933        #[inline]
11934        unsafe fn encode(
11935            self,
11936            encoder: &mut fidl::encoding::Encoder<
11937                '_,
11938                fidl::encoding::DefaultFuchsiaResourceDialect,
11939            >,
11940            offset: usize,
11941            _depth: fidl::encoding::Depth,
11942        ) -> fidl::Result<()> {
11943            encoder.debug_check_bounds::<DictionaryDrainIteratorGetNextResponse>(offset);
11944            // Delegate to tuple encoding.
11945            fidl::encoding::Encode::<DictionaryDrainIteratorGetNextResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
11946                (
11947                    <fidl::encoding::Vector<DictionaryItem, 128> as fidl::encoding::ValueTypeMarker>::borrow(&self.items),
11948                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.end_id),
11949                ),
11950                encoder, offset, _depth
11951            )
11952        }
11953    }
11954    unsafe impl<
11955        T0: fidl::encoding::Encode<
11956                fidl::encoding::Vector<DictionaryItem, 128>,
11957                fidl::encoding::DefaultFuchsiaResourceDialect,
11958            >,
11959        T1: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
11960    >
11961        fidl::encoding::Encode<
11962            DictionaryDrainIteratorGetNextResponse,
11963            fidl::encoding::DefaultFuchsiaResourceDialect,
11964        > for (T0, T1)
11965    {
11966        #[inline]
11967        unsafe fn encode(
11968            self,
11969            encoder: &mut fidl::encoding::Encoder<
11970                '_,
11971                fidl::encoding::DefaultFuchsiaResourceDialect,
11972            >,
11973            offset: usize,
11974            depth: fidl::encoding::Depth,
11975        ) -> fidl::Result<()> {
11976            encoder.debug_check_bounds::<DictionaryDrainIteratorGetNextResponse>(offset);
11977            // Zero out padding regions. There's no need to apply masks
11978            // because the unmasked parts will be overwritten by fields.
11979            // Write the fields.
11980            self.0.encode(encoder, offset + 0, depth)?;
11981            self.1.encode(encoder, offset + 16, depth)?;
11982            Ok(())
11983        }
11984    }
11985
11986    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11987        for DictionaryDrainIteratorGetNextResponse
11988    {
11989        #[inline(always)]
11990        fn new_empty() -> Self {
11991            Self {
11992                items: fidl::new_empty!(fidl::encoding::Vector<DictionaryItem, 128>, fidl::encoding::DefaultFuchsiaResourceDialect),
11993                end_id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
11994            }
11995        }
11996
11997        #[inline]
11998        unsafe fn decode(
11999            &mut self,
12000            decoder: &mut fidl::encoding::Decoder<
12001                '_,
12002                fidl::encoding::DefaultFuchsiaResourceDialect,
12003            >,
12004            offset: usize,
12005            _depth: fidl::encoding::Depth,
12006        ) -> fidl::Result<()> {
12007            decoder.debug_check_bounds::<Self>(offset);
12008            // Verify that padding bytes are zero.
12009            fidl::decode!(fidl::encoding::Vector<DictionaryItem, 128>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.items, decoder, offset + 0, _depth)?;
12010            fidl::decode!(
12011                u64,
12012                fidl::encoding::DefaultFuchsiaResourceDialect,
12013                &mut self.end_id,
12014                decoder,
12015                offset + 16,
12016                _depth
12017            )?;
12018            Ok(())
12019        }
12020    }
12021
12022    impl fidl::encoding::ResourceTypeMarker for DictionaryEnumerateIteratorGetNextResponse {
12023        type Borrowed<'a> = &'a mut Self;
12024        fn take_or_borrow<'a>(
12025            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12026        ) -> Self::Borrowed<'a> {
12027            value
12028        }
12029    }
12030
12031    unsafe impl fidl::encoding::TypeMarker for DictionaryEnumerateIteratorGetNextResponse {
12032        type Owned = Self;
12033
12034        #[inline(always)]
12035        fn inline_align(_context: fidl::encoding::Context) -> usize {
12036            8
12037        }
12038
12039        #[inline(always)]
12040        fn inline_size(_context: fidl::encoding::Context) -> usize {
12041            24
12042        }
12043    }
12044
12045    unsafe impl
12046        fidl::encoding::Encode<
12047            DictionaryEnumerateIteratorGetNextResponse,
12048            fidl::encoding::DefaultFuchsiaResourceDialect,
12049        > for &mut DictionaryEnumerateIteratorGetNextResponse
12050    {
12051        #[inline]
12052        unsafe fn encode(
12053            self,
12054            encoder: &mut fidl::encoding::Encoder<
12055                '_,
12056                fidl::encoding::DefaultFuchsiaResourceDialect,
12057            >,
12058            offset: usize,
12059            _depth: fidl::encoding::Depth,
12060        ) -> fidl::Result<()> {
12061            encoder.debug_check_bounds::<DictionaryEnumerateIteratorGetNextResponse>(offset);
12062            // Delegate to tuple encoding.
12063            fidl::encoding::Encode::<DictionaryEnumerateIteratorGetNextResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
12064                (
12065                    <fidl::encoding::Vector<DictionaryOptionalItem, 128> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.items),
12066                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.end_id),
12067                ),
12068                encoder, offset, _depth
12069            )
12070        }
12071    }
12072    unsafe impl<
12073        T0: fidl::encoding::Encode<
12074                fidl::encoding::Vector<DictionaryOptionalItem, 128>,
12075                fidl::encoding::DefaultFuchsiaResourceDialect,
12076            >,
12077        T1: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
12078    >
12079        fidl::encoding::Encode<
12080            DictionaryEnumerateIteratorGetNextResponse,
12081            fidl::encoding::DefaultFuchsiaResourceDialect,
12082        > for (T0, T1)
12083    {
12084        #[inline]
12085        unsafe fn encode(
12086            self,
12087            encoder: &mut fidl::encoding::Encoder<
12088                '_,
12089                fidl::encoding::DefaultFuchsiaResourceDialect,
12090            >,
12091            offset: usize,
12092            depth: fidl::encoding::Depth,
12093        ) -> fidl::Result<()> {
12094            encoder.debug_check_bounds::<DictionaryEnumerateIteratorGetNextResponse>(offset);
12095            // Zero out padding regions. There's no need to apply masks
12096            // because the unmasked parts will be overwritten by fields.
12097            // Write the fields.
12098            self.0.encode(encoder, offset + 0, depth)?;
12099            self.1.encode(encoder, offset + 16, depth)?;
12100            Ok(())
12101        }
12102    }
12103
12104    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12105        for DictionaryEnumerateIteratorGetNextResponse
12106    {
12107        #[inline(always)]
12108        fn new_empty() -> Self {
12109            Self {
12110                items: fidl::new_empty!(fidl::encoding::Vector<DictionaryOptionalItem, 128>, fidl::encoding::DefaultFuchsiaResourceDialect),
12111                end_id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
12112            }
12113        }
12114
12115        #[inline]
12116        unsafe fn decode(
12117            &mut self,
12118            decoder: &mut fidl::encoding::Decoder<
12119                '_,
12120                fidl::encoding::DefaultFuchsiaResourceDialect,
12121            >,
12122            offset: usize,
12123            _depth: fidl::encoding::Depth,
12124        ) -> fidl::Result<()> {
12125            decoder.debug_check_bounds::<Self>(offset);
12126            // Verify that padding bytes are zero.
12127            fidl::decode!(fidl::encoding::Vector<DictionaryOptionalItem, 128>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.items, decoder, offset + 0, _depth)?;
12128            fidl::decode!(
12129                u64,
12130                fidl::encoding::DefaultFuchsiaResourceDialect,
12131                &mut self.end_id,
12132                decoder,
12133                offset + 16,
12134                _depth
12135            )?;
12136            Ok(())
12137        }
12138    }
12139
12140    impl fidl::encoding::ResourceTypeMarker for DictionaryKeysIteratorGetNextResponse {
12141        type Borrowed<'a> = &'a mut Self;
12142        fn take_or_borrow<'a>(
12143            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12144        ) -> Self::Borrowed<'a> {
12145            value
12146        }
12147    }
12148
12149    unsafe impl fidl::encoding::TypeMarker for DictionaryKeysIteratorGetNextResponse {
12150        type Owned = Self;
12151
12152        #[inline(always)]
12153        fn inline_align(_context: fidl::encoding::Context) -> usize {
12154            8
12155        }
12156
12157        #[inline(always)]
12158        fn inline_size(_context: fidl::encoding::Context) -> usize {
12159            16
12160        }
12161    }
12162
12163    unsafe impl
12164        fidl::encoding::Encode<
12165            DictionaryKeysIteratorGetNextResponse,
12166            fidl::encoding::DefaultFuchsiaResourceDialect,
12167        > for &mut DictionaryKeysIteratorGetNextResponse
12168    {
12169        #[inline]
12170        unsafe fn encode(
12171            self,
12172            encoder: &mut fidl::encoding::Encoder<
12173                '_,
12174                fidl::encoding::DefaultFuchsiaResourceDialect,
12175            >,
12176            offset: usize,
12177            _depth: fidl::encoding::Depth,
12178        ) -> fidl::Result<()> {
12179            encoder.debug_check_bounds::<DictionaryKeysIteratorGetNextResponse>(offset);
12180            // Delegate to tuple encoding.
12181            fidl::encoding::Encode::<DictionaryKeysIteratorGetNextResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
12182                (
12183                    <fidl::encoding::Vector<fidl::encoding::BoundedString<255>, 128> as fidl::encoding::ValueTypeMarker>::borrow(&self.keys),
12184                ),
12185                encoder, offset, _depth
12186            )
12187        }
12188    }
12189    unsafe impl<
12190        T0: fidl::encoding::Encode<
12191                fidl::encoding::Vector<fidl::encoding::BoundedString<255>, 128>,
12192                fidl::encoding::DefaultFuchsiaResourceDialect,
12193            >,
12194    >
12195        fidl::encoding::Encode<
12196            DictionaryKeysIteratorGetNextResponse,
12197            fidl::encoding::DefaultFuchsiaResourceDialect,
12198        > for (T0,)
12199    {
12200        #[inline]
12201        unsafe fn encode(
12202            self,
12203            encoder: &mut fidl::encoding::Encoder<
12204                '_,
12205                fidl::encoding::DefaultFuchsiaResourceDialect,
12206            >,
12207            offset: usize,
12208            depth: fidl::encoding::Depth,
12209        ) -> fidl::Result<()> {
12210            encoder.debug_check_bounds::<DictionaryKeysIteratorGetNextResponse>(offset);
12211            // Zero out padding regions. There's no need to apply masks
12212            // because the unmasked parts will be overwritten by fields.
12213            // Write the fields.
12214            self.0.encode(encoder, offset + 0, depth)?;
12215            Ok(())
12216        }
12217    }
12218
12219    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12220        for DictionaryKeysIteratorGetNextResponse
12221    {
12222        #[inline(always)]
12223        fn new_empty() -> Self {
12224            Self {
12225                keys: fidl::new_empty!(
12226                    fidl::encoding::Vector<fidl::encoding::BoundedString<255>, 128>,
12227                    fidl::encoding::DefaultFuchsiaResourceDialect
12228                ),
12229            }
12230        }
12231
12232        #[inline]
12233        unsafe fn decode(
12234            &mut self,
12235            decoder: &mut fidl::encoding::Decoder<
12236                '_,
12237                fidl::encoding::DefaultFuchsiaResourceDialect,
12238            >,
12239            offset: usize,
12240            _depth: fidl::encoding::Depth,
12241        ) -> fidl::Result<()> {
12242            decoder.debug_check_bounds::<Self>(offset);
12243            // Verify that padding bytes are zero.
12244            fidl::decode!(
12245                fidl::encoding::Vector<fidl::encoding::BoundedString<255>, 128>,
12246                fidl::encoding::DefaultFuchsiaResourceDialect,
12247                &mut self.keys,
12248                decoder,
12249                offset + 0,
12250                _depth
12251            )?;
12252            Ok(())
12253        }
12254    }
12255
12256    impl fidl::encoding::ResourceTypeMarker for DictionaryOptionalItem {
12257        type Borrowed<'a> = &'a mut Self;
12258        fn take_or_borrow<'a>(
12259            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12260        ) -> Self::Borrowed<'a> {
12261            value
12262        }
12263    }
12264
12265    unsafe impl fidl::encoding::TypeMarker for DictionaryOptionalItem {
12266        type Owned = Self;
12267
12268        #[inline(always)]
12269        fn inline_align(_context: fidl::encoding::Context) -> usize {
12270            8
12271        }
12272
12273        #[inline(always)]
12274        fn inline_size(_context: fidl::encoding::Context) -> usize {
12275            24
12276        }
12277    }
12278
12279    unsafe impl
12280        fidl::encoding::Encode<
12281            DictionaryOptionalItem,
12282            fidl::encoding::DefaultFuchsiaResourceDialect,
12283        > for &mut DictionaryOptionalItem
12284    {
12285        #[inline]
12286        unsafe fn encode(
12287            self,
12288            encoder: &mut fidl::encoding::Encoder<
12289                '_,
12290                fidl::encoding::DefaultFuchsiaResourceDialect,
12291            >,
12292            offset: usize,
12293            _depth: fidl::encoding::Depth,
12294        ) -> fidl::Result<()> {
12295            encoder.debug_check_bounds::<DictionaryOptionalItem>(offset);
12296            // Delegate to tuple encoding.
12297            fidl::encoding::Encode::<DictionaryOptionalItem, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
12298                (
12299                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(&self.key),
12300                    <fidl::encoding::Boxed<WrappedCapabilityId> as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
12301                ),
12302                encoder, offset, _depth
12303            )
12304        }
12305    }
12306    unsafe impl<
12307        T0: fidl::encoding::Encode<
12308                fidl::encoding::BoundedString<255>,
12309                fidl::encoding::DefaultFuchsiaResourceDialect,
12310            >,
12311        T1: fidl::encoding::Encode<
12312                fidl::encoding::Boxed<WrappedCapabilityId>,
12313                fidl::encoding::DefaultFuchsiaResourceDialect,
12314            >,
12315    >
12316        fidl::encoding::Encode<
12317            DictionaryOptionalItem,
12318            fidl::encoding::DefaultFuchsiaResourceDialect,
12319        > for (T0, T1)
12320    {
12321        #[inline]
12322        unsafe fn encode(
12323            self,
12324            encoder: &mut fidl::encoding::Encoder<
12325                '_,
12326                fidl::encoding::DefaultFuchsiaResourceDialect,
12327            >,
12328            offset: usize,
12329            depth: fidl::encoding::Depth,
12330        ) -> fidl::Result<()> {
12331            encoder.debug_check_bounds::<DictionaryOptionalItem>(offset);
12332            // Zero out padding regions. There's no need to apply masks
12333            // because the unmasked parts will be overwritten by fields.
12334            // Write the fields.
12335            self.0.encode(encoder, offset + 0, depth)?;
12336            self.1.encode(encoder, offset + 16, depth)?;
12337            Ok(())
12338        }
12339    }
12340
12341    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12342        for DictionaryOptionalItem
12343    {
12344        #[inline(always)]
12345        fn new_empty() -> Self {
12346            Self {
12347                key: fidl::new_empty!(
12348                    fidl::encoding::BoundedString<255>,
12349                    fidl::encoding::DefaultFuchsiaResourceDialect
12350                ),
12351                value: fidl::new_empty!(
12352                    fidl::encoding::Boxed<WrappedCapabilityId>,
12353                    fidl::encoding::DefaultFuchsiaResourceDialect
12354                ),
12355            }
12356        }
12357
12358        #[inline]
12359        unsafe fn decode(
12360            &mut self,
12361            decoder: &mut fidl::encoding::Decoder<
12362                '_,
12363                fidl::encoding::DefaultFuchsiaResourceDialect,
12364            >,
12365            offset: usize,
12366            _depth: fidl::encoding::Depth,
12367        ) -> fidl::Result<()> {
12368            decoder.debug_check_bounds::<Self>(offset);
12369            // Verify that padding bytes are zero.
12370            fidl::decode!(
12371                fidl::encoding::BoundedString<255>,
12372                fidl::encoding::DefaultFuchsiaResourceDialect,
12373                &mut self.key,
12374                decoder,
12375                offset + 0,
12376                _depth
12377            )?;
12378            fidl::decode!(
12379                fidl::encoding::Boxed<WrappedCapabilityId>,
12380                fidl::encoding::DefaultFuchsiaResourceDialect,
12381                &mut self.value,
12382                decoder,
12383                offset + 16,
12384                _depth
12385            )?;
12386            Ok(())
12387        }
12388    }
12389
12390    impl fidl::encoding::ResourceTypeMarker for DictionaryRef {
12391        type Borrowed<'a> = &'a mut Self;
12392        fn take_or_borrow<'a>(
12393            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12394        ) -> Self::Borrowed<'a> {
12395            value
12396        }
12397    }
12398
12399    unsafe impl fidl::encoding::TypeMarker for DictionaryRef {
12400        type Owned = Self;
12401
12402        #[inline(always)]
12403        fn inline_align(_context: fidl::encoding::Context) -> usize {
12404            4
12405        }
12406
12407        #[inline(always)]
12408        fn inline_size(_context: fidl::encoding::Context) -> usize {
12409            4
12410        }
12411    }
12412
12413    unsafe impl fidl::encoding::Encode<DictionaryRef, fidl::encoding::DefaultFuchsiaResourceDialect>
12414        for &mut DictionaryRef
12415    {
12416        #[inline]
12417        unsafe fn encode(
12418            self,
12419            encoder: &mut fidl::encoding::Encoder<
12420                '_,
12421                fidl::encoding::DefaultFuchsiaResourceDialect,
12422            >,
12423            offset: usize,
12424            _depth: fidl::encoding::Depth,
12425        ) -> fidl::Result<()> {
12426            encoder.debug_check_bounds::<DictionaryRef>(offset);
12427            // Delegate to tuple encoding.
12428            fidl::encoding::Encode::<DictionaryRef, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
12429                (
12430                    <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.token),
12431                ),
12432                encoder, offset, _depth
12433            )
12434        }
12435    }
12436    unsafe impl<
12437        T0: fidl::encoding::Encode<
12438                fidl::encoding::HandleType<
12439                    fidl::EventPair,
12440                    { fidl::ObjectType::EVENTPAIR.into_raw() },
12441                    2147483648,
12442                >,
12443                fidl::encoding::DefaultFuchsiaResourceDialect,
12444            >,
12445    > fidl::encoding::Encode<DictionaryRef, fidl::encoding::DefaultFuchsiaResourceDialect>
12446        for (T0,)
12447    {
12448        #[inline]
12449        unsafe fn encode(
12450            self,
12451            encoder: &mut fidl::encoding::Encoder<
12452                '_,
12453                fidl::encoding::DefaultFuchsiaResourceDialect,
12454            >,
12455            offset: usize,
12456            depth: fidl::encoding::Depth,
12457        ) -> fidl::Result<()> {
12458            encoder.debug_check_bounds::<DictionaryRef>(offset);
12459            // Zero out padding regions. There's no need to apply masks
12460            // because the unmasked parts will be overwritten by fields.
12461            // Write the fields.
12462            self.0.encode(encoder, offset + 0, depth)?;
12463            Ok(())
12464        }
12465    }
12466
12467    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for DictionaryRef {
12468        #[inline(always)]
12469        fn new_empty() -> Self {
12470            Self {
12471                token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
12472            }
12473        }
12474
12475        #[inline]
12476        unsafe fn decode(
12477            &mut self,
12478            decoder: &mut fidl::encoding::Decoder<
12479                '_,
12480                fidl::encoding::DefaultFuchsiaResourceDialect,
12481            >,
12482            offset: usize,
12483            _depth: fidl::encoding::Depth,
12484        ) -> fidl::Result<()> {
12485            decoder.debug_check_bounds::<Self>(offset);
12486            // Verify that padding bytes are zero.
12487            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.token, decoder, offset + 0, _depth)?;
12488            Ok(())
12489        }
12490    }
12491
12492    impl fidl::encoding::ResourceTypeMarker for DirConnector {
12493        type Borrowed<'a> = &'a mut Self;
12494        fn take_or_borrow<'a>(
12495            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12496        ) -> Self::Borrowed<'a> {
12497            value
12498        }
12499    }
12500
12501    unsafe impl fidl::encoding::TypeMarker for DirConnector {
12502        type Owned = Self;
12503
12504        #[inline(always)]
12505        fn inline_align(_context: fidl::encoding::Context) -> usize {
12506            4
12507        }
12508
12509        #[inline(always)]
12510        fn inline_size(_context: fidl::encoding::Context) -> usize {
12511            4
12512        }
12513    }
12514
12515    unsafe impl fidl::encoding::Encode<DirConnector, fidl::encoding::DefaultFuchsiaResourceDialect>
12516        for &mut DirConnector
12517    {
12518        #[inline]
12519        unsafe fn encode(
12520            self,
12521            encoder: &mut fidl::encoding::Encoder<
12522                '_,
12523                fidl::encoding::DefaultFuchsiaResourceDialect,
12524            >,
12525            offset: usize,
12526            _depth: fidl::encoding::Depth,
12527        ) -> fidl::Result<()> {
12528            encoder.debug_check_bounds::<DirConnector>(offset);
12529            // Delegate to tuple encoding.
12530            fidl::encoding::Encode::<DirConnector, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
12531                (
12532                    <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.token),
12533                ),
12534                encoder, offset, _depth
12535            )
12536        }
12537    }
12538    unsafe impl<
12539        T0: fidl::encoding::Encode<
12540                fidl::encoding::HandleType<
12541                    fidl::EventPair,
12542                    { fidl::ObjectType::EVENTPAIR.into_raw() },
12543                    2147483648,
12544                >,
12545                fidl::encoding::DefaultFuchsiaResourceDialect,
12546            >,
12547    > fidl::encoding::Encode<DirConnector, fidl::encoding::DefaultFuchsiaResourceDialect> for (T0,)
12548    {
12549        #[inline]
12550        unsafe fn encode(
12551            self,
12552            encoder: &mut fidl::encoding::Encoder<
12553                '_,
12554                fidl::encoding::DefaultFuchsiaResourceDialect,
12555            >,
12556            offset: usize,
12557            depth: fidl::encoding::Depth,
12558        ) -> fidl::Result<()> {
12559            encoder.debug_check_bounds::<DirConnector>(offset);
12560            // Zero out padding regions. There's no need to apply masks
12561            // because the unmasked parts will be overwritten by fields.
12562            // Write the fields.
12563            self.0.encode(encoder, offset + 0, depth)?;
12564            Ok(())
12565        }
12566    }
12567
12568    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for DirConnector {
12569        #[inline(always)]
12570        fn new_empty() -> Self {
12571            Self {
12572                token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
12573            }
12574        }
12575
12576        #[inline]
12577        unsafe fn decode(
12578            &mut self,
12579            decoder: &mut fidl::encoding::Decoder<
12580                '_,
12581                fidl::encoding::DefaultFuchsiaResourceDialect,
12582            >,
12583            offset: usize,
12584            _depth: fidl::encoding::Depth,
12585        ) -> fidl::Result<()> {
12586            decoder.debug_check_bounds::<Self>(offset);
12587            // Verify that padding bytes are zero.
12588            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.token, decoder, offset + 0, _depth)?;
12589            Ok(())
12590        }
12591    }
12592
12593    impl fidl::encoding::ResourceTypeMarker for DirEntry {
12594        type Borrowed<'a> = &'a mut Self;
12595        fn take_or_borrow<'a>(
12596            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12597        ) -> Self::Borrowed<'a> {
12598            value
12599        }
12600    }
12601
12602    unsafe impl fidl::encoding::TypeMarker for DirEntry {
12603        type Owned = Self;
12604
12605        #[inline(always)]
12606        fn inline_align(_context: fidl::encoding::Context) -> usize {
12607            4
12608        }
12609
12610        #[inline(always)]
12611        fn inline_size(_context: fidl::encoding::Context) -> usize {
12612            4
12613        }
12614    }
12615
12616    unsafe impl fidl::encoding::Encode<DirEntry, fidl::encoding::DefaultFuchsiaResourceDialect>
12617        for &mut DirEntry
12618    {
12619        #[inline]
12620        unsafe fn encode(
12621            self,
12622            encoder: &mut fidl::encoding::Encoder<
12623                '_,
12624                fidl::encoding::DefaultFuchsiaResourceDialect,
12625            >,
12626            offset: usize,
12627            _depth: fidl::encoding::Depth,
12628        ) -> fidl::Result<()> {
12629            encoder.debug_check_bounds::<DirEntry>(offset);
12630            // Delegate to tuple encoding.
12631            fidl::encoding::Encode::<DirEntry, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
12632                (
12633                    <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.token),
12634                ),
12635                encoder, offset, _depth
12636            )
12637        }
12638    }
12639    unsafe impl<
12640        T0: fidl::encoding::Encode<
12641                fidl::encoding::HandleType<
12642                    fidl::EventPair,
12643                    { fidl::ObjectType::EVENTPAIR.into_raw() },
12644                    2147483648,
12645                >,
12646                fidl::encoding::DefaultFuchsiaResourceDialect,
12647            >,
12648    > fidl::encoding::Encode<DirEntry, fidl::encoding::DefaultFuchsiaResourceDialect> for (T0,)
12649    {
12650        #[inline]
12651        unsafe fn encode(
12652            self,
12653            encoder: &mut fidl::encoding::Encoder<
12654                '_,
12655                fidl::encoding::DefaultFuchsiaResourceDialect,
12656            >,
12657            offset: usize,
12658            depth: fidl::encoding::Depth,
12659        ) -> fidl::Result<()> {
12660            encoder.debug_check_bounds::<DirEntry>(offset);
12661            // Zero out padding regions. There's no need to apply masks
12662            // because the unmasked parts will be overwritten by fields.
12663            // Write the fields.
12664            self.0.encode(encoder, offset + 0, depth)?;
12665            Ok(())
12666        }
12667    }
12668
12669    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for DirEntry {
12670        #[inline(always)]
12671        fn new_empty() -> Self {
12672            Self {
12673                token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
12674            }
12675        }
12676
12677        #[inline]
12678        unsafe fn decode(
12679            &mut self,
12680            decoder: &mut fidl::encoding::Decoder<
12681                '_,
12682                fidl::encoding::DefaultFuchsiaResourceDialect,
12683            >,
12684            offset: usize,
12685            _depth: fidl::encoding::Depth,
12686        ) -> fidl::Result<()> {
12687            decoder.debug_check_bounds::<Self>(offset);
12688            // Verify that padding bytes are zero.
12689            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.token, decoder, offset + 0, _depth)?;
12690            Ok(())
12691        }
12692    }
12693
12694    impl fidl::encoding::ResourceTypeMarker for InstanceToken {
12695        type Borrowed<'a> = &'a mut Self;
12696        fn take_or_borrow<'a>(
12697            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12698        ) -> Self::Borrowed<'a> {
12699            value
12700        }
12701    }
12702
12703    unsafe impl fidl::encoding::TypeMarker for InstanceToken {
12704        type Owned = Self;
12705
12706        #[inline(always)]
12707        fn inline_align(_context: fidl::encoding::Context) -> usize {
12708            4
12709        }
12710
12711        #[inline(always)]
12712        fn inline_size(_context: fidl::encoding::Context) -> usize {
12713            4
12714        }
12715    }
12716
12717    unsafe impl fidl::encoding::Encode<InstanceToken, fidl::encoding::DefaultFuchsiaResourceDialect>
12718        for &mut InstanceToken
12719    {
12720        #[inline]
12721        unsafe fn encode(
12722            self,
12723            encoder: &mut fidl::encoding::Encoder<
12724                '_,
12725                fidl::encoding::DefaultFuchsiaResourceDialect,
12726            >,
12727            offset: usize,
12728            _depth: fidl::encoding::Depth,
12729        ) -> fidl::Result<()> {
12730            encoder.debug_check_bounds::<InstanceToken>(offset);
12731            // Delegate to tuple encoding.
12732            fidl::encoding::Encode::<InstanceToken, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
12733                (
12734                    <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.token),
12735                ),
12736                encoder, offset, _depth
12737            )
12738        }
12739    }
12740    unsafe impl<
12741        T0: fidl::encoding::Encode<
12742                fidl::encoding::HandleType<
12743                    fidl::EventPair,
12744                    { fidl::ObjectType::EVENTPAIR.into_raw() },
12745                    2147483648,
12746                >,
12747                fidl::encoding::DefaultFuchsiaResourceDialect,
12748            >,
12749    > fidl::encoding::Encode<InstanceToken, fidl::encoding::DefaultFuchsiaResourceDialect>
12750        for (T0,)
12751    {
12752        #[inline]
12753        unsafe fn encode(
12754            self,
12755            encoder: &mut fidl::encoding::Encoder<
12756                '_,
12757                fidl::encoding::DefaultFuchsiaResourceDialect,
12758            >,
12759            offset: usize,
12760            depth: fidl::encoding::Depth,
12761        ) -> fidl::Result<()> {
12762            encoder.debug_check_bounds::<InstanceToken>(offset);
12763            // Zero out padding regions. There's no need to apply masks
12764            // because the unmasked parts will be overwritten by fields.
12765            // Write the fields.
12766            self.0.encode(encoder, offset + 0, depth)?;
12767            Ok(())
12768        }
12769    }
12770
12771    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for InstanceToken {
12772        #[inline(always)]
12773        fn new_empty() -> Self {
12774            Self {
12775                token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
12776            }
12777        }
12778
12779        #[inline]
12780        unsafe fn decode(
12781            &mut self,
12782            decoder: &mut fidl::encoding::Decoder<
12783                '_,
12784                fidl::encoding::DefaultFuchsiaResourceDialect,
12785            >,
12786            offset: usize,
12787            _depth: fidl::encoding::Depth,
12788        ) -> fidl::Result<()> {
12789            decoder.debug_check_bounds::<Self>(offset);
12790            // Verify that padding bytes are zero.
12791            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.token, decoder, offset + 0, _depth)?;
12792            Ok(())
12793        }
12794    }
12795
12796    impl fidl::encoding::ResourceTypeMarker for ProtocolPayload {
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 ProtocolPayload {
12806        type Owned = Self;
12807
12808        #[inline(always)]
12809        fn inline_align(_context: fidl::encoding::Context) -> usize {
12810            4
12811        }
12812
12813        #[inline(always)]
12814        fn inline_size(_context: fidl::encoding::Context) -> usize {
12815            4
12816        }
12817    }
12818
12819    unsafe impl
12820        fidl::encoding::Encode<ProtocolPayload, fidl::encoding::DefaultFuchsiaResourceDialect>
12821        for &mut ProtocolPayload
12822    {
12823        #[inline]
12824        unsafe fn encode(
12825            self,
12826            encoder: &mut fidl::encoding::Encoder<
12827                '_,
12828                fidl::encoding::DefaultFuchsiaResourceDialect,
12829            >,
12830            offset: usize,
12831            _depth: fidl::encoding::Depth,
12832        ) -> fidl::Result<()> {
12833            encoder.debug_check_bounds::<ProtocolPayload>(offset);
12834            // Delegate to tuple encoding.
12835            fidl::encoding::Encode::<ProtocolPayload, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
12836                (
12837                    <fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.channel),
12838                ),
12839                encoder, offset, _depth
12840            )
12841        }
12842    }
12843    unsafe impl<
12844        T0: fidl::encoding::Encode<
12845                fidl::encoding::HandleType<
12846                    fidl::Channel,
12847                    { fidl::ObjectType::CHANNEL.into_raw() },
12848                    2147483648,
12849                >,
12850                fidl::encoding::DefaultFuchsiaResourceDialect,
12851            >,
12852    > fidl::encoding::Encode<ProtocolPayload, fidl::encoding::DefaultFuchsiaResourceDialect>
12853        for (T0,)
12854    {
12855        #[inline]
12856        unsafe fn encode(
12857            self,
12858            encoder: &mut fidl::encoding::Encoder<
12859                '_,
12860                fidl::encoding::DefaultFuchsiaResourceDialect,
12861            >,
12862            offset: usize,
12863            depth: fidl::encoding::Depth,
12864        ) -> fidl::Result<()> {
12865            encoder.debug_check_bounds::<ProtocolPayload>(offset);
12866            // Zero out padding regions. There's no need to apply masks
12867            // because the unmasked parts will be overwritten by fields.
12868            // Write the fields.
12869            self.0.encode(encoder, offset + 0, depth)?;
12870            Ok(())
12871        }
12872    }
12873
12874    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12875        for ProtocolPayload
12876    {
12877        #[inline(always)]
12878        fn new_empty() -> Self {
12879            Self {
12880                channel: fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
12881            }
12882        }
12883
12884        #[inline]
12885        unsafe fn decode(
12886            &mut self,
12887            decoder: &mut fidl::encoding::Decoder<
12888                '_,
12889                fidl::encoding::DefaultFuchsiaResourceDialect,
12890            >,
12891            offset: usize,
12892            _depth: fidl::encoding::Depth,
12893        ) -> fidl::Result<()> {
12894            decoder.debug_check_bounds::<Self>(offset);
12895            // Verify that padding bytes are zero.
12896            fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.channel, decoder, offset + 0, _depth)?;
12897            Ok(())
12898        }
12899    }
12900
12901    impl CapabilityStoreDirConnectorOpenRequest {
12902        #[inline(always)]
12903        fn max_ordinal_present(&self) -> u64 {
12904            if let Some(_) = self.path {
12905                return 4;
12906            }
12907            if let Some(_) = self.flags {
12908                return 3;
12909            }
12910            if let Some(_) = self.server_end {
12911                return 2;
12912            }
12913            if let Some(_) = self.id {
12914                return 1;
12915            }
12916            0
12917        }
12918    }
12919
12920    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDirConnectorOpenRequest {
12921        type Borrowed<'a> = &'a mut Self;
12922        fn take_or_borrow<'a>(
12923            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12924        ) -> Self::Borrowed<'a> {
12925            value
12926        }
12927    }
12928
12929    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDirConnectorOpenRequest {
12930        type Owned = Self;
12931
12932        #[inline(always)]
12933        fn inline_align(_context: fidl::encoding::Context) -> usize {
12934            8
12935        }
12936
12937        #[inline(always)]
12938        fn inline_size(_context: fidl::encoding::Context) -> usize {
12939            16
12940        }
12941    }
12942
12943    unsafe impl
12944        fidl::encoding::Encode<
12945            CapabilityStoreDirConnectorOpenRequest,
12946            fidl::encoding::DefaultFuchsiaResourceDialect,
12947        > for &mut CapabilityStoreDirConnectorOpenRequest
12948    {
12949        unsafe fn encode(
12950            self,
12951            encoder: &mut fidl::encoding::Encoder<
12952                '_,
12953                fidl::encoding::DefaultFuchsiaResourceDialect,
12954            >,
12955            offset: usize,
12956            mut depth: fidl::encoding::Depth,
12957        ) -> fidl::Result<()> {
12958            encoder.debug_check_bounds::<CapabilityStoreDirConnectorOpenRequest>(offset);
12959            // Vector header
12960            let max_ordinal: u64 = self.max_ordinal_present();
12961            encoder.write_num(max_ordinal, offset);
12962            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12963            // Calling encoder.out_of_line_offset(0) is not allowed.
12964            if max_ordinal == 0 {
12965                return Ok(());
12966            }
12967            depth.increment()?;
12968            let envelope_size = 8;
12969            let bytes_len = max_ordinal as usize * envelope_size;
12970            #[allow(unused_variables)]
12971            let offset = encoder.out_of_line_offset(bytes_len);
12972            let mut _prev_end_offset: usize = 0;
12973            if 1 > max_ordinal {
12974                return Ok(());
12975            }
12976
12977            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12978            // are envelope_size bytes.
12979            let cur_offset: usize = (1 - 1) * envelope_size;
12980
12981            // Zero reserved fields.
12982            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12983
12984            // Safety:
12985            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12986            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12987            //   envelope_size bytes, there is always sufficient room.
12988            fidl::encoding::encode_in_envelope_optional::<
12989                u64,
12990                fidl::encoding::DefaultFuchsiaResourceDialect,
12991            >(
12992                self.id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
12993                encoder,
12994                offset + cur_offset,
12995                depth,
12996            )?;
12997
12998            _prev_end_offset = cur_offset + envelope_size;
12999            if 2 > max_ordinal {
13000                return Ok(());
13001            }
13002
13003            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13004            // are envelope_size bytes.
13005            let cur_offset: usize = (2 - 1) * envelope_size;
13006
13007            // Zero reserved fields.
13008            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13009
13010            // Safety:
13011            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13012            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13013            //   envelope_size bytes, there is always sufficient room.
13014            fidl::encoding::encode_in_envelope_optional::<
13015                fidl::encoding::Endpoint<
13016                    fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
13017                >,
13018                fidl::encoding::DefaultFuchsiaResourceDialect,
13019            >(
13020                self.server_end.as_mut().map(
13021                    <fidl::encoding::Endpoint<
13022                        fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
13023                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
13024                ),
13025                encoder,
13026                offset + cur_offset,
13027                depth,
13028            )?;
13029
13030            _prev_end_offset = cur_offset + envelope_size;
13031            if 3 > max_ordinal {
13032                return Ok(());
13033            }
13034
13035            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13036            // are envelope_size bytes.
13037            let cur_offset: usize = (3 - 1) * envelope_size;
13038
13039            // Zero reserved fields.
13040            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13041
13042            // Safety:
13043            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13044            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13045            //   envelope_size bytes, there is always sufficient room.
13046            fidl::encoding::encode_in_envelope_optional::<
13047                fidl_fuchsia_io::Flags,
13048                fidl::encoding::DefaultFuchsiaResourceDialect,
13049            >(
13050                self.flags
13051                    .as_ref()
13052                    .map(<fidl_fuchsia_io::Flags as fidl::encoding::ValueTypeMarker>::borrow),
13053                encoder,
13054                offset + cur_offset,
13055                depth,
13056            )?;
13057
13058            _prev_end_offset = cur_offset + envelope_size;
13059            if 4 > max_ordinal {
13060                return Ok(());
13061            }
13062
13063            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13064            // are envelope_size bytes.
13065            let cur_offset: usize = (4 - 1) * envelope_size;
13066
13067            // Zero reserved fields.
13068            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13069
13070            // Safety:
13071            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13072            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13073            //   envelope_size bytes, there is always sufficient room.
13074            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<4095>, fidl::encoding::DefaultFuchsiaResourceDialect>(
13075            self.path.as_ref().map(<fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow),
13076            encoder, offset + cur_offset, depth
13077        )?;
13078
13079            _prev_end_offset = cur_offset + envelope_size;
13080
13081            Ok(())
13082        }
13083    }
13084
13085    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13086        for CapabilityStoreDirConnectorOpenRequest
13087    {
13088        #[inline(always)]
13089        fn new_empty() -> Self {
13090            Self::default()
13091        }
13092
13093        unsafe fn decode(
13094            &mut self,
13095            decoder: &mut fidl::encoding::Decoder<
13096                '_,
13097                fidl::encoding::DefaultFuchsiaResourceDialect,
13098            >,
13099            offset: usize,
13100            mut depth: fidl::encoding::Depth,
13101        ) -> fidl::Result<()> {
13102            decoder.debug_check_bounds::<Self>(offset);
13103            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13104                None => return Err(fidl::Error::NotNullable),
13105                Some(len) => len,
13106            };
13107            // Calling decoder.out_of_line_offset(0) is not allowed.
13108            if len == 0 {
13109                return Ok(());
13110            };
13111            depth.increment()?;
13112            let envelope_size = 8;
13113            let bytes_len = len * envelope_size;
13114            let offset = decoder.out_of_line_offset(bytes_len)?;
13115            // Decode the envelope for each type.
13116            let mut _next_ordinal_to_read = 0;
13117            let mut next_offset = offset;
13118            let end_offset = offset + bytes_len;
13119            _next_ordinal_to_read += 1;
13120            if next_offset >= end_offset {
13121                return Ok(());
13122            }
13123
13124            // Decode unknown envelopes for gaps in ordinals.
13125            while _next_ordinal_to_read < 1 {
13126                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13127                _next_ordinal_to_read += 1;
13128                next_offset += envelope_size;
13129            }
13130
13131            let next_out_of_line = decoder.next_out_of_line();
13132            let handles_before = decoder.remaining_handles();
13133            if let Some((inlined, num_bytes, num_handles)) =
13134                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13135            {
13136                let member_inline_size =
13137                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
13138                if inlined != (member_inline_size <= 4) {
13139                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13140                }
13141                let inner_offset;
13142                let mut inner_depth = depth.clone();
13143                if inlined {
13144                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13145                    inner_offset = next_offset;
13146                } else {
13147                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13148                    inner_depth.increment()?;
13149                }
13150                let val_ref = self.id.get_or_insert_with(|| {
13151                    fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect)
13152                });
13153                fidl::decode!(
13154                    u64,
13155                    fidl::encoding::DefaultFuchsiaResourceDialect,
13156                    val_ref,
13157                    decoder,
13158                    inner_offset,
13159                    inner_depth
13160                )?;
13161                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13162                {
13163                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13164                }
13165                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13166                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13167                }
13168            }
13169
13170            next_offset += envelope_size;
13171            _next_ordinal_to_read += 1;
13172            if next_offset >= end_offset {
13173                return Ok(());
13174            }
13175
13176            // Decode unknown envelopes for gaps in ordinals.
13177            while _next_ordinal_to_read < 2 {
13178                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13179                _next_ordinal_to_read += 1;
13180                next_offset += envelope_size;
13181            }
13182
13183            let next_out_of_line = decoder.next_out_of_line();
13184            let handles_before = decoder.remaining_handles();
13185            if let Some((inlined, num_bytes, num_handles)) =
13186                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13187            {
13188                let member_inline_size = <fidl::encoding::Endpoint<
13189                    fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
13190                > as fidl::encoding::TypeMarker>::inline_size(
13191                    decoder.context
13192                );
13193                if inlined != (member_inline_size <= 4) {
13194                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13195                }
13196                let inner_offset;
13197                let mut inner_depth = depth.clone();
13198                if inlined {
13199                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13200                    inner_offset = next_offset;
13201                } else {
13202                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13203                    inner_depth.increment()?;
13204                }
13205                let val_ref = self.server_end.get_or_insert_with(|| {
13206                    fidl::new_empty!(
13207                        fidl::encoding::Endpoint<
13208                            fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
13209                        >,
13210                        fidl::encoding::DefaultFuchsiaResourceDialect
13211                    )
13212                });
13213                fidl::decode!(
13214                    fidl::encoding::Endpoint<
13215                        fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
13216                    >,
13217                    fidl::encoding::DefaultFuchsiaResourceDialect,
13218                    val_ref,
13219                    decoder,
13220                    inner_offset,
13221                    inner_depth
13222                )?;
13223                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13224                {
13225                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13226                }
13227                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13228                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13229                }
13230            }
13231
13232            next_offset += envelope_size;
13233            _next_ordinal_to_read += 1;
13234            if next_offset >= end_offset {
13235                return Ok(());
13236            }
13237
13238            // Decode unknown envelopes for gaps in ordinals.
13239            while _next_ordinal_to_read < 3 {
13240                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13241                _next_ordinal_to_read += 1;
13242                next_offset += envelope_size;
13243            }
13244
13245            let next_out_of_line = decoder.next_out_of_line();
13246            let handles_before = decoder.remaining_handles();
13247            if let Some((inlined, num_bytes, num_handles)) =
13248                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13249            {
13250                let member_inline_size =
13251                    <fidl_fuchsia_io::Flags as fidl::encoding::TypeMarker>::inline_size(
13252                        decoder.context,
13253                    );
13254                if inlined != (member_inline_size <= 4) {
13255                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13256                }
13257                let inner_offset;
13258                let mut inner_depth = depth.clone();
13259                if inlined {
13260                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13261                    inner_offset = next_offset;
13262                } else {
13263                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13264                    inner_depth.increment()?;
13265                }
13266                let val_ref = self.flags.get_or_insert_with(|| {
13267                    fidl::new_empty!(
13268                        fidl_fuchsia_io::Flags,
13269                        fidl::encoding::DefaultFuchsiaResourceDialect
13270                    )
13271                });
13272                fidl::decode!(
13273                    fidl_fuchsia_io::Flags,
13274                    fidl::encoding::DefaultFuchsiaResourceDialect,
13275                    val_ref,
13276                    decoder,
13277                    inner_offset,
13278                    inner_depth
13279                )?;
13280                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13281                {
13282                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13283                }
13284                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13285                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13286                }
13287            }
13288
13289            next_offset += envelope_size;
13290            _next_ordinal_to_read += 1;
13291            if next_offset >= end_offset {
13292                return Ok(());
13293            }
13294
13295            // Decode unknown envelopes for gaps in ordinals.
13296            while _next_ordinal_to_read < 4 {
13297                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13298                _next_ordinal_to_read += 1;
13299                next_offset += envelope_size;
13300            }
13301
13302            let next_out_of_line = decoder.next_out_of_line();
13303            let handles_before = decoder.remaining_handles();
13304            if let Some((inlined, num_bytes, num_handles)) =
13305                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13306            {
13307                let member_inline_size = <fidl::encoding::BoundedString<4095> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
13308                if inlined != (member_inline_size <= 4) {
13309                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13310                }
13311                let inner_offset;
13312                let mut inner_depth = depth.clone();
13313                if inlined {
13314                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13315                    inner_offset = next_offset;
13316                } else {
13317                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13318                    inner_depth.increment()?;
13319                }
13320                let val_ref = self.path.get_or_insert_with(|| {
13321                    fidl::new_empty!(
13322                        fidl::encoding::BoundedString<4095>,
13323                        fidl::encoding::DefaultFuchsiaResourceDialect
13324                    )
13325                });
13326                fidl::decode!(
13327                    fidl::encoding::BoundedString<4095>,
13328                    fidl::encoding::DefaultFuchsiaResourceDialect,
13329                    val_ref,
13330                    decoder,
13331                    inner_offset,
13332                    inner_depth
13333                )?;
13334                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13335                {
13336                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13337                }
13338                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13339                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13340                }
13341            }
13342
13343            next_offset += envelope_size;
13344
13345            // Decode the remaining unknown envelopes.
13346            while next_offset < end_offset {
13347                _next_ordinal_to_read += 1;
13348                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13349                next_offset += envelope_size;
13350            }
13351
13352            Ok(())
13353        }
13354    }
13355
13356    impl DirReceiverReceiveRequest {
13357        #[inline(always)]
13358        fn max_ordinal_present(&self) -> u64 {
13359            if let Some(_) = self.subdir {
13360                return 3;
13361            }
13362            if let Some(_) = self.flags {
13363                return 2;
13364            }
13365            if let Some(_) = self.channel {
13366                return 1;
13367            }
13368            0
13369        }
13370    }
13371
13372    impl fidl::encoding::ResourceTypeMarker for DirReceiverReceiveRequest {
13373        type Borrowed<'a> = &'a mut Self;
13374        fn take_or_borrow<'a>(
13375            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13376        ) -> Self::Borrowed<'a> {
13377            value
13378        }
13379    }
13380
13381    unsafe impl fidl::encoding::TypeMarker for DirReceiverReceiveRequest {
13382        type Owned = Self;
13383
13384        #[inline(always)]
13385        fn inline_align(_context: fidl::encoding::Context) -> usize {
13386            8
13387        }
13388
13389        #[inline(always)]
13390        fn inline_size(_context: fidl::encoding::Context) -> usize {
13391            16
13392        }
13393    }
13394
13395    unsafe impl
13396        fidl::encoding::Encode<
13397            DirReceiverReceiveRequest,
13398            fidl::encoding::DefaultFuchsiaResourceDialect,
13399        > for &mut DirReceiverReceiveRequest
13400    {
13401        unsafe fn encode(
13402            self,
13403            encoder: &mut fidl::encoding::Encoder<
13404                '_,
13405                fidl::encoding::DefaultFuchsiaResourceDialect,
13406            >,
13407            offset: usize,
13408            mut depth: fidl::encoding::Depth,
13409        ) -> fidl::Result<()> {
13410            encoder.debug_check_bounds::<DirReceiverReceiveRequest>(offset);
13411            // Vector header
13412            let max_ordinal: u64 = self.max_ordinal_present();
13413            encoder.write_num(max_ordinal, offset);
13414            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
13415            // Calling encoder.out_of_line_offset(0) is not allowed.
13416            if max_ordinal == 0 {
13417                return Ok(());
13418            }
13419            depth.increment()?;
13420            let envelope_size = 8;
13421            let bytes_len = max_ordinal as usize * envelope_size;
13422            #[allow(unused_variables)]
13423            let offset = encoder.out_of_line_offset(bytes_len);
13424            let mut _prev_end_offset: usize = 0;
13425            if 1 > max_ordinal {
13426                return Ok(());
13427            }
13428
13429            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13430            // are envelope_size bytes.
13431            let cur_offset: usize = (1 - 1) * envelope_size;
13432
13433            // Zero reserved fields.
13434            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13435
13436            // Safety:
13437            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13438            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13439            //   envelope_size bytes, there is always sufficient room.
13440            fidl::encoding::encode_in_envelope_optional::<
13441                fidl::encoding::HandleType<
13442                    fidl::Channel,
13443                    { fidl::ObjectType::CHANNEL.into_raw() },
13444                    2147483648,
13445                >,
13446                fidl::encoding::DefaultFuchsiaResourceDialect,
13447            >(
13448                self.channel.as_mut().map(
13449                    <fidl::encoding::HandleType<
13450                        fidl::Channel,
13451                        { fidl::ObjectType::CHANNEL.into_raw() },
13452                        2147483648,
13453                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
13454                ),
13455                encoder,
13456                offset + cur_offset,
13457                depth,
13458            )?;
13459
13460            _prev_end_offset = cur_offset + envelope_size;
13461            if 2 > max_ordinal {
13462                return Ok(());
13463            }
13464
13465            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13466            // are envelope_size bytes.
13467            let cur_offset: usize = (2 - 1) * envelope_size;
13468
13469            // Zero reserved fields.
13470            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13471
13472            // Safety:
13473            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13474            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13475            //   envelope_size bytes, there is always sufficient room.
13476            fidl::encoding::encode_in_envelope_optional::<
13477                fidl_fuchsia_io::Flags,
13478                fidl::encoding::DefaultFuchsiaResourceDialect,
13479            >(
13480                self.flags
13481                    .as_ref()
13482                    .map(<fidl_fuchsia_io::Flags as fidl::encoding::ValueTypeMarker>::borrow),
13483                encoder,
13484                offset + cur_offset,
13485                depth,
13486            )?;
13487
13488            _prev_end_offset = cur_offset + envelope_size;
13489            if 3 > max_ordinal {
13490                return Ok(());
13491            }
13492
13493            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13494            // are envelope_size bytes.
13495            let cur_offset: usize = (3 - 1) * envelope_size;
13496
13497            // Zero reserved fields.
13498            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13499
13500            // Safety:
13501            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13502            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13503            //   envelope_size bytes, there is always sufficient room.
13504            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<4095>, fidl::encoding::DefaultFuchsiaResourceDialect>(
13505            self.subdir.as_ref().map(<fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow),
13506            encoder, offset + cur_offset, depth
13507        )?;
13508
13509            _prev_end_offset = cur_offset + envelope_size;
13510
13511            Ok(())
13512        }
13513    }
13514
13515    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13516        for DirReceiverReceiveRequest
13517    {
13518        #[inline(always)]
13519        fn new_empty() -> Self {
13520            Self::default()
13521        }
13522
13523        unsafe fn decode(
13524            &mut self,
13525            decoder: &mut fidl::encoding::Decoder<
13526                '_,
13527                fidl::encoding::DefaultFuchsiaResourceDialect,
13528            >,
13529            offset: usize,
13530            mut depth: fidl::encoding::Depth,
13531        ) -> fidl::Result<()> {
13532            decoder.debug_check_bounds::<Self>(offset);
13533            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13534                None => return Err(fidl::Error::NotNullable),
13535                Some(len) => len,
13536            };
13537            // Calling decoder.out_of_line_offset(0) is not allowed.
13538            if len == 0 {
13539                return Ok(());
13540            };
13541            depth.increment()?;
13542            let envelope_size = 8;
13543            let bytes_len = len * envelope_size;
13544            let offset = decoder.out_of_line_offset(bytes_len)?;
13545            // Decode the envelope for each type.
13546            let mut _next_ordinal_to_read = 0;
13547            let mut next_offset = offset;
13548            let end_offset = offset + bytes_len;
13549            _next_ordinal_to_read += 1;
13550            if next_offset >= end_offset {
13551                return Ok(());
13552            }
13553
13554            // Decode unknown envelopes for gaps in ordinals.
13555            while _next_ordinal_to_read < 1 {
13556                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13557                _next_ordinal_to_read += 1;
13558                next_offset += envelope_size;
13559            }
13560
13561            let next_out_of_line = decoder.next_out_of_line();
13562            let handles_before = decoder.remaining_handles();
13563            if let Some((inlined, num_bytes, num_handles)) =
13564                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13565            {
13566                let member_inline_size = <fidl::encoding::HandleType<
13567                    fidl::Channel,
13568                    { fidl::ObjectType::CHANNEL.into_raw() },
13569                    2147483648,
13570                > as fidl::encoding::TypeMarker>::inline_size(
13571                    decoder.context
13572                );
13573                if inlined != (member_inline_size <= 4) {
13574                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13575                }
13576                let inner_offset;
13577                let mut inner_depth = depth.clone();
13578                if inlined {
13579                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13580                    inner_offset = next_offset;
13581                } else {
13582                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13583                    inner_depth.increment()?;
13584                }
13585                let val_ref =
13586                self.channel.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
13587                fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
13588                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13589                {
13590                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13591                }
13592                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13593                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13594                }
13595            }
13596
13597            next_offset += envelope_size;
13598            _next_ordinal_to_read += 1;
13599            if next_offset >= end_offset {
13600                return Ok(());
13601            }
13602
13603            // Decode unknown envelopes for gaps in ordinals.
13604            while _next_ordinal_to_read < 2 {
13605                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13606                _next_ordinal_to_read += 1;
13607                next_offset += envelope_size;
13608            }
13609
13610            let next_out_of_line = decoder.next_out_of_line();
13611            let handles_before = decoder.remaining_handles();
13612            if let Some((inlined, num_bytes, num_handles)) =
13613                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13614            {
13615                let member_inline_size =
13616                    <fidl_fuchsia_io::Flags as fidl::encoding::TypeMarker>::inline_size(
13617                        decoder.context,
13618                    );
13619                if inlined != (member_inline_size <= 4) {
13620                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13621                }
13622                let inner_offset;
13623                let mut inner_depth = depth.clone();
13624                if inlined {
13625                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13626                    inner_offset = next_offset;
13627                } else {
13628                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13629                    inner_depth.increment()?;
13630                }
13631                let val_ref = self.flags.get_or_insert_with(|| {
13632                    fidl::new_empty!(
13633                        fidl_fuchsia_io::Flags,
13634                        fidl::encoding::DefaultFuchsiaResourceDialect
13635                    )
13636                });
13637                fidl::decode!(
13638                    fidl_fuchsia_io::Flags,
13639                    fidl::encoding::DefaultFuchsiaResourceDialect,
13640                    val_ref,
13641                    decoder,
13642                    inner_offset,
13643                    inner_depth
13644                )?;
13645                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13646                {
13647                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13648                }
13649                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13650                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13651                }
13652            }
13653
13654            next_offset += envelope_size;
13655            _next_ordinal_to_read += 1;
13656            if next_offset >= end_offset {
13657                return Ok(());
13658            }
13659
13660            // Decode unknown envelopes for gaps in ordinals.
13661            while _next_ordinal_to_read < 3 {
13662                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13663                _next_ordinal_to_read += 1;
13664                next_offset += envelope_size;
13665            }
13666
13667            let next_out_of_line = decoder.next_out_of_line();
13668            let handles_before = decoder.remaining_handles();
13669            if let Some((inlined, num_bytes, num_handles)) =
13670                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13671            {
13672                let member_inline_size = <fidl::encoding::BoundedString<4095> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
13673                if inlined != (member_inline_size <= 4) {
13674                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13675                }
13676                let inner_offset;
13677                let mut inner_depth = depth.clone();
13678                if inlined {
13679                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13680                    inner_offset = next_offset;
13681                } else {
13682                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13683                    inner_depth.increment()?;
13684                }
13685                let val_ref = self.subdir.get_or_insert_with(|| {
13686                    fidl::new_empty!(
13687                        fidl::encoding::BoundedString<4095>,
13688                        fidl::encoding::DefaultFuchsiaResourceDialect
13689                    )
13690                });
13691                fidl::decode!(
13692                    fidl::encoding::BoundedString<4095>,
13693                    fidl::encoding::DefaultFuchsiaResourceDialect,
13694                    val_ref,
13695                    decoder,
13696                    inner_offset,
13697                    inner_depth
13698                )?;
13699                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13700                {
13701                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13702                }
13703                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13704                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13705                }
13706            }
13707
13708            next_offset += envelope_size;
13709
13710            // Decode the remaining unknown envelopes.
13711            while next_offset < end_offset {
13712                _next_ordinal_to_read += 1;
13713                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13714                next_offset += envelope_size;
13715            }
13716
13717            Ok(())
13718        }
13719    }
13720
13721    impl RouteRequest {
13722        #[inline(always)]
13723        fn max_ordinal_present(&self) -> u64 {
13724            if let Some(_) = self.metadata {
13725                return 2;
13726            }
13727            if let Some(_) = self.requesting {
13728                return 1;
13729            }
13730            0
13731        }
13732    }
13733
13734    impl fidl::encoding::ResourceTypeMarker for RouteRequest {
13735        type Borrowed<'a> = &'a mut Self;
13736        fn take_or_borrow<'a>(
13737            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13738        ) -> Self::Borrowed<'a> {
13739            value
13740        }
13741    }
13742
13743    unsafe impl fidl::encoding::TypeMarker for RouteRequest {
13744        type Owned = Self;
13745
13746        #[inline(always)]
13747        fn inline_align(_context: fidl::encoding::Context) -> usize {
13748            8
13749        }
13750
13751        #[inline(always)]
13752        fn inline_size(_context: fidl::encoding::Context) -> usize {
13753            16
13754        }
13755    }
13756
13757    unsafe impl fidl::encoding::Encode<RouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
13758        for &mut RouteRequest
13759    {
13760        unsafe fn encode(
13761            self,
13762            encoder: &mut fidl::encoding::Encoder<
13763                '_,
13764                fidl::encoding::DefaultFuchsiaResourceDialect,
13765            >,
13766            offset: usize,
13767            mut depth: fidl::encoding::Depth,
13768        ) -> fidl::Result<()> {
13769            encoder.debug_check_bounds::<RouteRequest>(offset);
13770            // Vector header
13771            let max_ordinal: u64 = self.max_ordinal_present();
13772            encoder.write_num(max_ordinal, offset);
13773            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
13774            // Calling encoder.out_of_line_offset(0) is not allowed.
13775            if max_ordinal == 0 {
13776                return Ok(());
13777            }
13778            depth.increment()?;
13779            let envelope_size = 8;
13780            let bytes_len = max_ordinal as usize * envelope_size;
13781            #[allow(unused_variables)]
13782            let offset = encoder.out_of_line_offset(bytes_len);
13783            let mut _prev_end_offset: usize = 0;
13784            if 1 > max_ordinal {
13785                return Ok(());
13786            }
13787
13788            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13789            // are envelope_size bytes.
13790            let cur_offset: usize = (1 - 1) * envelope_size;
13791
13792            // Zero reserved fields.
13793            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13794
13795            // Safety:
13796            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13797            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13798            //   envelope_size bytes, there is always sufficient room.
13799            fidl::encoding::encode_in_envelope_optional::<
13800                InstanceToken,
13801                fidl::encoding::DefaultFuchsiaResourceDialect,
13802            >(
13803                self.requesting
13804                    .as_mut()
13805                    .map(<InstanceToken as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
13806                encoder,
13807                offset + cur_offset,
13808                depth,
13809            )?;
13810
13811            _prev_end_offset = cur_offset + envelope_size;
13812            if 2 > max_ordinal {
13813                return Ok(());
13814            }
13815
13816            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13817            // are envelope_size bytes.
13818            let cur_offset: usize = (2 - 1) * envelope_size;
13819
13820            // Zero reserved fields.
13821            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13822
13823            // Safety:
13824            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13825            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13826            //   envelope_size bytes, there is always sufficient room.
13827            fidl::encoding::encode_in_envelope_optional::<
13828                DictionaryRef,
13829                fidl::encoding::DefaultFuchsiaResourceDialect,
13830            >(
13831                self.metadata
13832                    .as_mut()
13833                    .map(<DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
13834                encoder,
13835                offset + cur_offset,
13836                depth,
13837            )?;
13838
13839            _prev_end_offset = cur_offset + envelope_size;
13840
13841            Ok(())
13842        }
13843    }
13844
13845    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for RouteRequest {
13846        #[inline(always)]
13847        fn new_empty() -> Self {
13848            Self::default()
13849        }
13850
13851        unsafe fn decode(
13852            &mut self,
13853            decoder: &mut fidl::encoding::Decoder<
13854                '_,
13855                fidl::encoding::DefaultFuchsiaResourceDialect,
13856            >,
13857            offset: usize,
13858            mut depth: fidl::encoding::Depth,
13859        ) -> fidl::Result<()> {
13860            decoder.debug_check_bounds::<Self>(offset);
13861            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13862                None => return Err(fidl::Error::NotNullable),
13863                Some(len) => len,
13864            };
13865            // Calling decoder.out_of_line_offset(0) is not allowed.
13866            if len == 0 {
13867                return Ok(());
13868            };
13869            depth.increment()?;
13870            let envelope_size = 8;
13871            let bytes_len = len * envelope_size;
13872            let offset = decoder.out_of_line_offset(bytes_len)?;
13873            // Decode the envelope for each type.
13874            let mut _next_ordinal_to_read = 0;
13875            let mut next_offset = offset;
13876            let end_offset = offset + bytes_len;
13877            _next_ordinal_to_read += 1;
13878            if next_offset >= end_offset {
13879                return Ok(());
13880            }
13881
13882            // Decode unknown envelopes for gaps in ordinals.
13883            while _next_ordinal_to_read < 1 {
13884                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13885                _next_ordinal_to_read += 1;
13886                next_offset += envelope_size;
13887            }
13888
13889            let next_out_of_line = decoder.next_out_of_line();
13890            let handles_before = decoder.remaining_handles();
13891            if let Some((inlined, num_bytes, num_handles)) =
13892                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13893            {
13894                let member_inline_size =
13895                    <InstanceToken as fidl::encoding::TypeMarker>::inline_size(decoder.context);
13896                if inlined != (member_inline_size <= 4) {
13897                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13898                }
13899                let inner_offset;
13900                let mut inner_depth = depth.clone();
13901                if inlined {
13902                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13903                    inner_offset = next_offset;
13904                } else {
13905                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13906                    inner_depth.increment()?;
13907                }
13908                let val_ref = self.requesting.get_or_insert_with(|| {
13909                    fidl::new_empty!(InstanceToken, fidl::encoding::DefaultFuchsiaResourceDialect)
13910                });
13911                fidl::decode!(
13912                    InstanceToken,
13913                    fidl::encoding::DefaultFuchsiaResourceDialect,
13914                    val_ref,
13915                    decoder,
13916                    inner_offset,
13917                    inner_depth
13918                )?;
13919                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13920                {
13921                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13922                }
13923                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13924                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13925                }
13926            }
13927
13928            next_offset += envelope_size;
13929            _next_ordinal_to_read += 1;
13930            if next_offset >= end_offset {
13931                return Ok(());
13932            }
13933
13934            // Decode unknown envelopes for gaps in ordinals.
13935            while _next_ordinal_to_read < 2 {
13936                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13937                _next_ordinal_to_read += 1;
13938                next_offset += envelope_size;
13939            }
13940
13941            let next_out_of_line = decoder.next_out_of_line();
13942            let handles_before = decoder.remaining_handles();
13943            if let Some((inlined, num_bytes, num_handles)) =
13944                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13945            {
13946                let member_inline_size =
13947                    <DictionaryRef as fidl::encoding::TypeMarker>::inline_size(decoder.context);
13948                if inlined != (member_inline_size <= 4) {
13949                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13950                }
13951                let inner_offset;
13952                let mut inner_depth = depth.clone();
13953                if inlined {
13954                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13955                    inner_offset = next_offset;
13956                } else {
13957                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13958                    inner_depth.increment()?;
13959                }
13960                let val_ref = self.metadata.get_or_insert_with(|| {
13961                    fidl::new_empty!(DictionaryRef, fidl::encoding::DefaultFuchsiaResourceDialect)
13962                });
13963                fidl::decode!(
13964                    DictionaryRef,
13965                    fidl::encoding::DefaultFuchsiaResourceDialect,
13966                    val_ref,
13967                    decoder,
13968                    inner_offset,
13969                    inner_depth
13970                )?;
13971                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13972                {
13973                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13974                }
13975                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13976                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13977                }
13978            }
13979
13980            next_offset += envelope_size;
13981
13982            // Decode the remaining unknown envelopes.
13983            while next_offset < end_offset {
13984                _next_ordinal_to_read += 1;
13985                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13986                next_offset += envelope_size;
13987            }
13988
13989            Ok(())
13990        }
13991    }
13992
13993    impl fidl::encoding::ResourceTypeMarker for Capability {
13994        type Borrowed<'a> = &'a mut Self;
13995        fn take_or_borrow<'a>(
13996            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13997        ) -> Self::Borrowed<'a> {
13998            value
13999        }
14000    }
14001
14002    unsafe impl fidl::encoding::TypeMarker for Capability {
14003        type Owned = Self;
14004
14005        #[inline(always)]
14006        fn inline_align(_context: fidl::encoding::Context) -> usize {
14007            8
14008        }
14009
14010        #[inline(always)]
14011        fn inline_size(_context: fidl::encoding::Context) -> usize {
14012            16
14013        }
14014    }
14015
14016    unsafe impl fidl::encoding::Encode<Capability, fidl::encoding::DefaultFuchsiaResourceDialect>
14017        for &mut Capability
14018    {
14019        #[inline]
14020        unsafe fn encode(
14021            self,
14022            encoder: &mut fidl::encoding::Encoder<
14023                '_,
14024                fidl::encoding::DefaultFuchsiaResourceDialect,
14025            >,
14026            offset: usize,
14027            _depth: fidl::encoding::Depth,
14028        ) -> fidl::Result<()> {
14029            encoder.debug_check_bounds::<Capability>(offset);
14030            encoder.write_num::<u64>(self.ordinal(), offset);
14031            match self {
14032            Capability::Unit(ref val) => {
14033                fidl::encoding::encode_in_envelope::<Unit, fidl::encoding::DefaultFuchsiaResourceDialect>(
14034                    <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
14035                    encoder, offset + 8, _depth
14036                )
14037            }
14038            Capability::Handle(ref mut val) => {
14039                fidl::encoding::encode_in_envelope::<fidl::encoding::HandleType<fidl::NullableHandle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect>(
14040                    <fidl::encoding::HandleType<fidl::NullableHandle, { fidl::ObjectType::NONE.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
14041                    encoder, offset + 8, _depth
14042                )
14043            }
14044            Capability::Data(ref val) => {
14045                fidl::encoding::encode_in_envelope::<Data, fidl::encoding::DefaultFuchsiaResourceDialect>(
14046                    <Data as fidl::encoding::ValueTypeMarker>::borrow(val),
14047                    encoder, offset + 8, _depth
14048                )
14049            }
14050            Capability::Dictionary(ref mut val) => {
14051                fidl::encoding::encode_in_envelope::<DictionaryRef, fidl::encoding::DefaultFuchsiaResourceDialect>(
14052                    <DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
14053                    encoder, offset + 8, _depth
14054                )
14055            }
14056            Capability::Connector(ref mut val) => {
14057                fidl::encoding::encode_in_envelope::<Connector, fidl::encoding::DefaultFuchsiaResourceDialect>(
14058                    <Connector as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
14059                    encoder, offset + 8, _depth
14060                )
14061            }
14062            Capability::DirConnector(ref mut val) => {
14063                fidl::encoding::encode_in_envelope::<DirConnector, fidl::encoding::DefaultFuchsiaResourceDialect>(
14064                    <DirConnector as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
14065                    encoder, offset + 8, _depth
14066                )
14067            }
14068            Capability::Directory(ref mut val) => {
14069                fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
14070                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
14071                    encoder, offset + 8, _depth
14072                )
14073            }
14074            Capability::DirEntry(ref mut val) => {
14075                fidl::encoding::encode_in_envelope::<DirEntry, fidl::encoding::DefaultFuchsiaResourceDialect>(
14076                    <DirEntry as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
14077                    encoder, offset + 8, _depth
14078                )
14079            }
14080            Capability::ConnectorRouter(ref mut val) => {
14081                fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ConnectorRouterMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
14082                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ConnectorRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
14083                    encoder, offset + 8, _depth
14084                )
14085            }
14086            Capability::DictionaryRouter(ref mut val) => {
14087                fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DictionaryRouterMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
14088                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DictionaryRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
14089                    encoder, offset + 8, _depth
14090                )
14091            }
14092            Capability::DirEntryRouter(ref mut val) => {
14093                fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirEntryRouterMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
14094                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirEntryRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
14095                    encoder, offset + 8, _depth
14096                )
14097            }
14098            Capability::DataRouter(ref mut val) => {
14099                fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DataRouterMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
14100                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DataRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
14101                    encoder, offset + 8, _depth
14102                )
14103            }
14104            Capability::DirConnectorRouter(ref mut val) => {
14105                fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirConnectorRouterMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
14106                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirConnectorRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
14107                    encoder, offset + 8, _depth
14108                )
14109            }
14110            Capability::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
14111        }
14112        }
14113    }
14114
14115    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Capability {
14116        #[inline(always)]
14117        fn new_empty() -> Self {
14118            Self::__SourceBreaking { unknown_ordinal: 0 }
14119        }
14120
14121        #[inline]
14122        unsafe fn decode(
14123            &mut self,
14124            decoder: &mut fidl::encoding::Decoder<
14125                '_,
14126                fidl::encoding::DefaultFuchsiaResourceDialect,
14127            >,
14128            offset: usize,
14129            mut depth: fidl::encoding::Depth,
14130        ) -> fidl::Result<()> {
14131            decoder.debug_check_bounds::<Self>(offset);
14132            #[allow(unused_variables)]
14133            let next_out_of_line = decoder.next_out_of_line();
14134            let handles_before = decoder.remaining_handles();
14135            let (ordinal, inlined, num_bytes, num_handles) =
14136                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
14137
14138            let member_inline_size = match ordinal {
14139            1 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14140            2 => <fidl::encoding::HandleType<fidl::NullableHandle, { fidl::ObjectType::NONE.into_raw() }, 2147483648> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14141            3 => <Data as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14142            4 => <DictionaryRef as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14143            5 => <Connector as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14144            6 => <DirConnector as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14145            7 => <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14146            8 => <DirEntry as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14147            9 => <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ConnectorRouterMarker>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14148            10 => <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DictionaryRouterMarker>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14149            11 => <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirEntryRouterMarker>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14150            12 => <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DataRouterMarker>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14151            13 => <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirConnectorRouterMarker>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14152            0 => return Err(fidl::Error::UnknownUnionTag),
14153            _ => num_bytes as usize,
14154        };
14155
14156            if inlined != (member_inline_size <= 4) {
14157                return Err(fidl::Error::InvalidInlineBitInEnvelope);
14158            }
14159            let _inner_offset;
14160            if inlined {
14161                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
14162                _inner_offset = offset + 8;
14163            } else {
14164                depth.increment()?;
14165                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14166            }
14167            match ordinal {
14168                1 => {
14169                    #[allow(irrefutable_let_patterns)]
14170                    if let Capability::Unit(_) = self {
14171                        // Do nothing, read the value into the object
14172                    } else {
14173                        // Initialize `self` to the right variant
14174                        *self = Capability::Unit(fidl::new_empty!(
14175                            Unit,
14176                            fidl::encoding::DefaultFuchsiaResourceDialect
14177                        ));
14178                    }
14179                    #[allow(irrefutable_let_patterns)]
14180                    if let Capability::Unit(ref mut val) = self {
14181                        fidl::decode!(
14182                            Unit,
14183                            fidl::encoding::DefaultFuchsiaResourceDialect,
14184                            val,
14185                            decoder,
14186                            _inner_offset,
14187                            depth
14188                        )?;
14189                    } else {
14190                        unreachable!()
14191                    }
14192                }
14193                2 => {
14194                    #[allow(irrefutable_let_patterns)]
14195                    if let Capability::Handle(_) = self {
14196                        // Do nothing, read the value into the object
14197                    } else {
14198                        // Initialize `self` to the right variant
14199                        *self = Capability::Handle(
14200                            fidl::new_empty!(fidl::encoding::HandleType<fidl::NullableHandle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
14201                        );
14202                    }
14203                    #[allow(irrefutable_let_patterns)]
14204                    if let Capability::Handle(ref mut val) = self {
14205                        fidl::decode!(fidl::encoding::HandleType<fidl::NullableHandle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val, decoder, _inner_offset, depth)?;
14206                    } else {
14207                        unreachable!()
14208                    }
14209                }
14210                3 => {
14211                    #[allow(irrefutable_let_patterns)]
14212                    if let Capability::Data(_) = self {
14213                        // Do nothing, read the value into the object
14214                    } else {
14215                        // Initialize `self` to the right variant
14216                        *self = Capability::Data(fidl::new_empty!(
14217                            Data,
14218                            fidl::encoding::DefaultFuchsiaResourceDialect
14219                        ));
14220                    }
14221                    #[allow(irrefutable_let_patterns)]
14222                    if let Capability::Data(ref mut val) = self {
14223                        fidl::decode!(
14224                            Data,
14225                            fidl::encoding::DefaultFuchsiaResourceDialect,
14226                            val,
14227                            decoder,
14228                            _inner_offset,
14229                            depth
14230                        )?;
14231                    } else {
14232                        unreachable!()
14233                    }
14234                }
14235                4 => {
14236                    #[allow(irrefutable_let_patterns)]
14237                    if let Capability::Dictionary(_) = self {
14238                        // Do nothing, read the value into the object
14239                    } else {
14240                        // Initialize `self` to the right variant
14241                        *self = Capability::Dictionary(fidl::new_empty!(
14242                            DictionaryRef,
14243                            fidl::encoding::DefaultFuchsiaResourceDialect
14244                        ));
14245                    }
14246                    #[allow(irrefutable_let_patterns)]
14247                    if let Capability::Dictionary(ref mut val) = self {
14248                        fidl::decode!(
14249                            DictionaryRef,
14250                            fidl::encoding::DefaultFuchsiaResourceDialect,
14251                            val,
14252                            decoder,
14253                            _inner_offset,
14254                            depth
14255                        )?;
14256                    } else {
14257                        unreachable!()
14258                    }
14259                }
14260                5 => {
14261                    #[allow(irrefutable_let_patterns)]
14262                    if let Capability::Connector(_) = self {
14263                        // Do nothing, read the value into the object
14264                    } else {
14265                        // Initialize `self` to the right variant
14266                        *self = Capability::Connector(fidl::new_empty!(
14267                            Connector,
14268                            fidl::encoding::DefaultFuchsiaResourceDialect
14269                        ));
14270                    }
14271                    #[allow(irrefutable_let_patterns)]
14272                    if let Capability::Connector(ref mut val) = self {
14273                        fidl::decode!(
14274                            Connector,
14275                            fidl::encoding::DefaultFuchsiaResourceDialect,
14276                            val,
14277                            decoder,
14278                            _inner_offset,
14279                            depth
14280                        )?;
14281                    } else {
14282                        unreachable!()
14283                    }
14284                }
14285                6 => {
14286                    #[allow(irrefutable_let_patterns)]
14287                    if let Capability::DirConnector(_) = self {
14288                        // Do nothing, read the value into the object
14289                    } else {
14290                        // Initialize `self` to the right variant
14291                        *self = Capability::DirConnector(fidl::new_empty!(
14292                            DirConnector,
14293                            fidl::encoding::DefaultFuchsiaResourceDialect
14294                        ));
14295                    }
14296                    #[allow(irrefutable_let_patterns)]
14297                    if let Capability::DirConnector(ref mut val) = self {
14298                        fidl::decode!(
14299                            DirConnector,
14300                            fidl::encoding::DefaultFuchsiaResourceDialect,
14301                            val,
14302                            decoder,
14303                            _inner_offset,
14304                            depth
14305                        )?;
14306                    } else {
14307                        unreachable!()
14308                    }
14309                }
14310                7 => {
14311                    #[allow(irrefutable_let_patterns)]
14312                    if let Capability::Directory(_) = self {
14313                        // Do nothing, read the value into the object
14314                    } else {
14315                        // Initialize `self` to the right variant
14316                        *self = Capability::Directory(fidl::new_empty!(
14317                            fidl::encoding::Endpoint<
14318                                fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
14319                            >,
14320                            fidl::encoding::DefaultFuchsiaResourceDialect
14321                        ));
14322                    }
14323                    #[allow(irrefutable_let_patterns)]
14324                    if let Capability::Directory(ref mut val) = self {
14325                        fidl::decode!(
14326                            fidl::encoding::Endpoint<
14327                                fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
14328                            >,
14329                            fidl::encoding::DefaultFuchsiaResourceDialect,
14330                            val,
14331                            decoder,
14332                            _inner_offset,
14333                            depth
14334                        )?;
14335                    } else {
14336                        unreachable!()
14337                    }
14338                }
14339                8 => {
14340                    #[allow(irrefutable_let_patterns)]
14341                    if let Capability::DirEntry(_) = self {
14342                        // Do nothing, read the value into the object
14343                    } else {
14344                        // Initialize `self` to the right variant
14345                        *self = Capability::DirEntry(fidl::new_empty!(
14346                            DirEntry,
14347                            fidl::encoding::DefaultFuchsiaResourceDialect
14348                        ));
14349                    }
14350                    #[allow(irrefutable_let_patterns)]
14351                    if let Capability::DirEntry(ref mut val) = self {
14352                        fidl::decode!(
14353                            DirEntry,
14354                            fidl::encoding::DefaultFuchsiaResourceDialect,
14355                            val,
14356                            decoder,
14357                            _inner_offset,
14358                            depth
14359                        )?;
14360                    } else {
14361                        unreachable!()
14362                    }
14363                }
14364                9 => {
14365                    #[allow(irrefutable_let_patterns)]
14366                    if let Capability::ConnectorRouter(_) = self {
14367                        // Do nothing, read the value into the object
14368                    } else {
14369                        // Initialize `self` to the right variant
14370                        *self = Capability::ConnectorRouter(fidl::new_empty!(
14371                            fidl::encoding::Endpoint<
14372                                fidl::endpoints::ClientEnd<ConnectorRouterMarker>,
14373                            >,
14374                            fidl::encoding::DefaultFuchsiaResourceDialect
14375                        ));
14376                    }
14377                    #[allow(irrefutable_let_patterns)]
14378                    if let Capability::ConnectorRouter(ref mut val) = self {
14379                        fidl::decode!(
14380                            fidl::encoding::Endpoint<
14381                                fidl::endpoints::ClientEnd<ConnectorRouterMarker>,
14382                            >,
14383                            fidl::encoding::DefaultFuchsiaResourceDialect,
14384                            val,
14385                            decoder,
14386                            _inner_offset,
14387                            depth
14388                        )?;
14389                    } else {
14390                        unreachable!()
14391                    }
14392                }
14393                10 => {
14394                    #[allow(irrefutable_let_patterns)]
14395                    if let Capability::DictionaryRouter(_) = self {
14396                        // Do nothing, read the value into the object
14397                    } else {
14398                        // Initialize `self` to the right variant
14399                        *self = Capability::DictionaryRouter(fidl::new_empty!(
14400                            fidl::encoding::Endpoint<
14401                                fidl::endpoints::ClientEnd<DictionaryRouterMarker>,
14402                            >,
14403                            fidl::encoding::DefaultFuchsiaResourceDialect
14404                        ));
14405                    }
14406                    #[allow(irrefutable_let_patterns)]
14407                    if let Capability::DictionaryRouter(ref mut val) = self {
14408                        fidl::decode!(
14409                            fidl::encoding::Endpoint<
14410                                fidl::endpoints::ClientEnd<DictionaryRouterMarker>,
14411                            >,
14412                            fidl::encoding::DefaultFuchsiaResourceDialect,
14413                            val,
14414                            decoder,
14415                            _inner_offset,
14416                            depth
14417                        )?;
14418                    } else {
14419                        unreachable!()
14420                    }
14421                }
14422                11 => {
14423                    #[allow(irrefutable_let_patterns)]
14424                    if let Capability::DirEntryRouter(_) = self {
14425                        // Do nothing, read the value into the object
14426                    } else {
14427                        // Initialize `self` to the right variant
14428                        *self = Capability::DirEntryRouter(fidl::new_empty!(
14429                            fidl::encoding::Endpoint<
14430                                fidl::endpoints::ClientEnd<DirEntryRouterMarker>,
14431                            >,
14432                            fidl::encoding::DefaultFuchsiaResourceDialect
14433                        ));
14434                    }
14435                    #[allow(irrefutable_let_patterns)]
14436                    if let Capability::DirEntryRouter(ref mut val) = self {
14437                        fidl::decode!(
14438                            fidl::encoding::Endpoint<
14439                                fidl::endpoints::ClientEnd<DirEntryRouterMarker>,
14440                            >,
14441                            fidl::encoding::DefaultFuchsiaResourceDialect,
14442                            val,
14443                            decoder,
14444                            _inner_offset,
14445                            depth
14446                        )?;
14447                    } else {
14448                        unreachable!()
14449                    }
14450                }
14451                12 => {
14452                    #[allow(irrefutable_let_patterns)]
14453                    if let Capability::DataRouter(_) = self {
14454                        // Do nothing, read the value into the object
14455                    } else {
14456                        // Initialize `self` to the right variant
14457                        *self = Capability::DataRouter(fidl::new_empty!(
14458                            fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DataRouterMarker>>,
14459                            fidl::encoding::DefaultFuchsiaResourceDialect
14460                        ));
14461                    }
14462                    #[allow(irrefutable_let_patterns)]
14463                    if let Capability::DataRouter(ref mut val) = self {
14464                        fidl::decode!(
14465                            fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DataRouterMarker>>,
14466                            fidl::encoding::DefaultFuchsiaResourceDialect,
14467                            val,
14468                            decoder,
14469                            _inner_offset,
14470                            depth
14471                        )?;
14472                    } else {
14473                        unreachable!()
14474                    }
14475                }
14476                13 => {
14477                    #[allow(irrefutable_let_patterns)]
14478                    if let Capability::DirConnectorRouter(_) = self {
14479                        // Do nothing, read the value into the object
14480                    } else {
14481                        // Initialize `self` to the right variant
14482                        *self = Capability::DirConnectorRouter(fidl::new_empty!(
14483                            fidl::encoding::Endpoint<
14484                                fidl::endpoints::ClientEnd<DirConnectorRouterMarker>,
14485                            >,
14486                            fidl::encoding::DefaultFuchsiaResourceDialect
14487                        ));
14488                    }
14489                    #[allow(irrefutable_let_patterns)]
14490                    if let Capability::DirConnectorRouter(ref mut val) = self {
14491                        fidl::decode!(
14492                            fidl::encoding::Endpoint<
14493                                fidl::endpoints::ClientEnd<DirConnectorRouterMarker>,
14494                            >,
14495                            fidl::encoding::DefaultFuchsiaResourceDialect,
14496                            val,
14497                            decoder,
14498                            _inner_offset,
14499                            depth
14500                        )?;
14501                    } else {
14502                        unreachable!()
14503                    }
14504                }
14505                #[allow(deprecated)]
14506                ordinal => {
14507                    for _ in 0..num_handles {
14508                        decoder.drop_next_handle()?;
14509                    }
14510                    *self = Capability::__SourceBreaking { unknown_ordinal: ordinal };
14511                }
14512            }
14513            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
14514                return Err(fidl::Error::InvalidNumBytesInEnvelope);
14515            }
14516            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14517                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14518            }
14519            Ok(())
14520        }
14521    }
14522
14523    impl fidl::encoding::ResourceTypeMarker for ConnectorRouterRouteResponse {
14524        type Borrowed<'a> = &'a mut Self;
14525        fn take_or_borrow<'a>(
14526            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14527        ) -> Self::Borrowed<'a> {
14528            value
14529        }
14530    }
14531
14532    unsafe impl fidl::encoding::TypeMarker for ConnectorRouterRouteResponse {
14533        type Owned = Self;
14534
14535        #[inline(always)]
14536        fn inline_align(_context: fidl::encoding::Context) -> usize {
14537            8
14538        }
14539
14540        #[inline(always)]
14541        fn inline_size(_context: fidl::encoding::Context) -> usize {
14542            16
14543        }
14544    }
14545
14546    unsafe impl
14547        fidl::encoding::Encode<
14548            ConnectorRouterRouteResponse,
14549            fidl::encoding::DefaultFuchsiaResourceDialect,
14550        > for &mut ConnectorRouterRouteResponse
14551    {
14552        #[inline]
14553        unsafe fn encode(
14554            self,
14555            encoder: &mut fidl::encoding::Encoder<
14556                '_,
14557                fidl::encoding::DefaultFuchsiaResourceDialect,
14558            >,
14559            offset: usize,
14560            _depth: fidl::encoding::Depth,
14561        ) -> fidl::Result<()> {
14562            encoder.debug_check_bounds::<ConnectorRouterRouteResponse>(offset);
14563            encoder.write_num::<u64>(self.ordinal(), offset);
14564            match self {
14565                ConnectorRouterRouteResponse::Connector(ref mut val) => {
14566                    fidl::encoding::encode_in_envelope::<
14567                        Connector,
14568                        fidl::encoding::DefaultFuchsiaResourceDialect,
14569                    >(
14570                        <Connector as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
14571                        encoder,
14572                        offset + 8,
14573                        _depth,
14574                    )
14575                }
14576                ConnectorRouterRouteResponse::Unavailable(ref val) => {
14577                    fidl::encoding::encode_in_envelope::<
14578                        Unit,
14579                        fidl::encoding::DefaultFuchsiaResourceDialect,
14580                    >(
14581                        <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
14582                        encoder,
14583                        offset + 8,
14584                        _depth,
14585                    )
14586                }
14587            }
14588        }
14589    }
14590
14591    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14592        for ConnectorRouterRouteResponse
14593    {
14594        #[inline(always)]
14595        fn new_empty() -> Self {
14596            Self::Connector(fidl::new_empty!(
14597                Connector,
14598                fidl::encoding::DefaultFuchsiaResourceDialect
14599            ))
14600        }
14601
14602        #[inline]
14603        unsafe fn decode(
14604            &mut self,
14605            decoder: &mut fidl::encoding::Decoder<
14606                '_,
14607                fidl::encoding::DefaultFuchsiaResourceDialect,
14608            >,
14609            offset: usize,
14610            mut depth: fidl::encoding::Depth,
14611        ) -> fidl::Result<()> {
14612            decoder.debug_check_bounds::<Self>(offset);
14613            #[allow(unused_variables)]
14614            let next_out_of_line = decoder.next_out_of_line();
14615            let handles_before = decoder.remaining_handles();
14616            let (ordinal, inlined, num_bytes, num_handles) =
14617                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
14618
14619            let member_inline_size = match ordinal {
14620                1 => <Connector as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14621                2 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14622                _ => return Err(fidl::Error::UnknownUnionTag),
14623            };
14624
14625            if inlined != (member_inline_size <= 4) {
14626                return Err(fidl::Error::InvalidInlineBitInEnvelope);
14627            }
14628            let _inner_offset;
14629            if inlined {
14630                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
14631                _inner_offset = offset + 8;
14632            } else {
14633                depth.increment()?;
14634                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14635            }
14636            match ordinal {
14637                1 => {
14638                    #[allow(irrefutable_let_patterns)]
14639                    if let ConnectorRouterRouteResponse::Connector(_) = self {
14640                        // Do nothing, read the value into the object
14641                    } else {
14642                        // Initialize `self` to the right variant
14643                        *self = ConnectorRouterRouteResponse::Connector(fidl::new_empty!(
14644                            Connector,
14645                            fidl::encoding::DefaultFuchsiaResourceDialect
14646                        ));
14647                    }
14648                    #[allow(irrefutable_let_patterns)]
14649                    if let ConnectorRouterRouteResponse::Connector(ref mut val) = self {
14650                        fidl::decode!(
14651                            Connector,
14652                            fidl::encoding::DefaultFuchsiaResourceDialect,
14653                            val,
14654                            decoder,
14655                            _inner_offset,
14656                            depth
14657                        )?;
14658                    } else {
14659                        unreachable!()
14660                    }
14661                }
14662                2 => {
14663                    #[allow(irrefutable_let_patterns)]
14664                    if let ConnectorRouterRouteResponse::Unavailable(_) = self {
14665                        // Do nothing, read the value into the object
14666                    } else {
14667                        // Initialize `self` to the right variant
14668                        *self = ConnectorRouterRouteResponse::Unavailable(fidl::new_empty!(
14669                            Unit,
14670                            fidl::encoding::DefaultFuchsiaResourceDialect
14671                        ));
14672                    }
14673                    #[allow(irrefutable_let_patterns)]
14674                    if let ConnectorRouterRouteResponse::Unavailable(ref mut val) = self {
14675                        fidl::decode!(
14676                            Unit,
14677                            fidl::encoding::DefaultFuchsiaResourceDialect,
14678                            val,
14679                            decoder,
14680                            _inner_offset,
14681                            depth
14682                        )?;
14683                    } else {
14684                        unreachable!()
14685                    }
14686                }
14687                ordinal => panic!("unexpected ordinal {:?}", ordinal),
14688            }
14689            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
14690                return Err(fidl::Error::InvalidNumBytesInEnvelope);
14691            }
14692            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14693                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14694            }
14695            Ok(())
14696        }
14697    }
14698
14699    impl fidl::encoding::ResourceTypeMarker for DataRouterRouteResponse {
14700        type Borrowed<'a> = &'a mut Self;
14701        fn take_or_borrow<'a>(
14702            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14703        ) -> Self::Borrowed<'a> {
14704            value
14705        }
14706    }
14707
14708    unsafe impl fidl::encoding::TypeMarker for DataRouterRouteResponse {
14709        type Owned = Self;
14710
14711        #[inline(always)]
14712        fn inline_align(_context: fidl::encoding::Context) -> usize {
14713            8
14714        }
14715
14716        #[inline(always)]
14717        fn inline_size(_context: fidl::encoding::Context) -> usize {
14718            16
14719        }
14720    }
14721
14722    unsafe impl
14723        fidl::encoding::Encode<
14724            DataRouterRouteResponse,
14725            fidl::encoding::DefaultFuchsiaResourceDialect,
14726        > for &mut DataRouterRouteResponse
14727    {
14728        #[inline]
14729        unsafe fn encode(
14730            self,
14731            encoder: &mut fidl::encoding::Encoder<
14732                '_,
14733                fidl::encoding::DefaultFuchsiaResourceDialect,
14734            >,
14735            offset: usize,
14736            _depth: fidl::encoding::Depth,
14737        ) -> fidl::Result<()> {
14738            encoder.debug_check_bounds::<DataRouterRouteResponse>(offset);
14739            encoder.write_num::<u64>(self.ordinal(), offset);
14740            match self {
14741                DataRouterRouteResponse::Data(ref val) => fidl::encoding::encode_in_envelope::<
14742                    Data,
14743                    fidl::encoding::DefaultFuchsiaResourceDialect,
14744                >(
14745                    <Data as fidl::encoding::ValueTypeMarker>::borrow(val),
14746                    encoder,
14747                    offset + 8,
14748                    _depth,
14749                ),
14750                DataRouterRouteResponse::Unavailable(ref val) => {
14751                    fidl::encoding::encode_in_envelope::<
14752                        Unit,
14753                        fidl::encoding::DefaultFuchsiaResourceDialect,
14754                    >(
14755                        <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
14756                        encoder,
14757                        offset + 8,
14758                        _depth,
14759                    )
14760                }
14761            }
14762        }
14763    }
14764
14765    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14766        for DataRouterRouteResponse
14767    {
14768        #[inline(always)]
14769        fn new_empty() -> Self {
14770            Self::Data(fidl::new_empty!(Data, fidl::encoding::DefaultFuchsiaResourceDialect))
14771        }
14772
14773        #[inline]
14774        unsafe fn decode(
14775            &mut self,
14776            decoder: &mut fidl::encoding::Decoder<
14777                '_,
14778                fidl::encoding::DefaultFuchsiaResourceDialect,
14779            >,
14780            offset: usize,
14781            mut depth: fidl::encoding::Depth,
14782        ) -> fidl::Result<()> {
14783            decoder.debug_check_bounds::<Self>(offset);
14784            #[allow(unused_variables)]
14785            let next_out_of_line = decoder.next_out_of_line();
14786            let handles_before = decoder.remaining_handles();
14787            let (ordinal, inlined, num_bytes, num_handles) =
14788                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
14789
14790            let member_inline_size = match ordinal {
14791                1 => <Data as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14792                2 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14793                _ => return Err(fidl::Error::UnknownUnionTag),
14794            };
14795
14796            if inlined != (member_inline_size <= 4) {
14797                return Err(fidl::Error::InvalidInlineBitInEnvelope);
14798            }
14799            let _inner_offset;
14800            if inlined {
14801                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
14802                _inner_offset = offset + 8;
14803            } else {
14804                depth.increment()?;
14805                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14806            }
14807            match ordinal {
14808                1 => {
14809                    #[allow(irrefutable_let_patterns)]
14810                    if let DataRouterRouteResponse::Data(_) = self {
14811                        // Do nothing, read the value into the object
14812                    } else {
14813                        // Initialize `self` to the right variant
14814                        *self = DataRouterRouteResponse::Data(fidl::new_empty!(
14815                            Data,
14816                            fidl::encoding::DefaultFuchsiaResourceDialect
14817                        ));
14818                    }
14819                    #[allow(irrefutable_let_patterns)]
14820                    if let DataRouterRouteResponse::Data(ref mut val) = self {
14821                        fidl::decode!(
14822                            Data,
14823                            fidl::encoding::DefaultFuchsiaResourceDialect,
14824                            val,
14825                            decoder,
14826                            _inner_offset,
14827                            depth
14828                        )?;
14829                    } else {
14830                        unreachable!()
14831                    }
14832                }
14833                2 => {
14834                    #[allow(irrefutable_let_patterns)]
14835                    if let DataRouterRouteResponse::Unavailable(_) = self {
14836                        // Do nothing, read the value into the object
14837                    } else {
14838                        // Initialize `self` to the right variant
14839                        *self = DataRouterRouteResponse::Unavailable(fidl::new_empty!(
14840                            Unit,
14841                            fidl::encoding::DefaultFuchsiaResourceDialect
14842                        ));
14843                    }
14844                    #[allow(irrefutable_let_patterns)]
14845                    if let DataRouterRouteResponse::Unavailable(ref mut val) = self {
14846                        fidl::decode!(
14847                            Unit,
14848                            fidl::encoding::DefaultFuchsiaResourceDialect,
14849                            val,
14850                            decoder,
14851                            _inner_offset,
14852                            depth
14853                        )?;
14854                    } else {
14855                        unreachable!()
14856                    }
14857                }
14858                ordinal => panic!("unexpected ordinal {:?}", ordinal),
14859            }
14860            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
14861                return Err(fidl::Error::InvalidNumBytesInEnvelope);
14862            }
14863            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14864                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14865            }
14866            Ok(())
14867        }
14868    }
14869
14870    impl fidl::encoding::ResourceTypeMarker for DictionaryRouterRouteResponse {
14871        type Borrowed<'a> = &'a mut Self;
14872        fn take_or_borrow<'a>(
14873            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14874        ) -> Self::Borrowed<'a> {
14875            value
14876        }
14877    }
14878
14879    unsafe impl fidl::encoding::TypeMarker for DictionaryRouterRouteResponse {
14880        type Owned = Self;
14881
14882        #[inline(always)]
14883        fn inline_align(_context: fidl::encoding::Context) -> usize {
14884            8
14885        }
14886
14887        #[inline(always)]
14888        fn inline_size(_context: fidl::encoding::Context) -> usize {
14889            16
14890        }
14891    }
14892
14893    unsafe impl
14894        fidl::encoding::Encode<
14895            DictionaryRouterRouteResponse,
14896            fidl::encoding::DefaultFuchsiaResourceDialect,
14897        > for &mut DictionaryRouterRouteResponse
14898    {
14899        #[inline]
14900        unsafe fn encode(
14901            self,
14902            encoder: &mut fidl::encoding::Encoder<
14903                '_,
14904                fidl::encoding::DefaultFuchsiaResourceDialect,
14905            >,
14906            offset: usize,
14907            _depth: fidl::encoding::Depth,
14908        ) -> fidl::Result<()> {
14909            encoder.debug_check_bounds::<DictionaryRouterRouteResponse>(offset);
14910            encoder.write_num::<u64>(self.ordinal(), offset);
14911            match self {
14912                DictionaryRouterRouteResponse::Dictionary(ref mut val) => {
14913                    fidl::encoding::encode_in_envelope::<
14914                        DictionaryRef,
14915                        fidl::encoding::DefaultFuchsiaResourceDialect,
14916                    >(
14917                        <DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
14918                        encoder,
14919                        offset + 8,
14920                        _depth,
14921                    )
14922                }
14923                DictionaryRouterRouteResponse::Unavailable(ref val) => {
14924                    fidl::encoding::encode_in_envelope::<
14925                        Unit,
14926                        fidl::encoding::DefaultFuchsiaResourceDialect,
14927                    >(
14928                        <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
14929                        encoder,
14930                        offset + 8,
14931                        _depth,
14932                    )
14933                }
14934            }
14935        }
14936    }
14937
14938    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14939        for DictionaryRouterRouteResponse
14940    {
14941        #[inline(always)]
14942        fn new_empty() -> Self {
14943            Self::Dictionary(fidl::new_empty!(
14944                DictionaryRef,
14945                fidl::encoding::DefaultFuchsiaResourceDialect
14946            ))
14947        }
14948
14949        #[inline]
14950        unsafe fn decode(
14951            &mut self,
14952            decoder: &mut fidl::encoding::Decoder<
14953                '_,
14954                fidl::encoding::DefaultFuchsiaResourceDialect,
14955            >,
14956            offset: usize,
14957            mut depth: fidl::encoding::Depth,
14958        ) -> fidl::Result<()> {
14959            decoder.debug_check_bounds::<Self>(offset);
14960            #[allow(unused_variables)]
14961            let next_out_of_line = decoder.next_out_of_line();
14962            let handles_before = decoder.remaining_handles();
14963            let (ordinal, inlined, num_bytes, num_handles) =
14964                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
14965
14966            let member_inline_size = match ordinal {
14967                1 => <DictionaryRef as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14968                2 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14969                _ => return Err(fidl::Error::UnknownUnionTag),
14970            };
14971
14972            if inlined != (member_inline_size <= 4) {
14973                return Err(fidl::Error::InvalidInlineBitInEnvelope);
14974            }
14975            let _inner_offset;
14976            if inlined {
14977                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
14978                _inner_offset = offset + 8;
14979            } else {
14980                depth.increment()?;
14981                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14982            }
14983            match ordinal {
14984                1 => {
14985                    #[allow(irrefutable_let_patterns)]
14986                    if let DictionaryRouterRouteResponse::Dictionary(_) = self {
14987                        // Do nothing, read the value into the object
14988                    } else {
14989                        // Initialize `self` to the right variant
14990                        *self = DictionaryRouterRouteResponse::Dictionary(fidl::new_empty!(
14991                            DictionaryRef,
14992                            fidl::encoding::DefaultFuchsiaResourceDialect
14993                        ));
14994                    }
14995                    #[allow(irrefutable_let_patterns)]
14996                    if let DictionaryRouterRouteResponse::Dictionary(ref mut val) = self {
14997                        fidl::decode!(
14998                            DictionaryRef,
14999                            fidl::encoding::DefaultFuchsiaResourceDialect,
15000                            val,
15001                            decoder,
15002                            _inner_offset,
15003                            depth
15004                        )?;
15005                    } else {
15006                        unreachable!()
15007                    }
15008                }
15009                2 => {
15010                    #[allow(irrefutable_let_patterns)]
15011                    if let DictionaryRouterRouteResponse::Unavailable(_) = self {
15012                        // Do nothing, read the value into the object
15013                    } else {
15014                        // Initialize `self` to the right variant
15015                        *self = DictionaryRouterRouteResponse::Unavailable(fidl::new_empty!(
15016                            Unit,
15017                            fidl::encoding::DefaultFuchsiaResourceDialect
15018                        ));
15019                    }
15020                    #[allow(irrefutable_let_patterns)]
15021                    if let DictionaryRouterRouteResponse::Unavailable(ref mut val) = self {
15022                        fidl::decode!(
15023                            Unit,
15024                            fidl::encoding::DefaultFuchsiaResourceDialect,
15025                            val,
15026                            decoder,
15027                            _inner_offset,
15028                            depth
15029                        )?;
15030                    } else {
15031                        unreachable!()
15032                    }
15033                }
15034                ordinal => panic!("unexpected ordinal {:?}", ordinal),
15035            }
15036            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
15037                return Err(fidl::Error::InvalidNumBytesInEnvelope);
15038            }
15039            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15040                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15041            }
15042            Ok(())
15043        }
15044    }
15045
15046    impl fidl::encoding::ResourceTypeMarker for DirConnectorRouterRouteResponse {
15047        type Borrowed<'a> = &'a mut Self;
15048        fn take_or_borrow<'a>(
15049            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
15050        ) -> Self::Borrowed<'a> {
15051            value
15052        }
15053    }
15054
15055    unsafe impl fidl::encoding::TypeMarker for DirConnectorRouterRouteResponse {
15056        type Owned = Self;
15057
15058        #[inline(always)]
15059        fn inline_align(_context: fidl::encoding::Context) -> usize {
15060            8
15061        }
15062
15063        #[inline(always)]
15064        fn inline_size(_context: fidl::encoding::Context) -> usize {
15065            16
15066        }
15067    }
15068
15069    unsafe impl
15070        fidl::encoding::Encode<
15071            DirConnectorRouterRouteResponse,
15072            fidl::encoding::DefaultFuchsiaResourceDialect,
15073        > for &mut DirConnectorRouterRouteResponse
15074    {
15075        #[inline]
15076        unsafe fn encode(
15077            self,
15078            encoder: &mut fidl::encoding::Encoder<
15079                '_,
15080                fidl::encoding::DefaultFuchsiaResourceDialect,
15081            >,
15082            offset: usize,
15083            _depth: fidl::encoding::Depth,
15084        ) -> fidl::Result<()> {
15085            encoder.debug_check_bounds::<DirConnectorRouterRouteResponse>(offset);
15086            encoder.write_num::<u64>(self.ordinal(), offset);
15087            match self {
15088                DirConnectorRouterRouteResponse::DirConnector(ref mut val) => {
15089                    fidl::encoding::encode_in_envelope::<
15090                        DirConnector,
15091                        fidl::encoding::DefaultFuchsiaResourceDialect,
15092                    >(
15093                        <DirConnector as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
15094                        encoder,
15095                        offset + 8,
15096                        _depth,
15097                    )
15098                }
15099                DirConnectorRouterRouteResponse::Unavailable(ref val) => {
15100                    fidl::encoding::encode_in_envelope::<
15101                        Unit,
15102                        fidl::encoding::DefaultFuchsiaResourceDialect,
15103                    >(
15104                        <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
15105                        encoder,
15106                        offset + 8,
15107                        _depth,
15108                    )
15109                }
15110            }
15111        }
15112    }
15113
15114    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
15115        for DirConnectorRouterRouteResponse
15116    {
15117        #[inline(always)]
15118        fn new_empty() -> Self {
15119            Self::DirConnector(fidl::new_empty!(
15120                DirConnector,
15121                fidl::encoding::DefaultFuchsiaResourceDialect
15122            ))
15123        }
15124
15125        #[inline]
15126        unsafe fn decode(
15127            &mut self,
15128            decoder: &mut fidl::encoding::Decoder<
15129                '_,
15130                fidl::encoding::DefaultFuchsiaResourceDialect,
15131            >,
15132            offset: usize,
15133            mut depth: fidl::encoding::Depth,
15134        ) -> fidl::Result<()> {
15135            decoder.debug_check_bounds::<Self>(offset);
15136            #[allow(unused_variables)]
15137            let next_out_of_line = decoder.next_out_of_line();
15138            let handles_before = decoder.remaining_handles();
15139            let (ordinal, inlined, num_bytes, num_handles) =
15140                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
15141
15142            let member_inline_size = match ordinal {
15143                1 => <DirConnector as fidl::encoding::TypeMarker>::inline_size(decoder.context),
15144                2 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
15145                _ => return Err(fidl::Error::UnknownUnionTag),
15146            };
15147
15148            if inlined != (member_inline_size <= 4) {
15149                return Err(fidl::Error::InvalidInlineBitInEnvelope);
15150            }
15151            let _inner_offset;
15152            if inlined {
15153                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
15154                _inner_offset = offset + 8;
15155            } else {
15156                depth.increment()?;
15157                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15158            }
15159            match ordinal {
15160                1 => {
15161                    #[allow(irrefutable_let_patterns)]
15162                    if let DirConnectorRouterRouteResponse::DirConnector(_) = self {
15163                        // Do nothing, read the value into the object
15164                    } else {
15165                        // Initialize `self` to the right variant
15166                        *self = DirConnectorRouterRouteResponse::DirConnector(fidl::new_empty!(
15167                            DirConnector,
15168                            fidl::encoding::DefaultFuchsiaResourceDialect
15169                        ));
15170                    }
15171                    #[allow(irrefutable_let_patterns)]
15172                    if let DirConnectorRouterRouteResponse::DirConnector(ref mut val) = self {
15173                        fidl::decode!(
15174                            DirConnector,
15175                            fidl::encoding::DefaultFuchsiaResourceDialect,
15176                            val,
15177                            decoder,
15178                            _inner_offset,
15179                            depth
15180                        )?;
15181                    } else {
15182                        unreachable!()
15183                    }
15184                }
15185                2 => {
15186                    #[allow(irrefutable_let_patterns)]
15187                    if let DirConnectorRouterRouteResponse::Unavailable(_) = self {
15188                        // Do nothing, read the value into the object
15189                    } else {
15190                        // Initialize `self` to the right variant
15191                        *self = DirConnectorRouterRouteResponse::Unavailable(fidl::new_empty!(
15192                            Unit,
15193                            fidl::encoding::DefaultFuchsiaResourceDialect
15194                        ));
15195                    }
15196                    #[allow(irrefutable_let_patterns)]
15197                    if let DirConnectorRouterRouteResponse::Unavailable(ref mut val) = self {
15198                        fidl::decode!(
15199                            Unit,
15200                            fidl::encoding::DefaultFuchsiaResourceDialect,
15201                            val,
15202                            decoder,
15203                            _inner_offset,
15204                            depth
15205                        )?;
15206                    } else {
15207                        unreachable!()
15208                    }
15209                }
15210                ordinal => panic!("unexpected ordinal {:?}", ordinal),
15211            }
15212            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
15213                return Err(fidl::Error::InvalidNumBytesInEnvelope);
15214            }
15215            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15216                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15217            }
15218            Ok(())
15219        }
15220    }
15221
15222    impl fidl::encoding::ResourceTypeMarker for DirEntryRouterRouteResponse {
15223        type Borrowed<'a> = &'a mut Self;
15224        fn take_or_borrow<'a>(
15225            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
15226        ) -> Self::Borrowed<'a> {
15227            value
15228        }
15229    }
15230
15231    unsafe impl fidl::encoding::TypeMarker for DirEntryRouterRouteResponse {
15232        type Owned = Self;
15233
15234        #[inline(always)]
15235        fn inline_align(_context: fidl::encoding::Context) -> usize {
15236            8
15237        }
15238
15239        #[inline(always)]
15240        fn inline_size(_context: fidl::encoding::Context) -> usize {
15241            16
15242        }
15243    }
15244
15245    unsafe impl
15246        fidl::encoding::Encode<
15247            DirEntryRouterRouteResponse,
15248            fidl::encoding::DefaultFuchsiaResourceDialect,
15249        > for &mut DirEntryRouterRouteResponse
15250    {
15251        #[inline]
15252        unsafe fn encode(
15253            self,
15254            encoder: &mut fidl::encoding::Encoder<
15255                '_,
15256                fidl::encoding::DefaultFuchsiaResourceDialect,
15257            >,
15258            offset: usize,
15259            _depth: fidl::encoding::Depth,
15260        ) -> fidl::Result<()> {
15261            encoder.debug_check_bounds::<DirEntryRouterRouteResponse>(offset);
15262            encoder.write_num::<u64>(self.ordinal(), offset);
15263            match self {
15264                DirEntryRouterRouteResponse::DirEntry(ref mut val) => {
15265                    fidl::encoding::encode_in_envelope::<
15266                        DirEntry,
15267                        fidl::encoding::DefaultFuchsiaResourceDialect,
15268                    >(
15269                        <DirEntry as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
15270                        encoder,
15271                        offset + 8,
15272                        _depth,
15273                    )
15274                }
15275                DirEntryRouterRouteResponse::Unavailable(ref val) => {
15276                    fidl::encoding::encode_in_envelope::<
15277                        Unit,
15278                        fidl::encoding::DefaultFuchsiaResourceDialect,
15279                    >(
15280                        <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
15281                        encoder,
15282                        offset + 8,
15283                        _depth,
15284                    )
15285                }
15286            }
15287        }
15288    }
15289
15290    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
15291        for DirEntryRouterRouteResponse
15292    {
15293        #[inline(always)]
15294        fn new_empty() -> Self {
15295            Self::DirEntry(fidl::new_empty!(
15296                DirEntry,
15297                fidl::encoding::DefaultFuchsiaResourceDialect
15298            ))
15299        }
15300
15301        #[inline]
15302        unsafe fn decode(
15303            &mut self,
15304            decoder: &mut fidl::encoding::Decoder<
15305                '_,
15306                fidl::encoding::DefaultFuchsiaResourceDialect,
15307            >,
15308            offset: usize,
15309            mut depth: fidl::encoding::Depth,
15310        ) -> fidl::Result<()> {
15311            decoder.debug_check_bounds::<Self>(offset);
15312            #[allow(unused_variables)]
15313            let next_out_of_line = decoder.next_out_of_line();
15314            let handles_before = decoder.remaining_handles();
15315            let (ordinal, inlined, num_bytes, num_handles) =
15316                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
15317
15318            let member_inline_size = match ordinal {
15319                1 => <DirEntry as fidl::encoding::TypeMarker>::inline_size(decoder.context),
15320                2 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
15321                _ => return Err(fidl::Error::UnknownUnionTag),
15322            };
15323
15324            if inlined != (member_inline_size <= 4) {
15325                return Err(fidl::Error::InvalidInlineBitInEnvelope);
15326            }
15327            let _inner_offset;
15328            if inlined {
15329                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
15330                _inner_offset = offset + 8;
15331            } else {
15332                depth.increment()?;
15333                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15334            }
15335            match ordinal {
15336                1 => {
15337                    #[allow(irrefutable_let_patterns)]
15338                    if let DirEntryRouterRouteResponse::DirEntry(_) = self {
15339                        // Do nothing, read the value into the object
15340                    } else {
15341                        // Initialize `self` to the right variant
15342                        *self = DirEntryRouterRouteResponse::DirEntry(fidl::new_empty!(
15343                            DirEntry,
15344                            fidl::encoding::DefaultFuchsiaResourceDialect
15345                        ));
15346                    }
15347                    #[allow(irrefutable_let_patterns)]
15348                    if let DirEntryRouterRouteResponse::DirEntry(ref mut val) = self {
15349                        fidl::decode!(
15350                            DirEntry,
15351                            fidl::encoding::DefaultFuchsiaResourceDialect,
15352                            val,
15353                            decoder,
15354                            _inner_offset,
15355                            depth
15356                        )?;
15357                    } else {
15358                        unreachable!()
15359                    }
15360                }
15361                2 => {
15362                    #[allow(irrefutable_let_patterns)]
15363                    if let DirEntryRouterRouteResponse::Unavailable(_) = self {
15364                        // Do nothing, read the value into the object
15365                    } else {
15366                        // Initialize `self` to the right variant
15367                        *self = DirEntryRouterRouteResponse::Unavailable(fidl::new_empty!(
15368                            Unit,
15369                            fidl::encoding::DefaultFuchsiaResourceDialect
15370                        ));
15371                    }
15372                    #[allow(irrefutable_let_patterns)]
15373                    if let DirEntryRouterRouteResponse::Unavailable(ref mut val) = self {
15374                        fidl::decode!(
15375                            Unit,
15376                            fidl::encoding::DefaultFuchsiaResourceDialect,
15377                            val,
15378                            decoder,
15379                            _inner_offset,
15380                            depth
15381                        )?;
15382                    } else {
15383                        unreachable!()
15384                    }
15385                }
15386                ordinal => panic!("unexpected ordinal {:?}", ordinal),
15387            }
15388            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
15389                return Err(fidl::Error::InvalidNumBytesInEnvelope);
15390            }
15391            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15392                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15393            }
15394            Ok(())
15395        }
15396    }
15397
15398    impl fidl::encoding::ResourceTypeMarker for DirectoryRouterRouteResponse {
15399        type Borrowed<'a> = &'a mut Self;
15400        fn take_or_borrow<'a>(
15401            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
15402        ) -> Self::Borrowed<'a> {
15403            value
15404        }
15405    }
15406
15407    unsafe impl fidl::encoding::TypeMarker for DirectoryRouterRouteResponse {
15408        type Owned = Self;
15409
15410        #[inline(always)]
15411        fn inline_align(_context: fidl::encoding::Context) -> usize {
15412            8
15413        }
15414
15415        #[inline(always)]
15416        fn inline_size(_context: fidl::encoding::Context) -> usize {
15417            16
15418        }
15419    }
15420
15421    unsafe impl
15422        fidl::encoding::Encode<
15423            DirectoryRouterRouteResponse,
15424            fidl::encoding::DefaultFuchsiaResourceDialect,
15425        > for &mut DirectoryRouterRouteResponse
15426    {
15427        #[inline]
15428        unsafe fn encode(
15429            self,
15430            encoder: &mut fidl::encoding::Encoder<
15431                '_,
15432                fidl::encoding::DefaultFuchsiaResourceDialect,
15433            >,
15434            offset: usize,
15435            _depth: fidl::encoding::Depth,
15436        ) -> fidl::Result<()> {
15437            encoder.debug_check_bounds::<DirectoryRouterRouteResponse>(offset);
15438            encoder.write_num::<u64>(self.ordinal(), offset);
15439            match self {
15440                DirectoryRouterRouteResponse::Directory(ref mut val) => {
15441                    fidl::encoding::encode_in_envelope::<
15442                        fidl::encoding::Endpoint<
15443                            fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
15444                        >,
15445                        fidl::encoding::DefaultFuchsiaResourceDialect,
15446                    >(
15447                        <fidl::encoding::Endpoint<
15448                            fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
15449                        > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
15450                            val
15451                        ),
15452                        encoder,
15453                        offset + 8,
15454                        _depth,
15455                    )
15456                }
15457                DirectoryRouterRouteResponse::Unavailable(ref val) => {
15458                    fidl::encoding::encode_in_envelope::<
15459                        Unit,
15460                        fidl::encoding::DefaultFuchsiaResourceDialect,
15461                    >(
15462                        <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
15463                        encoder,
15464                        offset + 8,
15465                        _depth,
15466                    )
15467                }
15468            }
15469        }
15470    }
15471
15472    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
15473        for DirectoryRouterRouteResponse
15474    {
15475        #[inline(always)]
15476        fn new_empty() -> Self {
15477            Self::Directory(fidl::new_empty!(
15478                fidl::encoding::Endpoint<
15479                    fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
15480                >,
15481                fidl::encoding::DefaultFuchsiaResourceDialect
15482            ))
15483        }
15484
15485        #[inline]
15486        unsafe fn decode(
15487            &mut self,
15488            decoder: &mut fidl::encoding::Decoder<
15489                '_,
15490                fidl::encoding::DefaultFuchsiaResourceDialect,
15491            >,
15492            offset: usize,
15493            mut depth: fidl::encoding::Depth,
15494        ) -> fidl::Result<()> {
15495            decoder.debug_check_bounds::<Self>(offset);
15496            #[allow(unused_variables)]
15497            let next_out_of_line = decoder.next_out_of_line();
15498            let handles_before = decoder.remaining_handles();
15499            let (ordinal, inlined, num_bytes, num_handles) =
15500                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
15501
15502            let member_inline_size = match ordinal {
15503                1 => <fidl::encoding::Endpoint<
15504                    fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
15505                > as fidl::encoding::TypeMarker>::inline_size(decoder.context),
15506                2 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
15507                _ => return Err(fidl::Error::UnknownUnionTag),
15508            };
15509
15510            if inlined != (member_inline_size <= 4) {
15511                return Err(fidl::Error::InvalidInlineBitInEnvelope);
15512            }
15513            let _inner_offset;
15514            if inlined {
15515                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
15516                _inner_offset = offset + 8;
15517            } else {
15518                depth.increment()?;
15519                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15520            }
15521            match ordinal {
15522                1 => {
15523                    #[allow(irrefutable_let_patterns)]
15524                    if let DirectoryRouterRouteResponse::Directory(_) = self {
15525                        // Do nothing, read the value into the object
15526                    } else {
15527                        // Initialize `self` to the right variant
15528                        *self = DirectoryRouterRouteResponse::Directory(fidl::new_empty!(
15529                            fidl::encoding::Endpoint<
15530                                fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
15531                            >,
15532                            fidl::encoding::DefaultFuchsiaResourceDialect
15533                        ));
15534                    }
15535                    #[allow(irrefutable_let_patterns)]
15536                    if let DirectoryRouterRouteResponse::Directory(ref mut val) = self {
15537                        fidl::decode!(
15538                            fidl::encoding::Endpoint<
15539                                fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
15540                            >,
15541                            fidl::encoding::DefaultFuchsiaResourceDialect,
15542                            val,
15543                            decoder,
15544                            _inner_offset,
15545                            depth
15546                        )?;
15547                    } else {
15548                        unreachable!()
15549                    }
15550                }
15551                2 => {
15552                    #[allow(irrefutable_let_patterns)]
15553                    if let DirectoryRouterRouteResponse::Unavailable(_) = self {
15554                        // Do nothing, read the value into the object
15555                    } else {
15556                        // Initialize `self` to the right variant
15557                        *self = DirectoryRouterRouteResponse::Unavailable(fidl::new_empty!(
15558                            Unit,
15559                            fidl::encoding::DefaultFuchsiaResourceDialect
15560                        ));
15561                    }
15562                    #[allow(irrefutable_let_patterns)]
15563                    if let DirectoryRouterRouteResponse::Unavailable(ref mut val) = self {
15564                        fidl::decode!(
15565                            Unit,
15566                            fidl::encoding::DefaultFuchsiaResourceDialect,
15567                            val,
15568                            decoder,
15569                            _inner_offset,
15570                            depth
15571                        )?;
15572                    } else {
15573                        unreachable!()
15574                    }
15575                }
15576                ordinal => panic!("unexpected ordinal {:?}", ordinal),
15577            }
15578            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
15579                return Err(fidl::Error::InvalidNumBytesInEnvelope);
15580            }
15581            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15582                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15583            }
15584            Ok(())
15585        }
15586    }
15587}