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, Eq, Hash, Ord, PartialEq, PartialOrd)]
107pub struct CapabilityStoreDirConnectorOpenRequest {
108    pub id: u64,
109    pub server_end: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
110}
111
112impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
113    for CapabilityStoreDirConnectorOpenRequest
114{
115}
116
117#[derive(Debug, PartialEq)]
118pub struct CapabilityStoreImportRequest {
119    pub id: u64,
120    pub capability: Capability,
121}
122
123impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
124    for CapabilityStoreImportRequest
125{
126}
127
128#[derive(Debug, PartialEq)]
129pub struct CapabilityStoreExportResponse {
130    pub capability: Capability,
131}
132
133impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
134    for CapabilityStoreExportResponse
135{
136}
137
138#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
139pub struct Connector {
140    pub token: fidl::EventPair,
141}
142
143impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Connector {}
144
145#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
146pub struct DictionaryDrainIteratorGetNextResponse {
147    pub items: Vec<DictionaryItem>,
148    pub end_id: u64,
149}
150
151impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
152    for DictionaryDrainIteratorGetNextResponse
153{
154}
155
156#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
157pub struct DictionaryEnumerateIteratorGetNextResponse {
158    pub items: Vec<DictionaryOptionalItem>,
159    pub end_id: u64,
160}
161
162impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
163    for DictionaryEnumerateIteratorGetNextResponse
164{
165}
166
167#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
168pub struct DictionaryKeysIteratorGetNextResponse {
169    pub keys: Vec<String>,
170}
171
172impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
173    for DictionaryKeysIteratorGetNextResponse
174{
175}
176
177/// A key-value pair in a [`DictionaryRef`], where the value may be elided.
178/// This is useful for APIs that may wish to omit the value, for example if it could not be
179/// duplicated.
180#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
181pub struct DictionaryOptionalItem {
182    pub key: String,
183    pub value: Option<Box<WrappedCapabilityId>>,
184}
185
186impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DictionaryOptionalItem {}
187
188#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
189pub struct DictionaryRef {
190    pub token: fidl::EventPair,
191}
192
193impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DictionaryRef {}
194
195#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
196pub struct DirConnector {
197    pub token: fidl::EventPair,
198}
199
200impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DirConnector {}
201
202#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
203pub struct DirEntry {
204    pub token: fidl::EventPair,
205}
206
207impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DirEntry {}
208
209#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
210pub struct DirReceiverReceiveRequest {
211    pub channel: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
212}
213
214impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DirReceiverReceiveRequest {}
215
216/// Represents an instance in the component tree, either a component
217/// instance or component manager's instance.
218#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
219pub struct InstanceToken {
220    pub token: fidl::EventPair,
221}
222
223impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for InstanceToken {}
224
225/// Contains a protocol open request.
226#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
227pub struct ProtocolPayload {
228    pub channel: fidl::Channel,
229}
230
231impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ProtocolPayload {}
232
233/// A request for a route.
234#[derive(Debug, Default, PartialEq)]
235pub struct RouteRequest {
236    /// The component that is requesting the capability. May be omitted for a default request
237    /// (see `*Router.Route`).
238    pub requesting: Option<InstanceToken>,
239    /// Metadata associated with this capability request. May be omitted for a default request
240    /// (see `*Router.Route`).
241    pub metadata: Option<DictionaryRef>,
242    #[doc(hidden)]
243    pub __source_breaking: fidl::marker::SourceBreaking,
244}
245
246impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for RouteRequest {}
247
248#[derive(Debug)]
249pub enum Capability {
250    Unit(Unit),
251    Handle(fidl::Handle),
252    Data(Data),
253    Dictionary(DictionaryRef),
254    Connector(Connector),
255    DirConnector(DirConnector),
256    Directory(fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>),
257    DirEntry(DirEntry),
258    ConnectorRouter(fidl::endpoints::ClientEnd<ConnectorRouterMarker>),
259    DictionaryRouter(fidl::endpoints::ClientEnd<DictionaryRouterMarker>),
260    DirEntryRouter(fidl::endpoints::ClientEnd<DirEntryRouterMarker>),
261    DataRouter(fidl::endpoints::ClientEnd<DataRouterMarker>),
262    DirConnectorRouter(fidl::endpoints::ClientEnd<DirConnectorRouterMarker>),
263    #[doc(hidden)]
264    __SourceBreaking {
265        unknown_ordinal: u64,
266    },
267}
268
269/// Pattern that matches an unknown `Capability` member.
270#[macro_export]
271macro_rules! CapabilityUnknown {
272    () => {
273        _
274    };
275}
276
277// Custom PartialEq so that unknown variants are not equal to themselves.
278impl PartialEq for Capability {
279    fn eq(&self, other: &Self) -> bool {
280        match (self, other) {
281            (Self::Unit(x), Self::Unit(y)) => *x == *y,
282            (Self::Handle(x), Self::Handle(y)) => *x == *y,
283            (Self::Data(x), Self::Data(y)) => *x == *y,
284            (Self::Dictionary(x), Self::Dictionary(y)) => *x == *y,
285            (Self::Connector(x), Self::Connector(y)) => *x == *y,
286            (Self::DirConnector(x), Self::DirConnector(y)) => *x == *y,
287            (Self::Directory(x), Self::Directory(y)) => *x == *y,
288            (Self::DirEntry(x), Self::DirEntry(y)) => *x == *y,
289            (Self::ConnectorRouter(x), Self::ConnectorRouter(y)) => *x == *y,
290            (Self::DictionaryRouter(x), Self::DictionaryRouter(y)) => *x == *y,
291            (Self::DirEntryRouter(x), Self::DirEntryRouter(y)) => *x == *y,
292            (Self::DataRouter(x), Self::DataRouter(y)) => *x == *y,
293            (Self::DirConnectorRouter(x), Self::DirConnectorRouter(y)) => *x == *y,
294            _ => false,
295        }
296    }
297}
298
299impl Capability {
300    #[inline]
301    pub fn ordinal(&self) -> u64 {
302        match *self {
303            Self::Unit(_) => 1,
304            Self::Handle(_) => 2,
305            Self::Data(_) => 3,
306            Self::Dictionary(_) => 4,
307            Self::Connector(_) => 5,
308            Self::DirConnector(_) => 6,
309            Self::Directory(_) => 7,
310            Self::DirEntry(_) => 8,
311            Self::ConnectorRouter(_) => 9,
312            Self::DictionaryRouter(_) => 10,
313            Self::DirEntryRouter(_) => 11,
314            Self::DataRouter(_) => 12,
315            Self::DirConnectorRouter(_) => 13,
316            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
317        }
318    }
319
320    #[inline]
321    pub fn unknown_variant_for_testing() -> Self {
322        Self::__SourceBreaking { unknown_ordinal: 0 }
323    }
324
325    #[inline]
326    pub fn is_unknown(&self) -> bool {
327        match self {
328            Self::__SourceBreaking { .. } => true,
329            _ => false,
330        }
331    }
332}
333
334impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Capability {}
335
336#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
337pub enum ConnectorRouterRouteResponse {
338    Connector(Connector),
339    Unavailable(Unit),
340}
341
342impl ConnectorRouterRouteResponse {
343    #[inline]
344    pub fn ordinal(&self) -> u64 {
345        match *self {
346            Self::Connector(_) => 1,
347            Self::Unavailable(_) => 2,
348        }
349    }
350}
351
352impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
353    for ConnectorRouterRouteResponse
354{
355}
356
357#[derive(Debug, PartialEq)]
358pub enum DataRouterRouteResponse {
359    Data(Data),
360    Unavailable(Unit),
361}
362
363impl DataRouterRouteResponse {
364    #[inline]
365    pub fn ordinal(&self) -> u64 {
366        match *self {
367            Self::Data(_) => 1,
368            Self::Unavailable(_) => 2,
369        }
370    }
371}
372
373impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DataRouterRouteResponse {}
374
375#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
376pub enum DictionaryRouterRouteResponse {
377    Dictionary(DictionaryRef),
378    Unavailable(Unit),
379}
380
381impl DictionaryRouterRouteResponse {
382    #[inline]
383    pub fn ordinal(&self) -> u64 {
384        match *self {
385            Self::Dictionary(_) => 1,
386            Self::Unavailable(_) => 2,
387        }
388    }
389}
390
391impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
392    for DictionaryRouterRouteResponse
393{
394}
395
396#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
397pub enum DirConnectorRouterRouteResponse {
398    DirConnector(DirConnector),
399    Unavailable(Unit),
400}
401
402impl DirConnectorRouterRouteResponse {
403    #[inline]
404    pub fn ordinal(&self) -> u64 {
405        match *self {
406            Self::DirConnector(_) => 1,
407            Self::Unavailable(_) => 2,
408        }
409    }
410}
411
412impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
413    for DirConnectorRouterRouteResponse
414{
415}
416
417#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
418pub enum DirEntryRouterRouteResponse {
419    DirEntry(DirEntry),
420    Unavailable(Unit),
421}
422
423impl DirEntryRouterRouteResponse {
424    #[inline]
425    pub fn ordinal(&self) -> u64 {
426        match *self {
427            Self::DirEntry(_) => 1,
428            Self::Unavailable(_) => 2,
429        }
430    }
431}
432
433impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
434    for DirEntryRouterRouteResponse
435{
436}
437
438#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
439pub enum DirectoryRouterRouteResponse {
440    Directory(fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>),
441    Unavailable(Unit),
442}
443
444impl DirectoryRouterRouteResponse {
445    #[inline]
446    pub fn ordinal(&self) -> u64 {
447        match *self {
448            Self::Directory(_) => 1,
449            Self::Unavailable(_) => 2,
450        }
451    }
452}
453
454impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
455    for DirectoryRouterRouteResponse
456{
457}
458
459#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
460pub struct CapabilityStoreMarker;
461
462impl fidl::endpoints::ProtocolMarker for CapabilityStoreMarker {
463    type Proxy = CapabilityStoreProxy;
464    type RequestStream = CapabilityStoreRequestStream;
465    #[cfg(target_os = "fuchsia")]
466    type SynchronousProxy = CapabilityStoreSynchronousProxy;
467
468    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.CapabilityStore";
469}
470impl fidl::endpoints::DiscoverableProtocolMarker for CapabilityStoreMarker {}
471pub type CapabilityStoreDuplicateResult = Result<(), CapabilityStoreError>;
472pub type CapabilityStoreDropResult = Result<(), CapabilityStoreError>;
473pub type CapabilityStoreExportResult = Result<Capability, CapabilityStoreError>;
474pub type CapabilityStoreImportResult = Result<(), CapabilityStoreError>;
475pub type CapabilityStoreConnectorCreateResult = Result<(), CapabilityStoreError>;
476pub type CapabilityStoreConnectorOpenResult = Result<(), CapabilityStoreError>;
477pub type CapabilityStoreDirConnectorCreateResult = Result<(), CapabilityStoreError>;
478pub type CapabilityStoreDirConnectorOpenResult = Result<(), CapabilityStoreError>;
479pub type CapabilityStoreDictionaryCreateResult = Result<(), CapabilityStoreError>;
480pub type CapabilityStoreDictionaryLegacyImportResult = Result<(), CapabilityStoreError>;
481pub type CapabilityStoreDictionaryLegacyExportResult = Result<(), CapabilityStoreError>;
482pub type CapabilityStoreDictionaryInsertResult = Result<(), CapabilityStoreError>;
483pub type CapabilityStoreDictionaryGetResult = Result<(), CapabilityStoreError>;
484pub type CapabilityStoreDictionaryRemoveResult = Result<(), CapabilityStoreError>;
485pub type CapabilityStoreDictionaryCopyResult = Result<(), CapabilityStoreError>;
486pub type CapabilityStoreDictionaryKeysResult = Result<(), CapabilityStoreError>;
487pub type CapabilityStoreDictionaryEnumerateResult = Result<(), CapabilityStoreError>;
488pub type CapabilityStoreDictionaryDrainResult = Result<(), CapabilityStoreError>;
489
490pub trait CapabilityStoreProxyInterface: Send + Sync {
491    type DuplicateResponseFut: std::future::Future<Output = Result<CapabilityStoreDuplicateResult, fidl::Error>>
492        + Send;
493    fn r#duplicate(&self, id: u64, dest_id: u64) -> Self::DuplicateResponseFut;
494    type DropResponseFut: std::future::Future<Output = Result<CapabilityStoreDropResult, fidl::Error>>
495        + Send;
496    fn r#drop(&self, id: u64) -> Self::DropResponseFut;
497    type ExportResponseFut: std::future::Future<Output = Result<CapabilityStoreExportResult, fidl::Error>>
498        + Send;
499    fn r#export(&self, id: u64) -> Self::ExportResponseFut;
500    type ImportResponseFut: std::future::Future<Output = Result<CapabilityStoreImportResult, fidl::Error>>
501        + Send;
502    fn r#import(&self, id: u64, capability: Capability) -> Self::ImportResponseFut;
503    type ConnectorCreateResponseFut: std::future::Future<Output = Result<CapabilityStoreConnectorCreateResult, fidl::Error>>
504        + Send;
505    fn r#connector_create(
506        &self,
507        id: u64,
508        receiver: fidl::endpoints::ClientEnd<ReceiverMarker>,
509    ) -> Self::ConnectorCreateResponseFut;
510    type ConnectorOpenResponseFut: std::future::Future<Output = Result<CapabilityStoreConnectorOpenResult, fidl::Error>>
511        + Send;
512    fn r#connector_open(
513        &self,
514        id: u64,
515        server_end: fidl::Channel,
516    ) -> Self::ConnectorOpenResponseFut;
517    type DirConnectorCreateResponseFut: std::future::Future<Output = Result<CapabilityStoreDirConnectorCreateResult, fidl::Error>>
518        + Send;
519    fn r#dir_connector_create(
520        &self,
521        id: u64,
522        receiver: fidl::endpoints::ClientEnd<DirReceiverMarker>,
523    ) -> Self::DirConnectorCreateResponseFut;
524    type DirConnectorOpenResponseFut: std::future::Future<Output = Result<CapabilityStoreDirConnectorOpenResult, fidl::Error>>
525        + Send;
526    fn r#dir_connector_open(
527        &self,
528        id: u64,
529        server_end: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
530    ) -> Self::DirConnectorOpenResponseFut;
531    type DictionaryCreateResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryCreateResult, fidl::Error>>
532        + Send;
533    fn r#dictionary_create(&self, id: u64) -> Self::DictionaryCreateResponseFut;
534    type DictionaryLegacyImportResponseFut: std::future::Future<
535            Output = Result<CapabilityStoreDictionaryLegacyImportResult, fidl::Error>,
536        > + Send;
537    fn r#dictionary_legacy_import(
538        &self,
539        id: u64,
540        client_end: fidl::Channel,
541    ) -> Self::DictionaryLegacyImportResponseFut;
542    type DictionaryLegacyExportResponseFut: std::future::Future<
543            Output = Result<CapabilityStoreDictionaryLegacyExportResult, fidl::Error>,
544        > + Send;
545    fn r#dictionary_legacy_export(
546        &self,
547        id: u64,
548        server_end: fidl::Channel,
549    ) -> Self::DictionaryLegacyExportResponseFut;
550    type DictionaryInsertResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryInsertResult, fidl::Error>>
551        + Send;
552    fn r#dictionary_insert(
553        &self,
554        id: u64,
555        item: &DictionaryItem,
556    ) -> Self::DictionaryInsertResponseFut;
557    type DictionaryGetResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryGetResult, fidl::Error>>
558        + Send;
559    fn r#dictionary_get(&self, id: u64, key: &str, dest_id: u64) -> Self::DictionaryGetResponseFut;
560    type DictionaryRemoveResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryRemoveResult, fidl::Error>>
561        + Send;
562    fn r#dictionary_remove(
563        &self,
564        id: u64,
565        key: &str,
566        dest_id: Option<&WrappedCapabilityId>,
567    ) -> Self::DictionaryRemoveResponseFut;
568    type DictionaryCopyResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryCopyResult, fidl::Error>>
569        + Send;
570    fn r#dictionary_copy(&self, id: u64, dest_id: u64) -> Self::DictionaryCopyResponseFut;
571    type DictionaryKeysResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryKeysResult, fidl::Error>>
572        + Send;
573    fn r#dictionary_keys(
574        &self,
575        id: u64,
576        iterator: fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>,
577    ) -> Self::DictionaryKeysResponseFut;
578    type DictionaryEnumerateResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryEnumerateResult, fidl::Error>>
579        + Send;
580    fn r#dictionary_enumerate(
581        &self,
582        id: u64,
583        iterator: fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
584    ) -> Self::DictionaryEnumerateResponseFut;
585    type DictionaryDrainResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryDrainResult, fidl::Error>>
586        + Send;
587    fn r#dictionary_drain(
588        &self,
589        id: u64,
590        iterator: Option<fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>>,
591    ) -> Self::DictionaryDrainResponseFut;
592}
593#[derive(Debug)]
594#[cfg(target_os = "fuchsia")]
595pub struct CapabilityStoreSynchronousProxy {
596    client: fidl::client::sync::Client,
597}
598
599#[cfg(target_os = "fuchsia")]
600impl fidl::endpoints::SynchronousProxy for CapabilityStoreSynchronousProxy {
601    type Proxy = CapabilityStoreProxy;
602    type Protocol = CapabilityStoreMarker;
603
604    fn from_channel(inner: fidl::Channel) -> Self {
605        Self::new(inner)
606    }
607
608    fn into_channel(self) -> fidl::Channel {
609        self.client.into_channel()
610    }
611
612    fn as_channel(&self) -> &fidl::Channel {
613        self.client.as_channel()
614    }
615}
616
617#[cfg(target_os = "fuchsia")]
618impl CapabilityStoreSynchronousProxy {
619    pub fn new(channel: fidl::Channel) -> Self {
620        let protocol_name = <CapabilityStoreMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
621        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
622    }
623
624    pub fn into_channel(self) -> fidl::Channel {
625        self.client.into_channel()
626    }
627
628    /// Waits until an event arrives and returns it. It is safe for other
629    /// threads to make concurrent requests while waiting for an event.
630    pub fn wait_for_event(
631        &self,
632        deadline: zx::MonotonicInstant,
633    ) -> Result<CapabilityStoreEvent, fidl::Error> {
634        CapabilityStoreEvent::decode(self.client.wait_for_event(deadline)?)
635    }
636
637    /// Duplicates the capability with `id` to `dest_id`.
638    ///
639    /// Errors:
640    ///
641    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
642    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
643    /// - `NOT_DUPLICATABLE` if `id` could not be duplicated.
644    pub fn r#duplicate(
645        &self,
646        mut id: u64,
647        mut dest_id: u64,
648        ___deadline: zx::MonotonicInstant,
649    ) -> Result<CapabilityStoreDuplicateResult, fidl::Error> {
650        let _response =
651            self.client
652                .send_query::<CapabilityStoreDuplicateRequest, fidl::encoding::FlexibleResultType<
653                    fidl::encoding::EmptyStruct,
654                    CapabilityStoreError,
655                >>(
656                    (id, dest_id),
657                    0x5d5d35d9c20a2184,
658                    fidl::encoding::DynamicFlags::FLEXIBLE,
659                    ___deadline,
660                )?
661                .into_result::<CapabilityStoreMarker>("duplicate")?;
662        Ok(_response.map(|x| x))
663    }
664
665    /// Drops the capability with `id` from this [`CapabilityStore`].
666    ///
667    /// Errors:
668    ///
669    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
670    pub fn r#drop(
671        &self,
672        mut id: u64,
673        ___deadline: zx::MonotonicInstant,
674    ) -> Result<CapabilityStoreDropResult, fidl::Error> {
675        let _response =
676            self.client
677                .send_query::<CapabilityStoreDropRequest, fidl::encoding::FlexibleResultType<
678                    fidl::encoding::EmptyStruct,
679                    CapabilityStoreError,
680                >>(
681                    (id,), 0xa745c0990fc2559, fidl::encoding::DynamicFlags::FLEXIBLE, ___deadline
682                )?
683                .into_result::<CapabilityStoreMarker>("drop")?;
684        Ok(_response.map(|x| x))
685    }
686
687    /// Exports the capability with the client-assigned identifier `id` to
688    /// `capability`. This operation removes the capability from the store. If
689    /// this is not desired, [Duplicate] the capability first.
690    ///
691    /// Errors:
692    ///
693    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
694    pub fn r#export(
695        &self,
696        mut id: u64,
697        ___deadline: zx::MonotonicInstant,
698    ) -> Result<CapabilityStoreExportResult, fidl::Error> {
699        let _response =
700            self.client
701                .send_query::<CapabilityStoreExportRequest, fidl::encoding::FlexibleResultType<
702                    CapabilityStoreExportResponse,
703                    CapabilityStoreError,
704                >>(
705                    (id,), 0x3237a8f4748faff, fidl::encoding::DynamicFlags::FLEXIBLE, ___deadline
706                )?
707                .into_result::<CapabilityStoreMarker>("export")?;
708        Ok(_response.map(|x| x.capability))
709    }
710
711    /// Imports `capability` into this store with the client-assigned `id`.
712    ///
713    /// Errors:
714    ///
715    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
716    /// - `BAD_CAPABILITY` if `capability` was not a valid [Capability].
717    pub fn r#import(
718        &self,
719        mut id: u64,
720        mut capability: Capability,
721        ___deadline: zx::MonotonicInstant,
722    ) -> Result<CapabilityStoreImportResult, fidl::Error> {
723        let _response =
724            self.client
725                .send_query::<CapabilityStoreImportRequest, fidl::encoding::FlexibleResultType<
726                    fidl::encoding::EmptyStruct,
727                    CapabilityStoreError,
728                >>(
729                    (id, &mut capability),
730                    0x1f96157a29f4539b,
731                    fidl::encoding::DynamicFlags::FLEXIBLE,
732                    ___deadline,
733                )?
734                .into_result::<CapabilityStoreMarker>("import")?;
735        Ok(_response.map(|x| x))
736    }
737
738    /// Creates a [Connector] from a [Receiver]. Incoming connections to the [Connector] will be
739    /// dispatched to this [Receiver].
740    ///
741    /// Errors:
742    ///
743    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
744    pub fn r#connector_create(
745        &self,
746        mut id: u64,
747        mut receiver: fidl::endpoints::ClientEnd<ReceiverMarker>,
748        ___deadline: zx::MonotonicInstant,
749    ) -> Result<CapabilityStoreConnectorCreateResult, fidl::Error> {
750        let _response = self.client.send_query::<
751            CapabilityStoreConnectorCreateRequest,
752            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
753        >(
754            (id, receiver,),
755            0x29592c5d63e91c25,
756            fidl::encoding::DynamicFlags::FLEXIBLE,
757            ___deadline,
758        )?
759        .into_result::<CapabilityStoreMarker>("connector_create")?;
760        Ok(_response.map(|x| x))
761    }
762
763    /// Open a connection from the provided [Connector] capability that will be dispatched to
764    /// the [Receiver] on the other end.
765    ///
766    /// If there is an error, it will be reported as a zx.Status epitaph on `server_end`.
767    ///
768    /// Errors:
769    ///
770    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
771    /// - `WRONG_TYPE` if `id` was not a connector capability.
772    pub fn r#connector_open(
773        &self,
774        mut id: u64,
775        mut server_end: fidl::Channel,
776        ___deadline: zx::MonotonicInstant,
777    ) -> Result<CapabilityStoreConnectorOpenResult, fidl::Error> {
778        let _response = self.client.send_query::<
779            CapabilityStoreConnectorOpenRequest,
780            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
781        >(
782            (id, server_end,),
783            0x537e69ab40563b9f,
784            fidl::encoding::DynamicFlags::FLEXIBLE,
785            ___deadline,
786        )?
787        .into_result::<CapabilityStoreMarker>("connector_open")?;
788        Ok(_response.map(|x| x))
789    }
790
791    /// Creates a [DirConnector] from a [DirReceiver]. Incoming connections to the [DirConnector]
792    /// will be dispatched to this [DirReceiver].
793    ///
794    /// Errors:
795    ///
796    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
797    pub fn r#dir_connector_create(
798        &self,
799        mut id: u64,
800        mut receiver: fidl::endpoints::ClientEnd<DirReceiverMarker>,
801        ___deadline: zx::MonotonicInstant,
802    ) -> Result<CapabilityStoreDirConnectorCreateResult, fidl::Error> {
803        let _response = self.client.send_query::<
804            CapabilityStoreDirConnectorCreateRequest,
805            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
806        >(
807            (id, receiver,),
808            0x186138a11ccf19bb,
809            fidl::encoding::DynamicFlags::FLEXIBLE,
810            ___deadline,
811        )?
812        .into_result::<CapabilityStoreMarker>("dir_connector_create")?;
813        Ok(_response.map(|x| x))
814    }
815
816    /// Open a connection from the provided [DirConnector] capability that will be dispatched to
817    /// the [DirReceiver] on the other end.
818    ///
819    /// This method does not take `Open`/`Open3` parameters such as `flags` or `path`.
820    /// Clients that wish to specify these can get an initial connection from this method
821    /// and call `fuchsia.io/Directory.Open` on it. See the [DirReceiver] documentation for
822    /// more information about the expectations of the server side.
823    ///
824    /// If there was an error making the connection, it will be reported as a zx.Status
825    /// epitaph on `server_end`.
826    ///
827    /// Errors:
828    ///
829    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
830    /// - `WRONG_TYPE` if `id` was not a connector capability.
831    pub fn r#dir_connector_open(
832        &self,
833        mut id: u64,
834        mut server_end: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
835        ___deadline: zx::MonotonicInstant,
836    ) -> Result<CapabilityStoreDirConnectorOpenResult, fidl::Error> {
837        let _response = self.client.send_query::<
838            CapabilityStoreDirConnectorOpenRequest,
839            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
840        >(
841            (id, server_end,),
842            0x5650d3d6a3a13901,
843            fidl::encoding::DynamicFlags::FLEXIBLE,
844            ___deadline,
845        )?
846        .into_result::<CapabilityStoreMarker>("dir_connector_open")?;
847        Ok(_response.map(|x| x))
848    }
849
850    /// Creates a new empty dictionary in this [`CapabilityStore`] with client-assigned `id`.
851    ///
852    /// Errors:
853    ///
854    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
855    pub fn r#dictionary_create(
856        &self,
857        mut id: u64,
858        ___deadline: zx::MonotonicInstant,
859    ) -> Result<CapabilityStoreDictionaryCreateResult, fidl::Error> {
860        let _response = self.client.send_query::<
861            CapabilityStoreDictionaryCreateRequest,
862            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
863        >(
864            (id,),
865            0x6997c8dfc63de093,
866            fidl::encoding::DynamicFlags::FLEXIBLE,
867            ___deadline,
868        )?
869        .into_result::<CapabilityStoreMarker>("dictionary_create")?;
870        Ok(_response.map(|x| x))
871    }
872
873    /// Imports a dictionary in the form of a channel.
874    ///
875    /// This is a legacy API to support backward compatibility with APIs that take a [Dictionary]
876    /// channel.
877    ///
878    /// Errors:
879    ///
880    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
881    /// - `BAD_CAPABILITY` if `client_end` was not a valid dictionary channel.
882    pub fn r#dictionary_legacy_import(
883        &self,
884        mut id: u64,
885        mut client_end: fidl::Channel,
886        ___deadline: zx::MonotonicInstant,
887    ) -> Result<CapabilityStoreDictionaryLegacyImportResult, fidl::Error> {
888        let _response = self.client.send_query::<
889            CapabilityStoreDictionaryLegacyImportRequest,
890            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
891        >(
892            (id, client_end,),
893            0x72fd686c37b6025f,
894            fidl::encoding::DynamicFlags::FLEXIBLE,
895            ___deadline,
896        )?
897        .into_result::<CapabilityStoreMarker>("dictionary_legacy_import")?;
898        Ok(_response.map(|x| x))
899    }
900
901    /// Binds a channel to the dictionary with `id`. The channel can
902    /// be re-imported into a [CapabilityStore] with [DictionaryImportLegacy].
903    ///
904    /// This is a legacy API to support backward compatibility with APIs that take a [Dictionary]
905    /// channel.
906    ///
907    /// Errors:
908    ///
909    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
910    pub fn r#dictionary_legacy_export(
911        &self,
912        mut id: u64,
913        mut server_end: fidl::Channel,
914        ___deadline: zx::MonotonicInstant,
915    ) -> Result<CapabilityStoreDictionaryLegacyExportResult, fidl::Error> {
916        let _response = self.client.send_query::<
917            CapabilityStoreDictionaryLegacyExportRequest,
918            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
919        >(
920            (id, server_end,),
921            0x407e15cc4bde5dcd,
922            fidl::encoding::DynamicFlags::FLEXIBLE,
923            ___deadline,
924        )?
925        .into_result::<CapabilityStoreMarker>("dictionary_legacy_export")?;
926        Ok(_response.map(|x| x))
927    }
928
929    /// Inserts `item` into the dictionary with `id`. `item.value` is moved into the dictionary and
930    /// its id is released if this call succeeds.
931    ///
932    /// Errors:
933    ///
934    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
935    /// - `WRONG_TYPE` if `id` was not a dictionary.
936    /// - `INVALID_KEY` if `item.key` was invalid.
937    /// - `ITEM_ALREADY_EXISTS` if the dictionary already contains an item with `item.key`.
938    pub fn r#dictionary_insert(
939        &self,
940        mut id: u64,
941        mut item: &DictionaryItem,
942        ___deadline: zx::MonotonicInstant,
943    ) -> Result<CapabilityStoreDictionaryInsertResult, fidl::Error> {
944        let _response = self.client.send_query::<
945            CapabilityStoreDictionaryInsertRequest,
946            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
947        >(
948            (id, item,),
949            0x7702183689d44c27,
950            fidl::encoding::DynamicFlags::FLEXIBLE,
951            ___deadline,
952        )?
953        .into_result::<CapabilityStoreMarker>("dictionary_insert")?;
954        Ok(_response.map(|x| x))
955    }
956
957    /// Get a duplicate of a capability from the dictionary with `id`, which is
958    /// loaded into `dest_id`.
959    ///
960    /// Errors:
961    ///
962    /// - `ID_NOT_FOUND` if `id` was not a recognized capability id in this store.
963    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
964    /// - `WRONG_TYPE` if `id` was not a dictionary.
965    /// - `INVALID_KEY` if `item.key` was invalid.
966    /// - `ITEM_NOT_FOUND` if the dictionary does not contain `key`.
967    /// - `NOT_DUPLICATABLE` if the capability could not be duplicated.
968    pub fn r#dictionary_get(
969        &self,
970        mut id: u64,
971        mut key: &str,
972        mut dest_id: u64,
973        ___deadline: zx::MonotonicInstant,
974    ) -> Result<CapabilityStoreDictionaryGetResult, fidl::Error> {
975        let _response = self.client.send_query::<
976            CapabilityStoreDictionaryGetRequest,
977            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
978        >(
979            (id, key, dest_id,),
980            0x4d9e27538284add2,
981            fidl::encoding::DynamicFlags::FLEXIBLE,
982            ___deadline,
983        )?
984        .into_result::<CapabilityStoreMarker>("dictionary_get")?;
985        Ok(_response.map(|x| x))
986    }
987
988    /// Removes a key from the dictionary with `id`. If `dest_id` is present, loads the value
989    /// into it, otherwise discards the value.
990    ///
991    /// Errors:
992    ///
993    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
994    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
995    /// - `WRONG_TYPE` if `id` was not a dictionary.
996    /// - `INVALID_KEY` if `key` was invalid.
997    /// - `ITEM_NOT_FOUND` if the dictionary does not contain the key.
998    pub fn r#dictionary_remove(
999        &self,
1000        mut id: u64,
1001        mut key: &str,
1002        mut dest_id: Option<&WrappedCapabilityId>,
1003        ___deadline: zx::MonotonicInstant,
1004    ) -> Result<CapabilityStoreDictionaryRemoveResult, fidl::Error> {
1005        let _response = self.client.send_query::<
1006            CapabilityStoreDictionaryRemoveRequest,
1007            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
1008        >(
1009            (id, key, dest_id,),
1010            0x4c5c025ab05d4f3,
1011            fidl::encoding::DynamicFlags::FLEXIBLE,
1012            ___deadline,
1013        )?
1014        .into_result::<CapabilityStoreMarker>("dictionary_remove")?;
1015        Ok(_response.map(|x| x))
1016    }
1017
1018    /// Create a new dictionary that contains a duplicate of all the entries in
1019    /// the dictionary with `id`, assigning `dest_id` to the new dictionary.
1020    /// The runtime of this method is linear in the number of top-level entries
1021    /// in the dictionary.
1022    ///
1023    /// For example, if the dictionary contains nested dictionaries, the newly
1024    /// created dictionary will contain references to those same nested
1025    /// dictionaries because the entries are duplicated rather than deep-copied.
1026    ///
1027    /// Errors:
1028    ///
1029    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1030    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
1031    /// - `WRONG_TYPE` if `id` was not a dictionary.
1032    /// - `NOT_DUPLICATABLE` if one of the capabilities in `id` could not be duplicated.
1033    pub fn r#dictionary_copy(
1034        &self,
1035        mut id: u64,
1036        mut dest_id: u64,
1037        ___deadline: zx::MonotonicInstant,
1038    ) -> Result<CapabilityStoreDictionaryCopyResult, fidl::Error> {
1039        let _response = self.client.send_query::<
1040            CapabilityStoreDictionaryCopyRequest,
1041            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
1042        >(
1043            (id, dest_id,),
1044            0x3733ecdf4ea1b44f,
1045            fidl::encoding::DynamicFlags::FLEXIBLE,
1046            ___deadline,
1047        )?
1048        .into_result::<CapabilityStoreMarker>("dictionary_copy")?;
1049        Ok(_response.map(|x| x))
1050    }
1051
1052    /// Enumerates the keys in the dictionary with `id`.
1053    ///
1054    /// Errors:
1055    ///
1056    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1057    /// - `WRONG_TYPE` if `id` was not a dictionary.
1058    pub fn r#dictionary_keys(
1059        &self,
1060        mut id: u64,
1061        mut iterator: fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>,
1062        ___deadline: zx::MonotonicInstant,
1063    ) -> Result<CapabilityStoreDictionaryKeysResult, fidl::Error> {
1064        let _response = self.client.send_query::<
1065            CapabilityStoreDictionaryKeysRequest,
1066            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
1067        >(
1068            (id, iterator,),
1069            0x84b05577ceaec9e,
1070            fidl::encoding::DynamicFlags::FLEXIBLE,
1071            ___deadline,
1072        )?
1073        .into_result::<CapabilityStoreMarker>("dictionary_keys")?;
1074        Ok(_response.map(|x| x))
1075    }
1076
1077    /// Enumerates the items (keys and values) in the dictionary with `id`.
1078    ///
1079    /// Creates a duplicate of each value (capability). If a value could not be duplicated,
1080    /// the value will be null.
1081    ///
1082    /// Errors:
1083    ///
1084    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1085    /// - `WRONG_TYPE` if `id` was not a dictionary.
1086    pub fn r#dictionary_enumerate(
1087        &self,
1088        mut id: u64,
1089        mut iterator: fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
1090        ___deadline: zx::MonotonicInstant,
1091    ) -> Result<CapabilityStoreDictionaryEnumerateResult, fidl::Error> {
1092        let _response = self.client.send_query::<
1093            CapabilityStoreDictionaryEnumerateRequest,
1094            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
1095        >(
1096            (id, iterator,),
1097            0xd6279b6ced04641,
1098            fidl::encoding::DynamicFlags::FLEXIBLE,
1099            ___deadline,
1100        )?
1101        .into_result::<CapabilityStoreMarker>("dictionary_enumerate")?;
1102        Ok(_response.map(|x| x))
1103    }
1104
1105    /// Removes all the entries in this dictionary, returning them in `contents` if provided.
1106    /// If `contents` is not provided, all the items are discarded without enumerating them.
1107    ///
1108    /// Errors:
1109    ///
1110    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1111    /// - `WRONG_TYPE` if `id` was not a dictionary.
1112    pub fn r#dictionary_drain(
1113        &self,
1114        mut id: u64,
1115        mut iterator: Option<fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>>,
1116        ___deadline: zx::MonotonicInstant,
1117    ) -> Result<CapabilityStoreDictionaryDrainResult, fidl::Error> {
1118        let _response = self.client.send_query::<
1119            CapabilityStoreDictionaryDrainRequest,
1120            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
1121        >(
1122            (id, iterator,),
1123            0x28a3a3f84d928cd8,
1124            fidl::encoding::DynamicFlags::FLEXIBLE,
1125            ___deadline,
1126        )?
1127        .into_result::<CapabilityStoreMarker>("dictionary_drain")?;
1128        Ok(_response.map(|x| x))
1129    }
1130}
1131
1132#[cfg(target_os = "fuchsia")]
1133impl From<CapabilityStoreSynchronousProxy> for zx::Handle {
1134    fn from(value: CapabilityStoreSynchronousProxy) -> Self {
1135        value.into_channel().into()
1136    }
1137}
1138
1139#[cfg(target_os = "fuchsia")]
1140impl From<fidl::Channel> for CapabilityStoreSynchronousProxy {
1141    fn from(value: fidl::Channel) -> Self {
1142        Self::new(value)
1143    }
1144}
1145
1146#[derive(Debug, Clone)]
1147pub struct CapabilityStoreProxy {
1148    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1149}
1150
1151impl fidl::endpoints::Proxy for CapabilityStoreProxy {
1152    type Protocol = CapabilityStoreMarker;
1153
1154    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1155        Self::new(inner)
1156    }
1157
1158    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1159        self.client.into_channel().map_err(|client| Self { client })
1160    }
1161
1162    fn as_channel(&self) -> &::fidl::AsyncChannel {
1163        self.client.as_channel()
1164    }
1165}
1166
1167impl CapabilityStoreProxy {
1168    /// Create a new Proxy for fuchsia.component.sandbox/CapabilityStore.
1169    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1170        let protocol_name = <CapabilityStoreMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1171        Self { client: fidl::client::Client::new(channel, protocol_name) }
1172    }
1173
1174    /// Get a Stream of events from the remote end of the protocol.
1175    ///
1176    /// # Panics
1177    ///
1178    /// Panics if the event stream was already taken.
1179    pub fn take_event_stream(&self) -> CapabilityStoreEventStream {
1180        CapabilityStoreEventStream { event_receiver: self.client.take_event_receiver() }
1181    }
1182
1183    /// Duplicates the capability with `id` to `dest_id`.
1184    ///
1185    /// Errors:
1186    ///
1187    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1188    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
1189    /// - `NOT_DUPLICATABLE` if `id` could not be duplicated.
1190    pub fn r#duplicate(
1191        &self,
1192        mut id: u64,
1193        mut dest_id: u64,
1194    ) -> fidl::client::QueryResponseFut<
1195        CapabilityStoreDuplicateResult,
1196        fidl::encoding::DefaultFuchsiaResourceDialect,
1197    > {
1198        CapabilityStoreProxyInterface::r#duplicate(self, id, dest_id)
1199    }
1200
1201    /// Drops the capability with `id` from this [`CapabilityStore`].
1202    ///
1203    /// Errors:
1204    ///
1205    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1206    pub fn r#drop(
1207        &self,
1208        mut id: u64,
1209    ) -> fidl::client::QueryResponseFut<
1210        CapabilityStoreDropResult,
1211        fidl::encoding::DefaultFuchsiaResourceDialect,
1212    > {
1213        CapabilityStoreProxyInterface::r#drop(self, id)
1214    }
1215
1216    /// Exports the capability with the client-assigned identifier `id` to
1217    /// `capability`. This operation removes the capability from the store. If
1218    /// this is not desired, [Duplicate] the capability first.
1219    ///
1220    /// Errors:
1221    ///
1222    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1223    pub fn r#export(
1224        &self,
1225        mut id: u64,
1226    ) -> fidl::client::QueryResponseFut<
1227        CapabilityStoreExportResult,
1228        fidl::encoding::DefaultFuchsiaResourceDialect,
1229    > {
1230        CapabilityStoreProxyInterface::r#export(self, id)
1231    }
1232
1233    /// Imports `capability` into this store with the client-assigned `id`.
1234    ///
1235    /// Errors:
1236    ///
1237    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
1238    /// - `BAD_CAPABILITY` if `capability` was not a valid [Capability].
1239    pub fn r#import(
1240        &self,
1241        mut id: u64,
1242        mut capability: Capability,
1243    ) -> fidl::client::QueryResponseFut<
1244        CapabilityStoreImportResult,
1245        fidl::encoding::DefaultFuchsiaResourceDialect,
1246    > {
1247        CapabilityStoreProxyInterface::r#import(self, id, capability)
1248    }
1249
1250    /// Creates a [Connector] from a [Receiver]. Incoming connections to the [Connector] will be
1251    /// dispatched to this [Receiver].
1252    ///
1253    /// Errors:
1254    ///
1255    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
1256    pub fn r#connector_create(
1257        &self,
1258        mut id: u64,
1259        mut receiver: fidl::endpoints::ClientEnd<ReceiverMarker>,
1260    ) -> fidl::client::QueryResponseFut<
1261        CapabilityStoreConnectorCreateResult,
1262        fidl::encoding::DefaultFuchsiaResourceDialect,
1263    > {
1264        CapabilityStoreProxyInterface::r#connector_create(self, id, receiver)
1265    }
1266
1267    /// Open a connection from the provided [Connector] capability that will be dispatched to
1268    /// the [Receiver] on the other end.
1269    ///
1270    /// If there is an error, it will be reported as a zx.Status epitaph on `server_end`.
1271    ///
1272    /// Errors:
1273    ///
1274    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1275    /// - `WRONG_TYPE` if `id` was not a connector capability.
1276    pub fn r#connector_open(
1277        &self,
1278        mut id: u64,
1279        mut server_end: fidl::Channel,
1280    ) -> fidl::client::QueryResponseFut<
1281        CapabilityStoreConnectorOpenResult,
1282        fidl::encoding::DefaultFuchsiaResourceDialect,
1283    > {
1284        CapabilityStoreProxyInterface::r#connector_open(self, id, server_end)
1285    }
1286
1287    /// Creates a [DirConnector] from a [DirReceiver]. Incoming connections to the [DirConnector]
1288    /// will be dispatched to this [DirReceiver].
1289    ///
1290    /// Errors:
1291    ///
1292    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
1293    pub fn r#dir_connector_create(
1294        &self,
1295        mut id: u64,
1296        mut receiver: fidl::endpoints::ClientEnd<DirReceiverMarker>,
1297    ) -> fidl::client::QueryResponseFut<
1298        CapabilityStoreDirConnectorCreateResult,
1299        fidl::encoding::DefaultFuchsiaResourceDialect,
1300    > {
1301        CapabilityStoreProxyInterface::r#dir_connector_create(self, id, receiver)
1302    }
1303
1304    /// Open a connection from the provided [DirConnector] capability that will be dispatched to
1305    /// the [DirReceiver] on the other end.
1306    ///
1307    /// This method does not take `Open`/`Open3` parameters such as `flags` or `path`.
1308    /// Clients that wish to specify these can get an initial connection from this method
1309    /// and call `fuchsia.io/Directory.Open` on it. See the [DirReceiver] documentation for
1310    /// more information about the expectations of the server side.
1311    ///
1312    /// If there was an error making the connection, it will be reported as a zx.Status
1313    /// epitaph on `server_end`.
1314    ///
1315    /// Errors:
1316    ///
1317    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1318    /// - `WRONG_TYPE` if `id` was not a connector capability.
1319    pub fn r#dir_connector_open(
1320        &self,
1321        mut id: u64,
1322        mut server_end: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
1323    ) -> fidl::client::QueryResponseFut<
1324        CapabilityStoreDirConnectorOpenResult,
1325        fidl::encoding::DefaultFuchsiaResourceDialect,
1326    > {
1327        CapabilityStoreProxyInterface::r#dir_connector_open(self, id, server_end)
1328    }
1329
1330    /// Creates a new empty dictionary in this [`CapabilityStore`] with client-assigned `id`.
1331    ///
1332    /// Errors:
1333    ///
1334    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
1335    pub fn r#dictionary_create(
1336        &self,
1337        mut id: u64,
1338    ) -> fidl::client::QueryResponseFut<
1339        CapabilityStoreDictionaryCreateResult,
1340        fidl::encoding::DefaultFuchsiaResourceDialect,
1341    > {
1342        CapabilityStoreProxyInterface::r#dictionary_create(self, id)
1343    }
1344
1345    /// Imports a dictionary in the form of a channel.
1346    ///
1347    /// This is a legacy API to support backward compatibility with APIs that take a [Dictionary]
1348    /// channel.
1349    ///
1350    /// Errors:
1351    ///
1352    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
1353    /// - `BAD_CAPABILITY` if `client_end` was not a valid dictionary channel.
1354    pub fn r#dictionary_legacy_import(
1355        &self,
1356        mut id: u64,
1357        mut client_end: fidl::Channel,
1358    ) -> fidl::client::QueryResponseFut<
1359        CapabilityStoreDictionaryLegacyImportResult,
1360        fidl::encoding::DefaultFuchsiaResourceDialect,
1361    > {
1362        CapabilityStoreProxyInterface::r#dictionary_legacy_import(self, id, client_end)
1363    }
1364
1365    /// Binds a channel to the dictionary with `id`. The channel can
1366    /// be re-imported into a [CapabilityStore] with [DictionaryImportLegacy].
1367    ///
1368    /// This is a legacy API to support backward compatibility with APIs that take a [Dictionary]
1369    /// channel.
1370    ///
1371    /// Errors:
1372    ///
1373    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1374    pub fn r#dictionary_legacy_export(
1375        &self,
1376        mut id: u64,
1377        mut server_end: fidl::Channel,
1378    ) -> fidl::client::QueryResponseFut<
1379        CapabilityStoreDictionaryLegacyExportResult,
1380        fidl::encoding::DefaultFuchsiaResourceDialect,
1381    > {
1382        CapabilityStoreProxyInterface::r#dictionary_legacy_export(self, id, server_end)
1383    }
1384
1385    /// Inserts `item` into the dictionary with `id`. `item.value` is moved into the dictionary and
1386    /// its id is released if this call succeeds.
1387    ///
1388    /// Errors:
1389    ///
1390    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1391    /// - `WRONG_TYPE` if `id` was not a dictionary.
1392    /// - `INVALID_KEY` if `item.key` was invalid.
1393    /// - `ITEM_ALREADY_EXISTS` if the dictionary already contains an item with `item.key`.
1394    pub fn r#dictionary_insert(
1395        &self,
1396        mut id: u64,
1397        mut item: &DictionaryItem,
1398    ) -> fidl::client::QueryResponseFut<
1399        CapabilityStoreDictionaryInsertResult,
1400        fidl::encoding::DefaultFuchsiaResourceDialect,
1401    > {
1402        CapabilityStoreProxyInterface::r#dictionary_insert(self, id, item)
1403    }
1404
1405    /// Get a duplicate of a capability from the dictionary with `id`, which is
1406    /// loaded into `dest_id`.
1407    ///
1408    /// Errors:
1409    ///
1410    /// - `ID_NOT_FOUND` if `id` was not a recognized capability id in this store.
1411    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
1412    /// - `WRONG_TYPE` if `id` was not a dictionary.
1413    /// - `INVALID_KEY` if `item.key` was invalid.
1414    /// - `ITEM_NOT_FOUND` if the dictionary does not contain `key`.
1415    /// - `NOT_DUPLICATABLE` if the capability could not be duplicated.
1416    pub fn r#dictionary_get(
1417        &self,
1418        mut id: u64,
1419        mut key: &str,
1420        mut dest_id: u64,
1421    ) -> fidl::client::QueryResponseFut<
1422        CapabilityStoreDictionaryGetResult,
1423        fidl::encoding::DefaultFuchsiaResourceDialect,
1424    > {
1425        CapabilityStoreProxyInterface::r#dictionary_get(self, id, key, dest_id)
1426    }
1427
1428    /// Removes a key from the dictionary with `id`. If `dest_id` is present, loads the value
1429    /// into it, otherwise discards the value.
1430    ///
1431    /// Errors:
1432    ///
1433    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1434    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
1435    /// - `WRONG_TYPE` if `id` was not a dictionary.
1436    /// - `INVALID_KEY` if `key` was invalid.
1437    /// - `ITEM_NOT_FOUND` if the dictionary does not contain the key.
1438    pub fn r#dictionary_remove(
1439        &self,
1440        mut id: u64,
1441        mut key: &str,
1442        mut dest_id: Option<&WrappedCapabilityId>,
1443    ) -> fidl::client::QueryResponseFut<
1444        CapabilityStoreDictionaryRemoveResult,
1445        fidl::encoding::DefaultFuchsiaResourceDialect,
1446    > {
1447        CapabilityStoreProxyInterface::r#dictionary_remove(self, id, key, dest_id)
1448    }
1449
1450    /// Create a new dictionary that contains a duplicate of all the entries in
1451    /// the dictionary with `id`, assigning `dest_id` to the new dictionary.
1452    /// The runtime of this method is linear in the number of top-level entries
1453    /// in the dictionary.
1454    ///
1455    /// For example, if the dictionary contains nested dictionaries, the newly
1456    /// created dictionary will contain references to those same nested
1457    /// dictionaries because the entries are duplicated rather than deep-copied.
1458    ///
1459    /// Errors:
1460    ///
1461    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1462    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
1463    /// - `WRONG_TYPE` if `id` was not a dictionary.
1464    /// - `NOT_DUPLICATABLE` if one of the capabilities in `id` could not be duplicated.
1465    pub fn r#dictionary_copy(
1466        &self,
1467        mut id: u64,
1468        mut dest_id: u64,
1469    ) -> fidl::client::QueryResponseFut<
1470        CapabilityStoreDictionaryCopyResult,
1471        fidl::encoding::DefaultFuchsiaResourceDialect,
1472    > {
1473        CapabilityStoreProxyInterface::r#dictionary_copy(self, id, dest_id)
1474    }
1475
1476    /// Enumerates the keys in the dictionary with `id`.
1477    ///
1478    /// Errors:
1479    ///
1480    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1481    /// - `WRONG_TYPE` if `id` was not a dictionary.
1482    pub fn r#dictionary_keys(
1483        &self,
1484        mut id: u64,
1485        mut iterator: fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>,
1486    ) -> fidl::client::QueryResponseFut<
1487        CapabilityStoreDictionaryKeysResult,
1488        fidl::encoding::DefaultFuchsiaResourceDialect,
1489    > {
1490        CapabilityStoreProxyInterface::r#dictionary_keys(self, id, iterator)
1491    }
1492
1493    /// Enumerates the items (keys and values) in the dictionary with `id`.
1494    ///
1495    /// Creates a duplicate of each value (capability). If a value could not be duplicated,
1496    /// the value will be null.
1497    ///
1498    /// Errors:
1499    ///
1500    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1501    /// - `WRONG_TYPE` if `id` was not a dictionary.
1502    pub fn r#dictionary_enumerate(
1503        &self,
1504        mut id: u64,
1505        mut iterator: fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
1506    ) -> fidl::client::QueryResponseFut<
1507        CapabilityStoreDictionaryEnumerateResult,
1508        fidl::encoding::DefaultFuchsiaResourceDialect,
1509    > {
1510        CapabilityStoreProxyInterface::r#dictionary_enumerate(self, id, iterator)
1511    }
1512
1513    /// Removes all the entries in this dictionary, returning them in `contents` if provided.
1514    /// If `contents` is not provided, all the items are discarded without enumerating them.
1515    ///
1516    /// Errors:
1517    ///
1518    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1519    /// - `WRONG_TYPE` if `id` was not a dictionary.
1520    pub fn r#dictionary_drain(
1521        &self,
1522        mut id: u64,
1523        mut iterator: Option<fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>>,
1524    ) -> fidl::client::QueryResponseFut<
1525        CapabilityStoreDictionaryDrainResult,
1526        fidl::encoding::DefaultFuchsiaResourceDialect,
1527    > {
1528        CapabilityStoreProxyInterface::r#dictionary_drain(self, id, iterator)
1529    }
1530}
1531
1532impl CapabilityStoreProxyInterface for CapabilityStoreProxy {
1533    type DuplicateResponseFut = fidl::client::QueryResponseFut<
1534        CapabilityStoreDuplicateResult,
1535        fidl::encoding::DefaultFuchsiaResourceDialect,
1536    >;
1537    fn r#duplicate(&self, mut id: u64, mut dest_id: u64) -> Self::DuplicateResponseFut {
1538        fn _decode(
1539            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1540        ) -> Result<CapabilityStoreDuplicateResult, fidl::Error> {
1541            let _response = fidl::client::decode_transaction_body::<
1542                fidl::encoding::FlexibleResultType<
1543                    fidl::encoding::EmptyStruct,
1544                    CapabilityStoreError,
1545                >,
1546                fidl::encoding::DefaultFuchsiaResourceDialect,
1547                0x5d5d35d9c20a2184,
1548            >(_buf?)?
1549            .into_result::<CapabilityStoreMarker>("duplicate")?;
1550            Ok(_response.map(|x| x))
1551        }
1552        self.client.send_query_and_decode::<
1553            CapabilityStoreDuplicateRequest,
1554            CapabilityStoreDuplicateResult,
1555        >(
1556            (id, dest_id,),
1557            0x5d5d35d9c20a2184,
1558            fidl::encoding::DynamicFlags::FLEXIBLE,
1559            _decode,
1560        )
1561    }
1562
1563    type DropResponseFut = fidl::client::QueryResponseFut<
1564        CapabilityStoreDropResult,
1565        fidl::encoding::DefaultFuchsiaResourceDialect,
1566    >;
1567    fn r#drop(&self, mut id: u64) -> Self::DropResponseFut {
1568        fn _decode(
1569            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1570        ) -> Result<CapabilityStoreDropResult, fidl::Error> {
1571            let _response = fidl::client::decode_transaction_body::<
1572                fidl::encoding::FlexibleResultType<
1573                    fidl::encoding::EmptyStruct,
1574                    CapabilityStoreError,
1575                >,
1576                fidl::encoding::DefaultFuchsiaResourceDialect,
1577                0xa745c0990fc2559,
1578            >(_buf?)?
1579            .into_result::<CapabilityStoreMarker>("drop")?;
1580            Ok(_response.map(|x| x))
1581        }
1582        self.client.send_query_and_decode::<CapabilityStoreDropRequest, CapabilityStoreDropResult>(
1583            (id,),
1584            0xa745c0990fc2559,
1585            fidl::encoding::DynamicFlags::FLEXIBLE,
1586            _decode,
1587        )
1588    }
1589
1590    type ExportResponseFut = fidl::client::QueryResponseFut<
1591        CapabilityStoreExportResult,
1592        fidl::encoding::DefaultFuchsiaResourceDialect,
1593    >;
1594    fn r#export(&self, mut id: u64) -> Self::ExportResponseFut {
1595        fn _decode(
1596            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1597        ) -> Result<CapabilityStoreExportResult, fidl::Error> {
1598            let _response = fidl::client::decode_transaction_body::<
1599                fidl::encoding::FlexibleResultType<
1600                    CapabilityStoreExportResponse,
1601                    CapabilityStoreError,
1602                >,
1603                fidl::encoding::DefaultFuchsiaResourceDialect,
1604                0x3237a8f4748faff,
1605            >(_buf?)?
1606            .into_result::<CapabilityStoreMarker>("export")?;
1607            Ok(_response.map(|x| x.capability))
1608        }
1609        self.client
1610            .send_query_and_decode::<CapabilityStoreExportRequest, CapabilityStoreExportResult>(
1611                (id,),
1612                0x3237a8f4748faff,
1613                fidl::encoding::DynamicFlags::FLEXIBLE,
1614                _decode,
1615            )
1616    }
1617
1618    type ImportResponseFut = fidl::client::QueryResponseFut<
1619        CapabilityStoreImportResult,
1620        fidl::encoding::DefaultFuchsiaResourceDialect,
1621    >;
1622    fn r#import(&self, mut id: u64, mut capability: Capability) -> Self::ImportResponseFut {
1623        fn _decode(
1624            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1625        ) -> Result<CapabilityStoreImportResult, fidl::Error> {
1626            let _response = fidl::client::decode_transaction_body::<
1627                fidl::encoding::FlexibleResultType<
1628                    fidl::encoding::EmptyStruct,
1629                    CapabilityStoreError,
1630                >,
1631                fidl::encoding::DefaultFuchsiaResourceDialect,
1632                0x1f96157a29f4539b,
1633            >(_buf?)?
1634            .into_result::<CapabilityStoreMarker>("import")?;
1635            Ok(_response.map(|x| x))
1636        }
1637        self.client
1638            .send_query_and_decode::<CapabilityStoreImportRequest, CapabilityStoreImportResult>(
1639                (id, &mut capability),
1640                0x1f96157a29f4539b,
1641                fidl::encoding::DynamicFlags::FLEXIBLE,
1642                _decode,
1643            )
1644    }
1645
1646    type ConnectorCreateResponseFut = fidl::client::QueryResponseFut<
1647        CapabilityStoreConnectorCreateResult,
1648        fidl::encoding::DefaultFuchsiaResourceDialect,
1649    >;
1650    fn r#connector_create(
1651        &self,
1652        mut id: u64,
1653        mut receiver: fidl::endpoints::ClientEnd<ReceiverMarker>,
1654    ) -> Self::ConnectorCreateResponseFut {
1655        fn _decode(
1656            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1657        ) -> Result<CapabilityStoreConnectorCreateResult, fidl::Error> {
1658            let _response = fidl::client::decode_transaction_body::<
1659                fidl::encoding::FlexibleResultType<
1660                    fidl::encoding::EmptyStruct,
1661                    CapabilityStoreError,
1662                >,
1663                fidl::encoding::DefaultFuchsiaResourceDialect,
1664                0x29592c5d63e91c25,
1665            >(_buf?)?
1666            .into_result::<CapabilityStoreMarker>("connector_create")?;
1667            Ok(_response.map(|x| x))
1668        }
1669        self.client.send_query_and_decode::<
1670            CapabilityStoreConnectorCreateRequest,
1671            CapabilityStoreConnectorCreateResult,
1672        >(
1673            (id, receiver,),
1674            0x29592c5d63e91c25,
1675            fidl::encoding::DynamicFlags::FLEXIBLE,
1676            _decode,
1677        )
1678    }
1679
1680    type ConnectorOpenResponseFut = fidl::client::QueryResponseFut<
1681        CapabilityStoreConnectorOpenResult,
1682        fidl::encoding::DefaultFuchsiaResourceDialect,
1683    >;
1684    fn r#connector_open(
1685        &self,
1686        mut id: u64,
1687        mut server_end: fidl::Channel,
1688    ) -> Self::ConnectorOpenResponseFut {
1689        fn _decode(
1690            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1691        ) -> Result<CapabilityStoreConnectorOpenResult, fidl::Error> {
1692            let _response = fidl::client::decode_transaction_body::<
1693                fidl::encoding::FlexibleResultType<
1694                    fidl::encoding::EmptyStruct,
1695                    CapabilityStoreError,
1696                >,
1697                fidl::encoding::DefaultFuchsiaResourceDialect,
1698                0x537e69ab40563b9f,
1699            >(_buf?)?
1700            .into_result::<CapabilityStoreMarker>("connector_open")?;
1701            Ok(_response.map(|x| x))
1702        }
1703        self.client.send_query_and_decode::<
1704            CapabilityStoreConnectorOpenRequest,
1705            CapabilityStoreConnectorOpenResult,
1706        >(
1707            (id, server_end,),
1708            0x537e69ab40563b9f,
1709            fidl::encoding::DynamicFlags::FLEXIBLE,
1710            _decode,
1711        )
1712    }
1713
1714    type DirConnectorCreateResponseFut = fidl::client::QueryResponseFut<
1715        CapabilityStoreDirConnectorCreateResult,
1716        fidl::encoding::DefaultFuchsiaResourceDialect,
1717    >;
1718    fn r#dir_connector_create(
1719        &self,
1720        mut id: u64,
1721        mut receiver: fidl::endpoints::ClientEnd<DirReceiverMarker>,
1722    ) -> Self::DirConnectorCreateResponseFut {
1723        fn _decode(
1724            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1725        ) -> Result<CapabilityStoreDirConnectorCreateResult, fidl::Error> {
1726            let _response = fidl::client::decode_transaction_body::<
1727                fidl::encoding::FlexibleResultType<
1728                    fidl::encoding::EmptyStruct,
1729                    CapabilityStoreError,
1730                >,
1731                fidl::encoding::DefaultFuchsiaResourceDialect,
1732                0x186138a11ccf19bb,
1733            >(_buf?)?
1734            .into_result::<CapabilityStoreMarker>("dir_connector_create")?;
1735            Ok(_response.map(|x| x))
1736        }
1737        self.client.send_query_and_decode::<
1738            CapabilityStoreDirConnectorCreateRequest,
1739            CapabilityStoreDirConnectorCreateResult,
1740        >(
1741            (id, receiver,),
1742            0x186138a11ccf19bb,
1743            fidl::encoding::DynamicFlags::FLEXIBLE,
1744            _decode,
1745        )
1746    }
1747
1748    type DirConnectorOpenResponseFut = fidl::client::QueryResponseFut<
1749        CapabilityStoreDirConnectorOpenResult,
1750        fidl::encoding::DefaultFuchsiaResourceDialect,
1751    >;
1752    fn r#dir_connector_open(
1753        &self,
1754        mut id: u64,
1755        mut server_end: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
1756    ) -> Self::DirConnectorOpenResponseFut {
1757        fn _decode(
1758            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1759        ) -> Result<CapabilityStoreDirConnectorOpenResult, fidl::Error> {
1760            let _response = fidl::client::decode_transaction_body::<
1761                fidl::encoding::FlexibleResultType<
1762                    fidl::encoding::EmptyStruct,
1763                    CapabilityStoreError,
1764                >,
1765                fidl::encoding::DefaultFuchsiaResourceDialect,
1766                0x5650d3d6a3a13901,
1767            >(_buf?)?
1768            .into_result::<CapabilityStoreMarker>("dir_connector_open")?;
1769            Ok(_response.map(|x| x))
1770        }
1771        self.client.send_query_and_decode::<
1772            CapabilityStoreDirConnectorOpenRequest,
1773            CapabilityStoreDirConnectorOpenResult,
1774        >(
1775            (id, server_end,),
1776            0x5650d3d6a3a13901,
1777            fidl::encoding::DynamicFlags::FLEXIBLE,
1778            _decode,
1779        )
1780    }
1781
1782    type DictionaryCreateResponseFut = fidl::client::QueryResponseFut<
1783        CapabilityStoreDictionaryCreateResult,
1784        fidl::encoding::DefaultFuchsiaResourceDialect,
1785    >;
1786    fn r#dictionary_create(&self, mut id: u64) -> Self::DictionaryCreateResponseFut {
1787        fn _decode(
1788            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1789        ) -> Result<CapabilityStoreDictionaryCreateResult, fidl::Error> {
1790            let _response = fidl::client::decode_transaction_body::<
1791                fidl::encoding::FlexibleResultType<
1792                    fidl::encoding::EmptyStruct,
1793                    CapabilityStoreError,
1794                >,
1795                fidl::encoding::DefaultFuchsiaResourceDialect,
1796                0x6997c8dfc63de093,
1797            >(_buf?)?
1798            .into_result::<CapabilityStoreMarker>("dictionary_create")?;
1799            Ok(_response.map(|x| x))
1800        }
1801        self.client.send_query_and_decode::<
1802            CapabilityStoreDictionaryCreateRequest,
1803            CapabilityStoreDictionaryCreateResult,
1804        >(
1805            (id,),
1806            0x6997c8dfc63de093,
1807            fidl::encoding::DynamicFlags::FLEXIBLE,
1808            _decode,
1809        )
1810    }
1811
1812    type DictionaryLegacyImportResponseFut = fidl::client::QueryResponseFut<
1813        CapabilityStoreDictionaryLegacyImportResult,
1814        fidl::encoding::DefaultFuchsiaResourceDialect,
1815    >;
1816    fn r#dictionary_legacy_import(
1817        &self,
1818        mut id: u64,
1819        mut client_end: fidl::Channel,
1820    ) -> Self::DictionaryLegacyImportResponseFut {
1821        fn _decode(
1822            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1823        ) -> Result<CapabilityStoreDictionaryLegacyImportResult, fidl::Error> {
1824            let _response = fidl::client::decode_transaction_body::<
1825                fidl::encoding::FlexibleResultType<
1826                    fidl::encoding::EmptyStruct,
1827                    CapabilityStoreError,
1828                >,
1829                fidl::encoding::DefaultFuchsiaResourceDialect,
1830                0x72fd686c37b6025f,
1831            >(_buf?)?
1832            .into_result::<CapabilityStoreMarker>("dictionary_legacy_import")?;
1833            Ok(_response.map(|x| x))
1834        }
1835        self.client.send_query_and_decode::<
1836            CapabilityStoreDictionaryLegacyImportRequest,
1837            CapabilityStoreDictionaryLegacyImportResult,
1838        >(
1839            (id, client_end,),
1840            0x72fd686c37b6025f,
1841            fidl::encoding::DynamicFlags::FLEXIBLE,
1842            _decode,
1843        )
1844    }
1845
1846    type DictionaryLegacyExportResponseFut = fidl::client::QueryResponseFut<
1847        CapabilityStoreDictionaryLegacyExportResult,
1848        fidl::encoding::DefaultFuchsiaResourceDialect,
1849    >;
1850    fn r#dictionary_legacy_export(
1851        &self,
1852        mut id: u64,
1853        mut server_end: fidl::Channel,
1854    ) -> Self::DictionaryLegacyExportResponseFut {
1855        fn _decode(
1856            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1857        ) -> Result<CapabilityStoreDictionaryLegacyExportResult, fidl::Error> {
1858            let _response = fidl::client::decode_transaction_body::<
1859                fidl::encoding::FlexibleResultType<
1860                    fidl::encoding::EmptyStruct,
1861                    CapabilityStoreError,
1862                >,
1863                fidl::encoding::DefaultFuchsiaResourceDialect,
1864                0x407e15cc4bde5dcd,
1865            >(_buf?)?
1866            .into_result::<CapabilityStoreMarker>("dictionary_legacy_export")?;
1867            Ok(_response.map(|x| x))
1868        }
1869        self.client.send_query_and_decode::<
1870            CapabilityStoreDictionaryLegacyExportRequest,
1871            CapabilityStoreDictionaryLegacyExportResult,
1872        >(
1873            (id, server_end,),
1874            0x407e15cc4bde5dcd,
1875            fidl::encoding::DynamicFlags::FLEXIBLE,
1876            _decode,
1877        )
1878    }
1879
1880    type DictionaryInsertResponseFut = fidl::client::QueryResponseFut<
1881        CapabilityStoreDictionaryInsertResult,
1882        fidl::encoding::DefaultFuchsiaResourceDialect,
1883    >;
1884    fn r#dictionary_insert(
1885        &self,
1886        mut id: u64,
1887        mut item: &DictionaryItem,
1888    ) -> Self::DictionaryInsertResponseFut {
1889        fn _decode(
1890            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1891        ) -> Result<CapabilityStoreDictionaryInsertResult, fidl::Error> {
1892            let _response = fidl::client::decode_transaction_body::<
1893                fidl::encoding::FlexibleResultType<
1894                    fidl::encoding::EmptyStruct,
1895                    CapabilityStoreError,
1896                >,
1897                fidl::encoding::DefaultFuchsiaResourceDialect,
1898                0x7702183689d44c27,
1899            >(_buf?)?
1900            .into_result::<CapabilityStoreMarker>("dictionary_insert")?;
1901            Ok(_response.map(|x| x))
1902        }
1903        self.client.send_query_and_decode::<
1904            CapabilityStoreDictionaryInsertRequest,
1905            CapabilityStoreDictionaryInsertResult,
1906        >(
1907            (id, item,),
1908            0x7702183689d44c27,
1909            fidl::encoding::DynamicFlags::FLEXIBLE,
1910            _decode,
1911        )
1912    }
1913
1914    type DictionaryGetResponseFut = fidl::client::QueryResponseFut<
1915        CapabilityStoreDictionaryGetResult,
1916        fidl::encoding::DefaultFuchsiaResourceDialect,
1917    >;
1918    fn r#dictionary_get(
1919        &self,
1920        mut id: u64,
1921        mut key: &str,
1922        mut dest_id: u64,
1923    ) -> Self::DictionaryGetResponseFut {
1924        fn _decode(
1925            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1926        ) -> Result<CapabilityStoreDictionaryGetResult, fidl::Error> {
1927            let _response = fidl::client::decode_transaction_body::<
1928                fidl::encoding::FlexibleResultType<
1929                    fidl::encoding::EmptyStruct,
1930                    CapabilityStoreError,
1931                >,
1932                fidl::encoding::DefaultFuchsiaResourceDialect,
1933                0x4d9e27538284add2,
1934            >(_buf?)?
1935            .into_result::<CapabilityStoreMarker>("dictionary_get")?;
1936            Ok(_response.map(|x| x))
1937        }
1938        self.client.send_query_and_decode::<
1939            CapabilityStoreDictionaryGetRequest,
1940            CapabilityStoreDictionaryGetResult,
1941        >(
1942            (id, key, dest_id,),
1943            0x4d9e27538284add2,
1944            fidl::encoding::DynamicFlags::FLEXIBLE,
1945            _decode,
1946        )
1947    }
1948
1949    type DictionaryRemoveResponseFut = fidl::client::QueryResponseFut<
1950        CapabilityStoreDictionaryRemoveResult,
1951        fidl::encoding::DefaultFuchsiaResourceDialect,
1952    >;
1953    fn r#dictionary_remove(
1954        &self,
1955        mut id: u64,
1956        mut key: &str,
1957        mut dest_id: Option<&WrappedCapabilityId>,
1958    ) -> Self::DictionaryRemoveResponseFut {
1959        fn _decode(
1960            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1961        ) -> Result<CapabilityStoreDictionaryRemoveResult, fidl::Error> {
1962            let _response = fidl::client::decode_transaction_body::<
1963                fidl::encoding::FlexibleResultType<
1964                    fidl::encoding::EmptyStruct,
1965                    CapabilityStoreError,
1966                >,
1967                fidl::encoding::DefaultFuchsiaResourceDialect,
1968                0x4c5c025ab05d4f3,
1969            >(_buf?)?
1970            .into_result::<CapabilityStoreMarker>("dictionary_remove")?;
1971            Ok(_response.map(|x| x))
1972        }
1973        self.client.send_query_and_decode::<
1974            CapabilityStoreDictionaryRemoveRequest,
1975            CapabilityStoreDictionaryRemoveResult,
1976        >(
1977            (id, key, dest_id,),
1978            0x4c5c025ab05d4f3,
1979            fidl::encoding::DynamicFlags::FLEXIBLE,
1980            _decode,
1981        )
1982    }
1983
1984    type DictionaryCopyResponseFut = fidl::client::QueryResponseFut<
1985        CapabilityStoreDictionaryCopyResult,
1986        fidl::encoding::DefaultFuchsiaResourceDialect,
1987    >;
1988    fn r#dictionary_copy(&self, mut id: u64, mut dest_id: u64) -> Self::DictionaryCopyResponseFut {
1989        fn _decode(
1990            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1991        ) -> Result<CapabilityStoreDictionaryCopyResult, fidl::Error> {
1992            let _response = fidl::client::decode_transaction_body::<
1993                fidl::encoding::FlexibleResultType<
1994                    fidl::encoding::EmptyStruct,
1995                    CapabilityStoreError,
1996                >,
1997                fidl::encoding::DefaultFuchsiaResourceDialect,
1998                0x3733ecdf4ea1b44f,
1999            >(_buf?)?
2000            .into_result::<CapabilityStoreMarker>("dictionary_copy")?;
2001            Ok(_response.map(|x| x))
2002        }
2003        self.client.send_query_and_decode::<
2004            CapabilityStoreDictionaryCopyRequest,
2005            CapabilityStoreDictionaryCopyResult,
2006        >(
2007            (id, dest_id,),
2008            0x3733ecdf4ea1b44f,
2009            fidl::encoding::DynamicFlags::FLEXIBLE,
2010            _decode,
2011        )
2012    }
2013
2014    type DictionaryKeysResponseFut = fidl::client::QueryResponseFut<
2015        CapabilityStoreDictionaryKeysResult,
2016        fidl::encoding::DefaultFuchsiaResourceDialect,
2017    >;
2018    fn r#dictionary_keys(
2019        &self,
2020        mut id: u64,
2021        mut iterator: fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>,
2022    ) -> Self::DictionaryKeysResponseFut {
2023        fn _decode(
2024            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2025        ) -> Result<CapabilityStoreDictionaryKeysResult, fidl::Error> {
2026            let _response = fidl::client::decode_transaction_body::<
2027                fidl::encoding::FlexibleResultType<
2028                    fidl::encoding::EmptyStruct,
2029                    CapabilityStoreError,
2030                >,
2031                fidl::encoding::DefaultFuchsiaResourceDialect,
2032                0x84b05577ceaec9e,
2033            >(_buf?)?
2034            .into_result::<CapabilityStoreMarker>("dictionary_keys")?;
2035            Ok(_response.map(|x| x))
2036        }
2037        self.client.send_query_and_decode::<
2038            CapabilityStoreDictionaryKeysRequest,
2039            CapabilityStoreDictionaryKeysResult,
2040        >(
2041            (id, iterator,),
2042            0x84b05577ceaec9e,
2043            fidl::encoding::DynamicFlags::FLEXIBLE,
2044            _decode,
2045        )
2046    }
2047
2048    type DictionaryEnumerateResponseFut = fidl::client::QueryResponseFut<
2049        CapabilityStoreDictionaryEnumerateResult,
2050        fidl::encoding::DefaultFuchsiaResourceDialect,
2051    >;
2052    fn r#dictionary_enumerate(
2053        &self,
2054        mut id: u64,
2055        mut iterator: fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
2056    ) -> Self::DictionaryEnumerateResponseFut {
2057        fn _decode(
2058            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2059        ) -> Result<CapabilityStoreDictionaryEnumerateResult, fidl::Error> {
2060            let _response = fidl::client::decode_transaction_body::<
2061                fidl::encoding::FlexibleResultType<
2062                    fidl::encoding::EmptyStruct,
2063                    CapabilityStoreError,
2064                >,
2065                fidl::encoding::DefaultFuchsiaResourceDialect,
2066                0xd6279b6ced04641,
2067            >(_buf?)?
2068            .into_result::<CapabilityStoreMarker>("dictionary_enumerate")?;
2069            Ok(_response.map(|x| x))
2070        }
2071        self.client.send_query_and_decode::<
2072            CapabilityStoreDictionaryEnumerateRequest,
2073            CapabilityStoreDictionaryEnumerateResult,
2074        >(
2075            (id, iterator,),
2076            0xd6279b6ced04641,
2077            fidl::encoding::DynamicFlags::FLEXIBLE,
2078            _decode,
2079        )
2080    }
2081
2082    type DictionaryDrainResponseFut = fidl::client::QueryResponseFut<
2083        CapabilityStoreDictionaryDrainResult,
2084        fidl::encoding::DefaultFuchsiaResourceDialect,
2085    >;
2086    fn r#dictionary_drain(
2087        &self,
2088        mut id: u64,
2089        mut iterator: Option<fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>>,
2090    ) -> Self::DictionaryDrainResponseFut {
2091        fn _decode(
2092            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2093        ) -> Result<CapabilityStoreDictionaryDrainResult, fidl::Error> {
2094            let _response = fidl::client::decode_transaction_body::<
2095                fidl::encoding::FlexibleResultType<
2096                    fidl::encoding::EmptyStruct,
2097                    CapabilityStoreError,
2098                >,
2099                fidl::encoding::DefaultFuchsiaResourceDialect,
2100                0x28a3a3f84d928cd8,
2101            >(_buf?)?
2102            .into_result::<CapabilityStoreMarker>("dictionary_drain")?;
2103            Ok(_response.map(|x| x))
2104        }
2105        self.client.send_query_and_decode::<
2106            CapabilityStoreDictionaryDrainRequest,
2107            CapabilityStoreDictionaryDrainResult,
2108        >(
2109            (id, iterator,),
2110            0x28a3a3f84d928cd8,
2111            fidl::encoding::DynamicFlags::FLEXIBLE,
2112            _decode,
2113        )
2114    }
2115}
2116
2117pub struct CapabilityStoreEventStream {
2118    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2119}
2120
2121impl std::marker::Unpin for CapabilityStoreEventStream {}
2122
2123impl futures::stream::FusedStream for CapabilityStoreEventStream {
2124    fn is_terminated(&self) -> bool {
2125        self.event_receiver.is_terminated()
2126    }
2127}
2128
2129impl futures::Stream for CapabilityStoreEventStream {
2130    type Item = Result<CapabilityStoreEvent, fidl::Error>;
2131
2132    fn poll_next(
2133        mut self: std::pin::Pin<&mut Self>,
2134        cx: &mut std::task::Context<'_>,
2135    ) -> std::task::Poll<Option<Self::Item>> {
2136        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2137            &mut self.event_receiver,
2138            cx
2139        )?) {
2140            Some(buf) => std::task::Poll::Ready(Some(CapabilityStoreEvent::decode(buf))),
2141            None => std::task::Poll::Ready(None),
2142        }
2143    }
2144}
2145
2146#[derive(Debug)]
2147pub enum CapabilityStoreEvent {
2148    #[non_exhaustive]
2149    _UnknownEvent {
2150        /// Ordinal of the event that was sent.
2151        ordinal: u64,
2152    },
2153}
2154
2155impl CapabilityStoreEvent {
2156    /// Decodes a message buffer as a [`CapabilityStoreEvent`].
2157    fn decode(
2158        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2159    ) -> Result<CapabilityStoreEvent, fidl::Error> {
2160        let (bytes, _handles) = buf.split_mut();
2161        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2162        debug_assert_eq!(tx_header.tx_id, 0);
2163        match tx_header.ordinal {
2164            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2165                Ok(CapabilityStoreEvent::_UnknownEvent { ordinal: tx_header.ordinal })
2166            }
2167            _ => Err(fidl::Error::UnknownOrdinal {
2168                ordinal: tx_header.ordinal,
2169                protocol_name:
2170                    <CapabilityStoreMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2171            }),
2172        }
2173    }
2174}
2175
2176/// A Stream of incoming requests for fuchsia.component.sandbox/CapabilityStore.
2177pub struct CapabilityStoreRequestStream {
2178    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2179    is_terminated: bool,
2180}
2181
2182impl std::marker::Unpin for CapabilityStoreRequestStream {}
2183
2184impl futures::stream::FusedStream for CapabilityStoreRequestStream {
2185    fn is_terminated(&self) -> bool {
2186        self.is_terminated
2187    }
2188}
2189
2190impl fidl::endpoints::RequestStream for CapabilityStoreRequestStream {
2191    type Protocol = CapabilityStoreMarker;
2192    type ControlHandle = CapabilityStoreControlHandle;
2193
2194    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2195        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2196    }
2197
2198    fn control_handle(&self) -> Self::ControlHandle {
2199        CapabilityStoreControlHandle { inner: self.inner.clone() }
2200    }
2201
2202    fn into_inner(
2203        self,
2204    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2205    {
2206        (self.inner, self.is_terminated)
2207    }
2208
2209    fn from_inner(
2210        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2211        is_terminated: bool,
2212    ) -> Self {
2213        Self { inner, is_terminated }
2214    }
2215}
2216
2217impl futures::Stream for CapabilityStoreRequestStream {
2218    type Item = Result<CapabilityStoreRequest, fidl::Error>;
2219
2220    fn poll_next(
2221        mut self: std::pin::Pin<&mut Self>,
2222        cx: &mut std::task::Context<'_>,
2223    ) -> std::task::Poll<Option<Self::Item>> {
2224        let this = &mut *self;
2225        if this.inner.check_shutdown(cx) {
2226            this.is_terminated = true;
2227            return std::task::Poll::Ready(None);
2228        }
2229        if this.is_terminated {
2230            panic!("polled CapabilityStoreRequestStream after completion");
2231        }
2232        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2233            |bytes, handles| {
2234                match this.inner.channel().read_etc(cx, bytes, handles) {
2235                    std::task::Poll::Ready(Ok(())) => {}
2236                    std::task::Poll::Pending => return std::task::Poll::Pending,
2237                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2238                        this.is_terminated = true;
2239                        return std::task::Poll::Ready(None);
2240                    }
2241                    std::task::Poll::Ready(Err(e)) => {
2242                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2243                            e.into(),
2244                        ))))
2245                    }
2246                }
2247
2248                // A message has been received from the channel
2249                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2250
2251                std::task::Poll::Ready(Some(match header.ordinal {
2252                    0x5d5d35d9c20a2184 => {
2253                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2254                        let mut req = fidl::new_empty!(
2255                            CapabilityStoreDuplicateRequest,
2256                            fidl::encoding::DefaultFuchsiaResourceDialect
2257                        );
2258                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDuplicateRequest>(&header, _body_bytes, handles, &mut req)?;
2259                        let control_handle =
2260                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2261                        Ok(CapabilityStoreRequest::Duplicate {
2262                            id: req.id,
2263                            dest_id: req.dest_id,
2264
2265                            responder: CapabilityStoreDuplicateResponder {
2266                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2267                                tx_id: header.tx_id,
2268                            },
2269                        })
2270                    }
2271                    0xa745c0990fc2559 => {
2272                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2273                        let mut req = fidl::new_empty!(
2274                            CapabilityStoreDropRequest,
2275                            fidl::encoding::DefaultFuchsiaResourceDialect
2276                        );
2277                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDropRequest>(&header, _body_bytes, handles, &mut req)?;
2278                        let control_handle =
2279                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2280                        Ok(CapabilityStoreRequest::Drop {
2281                            id: req.id,
2282
2283                            responder: CapabilityStoreDropResponder {
2284                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2285                                tx_id: header.tx_id,
2286                            },
2287                        })
2288                    }
2289                    0x3237a8f4748faff => {
2290                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2291                        let mut req = fidl::new_empty!(
2292                            CapabilityStoreExportRequest,
2293                            fidl::encoding::DefaultFuchsiaResourceDialect
2294                        );
2295                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreExportRequest>(&header, _body_bytes, handles, &mut req)?;
2296                        let control_handle =
2297                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2298                        Ok(CapabilityStoreRequest::Export {
2299                            id: req.id,
2300
2301                            responder: CapabilityStoreExportResponder {
2302                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2303                                tx_id: header.tx_id,
2304                            },
2305                        })
2306                    }
2307                    0x1f96157a29f4539b => {
2308                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2309                        let mut req = fidl::new_empty!(
2310                            CapabilityStoreImportRequest,
2311                            fidl::encoding::DefaultFuchsiaResourceDialect
2312                        );
2313                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreImportRequest>(&header, _body_bytes, handles, &mut req)?;
2314                        let control_handle =
2315                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2316                        Ok(CapabilityStoreRequest::Import {
2317                            id: req.id,
2318                            capability: req.capability,
2319
2320                            responder: CapabilityStoreImportResponder {
2321                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2322                                tx_id: header.tx_id,
2323                            },
2324                        })
2325                    }
2326                    0x29592c5d63e91c25 => {
2327                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2328                        let mut req = fidl::new_empty!(
2329                            CapabilityStoreConnectorCreateRequest,
2330                            fidl::encoding::DefaultFuchsiaResourceDialect
2331                        );
2332                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreConnectorCreateRequest>(&header, _body_bytes, handles, &mut req)?;
2333                        let control_handle =
2334                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2335                        Ok(CapabilityStoreRequest::ConnectorCreate {
2336                            id: req.id,
2337                            receiver: req.receiver,
2338
2339                            responder: CapabilityStoreConnectorCreateResponder {
2340                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2341                                tx_id: header.tx_id,
2342                            },
2343                        })
2344                    }
2345                    0x537e69ab40563b9f => {
2346                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2347                        let mut req = fidl::new_empty!(
2348                            CapabilityStoreConnectorOpenRequest,
2349                            fidl::encoding::DefaultFuchsiaResourceDialect
2350                        );
2351                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreConnectorOpenRequest>(&header, _body_bytes, handles, &mut req)?;
2352                        let control_handle =
2353                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2354                        Ok(CapabilityStoreRequest::ConnectorOpen {
2355                            id: req.id,
2356                            server_end: req.server_end,
2357
2358                            responder: CapabilityStoreConnectorOpenResponder {
2359                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2360                                tx_id: header.tx_id,
2361                            },
2362                        })
2363                    }
2364                    0x186138a11ccf19bb => {
2365                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2366                        let mut req = fidl::new_empty!(
2367                            CapabilityStoreDirConnectorCreateRequest,
2368                            fidl::encoding::DefaultFuchsiaResourceDialect
2369                        );
2370                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDirConnectorCreateRequest>(&header, _body_bytes, handles, &mut req)?;
2371                        let control_handle =
2372                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2373                        Ok(CapabilityStoreRequest::DirConnectorCreate {
2374                            id: req.id,
2375                            receiver: req.receiver,
2376
2377                            responder: CapabilityStoreDirConnectorCreateResponder {
2378                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2379                                tx_id: header.tx_id,
2380                            },
2381                        })
2382                    }
2383                    0x5650d3d6a3a13901 => {
2384                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2385                        let mut req = fidl::new_empty!(
2386                            CapabilityStoreDirConnectorOpenRequest,
2387                            fidl::encoding::DefaultFuchsiaResourceDialect
2388                        );
2389                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDirConnectorOpenRequest>(&header, _body_bytes, handles, &mut req)?;
2390                        let control_handle =
2391                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2392                        Ok(CapabilityStoreRequest::DirConnectorOpen {
2393                            id: req.id,
2394                            server_end: req.server_end,
2395
2396                            responder: CapabilityStoreDirConnectorOpenResponder {
2397                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2398                                tx_id: header.tx_id,
2399                            },
2400                        })
2401                    }
2402                    0x6997c8dfc63de093 => {
2403                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2404                        let mut req = fidl::new_empty!(
2405                            CapabilityStoreDictionaryCreateRequest,
2406                            fidl::encoding::DefaultFuchsiaResourceDialect
2407                        );
2408                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryCreateRequest>(&header, _body_bytes, handles, &mut req)?;
2409                        let control_handle =
2410                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2411                        Ok(CapabilityStoreRequest::DictionaryCreate {
2412                            id: req.id,
2413
2414                            responder: CapabilityStoreDictionaryCreateResponder {
2415                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2416                                tx_id: header.tx_id,
2417                            },
2418                        })
2419                    }
2420                    0x72fd686c37b6025f => {
2421                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2422                        let mut req = fidl::new_empty!(
2423                            CapabilityStoreDictionaryLegacyImportRequest,
2424                            fidl::encoding::DefaultFuchsiaResourceDialect
2425                        );
2426                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryLegacyImportRequest>(&header, _body_bytes, handles, &mut req)?;
2427                        let control_handle =
2428                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2429                        Ok(CapabilityStoreRequest::DictionaryLegacyImport {
2430                            id: req.id,
2431                            client_end: req.client_end,
2432
2433                            responder: CapabilityStoreDictionaryLegacyImportResponder {
2434                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2435                                tx_id: header.tx_id,
2436                            },
2437                        })
2438                    }
2439                    0x407e15cc4bde5dcd => {
2440                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2441                        let mut req = fidl::new_empty!(
2442                            CapabilityStoreDictionaryLegacyExportRequest,
2443                            fidl::encoding::DefaultFuchsiaResourceDialect
2444                        );
2445                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryLegacyExportRequest>(&header, _body_bytes, handles, &mut req)?;
2446                        let control_handle =
2447                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2448                        Ok(CapabilityStoreRequest::DictionaryLegacyExport {
2449                            id: req.id,
2450                            server_end: req.server_end,
2451
2452                            responder: CapabilityStoreDictionaryLegacyExportResponder {
2453                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2454                                tx_id: header.tx_id,
2455                            },
2456                        })
2457                    }
2458                    0x7702183689d44c27 => {
2459                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2460                        let mut req = fidl::new_empty!(
2461                            CapabilityStoreDictionaryInsertRequest,
2462                            fidl::encoding::DefaultFuchsiaResourceDialect
2463                        );
2464                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryInsertRequest>(&header, _body_bytes, handles, &mut req)?;
2465                        let control_handle =
2466                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2467                        Ok(CapabilityStoreRequest::DictionaryInsert {
2468                            id: req.id,
2469                            item: req.item,
2470
2471                            responder: CapabilityStoreDictionaryInsertResponder {
2472                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2473                                tx_id: header.tx_id,
2474                            },
2475                        })
2476                    }
2477                    0x4d9e27538284add2 => {
2478                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2479                        let mut req = fidl::new_empty!(
2480                            CapabilityStoreDictionaryGetRequest,
2481                            fidl::encoding::DefaultFuchsiaResourceDialect
2482                        );
2483                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryGetRequest>(&header, _body_bytes, handles, &mut req)?;
2484                        let control_handle =
2485                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2486                        Ok(CapabilityStoreRequest::DictionaryGet {
2487                            id: req.id,
2488                            key: req.key,
2489                            dest_id: req.dest_id,
2490
2491                            responder: CapabilityStoreDictionaryGetResponder {
2492                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2493                                tx_id: header.tx_id,
2494                            },
2495                        })
2496                    }
2497                    0x4c5c025ab05d4f3 => {
2498                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2499                        let mut req = fidl::new_empty!(
2500                            CapabilityStoreDictionaryRemoveRequest,
2501                            fidl::encoding::DefaultFuchsiaResourceDialect
2502                        );
2503                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryRemoveRequest>(&header, _body_bytes, handles, &mut req)?;
2504                        let control_handle =
2505                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2506                        Ok(CapabilityStoreRequest::DictionaryRemove {
2507                            id: req.id,
2508                            key: req.key,
2509                            dest_id: req.dest_id,
2510
2511                            responder: CapabilityStoreDictionaryRemoveResponder {
2512                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2513                                tx_id: header.tx_id,
2514                            },
2515                        })
2516                    }
2517                    0x3733ecdf4ea1b44f => {
2518                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2519                        let mut req = fidl::new_empty!(
2520                            CapabilityStoreDictionaryCopyRequest,
2521                            fidl::encoding::DefaultFuchsiaResourceDialect
2522                        );
2523                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryCopyRequest>(&header, _body_bytes, handles, &mut req)?;
2524                        let control_handle =
2525                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2526                        Ok(CapabilityStoreRequest::DictionaryCopy {
2527                            id: req.id,
2528                            dest_id: req.dest_id,
2529
2530                            responder: CapabilityStoreDictionaryCopyResponder {
2531                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2532                                tx_id: header.tx_id,
2533                            },
2534                        })
2535                    }
2536                    0x84b05577ceaec9e => {
2537                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2538                        let mut req = fidl::new_empty!(
2539                            CapabilityStoreDictionaryKeysRequest,
2540                            fidl::encoding::DefaultFuchsiaResourceDialect
2541                        );
2542                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryKeysRequest>(&header, _body_bytes, handles, &mut req)?;
2543                        let control_handle =
2544                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2545                        Ok(CapabilityStoreRequest::DictionaryKeys {
2546                            id: req.id,
2547                            iterator: req.iterator,
2548
2549                            responder: CapabilityStoreDictionaryKeysResponder {
2550                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2551                                tx_id: header.tx_id,
2552                            },
2553                        })
2554                    }
2555                    0xd6279b6ced04641 => {
2556                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2557                        let mut req = fidl::new_empty!(
2558                            CapabilityStoreDictionaryEnumerateRequest,
2559                            fidl::encoding::DefaultFuchsiaResourceDialect
2560                        );
2561                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryEnumerateRequest>(&header, _body_bytes, handles, &mut req)?;
2562                        let control_handle =
2563                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2564                        Ok(CapabilityStoreRequest::DictionaryEnumerate {
2565                            id: req.id,
2566                            iterator: req.iterator,
2567
2568                            responder: CapabilityStoreDictionaryEnumerateResponder {
2569                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2570                                tx_id: header.tx_id,
2571                            },
2572                        })
2573                    }
2574                    0x28a3a3f84d928cd8 => {
2575                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2576                        let mut req = fidl::new_empty!(
2577                            CapabilityStoreDictionaryDrainRequest,
2578                            fidl::encoding::DefaultFuchsiaResourceDialect
2579                        );
2580                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryDrainRequest>(&header, _body_bytes, handles, &mut req)?;
2581                        let control_handle =
2582                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2583                        Ok(CapabilityStoreRequest::DictionaryDrain {
2584                            id: req.id,
2585                            iterator: req.iterator,
2586
2587                            responder: CapabilityStoreDictionaryDrainResponder {
2588                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2589                                tx_id: header.tx_id,
2590                            },
2591                        })
2592                    }
2593                    _ if header.tx_id == 0
2594                        && header
2595                            .dynamic_flags()
2596                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2597                    {
2598                        Ok(CapabilityStoreRequest::_UnknownMethod {
2599                            ordinal: header.ordinal,
2600                            control_handle: CapabilityStoreControlHandle {
2601                                inner: this.inner.clone(),
2602                            },
2603                            method_type: fidl::MethodType::OneWay,
2604                        })
2605                    }
2606                    _ if header
2607                        .dynamic_flags()
2608                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2609                    {
2610                        this.inner.send_framework_err(
2611                            fidl::encoding::FrameworkErr::UnknownMethod,
2612                            header.tx_id,
2613                            header.ordinal,
2614                            header.dynamic_flags(),
2615                            (bytes, handles),
2616                        )?;
2617                        Ok(CapabilityStoreRequest::_UnknownMethod {
2618                            ordinal: header.ordinal,
2619                            control_handle: CapabilityStoreControlHandle {
2620                                inner: this.inner.clone(),
2621                            },
2622                            method_type: fidl::MethodType::TwoWay,
2623                        })
2624                    }
2625                    _ => Err(fidl::Error::UnknownOrdinal {
2626                        ordinal: header.ordinal,
2627                        protocol_name:
2628                            <CapabilityStoreMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2629                    }),
2630                }))
2631            },
2632        )
2633    }
2634}
2635
2636/// Protocol that represents the concept of a "capability store", a repository
2637/// for [Capability]s that are held by the component framework runtime.
2638///
2639/// [CapabilityStore] serves as the main bridge between the component runtime and clients
2640/// that enables them to operate on and exchange [Capability]s. A [CapabilityStore] instance
2641/// contains a set of [Capability]s, each of which has a [CapabilityId] assigned by the client.
2642///
2643/// Normally, a program would not exchange a [CapabilityStore] or [CapabilityId] with other
2644/// programs -- a [CapabilityStore] connection and its enclosed capabilities are intended to
2645/// be "local" to a program. Instead, if a program wishes to exchange a [Capability] with other
2646/// programs, it should [Export] the [Capability] out of the store, send the [Capability] to the
2647/// target program, which can then [Import] the capability into its own store.
2648///
2649/// [CapabilityStore] is also used to manage capability lifetimes. The lifetime of a capability is
2650/// scoped to the [CapabilityStore] in which it resides; i.e. to drop the [CapabilityStore]
2651/// connections to release the capabilities instead it. In addition, [CapabilityStore] supports a
2652/// [Drop] API to drop an individual [Capability] reference. (Note that it is possible for a
2653/// some capabilities, like [DictionaryRef], to have multiple references, in which case all of
2654/// the references must be dropped for the underlying resource to be released.)
2655///
2656/// A note about semantics: the [CapabilityStore] APIs do not return [CapabilityId]s, because
2657/// [CapabilityId]s are assigned by the client. Instead, when a method would semantically return
2658/// a capability, this is expressed by taking the destination [CapabilityId] as an output parameter.
2659#[derive(Debug)]
2660pub enum CapabilityStoreRequest {
2661    /// Duplicates the capability with `id` to `dest_id`.
2662    ///
2663    /// Errors:
2664    ///
2665    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2666    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
2667    /// - `NOT_DUPLICATABLE` if `id` could not be duplicated.
2668    Duplicate { id: u64, dest_id: u64, responder: CapabilityStoreDuplicateResponder },
2669    /// Drops the capability with `id` from this [`CapabilityStore`].
2670    ///
2671    /// Errors:
2672    ///
2673    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2674    Drop { id: u64, responder: CapabilityStoreDropResponder },
2675    /// Exports the capability with the client-assigned identifier `id` to
2676    /// `capability`. This operation removes the capability from the store. If
2677    /// this is not desired, [Duplicate] the capability first.
2678    ///
2679    /// Errors:
2680    ///
2681    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2682    Export { id: u64, responder: CapabilityStoreExportResponder },
2683    /// Imports `capability` into this store with the client-assigned `id`.
2684    ///
2685    /// Errors:
2686    ///
2687    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
2688    /// - `BAD_CAPABILITY` if `capability` was not a valid [Capability].
2689    Import { id: u64, capability: Capability, responder: CapabilityStoreImportResponder },
2690    /// Creates a [Connector] from a [Receiver]. Incoming connections to the [Connector] will be
2691    /// dispatched to this [Receiver].
2692    ///
2693    /// Errors:
2694    ///
2695    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
2696    ConnectorCreate {
2697        id: u64,
2698        receiver: fidl::endpoints::ClientEnd<ReceiverMarker>,
2699        responder: CapabilityStoreConnectorCreateResponder,
2700    },
2701    /// Open a connection from the provided [Connector] capability that will be dispatched to
2702    /// the [Receiver] on the other end.
2703    ///
2704    /// If there is an error, it will be reported as a zx.Status epitaph on `server_end`.
2705    ///
2706    /// Errors:
2707    ///
2708    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2709    /// - `WRONG_TYPE` if `id` was not a connector capability.
2710    ConnectorOpen {
2711        id: u64,
2712        server_end: fidl::Channel,
2713        responder: CapabilityStoreConnectorOpenResponder,
2714    },
2715    /// Creates a [DirConnector] from a [DirReceiver]. Incoming connections to the [DirConnector]
2716    /// will be dispatched to this [DirReceiver].
2717    ///
2718    /// Errors:
2719    ///
2720    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
2721    DirConnectorCreate {
2722        id: u64,
2723        receiver: fidl::endpoints::ClientEnd<DirReceiverMarker>,
2724        responder: CapabilityStoreDirConnectorCreateResponder,
2725    },
2726    /// Open a connection from the provided [DirConnector] capability that will be dispatched to
2727    /// the [DirReceiver] on the other end.
2728    ///
2729    /// This method does not take `Open`/`Open3` parameters such as `flags` or `path`.
2730    /// Clients that wish to specify these can get an initial connection from this method
2731    /// and call `fuchsia.io/Directory.Open` on it. See the [DirReceiver] documentation for
2732    /// more information about the expectations of the server side.
2733    ///
2734    /// If there was an error making the connection, it will be reported as a zx.Status
2735    /// epitaph on `server_end`.
2736    ///
2737    /// Errors:
2738    ///
2739    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2740    /// - `WRONG_TYPE` if `id` was not a connector capability.
2741    DirConnectorOpen {
2742        id: u64,
2743        server_end: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
2744        responder: CapabilityStoreDirConnectorOpenResponder,
2745    },
2746    /// Creates a new empty dictionary in this [`CapabilityStore`] with client-assigned `id`.
2747    ///
2748    /// Errors:
2749    ///
2750    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
2751    DictionaryCreate { id: u64, responder: CapabilityStoreDictionaryCreateResponder },
2752    /// Imports a dictionary in the form of a channel.
2753    ///
2754    /// This is a legacy API to support backward compatibility with APIs that take a [Dictionary]
2755    /// channel.
2756    ///
2757    /// Errors:
2758    ///
2759    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
2760    /// - `BAD_CAPABILITY` if `client_end` was not a valid dictionary channel.
2761    DictionaryLegacyImport {
2762        id: u64,
2763        client_end: fidl::Channel,
2764        responder: CapabilityStoreDictionaryLegacyImportResponder,
2765    },
2766    /// Binds a channel to the dictionary with `id`. The channel can
2767    /// be re-imported into a [CapabilityStore] with [DictionaryImportLegacy].
2768    ///
2769    /// This is a legacy API to support backward compatibility with APIs that take a [Dictionary]
2770    /// channel.
2771    ///
2772    /// Errors:
2773    ///
2774    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2775    DictionaryLegacyExport {
2776        id: u64,
2777        server_end: fidl::Channel,
2778        responder: CapabilityStoreDictionaryLegacyExportResponder,
2779    },
2780    /// Inserts `item` into the dictionary with `id`. `item.value` is moved into the dictionary and
2781    /// its id is released if this call succeeds.
2782    ///
2783    /// Errors:
2784    ///
2785    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2786    /// - `WRONG_TYPE` if `id` was not a dictionary.
2787    /// - `INVALID_KEY` if `item.key` was invalid.
2788    /// - `ITEM_ALREADY_EXISTS` if the dictionary already contains an item with `item.key`.
2789    DictionaryInsert {
2790        id: u64,
2791        item: DictionaryItem,
2792        responder: CapabilityStoreDictionaryInsertResponder,
2793    },
2794    /// Get a duplicate of a capability from the dictionary with `id`, which is
2795    /// loaded into `dest_id`.
2796    ///
2797    /// Errors:
2798    ///
2799    /// - `ID_NOT_FOUND` if `id` was not a recognized capability id in this store.
2800    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
2801    /// - `WRONG_TYPE` if `id` was not a dictionary.
2802    /// - `INVALID_KEY` if `item.key` was invalid.
2803    /// - `ITEM_NOT_FOUND` if the dictionary does not contain `key`.
2804    /// - `NOT_DUPLICATABLE` if the capability could not be duplicated.
2805    DictionaryGet {
2806        id: u64,
2807        key: String,
2808        dest_id: u64,
2809        responder: CapabilityStoreDictionaryGetResponder,
2810    },
2811    /// Removes a key from the dictionary with `id`. If `dest_id` is present, loads the value
2812    /// into it, otherwise discards the value.
2813    ///
2814    /// Errors:
2815    ///
2816    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2817    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
2818    /// - `WRONG_TYPE` if `id` was not a dictionary.
2819    /// - `INVALID_KEY` if `key` was invalid.
2820    /// - `ITEM_NOT_FOUND` if the dictionary does not contain the key.
2821    DictionaryRemove {
2822        id: u64,
2823        key: String,
2824        dest_id: Option<Box<WrappedCapabilityId>>,
2825        responder: CapabilityStoreDictionaryRemoveResponder,
2826    },
2827    /// Create a new dictionary that contains a duplicate of all the entries in
2828    /// the dictionary with `id`, assigning `dest_id` to the new dictionary.
2829    /// The runtime of this method is linear in the number of top-level entries
2830    /// in the dictionary.
2831    ///
2832    /// For example, if the dictionary contains nested dictionaries, the newly
2833    /// created dictionary will contain references to those same nested
2834    /// dictionaries because the entries are duplicated rather than deep-copied.
2835    ///
2836    /// Errors:
2837    ///
2838    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2839    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
2840    /// - `WRONG_TYPE` if `id` was not a dictionary.
2841    /// - `NOT_DUPLICATABLE` if one of the capabilities in `id` could not be duplicated.
2842    DictionaryCopy { id: u64, dest_id: u64, responder: CapabilityStoreDictionaryCopyResponder },
2843    /// Enumerates the keys in the dictionary with `id`.
2844    ///
2845    /// Errors:
2846    ///
2847    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2848    /// - `WRONG_TYPE` if `id` was not a dictionary.
2849    DictionaryKeys {
2850        id: u64,
2851        iterator: fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>,
2852        responder: CapabilityStoreDictionaryKeysResponder,
2853    },
2854    /// Enumerates the items (keys and values) in the dictionary with `id`.
2855    ///
2856    /// Creates a duplicate of each value (capability). If a value could not be duplicated,
2857    /// the value will be null.
2858    ///
2859    /// Errors:
2860    ///
2861    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2862    /// - `WRONG_TYPE` if `id` was not a dictionary.
2863    DictionaryEnumerate {
2864        id: u64,
2865        iterator: fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
2866        responder: CapabilityStoreDictionaryEnumerateResponder,
2867    },
2868    /// Removes all the entries in this dictionary, returning them in `contents` if provided.
2869    /// If `contents` is not provided, all the items are discarded without enumerating them.
2870    ///
2871    /// Errors:
2872    ///
2873    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2874    /// - `WRONG_TYPE` if `id` was not a dictionary.
2875    DictionaryDrain {
2876        id: u64,
2877        iterator: Option<fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>>,
2878        responder: CapabilityStoreDictionaryDrainResponder,
2879    },
2880    /// An interaction was received which does not match any known method.
2881    #[non_exhaustive]
2882    _UnknownMethod {
2883        /// Ordinal of the method that was called.
2884        ordinal: u64,
2885        control_handle: CapabilityStoreControlHandle,
2886        method_type: fidl::MethodType,
2887    },
2888}
2889
2890impl CapabilityStoreRequest {
2891    #[allow(irrefutable_let_patterns)]
2892    pub fn into_duplicate(self) -> Option<(u64, u64, CapabilityStoreDuplicateResponder)> {
2893        if let CapabilityStoreRequest::Duplicate { id, dest_id, responder } = self {
2894            Some((id, dest_id, responder))
2895        } else {
2896            None
2897        }
2898    }
2899
2900    #[allow(irrefutable_let_patterns)]
2901    pub fn into_drop(self) -> Option<(u64, CapabilityStoreDropResponder)> {
2902        if let CapabilityStoreRequest::Drop { id, responder } = self {
2903            Some((id, responder))
2904        } else {
2905            None
2906        }
2907    }
2908
2909    #[allow(irrefutable_let_patterns)]
2910    pub fn into_export(self) -> Option<(u64, CapabilityStoreExportResponder)> {
2911        if let CapabilityStoreRequest::Export { id, responder } = self {
2912            Some((id, responder))
2913        } else {
2914            None
2915        }
2916    }
2917
2918    #[allow(irrefutable_let_patterns)]
2919    pub fn into_import(self) -> Option<(u64, Capability, CapabilityStoreImportResponder)> {
2920        if let CapabilityStoreRequest::Import { id, capability, responder } = self {
2921            Some((id, capability, responder))
2922        } else {
2923            None
2924        }
2925    }
2926
2927    #[allow(irrefutable_let_patterns)]
2928    pub fn into_connector_create(
2929        self,
2930    ) -> Option<(
2931        u64,
2932        fidl::endpoints::ClientEnd<ReceiverMarker>,
2933        CapabilityStoreConnectorCreateResponder,
2934    )> {
2935        if let CapabilityStoreRequest::ConnectorCreate { id, receiver, responder } = self {
2936            Some((id, receiver, responder))
2937        } else {
2938            None
2939        }
2940    }
2941
2942    #[allow(irrefutable_let_patterns)]
2943    pub fn into_connector_open(
2944        self,
2945    ) -> Option<(u64, fidl::Channel, CapabilityStoreConnectorOpenResponder)> {
2946        if let CapabilityStoreRequest::ConnectorOpen { id, server_end, responder } = self {
2947            Some((id, server_end, responder))
2948        } else {
2949            None
2950        }
2951    }
2952
2953    #[allow(irrefutable_let_patterns)]
2954    pub fn into_dir_connector_create(
2955        self,
2956    ) -> Option<(
2957        u64,
2958        fidl::endpoints::ClientEnd<DirReceiverMarker>,
2959        CapabilityStoreDirConnectorCreateResponder,
2960    )> {
2961        if let CapabilityStoreRequest::DirConnectorCreate { id, receiver, responder } = self {
2962            Some((id, receiver, responder))
2963        } else {
2964            None
2965        }
2966    }
2967
2968    #[allow(irrefutable_let_patterns)]
2969    pub fn into_dir_connector_open(
2970        self,
2971    ) -> Option<(
2972        u64,
2973        fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
2974        CapabilityStoreDirConnectorOpenResponder,
2975    )> {
2976        if let CapabilityStoreRequest::DirConnectorOpen { id, server_end, responder } = self {
2977            Some((id, server_end, responder))
2978        } else {
2979            None
2980        }
2981    }
2982
2983    #[allow(irrefutable_let_patterns)]
2984    pub fn into_dictionary_create(self) -> Option<(u64, CapabilityStoreDictionaryCreateResponder)> {
2985        if let CapabilityStoreRequest::DictionaryCreate { id, responder } = self {
2986            Some((id, responder))
2987        } else {
2988            None
2989        }
2990    }
2991
2992    #[allow(irrefutable_let_patterns)]
2993    pub fn into_dictionary_legacy_import(
2994        self,
2995    ) -> Option<(u64, fidl::Channel, CapabilityStoreDictionaryLegacyImportResponder)> {
2996        if let CapabilityStoreRequest::DictionaryLegacyImport { id, client_end, responder } = self {
2997            Some((id, client_end, responder))
2998        } else {
2999            None
3000        }
3001    }
3002
3003    #[allow(irrefutable_let_patterns)]
3004    pub fn into_dictionary_legacy_export(
3005        self,
3006    ) -> Option<(u64, fidl::Channel, CapabilityStoreDictionaryLegacyExportResponder)> {
3007        if let CapabilityStoreRequest::DictionaryLegacyExport { id, server_end, responder } = self {
3008            Some((id, server_end, responder))
3009        } else {
3010            None
3011        }
3012    }
3013
3014    #[allow(irrefutable_let_patterns)]
3015    pub fn into_dictionary_insert(
3016        self,
3017    ) -> Option<(u64, DictionaryItem, CapabilityStoreDictionaryInsertResponder)> {
3018        if let CapabilityStoreRequest::DictionaryInsert { id, item, responder } = self {
3019            Some((id, item, responder))
3020        } else {
3021            None
3022        }
3023    }
3024
3025    #[allow(irrefutable_let_patterns)]
3026    pub fn into_dictionary_get(
3027        self,
3028    ) -> Option<(u64, String, u64, CapabilityStoreDictionaryGetResponder)> {
3029        if let CapabilityStoreRequest::DictionaryGet { id, key, dest_id, responder } = self {
3030            Some((id, key, dest_id, responder))
3031        } else {
3032            None
3033        }
3034    }
3035
3036    #[allow(irrefutable_let_patterns)]
3037    pub fn into_dictionary_remove(
3038        self,
3039    ) -> Option<(
3040        u64,
3041        String,
3042        Option<Box<WrappedCapabilityId>>,
3043        CapabilityStoreDictionaryRemoveResponder,
3044    )> {
3045        if let CapabilityStoreRequest::DictionaryRemove { id, key, dest_id, responder } = self {
3046            Some((id, key, dest_id, responder))
3047        } else {
3048            None
3049        }
3050    }
3051
3052    #[allow(irrefutable_let_patterns)]
3053    pub fn into_dictionary_copy(
3054        self,
3055    ) -> Option<(u64, u64, CapabilityStoreDictionaryCopyResponder)> {
3056        if let CapabilityStoreRequest::DictionaryCopy { id, dest_id, responder } = self {
3057            Some((id, dest_id, responder))
3058        } else {
3059            None
3060        }
3061    }
3062
3063    #[allow(irrefutable_let_patterns)]
3064    pub fn into_dictionary_keys(
3065        self,
3066    ) -> Option<(
3067        u64,
3068        fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>,
3069        CapabilityStoreDictionaryKeysResponder,
3070    )> {
3071        if let CapabilityStoreRequest::DictionaryKeys { id, iterator, responder } = self {
3072            Some((id, iterator, responder))
3073        } else {
3074            None
3075        }
3076    }
3077
3078    #[allow(irrefutable_let_patterns)]
3079    pub fn into_dictionary_enumerate(
3080        self,
3081    ) -> Option<(
3082        u64,
3083        fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
3084        CapabilityStoreDictionaryEnumerateResponder,
3085    )> {
3086        if let CapabilityStoreRequest::DictionaryEnumerate { id, iterator, responder } = self {
3087            Some((id, iterator, responder))
3088        } else {
3089            None
3090        }
3091    }
3092
3093    #[allow(irrefutable_let_patterns)]
3094    pub fn into_dictionary_drain(
3095        self,
3096    ) -> Option<(
3097        u64,
3098        Option<fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>>,
3099        CapabilityStoreDictionaryDrainResponder,
3100    )> {
3101        if let CapabilityStoreRequest::DictionaryDrain { id, iterator, responder } = self {
3102            Some((id, iterator, responder))
3103        } else {
3104            None
3105        }
3106    }
3107
3108    /// Name of the method defined in FIDL
3109    pub fn method_name(&self) -> &'static str {
3110        match *self {
3111            CapabilityStoreRequest::Duplicate { .. } => "duplicate",
3112            CapabilityStoreRequest::Drop { .. } => "drop",
3113            CapabilityStoreRequest::Export { .. } => "export",
3114            CapabilityStoreRequest::Import { .. } => "import",
3115            CapabilityStoreRequest::ConnectorCreate { .. } => "connector_create",
3116            CapabilityStoreRequest::ConnectorOpen { .. } => "connector_open",
3117            CapabilityStoreRequest::DirConnectorCreate { .. } => "dir_connector_create",
3118            CapabilityStoreRequest::DirConnectorOpen { .. } => "dir_connector_open",
3119            CapabilityStoreRequest::DictionaryCreate { .. } => "dictionary_create",
3120            CapabilityStoreRequest::DictionaryLegacyImport { .. } => "dictionary_legacy_import",
3121            CapabilityStoreRequest::DictionaryLegacyExport { .. } => "dictionary_legacy_export",
3122            CapabilityStoreRequest::DictionaryInsert { .. } => "dictionary_insert",
3123            CapabilityStoreRequest::DictionaryGet { .. } => "dictionary_get",
3124            CapabilityStoreRequest::DictionaryRemove { .. } => "dictionary_remove",
3125            CapabilityStoreRequest::DictionaryCopy { .. } => "dictionary_copy",
3126            CapabilityStoreRequest::DictionaryKeys { .. } => "dictionary_keys",
3127            CapabilityStoreRequest::DictionaryEnumerate { .. } => "dictionary_enumerate",
3128            CapabilityStoreRequest::DictionaryDrain { .. } => "dictionary_drain",
3129            CapabilityStoreRequest::_UnknownMethod {
3130                method_type: fidl::MethodType::OneWay,
3131                ..
3132            } => "unknown one-way method",
3133            CapabilityStoreRequest::_UnknownMethod {
3134                method_type: fidl::MethodType::TwoWay,
3135                ..
3136            } => "unknown two-way method",
3137        }
3138    }
3139}
3140
3141#[derive(Debug, Clone)]
3142pub struct CapabilityStoreControlHandle {
3143    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3144}
3145
3146impl fidl::endpoints::ControlHandle for CapabilityStoreControlHandle {
3147    fn shutdown(&self) {
3148        self.inner.shutdown()
3149    }
3150    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3151        self.inner.shutdown_with_epitaph(status)
3152    }
3153
3154    fn is_closed(&self) -> bool {
3155        self.inner.channel().is_closed()
3156    }
3157    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3158        self.inner.channel().on_closed()
3159    }
3160
3161    #[cfg(target_os = "fuchsia")]
3162    fn signal_peer(
3163        &self,
3164        clear_mask: zx::Signals,
3165        set_mask: zx::Signals,
3166    ) -> Result<(), zx_status::Status> {
3167        use fidl::Peered;
3168        self.inner.channel().signal_peer(clear_mask, set_mask)
3169    }
3170}
3171
3172impl CapabilityStoreControlHandle {}
3173
3174#[must_use = "FIDL methods require a response to be sent"]
3175#[derive(Debug)]
3176pub struct CapabilityStoreDuplicateResponder {
3177    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3178    tx_id: u32,
3179}
3180
3181/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3182/// if the responder is dropped without sending a response, so that the client
3183/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3184impl std::ops::Drop for CapabilityStoreDuplicateResponder {
3185    fn drop(&mut self) {
3186        self.control_handle.shutdown();
3187        // Safety: drops once, never accessed again
3188        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3189    }
3190}
3191
3192impl fidl::endpoints::Responder for CapabilityStoreDuplicateResponder {
3193    type ControlHandle = CapabilityStoreControlHandle;
3194
3195    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3196        &self.control_handle
3197    }
3198
3199    fn drop_without_shutdown(mut self) {
3200        // Safety: drops once, never accessed again due to mem::forget
3201        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3202        // Prevent Drop from running (which would shut down the channel)
3203        std::mem::forget(self);
3204    }
3205}
3206
3207impl CapabilityStoreDuplicateResponder {
3208    /// Sends a response to the FIDL transaction.
3209    ///
3210    /// Sets the channel to shutdown if an error occurs.
3211    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3212        let _result = self.send_raw(result);
3213        if _result.is_err() {
3214            self.control_handle.shutdown();
3215        }
3216        self.drop_without_shutdown();
3217        _result
3218    }
3219
3220    /// Similar to "send" but does not shutdown the channel if an error occurs.
3221    pub fn send_no_shutdown_on_err(
3222        self,
3223        mut result: Result<(), CapabilityStoreError>,
3224    ) -> Result<(), fidl::Error> {
3225        let _result = self.send_raw(result);
3226        self.drop_without_shutdown();
3227        _result
3228    }
3229
3230    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3231        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3232            fidl::encoding::EmptyStruct,
3233            CapabilityStoreError,
3234        >>(
3235            fidl::encoding::FlexibleResult::new(result),
3236            self.tx_id,
3237            0x5d5d35d9c20a2184,
3238            fidl::encoding::DynamicFlags::FLEXIBLE,
3239        )
3240    }
3241}
3242
3243#[must_use = "FIDL methods require a response to be sent"]
3244#[derive(Debug)]
3245pub struct CapabilityStoreDropResponder {
3246    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3247    tx_id: u32,
3248}
3249
3250/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3251/// if the responder is dropped without sending a response, so that the client
3252/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3253impl std::ops::Drop for CapabilityStoreDropResponder {
3254    fn drop(&mut self) {
3255        self.control_handle.shutdown();
3256        // Safety: drops once, never accessed again
3257        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3258    }
3259}
3260
3261impl fidl::endpoints::Responder for CapabilityStoreDropResponder {
3262    type ControlHandle = CapabilityStoreControlHandle;
3263
3264    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3265        &self.control_handle
3266    }
3267
3268    fn drop_without_shutdown(mut self) {
3269        // Safety: drops once, never accessed again due to mem::forget
3270        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3271        // Prevent Drop from running (which would shut down the channel)
3272        std::mem::forget(self);
3273    }
3274}
3275
3276impl CapabilityStoreDropResponder {
3277    /// Sends a response to the FIDL transaction.
3278    ///
3279    /// Sets the channel to shutdown if an error occurs.
3280    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3281        let _result = self.send_raw(result);
3282        if _result.is_err() {
3283            self.control_handle.shutdown();
3284        }
3285        self.drop_without_shutdown();
3286        _result
3287    }
3288
3289    /// Similar to "send" but does not shutdown the channel if an error occurs.
3290    pub fn send_no_shutdown_on_err(
3291        self,
3292        mut result: Result<(), CapabilityStoreError>,
3293    ) -> Result<(), fidl::Error> {
3294        let _result = self.send_raw(result);
3295        self.drop_without_shutdown();
3296        _result
3297    }
3298
3299    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3300        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3301            fidl::encoding::EmptyStruct,
3302            CapabilityStoreError,
3303        >>(
3304            fidl::encoding::FlexibleResult::new(result),
3305            self.tx_id,
3306            0xa745c0990fc2559,
3307            fidl::encoding::DynamicFlags::FLEXIBLE,
3308        )
3309    }
3310}
3311
3312#[must_use = "FIDL methods require a response to be sent"]
3313#[derive(Debug)]
3314pub struct CapabilityStoreExportResponder {
3315    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3316    tx_id: u32,
3317}
3318
3319/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3320/// if the responder is dropped without sending a response, so that the client
3321/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3322impl std::ops::Drop for CapabilityStoreExportResponder {
3323    fn drop(&mut self) {
3324        self.control_handle.shutdown();
3325        // Safety: drops once, never accessed again
3326        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3327    }
3328}
3329
3330impl fidl::endpoints::Responder for CapabilityStoreExportResponder {
3331    type ControlHandle = CapabilityStoreControlHandle;
3332
3333    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3334        &self.control_handle
3335    }
3336
3337    fn drop_without_shutdown(mut self) {
3338        // Safety: drops once, never accessed again due to mem::forget
3339        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3340        // Prevent Drop from running (which would shut down the channel)
3341        std::mem::forget(self);
3342    }
3343}
3344
3345impl CapabilityStoreExportResponder {
3346    /// Sends a response to the FIDL transaction.
3347    ///
3348    /// Sets the channel to shutdown if an error occurs.
3349    pub fn send(
3350        self,
3351        mut result: Result<Capability, CapabilityStoreError>,
3352    ) -> Result<(), fidl::Error> {
3353        let _result = self.send_raw(result);
3354        if _result.is_err() {
3355            self.control_handle.shutdown();
3356        }
3357        self.drop_without_shutdown();
3358        _result
3359    }
3360
3361    /// Similar to "send" but does not shutdown the channel if an error occurs.
3362    pub fn send_no_shutdown_on_err(
3363        self,
3364        mut result: Result<Capability, CapabilityStoreError>,
3365    ) -> Result<(), fidl::Error> {
3366        let _result = self.send_raw(result);
3367        self.drop_without_shutdown();
3368        _result
3369    }
3370
3371    fn send_raw(
3372        &self,
3373        mut result: Result<Capability, CapabilityStoreError>,
3374    ) -> Result<(), fidl::Error> {
3375        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3376            CapabilityStoreExportResponse,
3377            CapabilityStoreError,
3378        >>(
3379            fidl::encoding::FlexibleResult::new(
3380                result.as_mut().map_err(|e| *e).map(|capability| (capability,)),
3381            ),
3382            self.tx_id,
3383            0x3237a8f4748faff,
3384            fidl::encoding::DynamicFlags::FLEXIBLE,
3385        )
3386    }
3387}
3388
3389#[must_use = "FIDL methods require a response to be sent"]
3390#[derive(Debug)]
3391pub struct CapabilityStoreImportResponder {
3392    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3393    tx_id: u32,
3394}
3395
3396/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3397/// if the responder is dropped without sending a response, so that the client
3398/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3399impl std::ops::Drop for CapabilityStoreImportResponder {
3400    fn drop(&mut self) {
3401        self.control_handle.shutdown();
3402        // Safety: drops once, never accessed again
3403        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3404    }
3405}
3406
3407impl fidl::endpoints::Responder for CapabilityStoreImportResponder {
3408    type ControlHandle = CapabilityStoreControlHandle;
3409
3410    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3411        &self.control_handle
3412    }
3413
3414    fn drop_without_shutdown(mut self) {
3415        // Safety: drops once, never accessed again due to mem::forget
3416        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3417        // Prevent Drop from running (which would shut down the channel)
3418        std::mem::forget(self);
3419    }
3420}
3421
3422impl CapabilityStoreImportResponder {
3423    /// Sends a response to the FIDL transaction.
3424    ///
3425    /// Sets the channel to shutdown if an error occurs.
3426    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3427        let _result = self.send_raw(result);
3428        if _result.is_err() {
3429            self.control_handle.shutdown();
3430        }
3431        self.drop_without_shutdown();
3432        _result
3433    }
3434
3435    /// Similar to "send" but does not shutdown the channel if an error occurs.
3436    pub fn send_no_shutdown_on_err(
3437        self,
3438        mut result: Result<(), CapabilityStoreError>,
3439    ) -> Result<(), fidl::Error> {
3440        let _result = self.send_raw(result);
3441        self.drop_without_shutdown();
3442        _result
3443    }
3444
3445    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3446        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3447            fidl::encoding::EmptyStruct,
3448            CapabilityStoreError,
3449        >>(
3450            fidl::encoding::FlexibleResult::new(result),
3451            self.tx_id,
3452            0x1f96157a29f4539b,
3453            fidl::encoding::DynamicFlags::FLEXIBLE,
3454        )
3455    }
3456}
3457
3458#[must_use = "FIDL methods require a response to be sent"]
3459#[derive(Debug)]
3460pub struct CapabilityStoreConnectorCreateResponder {
3461    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3462    tx_id: u32,
3463}
3464
3465/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3466/// if the responder is dropped without sending a response, so that the client
3467/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3468impl std::ops::Drop for CapabilityStoreConnectorCreateResponder {
3469    fn drop(&mut self) {
3470        self.control_handle.shutdown();
3471        // Safety: drops once, never accessed again
3472        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3473    }
3474}
3475
3476impl fidl::endpoints::Responder for CapabilityStoreConnectorCreateResponder {
3477    type ControlHandle = CapabilityStoreControlHandle;
3478
3479    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3480        &self.control_handle
3481    }
3482
3483    fn drop_without_shutdown(mut self) {
3484        // Safety: drops once, never accessed again due to mem::forget
3485        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3486        // Prevent Drop from running (which would shut down the channel)
3487        std::mem::forget(self);
3488    }
3489}
3490
3491impl CapabilityStoreConnectorCreateResponder {
3492    /// Sends a response to the FIDL transaction.
3493    ///
3494    /// Sets the channel to shutdown if an error occurs.
3495    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3496        let _result = self.send_raw(result);
3497        if _result.is_err() {
3498            self.control_handle.shutdown();
3499        }
3500        self.drop_without_shutdown();
3501        _result
3502    }
3503
3504    /// Similar to "send" but does not shutdown the channel if an error occurs.
3505    pub fn send_no_shutdown_on_err(
3506        self,
3507        mut result: Result<(), CapabilityStoreError>,
3508    ) -> Result<(), fidl::Error> {
3509        let _result = self.send_raw(result);
3510        self.drop_without_shutdown();
3511        _result
3512    }
3513
3514    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3515        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3516            fidl::encoding::EmptyStruct,
3517            CapabilityStoreError,
3518        >>(
3519            fidl::encoding::FlexibleResult::new(result),
3520            self.tx_id,
3521            0x29592c5d63e91c25,
3522            fidl::encoding::DynamicFlags::FLEXIBLE,
3523        )
3524    }
3525}
3526
3527#[must_use = "FIDL methods require a response to be sent"]
3528#[derive(Debug)]
3529pub struct CapabilityStoreConnectorOpenResponder {
3530    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3531    tx_id: u32,
3532}
3533
3534/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3535/// if the responder is dropped without sending a response, so that the client
3536/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3537impl std::ops::Drop for CapabilityStoreConnectorOpenResponder {
3538    fn drop(&mut self) {
3539        self.control_handle.shutdown();
3540        // Safety: drops once, never accessed again
3541        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3542    }
3543}
3544
3545impl fidl::endpoints::Responder for CapabilityStoreConnectorOpenResponder {
3546    type ControlHandle = CapabilityStoreControlHandle;
3547
3548    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3549        &self.control_handle
3550    }
3551
3552    fn drop_without_shutdown(mut self) {
3553        // Safety: drops once, never accessed again due to mem::forget
3554        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3555        // Prevent Drop from running (which would shut down the channel)
3556        std::mem::forget(self);
3557    }
3558}
3559
3560impl CapabilityStoreConnectorOpenResponder {
3561    /// Sends a response to the FIDL transaction.
3562    ///
3563    /// Sets the channel to shutdown if an error occurs.
3564    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3565        let _result = self.send_raw(result);
3566        if _result.is_err() {
3567            self.control_handle.shutdown();
3568        }
3569        self.drop_without_shutdown();
3570        _result
3571    }
3572
3573    /// Similar to "send" but does not shutdown the channel if an error occurs.
3574    pub fn send_no_shutdown_on_err(
3575        self,
3576        mut result: Result<(), CapabilityStoreError>,
3577    ) -> Result<(), fidl::Error> {
3578        let _result = self.send_raw(result);
3579        self.drop_without_shutdown();
3580        _result
3581    }
3582
3583    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3584        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3585            fidl::encoding::EmptyStruct,
3586            CapabilityStoreError,
3587        >>(
3588            fidl::encoding::FlexibleResult::new(result),
3589            self.tx_id,
3590            0x537e69ab40563b9f,
3591            fidl::encoding::DynamicFlags::FLEXIBLE,
3592        )
3593    }
3594}
3595
3596#[must_use = "FIDL methods require a response to be sent"]
3597#[derive(Debug)]
3598pub struct CapabilityStoreDirConnectorCreateResponder {
3599    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3600    tx_id: u32,
3601}
3602
3603/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3604/// if the responder is dropped without sending a response, so that the client
3605/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3606impl std::ops::Drop for CapabilityStoreDirConnectorCreateResponder {
3607    fn drop(&mut self) {
3608        self.control_handle.shutdown();
3609        // Safety: drops once, never accessed again
3610        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3611    }
3612}
3613
3614impl fidl::endpoints::Responder for CapabilityStoreDirConnectorCreateResponder {
3615    type ControlHandle = CapabilityStoreControlHandle;
3616
3617    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3618        &self.control_handle
3619    }
3620
3621    fn drop_without_shutdown(mut self) {
3622        // Safety: drops once, never accessed again due to mem::forget
3623        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3624        // Prevent Drop from running (which would shut down the channel)
3625        std::mem::forget(self);
3626    }
3627}
3628
3629impl CapabilityStoreDirConnectorCreateResponder {
3630    /// Sends a response to the FIDL transaction.
3631    ///
3632    /// Sets the channel to shutdown if an error occurs.
3633    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3634        let _result = self.send_raw(result);
3635        if _result.is_err() {
3636            self.control_handle.shutdown();
3637        }
3638        self.drop_without_shutdown();
3639        _result
3640    }
3641
3642    /// Similar to "send" but does not shutdown the channel if an error occurs.
3643    pub fn send_no_shutdown_on_err(
3644        self,
3645        mut result: Result<(), CapabilityStoreError>,
3646    ) -> Result<(), fidl::Error> {
3647        let _result = self.send_raw(result);
3648        self.drop_without_shutdown();
3649        _result
3650    }
3651
3652    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3653        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3654            fidl::encoding::EmptyStruct,
3655            CapabilityStoreError,
3656        >>(
3657            fidl::encoding::FlexibleResult::new(result),
3658            self.tx_id,
3659            0x186138a11ccf19bb,
3660            fidl::encoding::DynamicFlags::FLEXIBLE,
3661        )
3662    }
3663}
3664
3665#[must_use = "FIDL methods require a response to be sent"]
3666#[derive(Debug)]
3667pub struct CapabilityStoreDirConnectorOpenResponder {
3668    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3669    tx_id: u32,
3670}
3671
3672/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3673/// if the responder is dropped without sending a response, so that the client
3674/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3675impl std::ops::Drop for CapabilityStoreDirConnectorOpenResponder {
3676    fn drop(&mut self) {
3677        self.control_handle.shutdown();
3678        // Safety: drops once, never accessed again
3679        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3680    }
3681}
3682
3683impl fidl::endpoints::Responder for CapabilityStoreDirConnectorOpenResponder {
3684    type ControlHandle = CapabilityStoreControlHandle;
3685
3686    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3687        &self.control_handle
3688    }
3689
3690    fn drop_without_shutdown(mut self) {
3691        // Safety: drops once, never accessed again due to mem::forget
3692        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3693        // Prevent Drop from running (which would shut down the channel)
3694        std::mem::forget(self);
3695    }
3696}
3697
3698impl CapabilityStoreDirConnectorOpenResponder {
3699    /// Sends a response to the FIDL transaction.
3700    ///
3701    /// Sets the channel to shutdown if an error occurs.
3702    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3703        let _result = self.send_raw(result);
3704        if _result.is_err() {
3705            self.control_handle.shutdown();
3706        }
3707        self.drop_without_shutdown();
3708        _result
3709    }
3710
3711    /// Similar to "send" but does not shutdown the channel if an error occurs.
3712    pub fn send_no_shutdown_on_err(
3713        self,
3714        mut result: Result<(), CapabilityStoreError>,
3715    ) -> Result<(), fidl::Error> {
3716        let _result = self.send_raw(result);
3717        self.drop_without_shutdown();
3718        _result
3719    }
3720
3721    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3722        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3723            fidl::encoding::EmptyStruct,
3724            CapabilityStoreError,
3725        >>(
3726            fidl::encoding::FlexibleResult::new(result),
3727            self.tx_id,
3728            0x5650d3d6a3a13901,
3729            fidl::encoding::DynamicFlags::FLEXIBLE,
3730        )
3731    }
3732}
3733
3734#[must_use = "FIDL methods require a response to be sent"]
3735#[derive(Debug)]
3736pub struct CapabilityStoreDictionaryCreateResponder {
3737    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3738    tx_id: u32,
3739}
3740
3741/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3742/// if the responder is dropped without sending a response, so that the client
3743/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3744impl std::ops::Drop for CapabilityStoreDictionaryCreateResponder {
3745    fn drop(&mut self) {
3746        self.control_handle.shutdown();
3747        // Safety: drops once, never accessed again
3748        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3749    }
3750}
3751
3752impl fidl::endpoints::Responder for CapabilityStoreDictionaryCreateResponder {
3753    type ControlHandle = CapabilityStoreControlHandle;
3754
3755    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3756        &self.control_handle
3757    }
3758
3759    fn drop_without_shutdown(mut self) {
3760        // Safety: drops once, never accessed again due to mem::forget
3761        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3762        // Prevent Drop from running (which would shut down the channel)
3763        std::mem::forget(self);
3764    }
3765}
3766
3767impl CapabilityStoreDictionaryCreateResponder {
3768    /// Sends a response to the FIDL transaction.
3769    ///
3770    /// Sets the channel to shutdown if an error occurs.
3771    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3772        let _result = self.send_raw(result);
3773        if _result.is_err() {
3774            self.control_handle.shutdown();
3775        }
3776        self.drop_without_shutdown();
3777        _result
3778    }
3779
3780    /// Similar to "send" but does not shutdown the channel if an error occurs.
3781    pub fn send_no_shutdown_on_err(
3782        self,
3783        mut result: Result<(), CapabilityStoreError>,
3784    ) -> Result<(), fidl::Error> {
3785        let _result = self.send_raw(result);
3786        self.drop_without_shutdown();
3787        _result
3788    }
3789
3790    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3791        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3792            fidl::encoding::EmptyStruct,
3793            CapabilityStoreError,
3794        >>(
3795            fidl::encoding::FlexibleResult::new(result),
3796            self.tx_id,
3797            0x6997c8dfc63de093,
3798            fidl::encoding::DynamicFlags::FLEXIBLE,
3799        )
3800    }
3801}
3802
3803#[must_use = "FIDL methods require a response to be sent"]
3804#[derive(Debug)]
3805pub struct CapabilityStoreDictionaryLegacyImportResponder {
3806    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3807    tx_id: u32,
3808}
3809
3810/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3811/// if the responder is dropped without sending a response, so that the client
3812/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3813impl std::ops::Drop for CapabilityStoreDictionaryLegacyImportResponder {
3814    fn drop(&mut self) {
3815        self.control_handle.shutdown();
3816        // Safety: drops once, never accessed again
3817        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3818    }
3819}
3820
3821impl fidl::endpoints::Responder for CapabilityStoreDictionaryLegacyImportResponder {
3822    type ControlHandle = CapabilityStoreControlHandle;
3823
3824    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3825        &self.control_handle
3826    }
3827
3828    fn drop_without_shutdown(mut self) {
3829        // Safety: drops once, never accessed again due to mem::forget
3830        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3831        // Prevent Drop from running (which would shut down the channel)
3832        std::mem::forget(self);
3833    }
3834}
3835
3836impl CapabilityStoreDictionaryLegacyImportResponder {
3837    /// Sends a response to the FIDL transaction.
3838    ///
3839    /// Sets the channel to shutdown if an error occurs.
3840    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3841        let _result = self.send_raw(result);
3842        if _result.is_err() {
3843            self.control_handle.shutdown();
3844        }
3845        self.drop_without_shutdown();
3846        _result
3847    }
3848
3849    /// Similar to "send" but does not shutdown the channel if an error occurs.
3850    pub fn send_no_shutdown_on_err(
3851        self,
3852        mut result: Result<(), CapabilityStoreError>,
3853    ) -> Result<(), fidl::Error> {
3854        let _result = self.send_raw(result);
3855        self.drop_without_shutdown();
3856        _result
3857    }
3858
3859    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3860        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3861            fidl::encoding::EmptyStruct,
3862            CapabilityStoreError,
3863        >>(
3864            fidl::encoding::FlexibleResult::new(result),
3865            self.tx_id,
3866            0x72fd686c37b6025f,
3867            fidl::encoding::DynamicFlags::FLEXIBLE,
3868        )
3869    }
3870}
3871
3872#[must_use = "FIDL methods require a response to be sent"]
3873#[derive(Debug)]
3874pub struct CapabilityStoreDictionaryLegacyExportResponder {
3875    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3876    tx_id: u32,
3877}
3878
3879/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3880/// if the responder is dropped without sending a response, so that the client
3881/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3882impl std::ops::Drop for CapabilityStoreDictionaryLegacyExportResponder {
3883    fn drop(&mut self) {
3884        self.control_handle.shutdown();
3885        // Safety: drops once, never accessed again
3886        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3887    }
3888}
3889
3890impl fidl::endpoints::Responder for CapabilityStoreDictionaryLegacyExportResponder {
3891    type ControlHandle = CapabilityStoreControlHandle;
3892
3893    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3894        &self.control_handle
3895    }
3896
3897    fn drop_without_shutdown(mut self) {
3898        // Safety: drops once, never accessed again due to mem::forget
3899        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3900        // Prevent Drop from running (which would shut down the channel)
3901        std::mem::forget(self);
3902    }
3903}
3904
3905impl CapabilityStoreDictionaryLegacyExportResponder {
3906    /// Sends a response to the FIDL transaction.
3907    ///
3908    /// Sets the channel to shutdown if an error occurs.
3909    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3910        let _result = self.send_raw(result);
3911        if _result.is_err() {
3912            self.control_handle.shutdown();
3913        }
3914        self.drop_without_shutdown();
3915        _result
3916    }
3917
3918    /// Similar to "send" but does not shutdown the channel if an error occurs.
3919    pub fn send_no_shutdown_on_err(
3920        self,
3921        mut result: Result<(), CapabilityStoreError>,
3922    ) -> Result<(), fidl::Error> {
3923        let _result = self.send_raw(result);
3924        self.drop_without_shutdown();
3925        _result
3926    }
3927
3928    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3929        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3930            fidl::encoding::EmptyStruct,
3931            CapabilityStoreError,
3932        >>(
3933            fidl::encoding::FlexibleResult::new(result),
3934            self.tx_id,
3935            0x407e15cc4bde5dcd,
3936            fidl::encoding::DynamicFlags::FLEXIBLE,
3937        )
3938    }
3939}
3940
3941#[must_use = "FIDL methods require a response to be sent"]
3942#[derive(Debug)]
3943pub struct CapabilityStoreDictionaryInsertResponder {
3944    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3945    tx_id: u32,
3946}
3947
3948/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3949/// if the responder is dropped without sending a response, so that the client
3950/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3951impl std::ops::Drop for CapabilityStoreDictionaryInsertResponder {
3952    fn drop(&mut self) {
3953        self.control_handle.shutdown();
3954        // Safety: drops once, never accessed again
3955        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3956    }
3957}
3958
3959impl fidl::endpoints::Responder for CapabilityStoreDictionaryInsertResponder {
3960    type ControlHandle = CapabilityStoreControlHandle;
3961
3962    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3963        &self.control_handle
3964    }
3965
3966    fn drop_without_shutdown(mut self) {
3967        // Safety: drops once, never accessed again due to mem::forget
3968        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3969        // Prevent Drop from running (which would shut down the channel)
3970        std::mem::forget(self);
3971    }
3972}
3973
3974impl CapabilityStoreDictionaryInsertResponder {
3975    /// Sends a response to the FIDL transaction.
3976    ///
3977    /// Sets the channel to shutdown if an error occurs.
3978    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3979        let _result = self.send_raw(result);
3980        if _result.is_err() {
3981            self.control_handle.shutdown();
3982        }
3983        self.drop_without_shutdown();
3984        _result
3985    }
3986
3987    /// Similar to "send" but does not shutdown the channel if an error occurs.
3988    pub fn send_no_shutdown_on_err(
3989        self,
3990        mut result: Result<(), CapabilityStoreError>,
3991    ) -> Result<(), fidl::Error> {
3992        let _result = self.send_raw(result);
3993        self.drop_without_shutdown();
3994        _result
3995    }
3996
3997    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3998        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3999            fidl::encoding::EmptyStruct,
4000            CapabilityStoreError,
4001        >>(
4002            fidl::encoding::FlexibleResult::new(result),
4003            self.tx_id,
4004            0x7702183689d44c27,
4005            fidl::encoding::DynamicFlags::FLEXIBLE,
4006        )
4007    }
4008}
4009
4010#[must_use = "FIDL methods require a response to be sent"]
4011#[derive(Debug)]
4012pub struct CapabilityStoreDictionaryGetResponder {
4013    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
4014    tx_id: u32,
4015}
4016
4017/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
4018/// if the responder is dropped without sending a response, so that the client
4019/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4020impl std::ops::Drop for CapabilityStoreDictionaryGetResponder {
4021    fn drop(&mut self) {
4022        self.control_handle.shutdown();
4023        // Safety: drops once, never accessed again
4024        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4025    }
4026}
4027
4028impl fidl::endpoints::Responder for CapabilityStoreDictionaryGetResponder {
4029    type ControlHandle = CapabilityStoreControlHandle;
4030
4031    fn control_handle(&self) -> &CapabilityStoreControlHandle {
4032        &self.control_handle
4033    }
4034
4035    fn drop_without_shutdown(mut self) {
4036        // Safety: drops once, never accessed again due to mem::forget
4037        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4038        // Prevent Drop from running (which would shut down the channel)
4039        std::mem::forget(self);
4040    }
4041}
4042
4043impl CapabilityStoreDictionaryGetResponder {
4044    /// Sends a response to the FIDL transaction.
4045    ///
4046    /// Sets the channel to shutdown if an error occurs.
4047    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4048        let _result = self.send_raw(result);
4049        if _result.is_err() {
4050            self.control_handle.shutdown();
4051        }
4052        self.drop_without_shutdown();
4053        _result
4054    }
4055
4056    /// Similar to "send" but does not shutdown the channel if an error occurs.
4057    pub fn send_no_shutdown_on_err(
4058        self,
4059        mut result: Result<(), CapabilityStoreError>,
4060    ) -> Result<(), fidl::Error> {
4061        let _result = self.send_raw(result);
4062        self.drop_without_shutdown();
4063        _result
4064    }
4065
4066    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4067        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4068            fidl::encoding::EmptyStruct,
4069            CapabilityStoreError,
4070        >>(
4071            fidl::encoding::FlexibleResult::new(result),
4072            self.tx_id,
4073            0x4d9e27538284add2,
4074            fidl::encoding::DynamicFlags::FLEXIBLE,
4075        )
4076    }
4077}
4078
4079#[must_use = "FIDL methods require a response to be sent"]
4080#[derive(Debug)]
4081pub struct CapabilityStoreDictionaryRemoveResponder {
4082    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
4083    tx_id: u32,
4084}
4085
4086/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
4087/// if the responder is dropped without sending a response, so that the client
4088/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4089impl std::ops::Drop for CapabilityStoreDictionaryRemoveResponder {
4090    fn drop(&mut self) {
4091        self.control_handle.shutdown();
4092        // Safety: drops once, never accessed again
4093        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4094    }
4095}
4096
4097impl fidl::endpoints::Responder for CapabilityStoreDictionaryRemoveResponder {
4098    type ControlHandle = CapabilityStoreControlHandle;
4099
4100    fn control_handle(&self) -> &CapabilityStoreControlHandle {
4101        &self.control_handle
4102    }
4103
4104    fn drop_without_shutdown(mut self) {
4105        // Safety: drops once, never accessed again due to mem::forget
4106        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4107        // Prevent Drop from running (which would shut down the channel)
4108        std::mem::forget(self);
4109    }
4110}
4111
4112impl CapabilityStoreDictionaryRemoveResponder {
4113    /// Sends a response to the FIDL transaction.
4114    ///
4115    /// Sets the channel to shutdown if an error occurs.
4116    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4117        let _result = self.send_raw(result);
4118        if _result.is_err() {
4119            self.control_handle.shutdown();
4120        }
4121        self.drop_without_shutdown();
4122        _result
4123    }
4124
4125    /// Similar to "send" but does not shutdown the channel if an error occurs.
4126    pub fn send_no_shutdown_on_err(
4127        self,
4128        mut result: Result<(), CapabilityStoreError>,
4129    ) -> Result<(), fidl::Error> {
4130        let _result = self.send_raw(result);
4131        self.drop_without_shutdown();
4132        _result
4133    }
4134
4135    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4136        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4137            fidl::encoding::EmptyStruct,
4138            CapabilityStoreError,
4139        >>(
4140            fidl::encoding::FlexibleResult::new(result),
4141            self.tx_id,
4142            0x4c5c025ab05d4f3,
4143            fidl::encoding::DynamicFlags::FLEXIBLE,
4144        )
4145    }
4146}
4147
4148#[must_use = "FIDL methods require a response to be sent"]
4149#[derive(Debug)]
4150pub struct CapabilityStoreDictionaryCopyResponder {
4151    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
4152    tx_id: u32,
4153}
4154
4155/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
4156/// if the responder is dropped without sending a response, so that the client
4157/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4158impl std::ops::Drop for CapabilityStoreDictionaryCopyResponder {
4159    fn drop(&mut self) {
4160        self.control_handle.shutdown();
4161        // Safety: drops once, never accessed again
4162        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4163    }
4164}
4165
4166impl fidl::endpoints::Responder for CapabilityStoreDictionaryCopyResponder {
4167    type ControlHandle = CapabilityStoreControlHandle;
4168
4169    fn control_handle(&self) -> &CapabilityStoreControlHandle {
4170        &self.control_handle
4171    }
4172
4173    fn drop_without_shutdown(mut self) {
4174        // Safety: drops once, never accessed again due to mem::forget
4175        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4176        // Prevent Drop from running (which would shut down the channel)
4177        std::mem::forget(self);
4178    }
4179}
4180
4181impl CapabilityStoreDictionaryCopyResponder {
4182    /// Sends a response to the FIDL transaction.
4183    ///
4184    /// Sets the channel to shutdown if an error occurs.
4185    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4186        let _result = self.send_raw(result);
4187        if _result.is_err() {
4188            self.control_handle.shutdown();
4189        }
4190        self.drop_without_shutdown();
4191        _result
4192    }
4193
4194    /// Similar to "send" but does not shutdown the channel if an error occurs.
4195    pub fn send_no_shutdown_on_err(
4196        self,
4197        mut result: Result<(), CapabilityStoreError>,
4198    ) -> Result<(), fidl::Error> {
4199        let _result = self.send_raw(result);
4200        self.drop_without_shutdown();
4201        _result
4202    }
4203
4204    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4205        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4206            fidl::encoding::EmptyStruct,
4207            CapabilityStoreError,
4208        >>(
4209            fidl::encoding::FlexibleResult::new(result),
4210            self.tx_id,
4211            0x3733ecdf4ea1b44f,
4212            fidl::encoding::DynamicFlags::FLEXIBLE,
4213        )
4214    }
4215}
4216
4217#[must_use = "FIDL methods require a response to be sent"]
4218#[derive(Debug)]
4219pub struct CapabilityStoreDictionaryKeysResponder {
4220    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
4221    tx_id: u32,
4222}
4223
4224/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
4225/// if the responder is dropped without sending a response, so that the client
4226/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4227impl std::ops::Drop for CapabilityStoreDictionaryKeysResponder {
4228    fn drop(&mut self) {
4229        self.control_handle.shutdown();
4230        // Safety: drops once, never accessed again
4231        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4232    }
4233}
4234
4235impl fidl::endpoints::Responder for CapabilityStoreDictionaryKeysResponder {
4236    type ControlHandle = CapabilityStoreControlHandle;
4237
4238    fn control_handle(&self) -> &CapabilityStoreControlHandle {
4239        &self.control_handle
4240    }
4241
4242    fn drop_without_shutdown(mut self) {
4243        // Safety: drops once, never accessed again due to mem::forget
4244        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4245        // Prevent Drop from running (which would shut down the channel)
4246        std::mem::forget(self);
4247    }
4248}
4249
4250impl CapabilityStoreDictionaryKeysResponder {
4251    /// Sends a response to the FIDL transaction.
4252    ///
4253    /// Sets the channel to shutdown if an error occurs.
4254    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4255        let _result = self.send_raw(result);
4256        if _result.is_err() {
4257            self.control_handle.shutdown();
4258        }
4259        self.drop_without_shutdown();
4260        _result
4261    }
4262
4263    /// Similar to "send" but does not shutdown the channel if an error occurs.
4264    pub fn send_no_shutdown_on_err(
4265        self,
4266        mut result: Result<(), CapabilityStoreError>,
4267    ) -> Result<(), fidl::Error> {
4268        let _result = self.send_raw(result);
4269        self.drop_without_shutdown();
4270        _result
4271    }
4272
4273    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4274        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4275            fidl::encoding::EmptyStruct,
4276            CapabilityStoreError,
4277        >>(
4278            fidl::encoding::FlexibleResult::new(result),
4279            self.tx_id,
4280            0x84b05577ceaec9e,
4281            fidl::encoding::DynamicFlags::FLEXIBLE,
4282        )
4283    }
4284}
4285
4286#[must_use = "FIDL methods require a response to be sent"]
4287#[derive(Debug)]
4288pub struct CapabilityStoreDictionaryEnumerateResponder {
4289    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
4290    tx_id: u32,
4291}
4292
4293/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
4294/// if the responder is dropped without sending a response, so that the client
4295/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4296impl std::ops::Drop for CapabilityStoreDictionaryEnumerateResponder {
4297    fn drop(&mut self) {
4298        self.control_handle.shutdown();
4299        // Safety: drops once, never accessed again
4300        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4301    }
4302}
4303
4304impl fidl::endpoints::Responder for CapabilityStoreDictionaryEnumerateResponder {
4305    type ControlHandle = CapabilityStoreControlHandle;
4306
4307    fn control_handle(&self) -> &CapabilityStoreControlHandle {
4308        &self.control_handle
4309    }
4310
4311    fn drop_without_shutdown(mut self) {
4312        // Safety: drops once, never accessed again due to mem::forget
4313        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4314        // Prevent Drop from running (which would shut down the channel)
4315        std::mem::forget(self);
4316    }
4317}
4318
4319impl CapabilityStoreDictionaryEnumerateResponder {
4320    /// Sends a response to the FIDL transaction.
4321    ///
4322    /// Sets the channel to shutdown if an error occurs.
4323    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4324        let _result = self.send_raw(result);
4325        if _result.is_err() {
4326            self.control_handle.shutdown();
4327        }
4328        self.drop_without_shutdown();
4329        _result
4330    }
4331
4332    /// Similar to "send" but does not shutdown the channel if an error occurs.
4333    pub fn send_no_shutdown_on_err(
4334        self,
4335        mut result: Result<(), CapabilityStoreError>,
4336    ) -> Result<(), fidl::Error> {
4337        let _result = self.send_raw(result);
4338        self.drop_without_shutdown();
4339        _result
4340    }
4341
4342    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4343        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4344            fidl::encoding::EmptyStruct,
4345            CapabilityStoreError,
4346        >>(
4347            fidl::encoding::FlexibleResult::new(result),
4348            self.tx_id,
4349            0xd6279b6ced04641,
4350            fidl::encoding::DynamicFlags::FLEXIBLE,
4351        )
4352    }
4353}
4354
4355#[must_use = "FIDL methods require a response to be sent"]
4356#[derive(Debug)]
4357pub struct CapabilityStoreDictionaryDrainResponder {
4358    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
4359    tx_id: u32,
4360}
4361
4362/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
4363/// if the responder is dropped without sending a response, so that the client
4364/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4365impl std::ops::Drop for CapabilityStoreDictionaryDrainResponder {
4366    fn drop(&mut self) {
4367        self.control_handle.shutdown();
4368        // Safety: drops once, never accessed again
4369        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4370    }
4371}
4372
4373impl fidl::endpoints::Responder for CapabilityStoreDictionaryDrainResponder {
4374    type ControlHandle = CapabilityStoreControlHandle;
4375
4376    fn control_handle(&self) -> &CapabilityStoreControlHandle {
4377        &self.control_handle
4378    }
4379
4380    fn drop_without_shutdown(mut self) {
4381        // Safety: drops once, never accessed again due to mem::forget
4382        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4383        // Prevent Drop from running (which would shut down the channel)
4384        std::mem::forget(self);
4385    }
4386}
4387
4388impl CapabilityStoreDictionaryDrainResponder {
4389    /// Sends a response to the FIDL transaction.
4390    ///
4391    /// Sets the channel to shutdown if an error occurs.
4392    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4393        let _result = self.send_raw(result);
4394        if _result.is_err() {
4395            self.control_handle.shutdown();
4396        }
4397        self.drop_without_shutdown();
4398        _result
4399    }
4400
4401    /// Similar to "send" but does not shutdown the channel if an error occurs.
4402    pub fn send_no_shutdown_on_err(
4403        self,
4404        mut result: Result<(), CapabilityStoreError>,
4405    ) -> Result<(), fidl::Error> {
4406        let _result = self.send_raw(result);
4407        self.drop_without_shutdown();
4408        _result
4409    }
4410
4411    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4412        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4413            fidl::encoding::EmptyStruct,
4414            CapabilityStoreError,
4415        >>(
4416            fidl::encoding::FlexibleResult::new(result),
4417            self.tx_id,
4418            0x28a3a3f84d928cd8,
4419            fidl::encoding::DynamicFlags::FLEXIBLE,
4420        )
4421    }
4422}
4423
4424#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4425pub struct ConnectorRouterMarker;
4426
4427impl fidl::endpoints::ProtocolMarker for ConnectorRouterMarker {
4428    type Proxy = ConnectorRouterProxy;
4429    type RequestStream = ConnectorRouterRequestStream;
4430    #[cfg(target_os = "fuchsia")]
4431    type SynchronousProxy = ConnectorRouterSynchronousProxy;
4432
4433    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.ConnectorRouter";
4434}
4435impl fidl::endpoints::DiscoverableProtocolMarker for ConnectorRouterMarker {}
4436pub type ConnectorRouterRouteResult = Result<ConnectorRouterRouteResponse, RouterError>;
4437
4438pub trait ConnectorRouterProxyInterface: Send + Sync {
4439    type RouteResponseFut: std::future::Future<Output = Result<ConnectorRouterRouteResult, fidl::Error>>
4440        + Send;
4441    fn r#route(&self, payload: RouteRequest) -> Self::RouteResponseFut;
4442}
4443#[derive(Debug)]
4444#[cfg(target_os = "fuchsia")]
4445pub struct ConnectorRouterSynchronousProxy {
4446    client: fidl::client::sync::Client,
4447}
4448
4449#[cfg(target_os = "fuchsia")]
4450impl fidl::endpoints::SynchronousProxy for ConnectorRouterSynchronousProxy {
4451    type Proxy = ConnectorRouterProxy;
4452    type Protocol = ConnectorRouterMarker;
4453
4454    fn from_channel(inner: fidl::Channel) -> Self {
4455        Self::new(inner)
4456    }
4457
4458    fn into_channel(self) -> fidl::Channel {
4459        self.client.into_channel()
4460    }
4461
4462    fn as_channel(&self) -> &fidl::Channel {
4463        self.client.as_channel()
4464    }
4465}
4466
4467#[cfg(target_os = "fuchsia")]
4468impl ConnectorRouterSynchronousProxy {
4469    pub fn new(channel: fidl::Channel) -> Self {
4470        let protocol_name = <ConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4471        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
4472    }
4473
4474    pub fn into_channel(self) -> fidl::Channel {
4475        self.client.into_channel()
4476    }
4477
4478    /// Waits until an event arrives and returns it. It is safe for other
4479    /// threads to make concurrent requests while waiting for an event.
4480    pub fn wait_for_event(
4481        &self,
4482        deadline: zx::MonotonicInstant,
4483    ) -> Result<ConnectorRouterEvent, fidl::Error> {
4484        ConnectorRouterEvent::decode(self.client.wait_for_event(deadline)?)
4485    }
4486
4487    pub fn r#route(
4488        &self,
4489        mut payload: RouteRequest,
4490        ___deadline: zx::MonotonicInstant,
4491    ) -> Result<ConnectorRouterRouteResult, fidl::Error> {
4492        let _response = self.client.send_query::<
4493            RouteRequest,
4494            fidl::encoding::FlexibleResultType<ConnectorRouterRouteResponse, RouterError>,
4495        >(
4496            &mut payload,
4497            0x74dbb8bc13730766,
4498            fidl::encoding::DynamicFlags::FLEXIBLE,
4499            ___deadline,
4500        )?
4501        .into_result::<ConnectorRouterMarker>("route")?;
4502        Ok(_response.map(|x| x))
4503    }
4504}
4505
4506#[cfg(target_os = "fuchsia")]
4507impl From<ConnectorRouterSynchronousProxy> for zx::Handle {
4508    fn from(value: ConnectorRouterSynchronousProxy) -> Self {
4509        value.into_channel().into()
4510    }
4511}
4512
4513#[cfg(target_os = "fuchsia")]
4514impl From<fidl::Channel> for ConnectorRouterSynchronousProxy {
4515    fn from(value: fidl::Channel) -> Self {
4516        Self::new(value)
4517    }
4518}
4519
4520#[derive(Debug, Clone)]
4521pub struct ConnectorRouterProxy {
4522    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
4523}
4524
4525impl fidl::endpoints::Proxy for ConnectorRouterProxy {
4526    type Protocol = ConnectorRouterMarker;
4527
4528    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
4529        Self::new(inner)
4530    }
4531
4532    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
4533        self.client.into_channel().map_err(|client| Self { client })
4534    }
4535
4536    fn as_channel(&self) -> &::fidl::AsyncChannel {
4537        self.client.as_channel()
4538    }
4539}
4540
4541impl ConnectorRouterProxy {
4542    /// Create a new Proxy for fuchsia.component.sandbox/ConnectorRouter.
4543    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
4544        let protocol_name = <ConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4545        Self { client: fidl::client::Client::new(channel, protocol_name) }
4546    }
4547
4548    /// Get a Stream of events from the remote end of the protocol.
4549    ///
4550    /// # Panics
4551    ///
4552    /// Panics if the event stream was already taken.
4553    pub fn take_event_stream(&self) -> ConnectorRouterEventStream {
4554        ConnectorRouterEventStream { event_receiver: self.client.take_event_receiver() }
4555    }
4556
4557    pub fn r#route(
4558        &self,
4559        mut payload: RouteRequest,
4560    ) -> fidl::client::QueryResponseFut<
4561        ConnectorRouterRouteResult,
4562        fidl::encoding::DefaultFuchsiaResourceDialect,
4563    > {
4564        ConnectorRouterProxyInterface::r#route(self, payload)
4565    }
4566}
4567
4568impl ConnectorRouterProxyInterface for ConnectorRouterProxy {
4569    type RouteResponseFut = fidl::client::QueryResponseFut<
4570        ConnectorRouterRouteResult,
4571        fidl::encoding::DefaultFuchsiaResourceDialect,
4572    >;
4573    fn r#route(&self, mut payload: RouteRequest) -> Self::RouteResponseFut {
4574        fn _decode(
4575            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4576        ) -> Result<ConnectorRouterRouteResult, fidl::Error> {
4577            let _response = fidl::client::decode_transaction_body::<
4578                fidl::encoding::FlexibleResultType<ConnectorRouterRouteResponse, RouterError>,
4579                fidl::encoding::DefaultFuchsiaResourceDialect,
4580                0x74dbb8bc13730766,
4581            >(_buf?)?
4582            .into_result::<ConnectorRouterMarker>("route")?;
4583            Ok(_response.map(|x| x))
4584        }
4585        self.client.send_query_and_decode::<RouteRequest, ConnectorRouterRouteResult>(
4586            &mut payload,
4587            0x74dbb8bc13730766,
4588            fidl::encoding::DynamicFlags::FLEXIBLE,
4589            _decode,
4590        )
4591    }
4592}
4593
4594pub struct ConnectorRouterEventStream {
4595    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
4596}
4597
4598impl std::marker::Unpin for ConnectorRouterEventStream {}
4599
4600impl futures::stream::FusedStream for ConnectorRouterEventStream {
4601    fn is_terminated(&self) -> bool {
4602        self.event_receiver.is_terminated()
4603    }
4604}
4605
4606impl futures::Stream for ConnectorRouterEventStream {
4607    type Item = Result<ConnectorRouterEvent, fidl::Error>;
4608
4609    fn poll_next(
4610        mut self: std::pin::Pin<&mut Self>,
4611        cx: &mut std::task::Context<'_>,
4612    ) -> std::task::Poll<Option<Self::Item>> {
4613        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4614            &mut self.event_receiver,
4615            cx
4616        )?) {
4617            Some(buf) => std::task::Poll::Ready(Some(ConnectorRouterEvent::decode(buf))),
4618            None => std::task::Poll::Ready(None),
4619        }
4620    }
4621}
4622
4623#[derive(Debug)]
4624pub enum ConnectorRouterEvent {
4625    #[non_exhaustive]
4626    _UnknownEvent {
4627        /// Ordinal of the event that was sent.
4628        ordinal: u64,
4629    },
4630}
4631
4632impl ConnectorRouterEvent {
4633    /// Decodes a message buffer as a [`ConnectorRouterEvent`].
4634    fn decode(
4635        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4636    ) -> Result<ConnectorRouterEvent, fidl::Error> {
4637        let (bytes, _handles) = buf.split_mut();
4638        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4639        debug_assert_eq!(tx_header.tx_id, 0);
4640        match tx_header.ordinal {
4641            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4642                Ok(ConnectorRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
4643            }
4644            _ => Err(fidl::Error::UnknownOrdinal {
4645                ordinal: tx_header.ordinal,
4646                protocol_name:
4647                    <ConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4648            }),
4649        }
4650    }
4651}
4652
4653/// A Stream of incoming requests for fuchsia.component.sandbox/ConnectorRouter.
4654pub struct ConnectorRouterRequestStream {
4655    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4656    is_terminated: bool,
4657}
4658
4659impl std::marker::Unpin for ConnectorRouterRequestStream {}
4660
4661impl futures::stream::FusedStream for ConnectorRouterRequestStream {
4662    fn is_terminated(&self) -> bool {
4663        self.is_terminated
4664    }
4665}
4666
4667impl fidl::endpoints::RequestStream for ConnectorRouterRequestStream {
4668    type Protocol = ConnectorRouterMarker;
4669    type ControlHandle = ConnectorRouterControlHandle;
4670
4671    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
4672        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4673    }
4674
4675    fn control_handle(&self) -> Self::ControlHandle {
4676        ConnectorRouterControlHandle { inner: self.inner.clone() }
4677    }
4678
4679    fn into_inner(
4680        self,
4681    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
4682    {
4683        (self.inner, self.is_terminated)
4684    }
4685
4686    fn from_inner(
4687        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4688        is_terminated: bool,
4689    ) -> Self {
4690        Self { inner, is_terminated }
4691    }
4692}
4693
4694impl futures::Stream for ConnectorRouterRequestStream {
4695    type Item = Result<ConnectorRouterRequest, fidl::Error>;
4696
4697    fn poll_next(
4698        mut self: std::pin::Pin<&mut Self>,
4699        cx: &mut std::task::Context<'_>,
4700    ) -> std::task::Poll<Option<Self::Item>> {
4701        let this = &mut *self;
4702        if this.inner.check_shutdown(cx) {
4703            this.is_terminated = true;
4704            return std::task::Poll::Ready(None);
4705        }
4706        if this.is_terminated {
4707            panic!("polled ConnectorRouterRequestStream after completion");
4708        }
4709        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4710            |bytes, handles| {
4711                match this.inner.channel().read_etc(cx, bytes, handles) {
4712                    std::task::Poll::Ready(Ok(())) => {}
4713                    std::task::Poll::Pending => return std::task::Poll::Pending,
4714                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4715                        this.is_terminated = true;
4716                        return std::task::Poll::Ready(None);
4717                    }
4718                    std::task::Poll::Ready(Err(e)) => {
4719                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4720                            e.into(),
4721                        ))))
4722                    }
4723                }
4724
4725                // A message has been received from the channel
4726                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4727
4728                std::task::Poll::Ready(Some(match header.ordinal {
4729                    0x74dbb8bc13730766 => {
4730                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4731                        let mut req = fidl::new_empty!(
4732                            RouteRequest,
4733                            fidl::encoding::DefaultFuchsiaResourceDialect
4734                        );
4735                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RouteRequest>(&header, _body_bytes, handles, &mut req)?;
4736                        let control_handle =
4737                            ConnectorRouterControlHandle { inner: this.inner.clone() };
4738                        Ok(ConnectorRouterRequest::Route {
4739                            payload: req,
4740                            responder: ConnectorRouterRouteResponder {
4741                                control_handle: std::mem::ManuallyDrop::new(control_handle),
4742                                tx_id: header.tx_id,
4743                            },
4744                        })
4745                    }
4746                    _ if header.tx_id == 0
4747                        && header
4748                            .dynamic_flags()
4749                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
4750                    {
4751                        Ok(ConnectorRouterRequest::_UnknownMethod {
4752                            ordinal: header.ordinal,
4753                            control_handle: ConnectorRouterControlHandle {
4754                                inner: this.inner.clone(),
4755                            },
4756                            method_type: fidl::MethodType::OneWay,
4757                        })
4758                    }
4759                    _ if header
4760                        .dynamic_flags()
4761                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
4762                    {
4763                        this.inner.send_framework_err(
4764                            fidl::encoding::FrameworkErr::UnknownMethod,
4765                            header.tx_id,
4766                            header.ordinal,
4767                            header.dynamic_flags(),
4768                            (bytes, handles),
4769                        )?;
4770                        Ok(ConnectorRouterRequest::_UnknownMethod {
4771                            ordinal: header.ordinal,
4772                            control_handle: ConnectorRouterControlHandle {
4773                                inner: this.inner.clone(),
4774                            },
4775                            method_type: fidl::MethodType::TwoWay,
4776                        })
4777                    }
4778                    _ => Err(fidl::Error::UnknownOrdinal {
4779                        ordinal: header.ordinal,
4780                        protocol_name:
4781                            <ConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4782                    }),
4783                }))
4784            },
4785        )
4786    }
4787}
4788
4789#[derive(Debug)]
4790pub enum ConnectorRouterRequest {
4791    Route {
4792        payload: RouteRequest,
4793        responder: ConnectorRouterRouteResponder,
4794    },
4795    /// An interaction was received which does not match any known method.
4796    #[non_exhaustive]
4797    _UnknownMethod {
4798        /// Ordinal of the method that was called.
4799        ordinal: u64,
4800        control_handle: ConnectorRouterControlHandle,
4801        method_type: fidl::MethodType,
4802    },
4803}
4804
4805impl ConnectorRouterRequest {
4806    #[allow(irrefutable_let_patterns)]
4807    pub fn into_route(self) -> Option<(RouteRequest, ConnectorRouterRouteResponder)> {
4808        if let ConnectorRouterRequest::Route { payload, responder } = self {
4809            Some((payload, responder))
4810        } else {
4811            None
4812        }
4813    }
4814
4815    /// Name of the method defined in FIDL
4816    pub fn method_name(&self) -> &'static str {
4817        match *self {
4818            ConnectorRouterRequest::Route { .. } => "route",
4819            ConnectorRouterRequest::_UnknownMethod {
4820                method_type: fidl::MethodType::OneWay,
4821                ..
4822            } => "unknown one-way method",
4823            ConnectorRouterRequest::_UnknownMethod {
4824                method_type: fidl::MethodType::TwoWay,
4825                ..
4826            } => "unknown two-way method",
4827        }
4828    }
4829}
4830
4831#[derive(Debug, Clone)]
4832pub struct ConnectorRouterControlHandle {
4833    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4834}
4835
4836impl fidl::endpoints::ControlHandle for ConnectorRouterControlHandle {
4837    fn shutdown(&self) {
4838        self.inner.shutdown()
4839    }
4840    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
4841        self.inner.shutdown_with_epitaph(status)
4842    }
4843
4844    fn is_closed(&self) -> bool {
4845        self.inner.channel().is_closed()
4846    }
4847    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4848        self.inner.channel().on_closed()
4849    }
4850
4851    #[cfg(target_os = "fuchsia")]
4852    fn signal_peer(
4853        &self,
4854        clear_mask: zx::Signals,
4855        set_mask: zx::Signals,
4856    ) -> Result<(), zx_status::Status> {
4857        use fidl::Peered;
4858        self.inner.channel().signal_peer(clear_mask, set_mask)
4859    }
4860}
4861
4862impl ConnectorRouterControlHandle {}
4863
4864#[must_use = "FIDL methods require a response to be sent"]
4865#[derive(Debug)]
4866pub struct ConnectorRouterRouteResponder {
4867    control_handle: std::mem::ManuallyDrop<ConnectorRouterControlHandle>,
4868    tx_id: u32,
4869}
4870
4871/// Set the the channel to be shutdown (see [`ConnectorRouterControlHandle::shutdown`])
4872/// if the responder is dropped without sending a response, so that the client
4873/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4874impl std::ops::Drop for ConnectorRouterRouteResponder {
4875    fn drop(&mut self) {
4876        self.control_handle.shutdown();
4877        // Safety: drops once, never accessed again
4878        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4879    }
4880}
4881
4882impl fidl::endpoints::Responder for ConnectorRouterRouteResponder {
4883    type ControlHandle = ConnectorRouterControlHandle;
4884
4885    fn control_handle(&self) -> &ConnectorRouterControlHandle {
4886        &self.control_handle
4887    }
4888
4889    fn drop_without_shutdown(mut self) {
4890        // Safety: drops once, never accessed again due to mem::forget
4891        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4892        // Prevent Drop from running (which would shut down the channel)
4893        std::mem::forget(self);
4894    }
4895}
4896
4897impl ConnectorRouterRouteResponder {
4898    /// Sends a response to the FIDL transaction.
4899    ///
4900    /// Sets the channel to shutdown if an error occurs.
4901    pub fn send(
4902        self,
4903        mut result: Result<ConnectorRouterRouteResponse, RouterError>,
4904    ) -> Result<(), fidl::Error> {
4905        let _result = self.send_raw(result);
4906        if _result.is_err() {
4907            self.control_handle.shutdown();
4908        }
4909        self.drop_without_shutdown();
4910        _result
4911    }
4912
4913    /// Similar to "send" but does not shutdown the channel if an error occurs.
4914    pub fn send_no_shutdown_on_err(
4915        self,
4916        mut result: Result<ConnectorRouterRouteResponse, RouterError>,
4917    ) -> Result<(), fidl::Error> {
4918        let _result = self.send_raw(result);
4919        self.drop_without_shutdown();
4920        _result
4921    }
4922
4923    fn send_raw(
4924        &self,
4925        mut result: Result<ConnectorRouterRouteResponse, RouterError>,
4926    ) -> Result<(), fidl::Error> {
4927        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4928            ConnectorRouterRouteResponse,
4929            RouterError,
4930        >>(
4931            fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
4932            self.tx_id,
4933            0x74dbb8bc13730766,
4934            fidl::encoding::DynamicFlags::FLEXIBLE,
4935        )
4936    }
4937}
4938
4939#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4940pub struct DataRouterMarker;
4941
4942impl fidl::endpoints::ProtocolMarker for DataRouterMarker {
4943    type Proxy = DataRouterProxy;
4944    type RequestStream = DataRouterRequestStream;
4945    #[cfg(target_os = "fuchsia")]
4946    type SynchronousProxy = DataRouterSynchronousProxy;
4947
4948    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.DataRouter";
4949}
4950impl fidl::endpoints::DiscoverableProtocolMarker for DataRouterMarker {}
4951pub type DataRouterRouteResult = Result<DataRouterRouteResponse, RouterError>;
4952
4953pub trait DataRouterProxyInterface: Send + Sync {
4954    type RouteResponseFut: std::future::Future<Output = Result<DataRouterRouteResult, fidl::Error>>
4955        + Send;
4956    fn r#route(&self, payload: RouteRequest) -> Self::RouteResponseFut;
4957}
4958#[derive(Debug)]
4959#[cfg(target_os = "fuchsia")]
4960pub struct DataRouterSynchronousProxy {
4961    client: fidl::client::sync::Client,
4962}
4963
4964#[cfg(target_os = "fuchsia")]
4965impl fidl::endpoints::SynchronousProxy for DataRouterSynchronousProxy {
4966    type Proxy = DataRouterProxy;
4967    type Protocol = DataRouterMarker;
4968
4969    fn from_channel(inner: fidl::Channel) -> Self {
4970        Self::new(inner)
4971    }
4972
4973    fn into_channel(self) -> fidl::Channel {
4974        self.client.into_channel()
4975    }
4976
4977    fn as_channel(&self) -> &fidl::Channel {
4978        self.client.as_channel()
4979    }
4980}
4981
4982#[cfg(target_os = "fuchsia")]
4983impl DataRouterSynchronousProxy {
4984    pub fn new(channel: fidl::Channel) -> Self {
4985        let protocol_name = <DataRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4986        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
4987    }
4988
4989    pub fn into_channel(self) -> fidl::Channel {
4990        self.client.into_channel()
4991    }
4992
4993    /// Waits until an event arrives and returns it. It is safe for other
4994    /// threads to make concurrent requests while waiting for an event.
4995    pub fn wait_for_event(
4996        &self,
4997        deadline: zx::MonotonicInstant,
4998    ) -> Result<DataRouterEvent, fidl::Error> {
4999        DataRouterEvent::decode(self.client.wait_for_event(deadline)?)
5000    }
5001
5002    pub fn r#route(
5003        &self,
5004        mut payload: RouteRequest,
5005        ___deadline: zx::MonotonicInstant,
5006    ) -> Result<DataRouterRouteResult, fidl::Error> {
5007        let _response = self.client.send_query::<
5008            RouteRequest,
5009            fidl::encoding::FlexibleResultType<DataRouterRouteResponse, RouterError>,
5010        >(
5011            &mut payload,
5012            0x2e87dc44dfc53804,
5013            fidl::encoding::DynamicFlags::FLEXIBLE,
5014            ___deadline,
5015        )?
5016        .into_result::<DataRouterMarker>("route")?;
5017        Ok(_response.map(|x| x))
5018    }
5019}
5020
5021#[cfg(target_os = "fuchsia")]
5022impl From<DataRouterSynchronousProxy> for zx::Handle {
5023    fn from(value: DataRouterSynchronousProxy) -> Self {
5024        value.into_channel().into()
5025    }
5026}
5027
5028#[cfg(target_os = "fuchsia")]
5029impl From<fidl::Channel> for DataRouterSynchronousProxy {
5030    fn from(value: fidl::Channel) -> Self {
5031        Self::new(value)
5032    }
5033}
5034
5035#[derive(Debug, Clone)]
5036pub struct DataRouterProxy {
5037    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
5038}
5039
5040impl fidl::endpoints::Proxy for DataRouterProxy {
5041    type Protocol = DataRouterMarker;
5042
5043    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
5044        Self::new(inner)
5045    }
5046
5047    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
5048        self.client.into_channel().map_err(|client| Self { client })
5049    }
5050
5051    fn as_channel(&self) -> &::fidl::AsyncChannel {
5052        self.client.as_channel()
5053    }
5054}
5055
5056impl DataRouterProxy {
5057    /// Create a new Proxy for fuchsia.component.sandbox/DataRouter.
5058    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5059        let protocol_name = <DataRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5060        Self { client: fidl::client::Client::new(channel, protocol_name) }
5061    }
5062
5063    /// Get a Stream of events from the remote end of the protocol.
5064    ///
5065    /// # Panics
5066    ///
5067    /// Panics if the event stream was already taken.
5068    pub fn take_event_stream(&self) -> DataRouterEventStream {
5069        DataRouterEventStream { event_receiver: self.client.take_event_receiver() }
5070    }
5071
5072    pub fn r#route(
5073        &self,
5074        mut payload: RouteRequest,
5075    ) -> fidl::client::QueryResponseFut<
5076        DataRouterRouteResult,
5077        fidl::encoding::DefaultFuchsiaResourceDialect,
5078    > {
5079        DataRouterProxyInterface::r#route(self, payload)
5080    }
5081}
5082
5083impl DataRouterProxyInterface for DataRouterProxy {
5084    type RouteResponseFut = fidl::client::QueryResponseFut<
5085        DataRouterRouteResult,
5086        fidl::encoding::DefaultFuchsiaResourceDialect,
5087    >;
5088    fn r#route(&self, mut payload: RouteRequest) -> Self::RouteResponseFut {
5089        fn _decode(
5090            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5091        ) -> Result<DataRouterRouteResult, fidl::Error> {
5092            let _response = fidl::client::decode_transaction_body::<
5093                fidl::encoding::FlexibleResultType<DataRouterRouteResponse, RouterError>,
5094                fidl::encoding::DefaultFuchsiaResourceDialect,
5095                0x2e87dc44dfc53804,
5096            >(_buf?)?
5097            .into_result::<DataRouterMarker>("route")?;
5098            Ok(_response.map(|x| x))
5099        }
5100        self.client.send_query_and_decode::<RouteRequest, DataRouterRouteResult>(
5101            &mut payload,
5102            0x2e87dc44dfc53804,
5103            fidl::encoding::DynamicFlags::FLEXIBLE,
5104            _decode,
5105        )
5106    }
5107}
5108
5109pub struct DataRouterEventStream {
5110    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
5111}
5112
5113impl std::marker::Unpin for DataRouterEventStream {}
5114
5115impl futures::stream::FusedStream for DataRouterEventStream {
5116    fn is_terminated(&self) -> bool {
5117        self.event_receiver.is_terminated()
5118    }
5119}
5120
5121impl futures::Stream for DataRouterEventStream {
5122    type Item = Result<DataRouterEvent, fidl::Error>;
5123
5124    fn poll_next(
5125        mut self: std::pin::Pin<&mut Self>,
5126        cx: &mut std::task::Context<'_>,
5127    ) -> std::task::Poll<Option<Self::Item>> {
5128        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5129            &mut self.event_receiver,
5130            cx
5131        )?) {
5132            Some(buf) => std::task::Poll::Ready(Some(DataRouterEvent::decode(buf))),
5133            None => std::task::Poll::Ready(None),
5134        }
5135    }
5136}
5137
5138#[derive(Debug)]
5139pub enum DataRouterEvent {
5140    #[non_exhaustive]
5141    _UnknownEvent {
5142        /// Ordinal of the event that was sent.
5143        ordinal: u64,
5144    },
5145}
5146
5147impl DataRouterEvent {
5148    /// Decodes a message buffer as a [`DataRouterEvent`].
5149    fn decode(
5150        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5151    ) -> Result<DataRouterEvent, fidl::Error> {
5152        let (bytes, _handles) = buf.split_mut();
5153        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5154        debug_assert_eq!(tx_header.tx_id, 0);
5155        match tx_header.ordinal {
5156            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
5157                Ok(DataRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
5158            }
5159            _ => Err(fidl::Error::UnknownOrdinal {
5160                ordinal: tx_header.ordinal,
5161                protocol_name: <DataRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5162            }),
5163        }
5164    }
5165}
5166
5167/// A Stream of incoming requests for fuchsia.component.sandbox/DataRouter.
5168pub struct DataRouterRequestStream {
5169    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5170    is_terminated: bool,
5171}
5172
5173impl std::marker::Unpin for DataRouterRequestStream {}
5174
5175impl futures::stream::FusedStream for DataRouterRequestStream {
5176    fn is_terminated(&self) -> bool {
5177        self.is_terminated
5178    }
5179}
5180
5181impl fidl::endpoints::RequestStream for DataRouterRequestStream {
5182    type Protocol = DataRouterMarker;
5183    type ControlHandle = DataRouterControlHandle;
5184
5185    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5186        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5187    }
5188
5189    fn control_handle(&self) -> Self::ControlHandle {
5190        DataRouterControlHandle { inner: self.inner.clone() }
5191    }
5192
5193    fn into_inner(
5194        self,
5195    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5196    {
5197        (self.inner, self.is_terminated)
5198    }
5199
5200    fn from_inner(
5201        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5202        is_terminated: bool,
5203    ) -> Self {
5204        Self { inner, is_terminated }
5205    }
5206}
5207
5208impl futures::Stream for DataRouterRequestStream {
5209    type Item = Result<DataRouterRequest, fidl::Error>;
5210
5211    fn poll_next(
5212        mut self: std::pin::Pin<&mut Self>,
5213        cx: &mut std::task::Context<'_>,
5214    ) -> std::task::Poll<Option<Self::Item>> {
5215        let this = &mut *self;
5216        if this.inner.check_shutdown(cx) {
5217            this.is_terminated = true;
5218            return std::task::Poll::Ready(None);
5219        }
5220        if this.is_terminated {
5221            panic!("polled DataRouterRequestStream after completion");
5222        }
5223        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
5224            |bytes, handles| {
5225                match this.inner.channel().read_etc(cx, bytes, handles) {
5226                    std::task::Poll::Ready(Ok(())) => {}
5227                    std::task::Poll::Pending => return std::task::Poll::Pending,
5228                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
5229                        this.is_terminated = true;
5230                        return std::task::Poll::Ready(None);
5231                    }
5232                    std::task::Poll::Ready(Err(e)) => {
5233                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5234                            e.into(),
5235                        ))))
5236                    }
5237                }
5238
5239                // A message has been received from the channel
5240                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5241
5242                std::task::Poll::Ready(Some(match header.ordinal {
5243                    0x2e87dc44dfc53804 => {
5244                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5245                        let mut req = fidl::new_empty!(
5246                            RouteRequest,
5247                            fidl::encoding::DefaultFuchsiaResourceDialect
5248                        );
5249                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RouteRequest>(&header, _body_bytes, handles, &mut req)?;
5250                        let control_handle = DataRouterControlHandle { inner: this.inner.clone() };
5251                        Ok(DataRouterRequest::Route {
5252                            payload: req,
5253                            responder: DataRouterRouteResponder {
5254                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5255                                tx_id: header.tx_id,
5256                            },
5257                        })
5258                    }
5259                    _ if header.tx_id == 0
5260                        && header
5261                            .dynamic_flags()
5262                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5263                    {
5264                        Ok(DataRouterRequest::_UnknownMethod {
5265                            ordinal: header.ordinal,
5266                            control_handle: DataRouterControlHandle { inner: this.inner.clone() },
5267                            method_type: fidl::MethodType::OneWay,
5268                        })
5269                    }
5270                    _ if header
5271                        .dynamic_flags()
5272                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5273                    {
5274                        this.inner.send_framework_err(
5275                            fidl::encoding::FrameworkErr::UnknownMethod,
5276                            header.tx_id,
5277                            header.ordinal,
5278                            header.dynamic_flags(),
5279                            (bytes, handles),
5280                        )?;
5281                        Ok(DataRouterRequest::_UnknownMethod {
5282                            ordinal: header.ordinal,
5283                            control_handle: DataRouterControlHandle { inner: this.inner.clone() },
5284                            method_type: fidl::MethodType::TwoWay,
5285                        })
5286                    }
5287                    _ => Err(fidl::Error::UnknownOrdinal {
5288                        ordinal: header.ordinal,
5289                        protocol_name:
5290                            <DataRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5291                    }),
5292                }))
5293            },
5294        )
5295    }
5296}
5297
5298#[derive(Debug)]
5299pub enum DataRouterRequest {
5300    Route {
5301        payload: RouteRequest,
5302        responder: DataRouterRouteResponder,
5303    },
5304    /// An interaction was received which does not match any known method.
5305    #[non_exhaustive]
5306    _UnknownMethod {
5307        /// Ordinal of the method that was called.
5308        ordinal: u64,
5309        control_handle: DataRouterControlHandle,
5310        method_type: fidl::MethodType,
5311    },
5312}
5313
5314impl DataRouterRequest {
5315    #[allow(irrefutable_let_patterns)]
5316    pub fn into_route(self) -> Option<(RouteRequest, DataRouterRouteResponder)> {
5317        if let DataRouterRequest::Route { payload, responder } = self {
5318            Some((payload, responder))
5319        } else {
5320            None
5321        }
5322    }
5323
5324    /// Name of the method defined in FIDL
5325    pub fn method_name(&self) -> &'static str {
5326        match *self {
5327            DataRouterRequest::Route { .. } => "route",
5328            DataRouterRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
5329                "unknown one-way method"
5330            }
5331            DataRouterRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
5332                "unknown two-way method"
5333            }
5334        }
5335    }
5336}
5337
5338#[derive(Debug, Clone)]
5339pub struct DataRouterControlHandle {
5340    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5341}
5342
5343impl fidl::endpoints::ControlHandle for DataRouterControlHandle {
5344    fn shutdown(&self) {
5345        self.inner.shutdown()
5346    }
5347    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
5348        self.inner.shutdown_with_epitaph(status)
5349    }
5350
5351    fn is_closed(&self) -> bool {
5352        self.inner.channel().is_closed()
5353    }
5354    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
5355        self.inner.channel().on_closed()
5356    }
5357
5358    #[cfg(target_os = "fuchsia")]
5359    fn signal_peer(
5360        &self,
5361        clear_mask: zx::Signals,
5362        set_mask: zx::Signals,
5363    ) -> Result<(), zx_status::Status> {
5364        use fidl::Peered;
5365        self.inner.channel().signal_peer(clear_mask, set_mask)
5366    }
5367}
5368
5369impl DataRouterControlHandle {}
5370
5371#[must_use = "FIDL methods require a response to be sent"]
5372#[derive(Debug)]
5373pub struct DataRouterRouteResponder {
5374    control_handle: std::mem::ManuallyDrop<DataRouterControlHandle>,
5375    tx_id: u32,
5376}
5377
5378/// Set the the channel to be shutdown (see [`DataRouterControlHandle::shutdown`])
5379/// if the responder is dropped without sending a response, so that the client
5380/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5381impl std::ops::Drop for DataRouterRouteResponder {
5382    fn drop(&mut self) {
5383        self.control_handle.shutdown();
5384        // Safety: drops once, never accessed again
5385        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5386    }
5387}
5388
5389impl fidl::endpoints::Responder for DataRouterRouteResponder {
5390    type ControlHandle = DataRouterControlHandle;
5391
5392    fn control_handle(&self) -> &DataRouterControlHandle {
5393        &self.control_handle
5394    }
5395
5396    fn drop_without_shutdown(mut self) {
5397        // Safety: drops once, never accessed again due to mem::forget
5398        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5399        // Prevent Drop from running (which would shut down the channel)
5400        std::mem::forget(self);
5401    }
5402}
5403
5404impl DataRouterRouteResponder {
5405    /// Sends a response to the FIDL transaction.
5406    ///
5407    /// Sets the channel to shutdown if an error occurs.
5408    pub fn send(
5409        self,
5410        mut result: Result<DataRouterRouteResponse, RouterError>,
5411    ) -> Result<(), fidl::Error> {
5412        let _result = self.send_raw(result);
5413        if _result.is_err() {
5414            self.control_handle.shutdown();
5415        }
5416        self.drop_without_shutdown();
5417        _result
5418    }
5419
5420    /// Similar to "send" but does not shutdown the channel if an error occurs.
5421    pub fn send_no_shutdown_on_err(
5422        self,
5423        mut result: Result<DataRouterRouteResponse, RouterError>,
5424    ) -> Result<(), fidl::Error> {
5425        let _result = self.send_raw(result);
5426        self.drop_without_shutdown();
5427        _result
5428    }
5429
5430    fn send_raw(
5431        &self,
5432        mut result: Result<DataRouterRouteResponse, RouterError>,
5433    ) -> Result<(), fidl::Error> {
5434        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
5435            DataRouterRouteResponse,
5436            RouterError,
5437        >>(
5438            fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
5439            self.tx_id,
5440            0x2e87dc44dfc53804,
5441            fidl::encoding::DynamicFlags::FLEXIBLE,
5442        )
5443    }
5444}
5445
5446#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5447pub struct DictionaryMarker;
5448
5449impl fidl::endpoints::ProtocolMarker for DictionaryMarker {
5450    type Proxy = DictionaryProxy;
5451    type RequestStream = DictionaryRequestStream;
5452    #[cfg(target_os = "fuchsia")]
5453    type SynchronousProxy = DictionarySynchronousProxy;
5454
5455    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.Dictionary";
5456}
5457impl fidl::endpoints::DiscoverableProtocolMarker for DictionaryMarker {}
5458
5459pub trait DictionaryProxyInterface: Send + Sync {}
5460#[derive(Debug)]
5461#[cfg(target_os = "fuchsia")]
5462pub struct DictionarySynchronousProxy {
5463    client: fidl::client::sync::Client,
5464}
5465
5466#[cfg(target_os = "fuchsia")]
5467impl fidl::endpoints::SynchronousProxy for DictionarySynchronousProxy {
5468    type Proxy = DictionaryProxy;
5469    type Protocol = DictionaryMarker;
5470
5471    fn from_channel(inner: fidl::Channel) -> Self {
5472        Self::new(inner)
5473    }
5474
5475    fn into_channel(self) -> fidl::Channel {
5476        self.client.into_channel()
5477    }
5478
5479    fn as_channel(&self) -> &fidl::Channel {
5480        self.client.as_channel()
5481    }
5482}
5483
5484#[cfg(target_os = "fuchsia")]
5485impl DictionarySynchronousProxy {
5486    pub fn new(channel: fidl::Channel) -> Self {
5487        let protocol_name = <DictionaryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5488        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
5489    }
5490
5491    pub fn into_channel(self) -> fidl::Channel {
5492        self.client.into_channel()
5493    }
5494
5495    /// Waits until an event arrives and returns it. It is safe for other
5496    /// threads to make concurrent requests while waiting for an event.
5497    pub fn wait_for_event(
5498        &self,
5499        deadline: zx::MonotonicInstant,
5500    ) -> Result<DictionaryEvent, fidl::Error> {
5501        DictionaryEvent::decode(self.client.wait_for_event(deadline)?)
5502    }
5503}
5504
5505#[cfg(target_os = "fuchsia")]
5506impl From<DictionarySynchronousProxy> for zx::Handle {
5507    fn from(value: DictionarySynchronousProxy) -> Self {
5508        value.into_channel().into()
5509    }
5510}
5511
5512#[cfg(target_os = "fuchsia")]
5513impl From<fidl::Channel> for DictionarySynchronousProxy {
5514    fn from(value: fidl::Channel) -> Self {
5515        Self::new(value)
5516    }
5517}
5518
5519#[derive(Debug, Clone)]
5520pub struct DictionaryProxy {
5521    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
5522}
5523
5524impl fidl::endpoints::Proxy for DictionaryProxy {
5525    type Protocol = DictionaryMarker;
5526
5527    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
5528        Self::new(inner)
5529    }
5530
5531    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
5532        self.client.into_channel().map_err(|client| Self { client })
5533    }
5534
5535    fn as_channel(&self) -> &::fidl::AsyncChannel {
5536        self.client.as_channel()
5537    }
5538}
5539
5540impl DictionaryProxy {
5541    /// Create a new Proxy for fuchsia.component.sandbox/Dictionary.
5542    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5543        let protocol_name = <DictionaryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5544        Self { client: fidl::client::Client::new(channel, protocol_name) }
5545    }
5546
5547    /// Get a Stream of events from the remote end of the protocol.
5548    ///
5549    /// # Panics
5550    ///
5551    /// Panics if the event stream was already taken.
5552    pub fn take_event_stream(&self) -> DictionaryEventStream {
5553        DictionaryEventStream { event_receiver: self.client.take_event_receiver() }
5554    }
5555}
5556
5557impl DictionaryProxyInterface for DictionaryProxy {}
5558
5559pub struct DictionaryEventStream {
5560    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
5561}
5562
5563impl std::marker::Unpin for DictionaryEventStream {}
5564
5565impl futures::stream::FusedStream for DictionaryEventStream {
5566    fn is_terminated(&self) -> bool {
5567        self.event_receiver.is_terminated()
5568    }
5569}
5570
5571impl futures::Stream for DictionaryEventStream {
5572    type Item = Result<DictionaryEvent, fidl::Error>;
5573
5574    fn poll_next(
5575        mut self: std::pin::Pin<&mut Self>,
5576        cx: &mut std::task::Context<'_>,
5577    ) -> std::task::Poll<Option<Self::Item>> {
5578        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5579            &mut self.event_receiver,
5580            cx
5581        )?) {
5582            Some(buf) => std::task::Poll::Ready(Some(DictionaryEvent::decode(buf))),
5583            None => std::task::Poll::Ready(None),
5584        }
5585    }
5586}
5587
5588#[derive(Debug)]
5589pub enum DictionaryEvent {
5590    #[non_exhaustive]
5591    _UnknownEvent {
5592        /// Ordinal of the event that was sent.
5593        ordinal: u64,
5594    },
5595}
5596
5597impl DictionaryEvent {
5598    /// Decodes a message buffer as a [`DictionaryEvent`].
5599    fn decode(
5600        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5601    ) -> Result<DictionaryEvent, fidl::Error> {
5602        let (bytes, _handles) = buf.split_mut();
5603        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5604        debug_assert_eq!(tx_header.tx_id, 0);
5605        match tx_header.ordinal {
5606            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
5607                Ok(DictionaryEvent::_UnknownEvent { ordinal: tx_header.ordinal })
5608            }
5609            _ => Err(fidl::Error::UnknownOrdinal {
5610                ordinal: tx_header.ordinal,
5611                protocol_name: <DictionaryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5612            }),
5613        }
5614    }
5615}
5616
5617/// A Stream of incoming requests for fuchsia.component.sandbox/Dictionary.
5618pub struct DictionaryRequestStream {
5619    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5620    is_terminated: bool,
5621}
5622
5623impl std::marker::Unpin for DictionaryRequestStream {}
5624
5625impl futures::stream::FusedStream for DictionaryRequestStream {
5626    fn is_terminated(&self) -> bool {
5627        self.is_terminated
5628    }
5629}
5630
5631impl fidl::endpoints::RequestStream for DictionaryRequestStream {
5632    type Protocol = DictionaryMarker;
5633    type ControlHandle = DictionaryControlHandle;
5634
5635    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5636        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5637    }
5638
5639    fn control_handle(&self) -> Self::ControlHandle {
5640        DictionaryControlHandle { inner: self.inner.clone() }
5641    }
5642
5643    fn into_inner(
5644        self,
5645    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5646    {
5647        (self.inner, self.is_terminated)
5648    }
5649
5650    fn from_inner(
5651        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5652        is_terminated: bool,
5653    ) -> Self {
5654        Self { inner, is_terminated }
5655    }
5656}
5657
5658impl futures::Stream for DictionaryRequestStream {
5659    type Item = Result<DictionaryRequest, fidl::Error>;
5660
5661    fn poll_next(
5662        mut self: std::pin::Pin<&mut Self>,
5663        cx: &mut std::task::Context<'_>,
5664    ) -> std::task::Poll<Option<Self::Item>> {
5665        let this = &mut *self;
5666        if this.inner.check_shutdown(cx) {
5667            this.is_terminated = true;
5668            return std::task::Poll::Ready(None);
5669        }
5670        if this.is_terminated {
5671            panic!("polled DictionaryRequestStream after completion");
5672        }
5673        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
5674            |bytes, handles| {
5675                match this.inner.channel().read_etc(cx, bytes, handles) {
5676                    std::task::Poll::Ready(Ok(())) => {}
5677                    std::task::Poll::Pending => return std::task::Poll::Pending,
5678                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
5679                        this.is_terminated = true;
5680                        return std::task::Poll::Ready(None);
5681                    }
5682                    std::task::Poll::Ready(Err(e)) => {
5683                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5684                            e.into(),
5685                        ))))
5686                    }
5687                }
5688
5689                // A message has been received from the channel
5690                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5691
5692                std::task::Poll::Ready(Some(match header.ordinal {
5693                    _ if header.tx_id == 0
5694                        && header
5695                            .dynamic_flags()
5696                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5697                    {
5698                        Ok(DictionaryRequest::_UnknownMethod {
5699                            ordinal: header.ordinal,
5700                            control_handle: DictionaryControlHandle { inner: this.inner.clone() },
5701                            method_type: fidl::MethodType::OneWay,
5702                        })
5703                    }
5704                    _ if header
5705                        .dynamic_flags()
5706                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5707                    {
5708                        this.inner.send_framework_err(
5709                            fidl::encoding::FrameworkErr::UnknownMethod,
5710                            header.tx_id,
5711                            header.ordinal,
5712                            header.dynamic_flags(),
5713                            (bytes, handles),
5714                        )?;
5715                        Ok(DictionaryRequest::_UnknownMethod {
5716                            ordinal: header.ordinal,
5717                            control_handle: DictionaryControlHandle { inner: this.inner.clone() },
5718                            method_type: fidl::MethodType::TwoWay,
5719                        })
5720                    }
5721                    _ => Err(fidl::Error::UnknownOrdinal {
5722                        ordinal: header.ordinal,
5723                        protocol_name:
5724                            <DictionaryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5725                    }),
5726                }))
5727            },
5728        )
5729    }
5730}
5731
5732#[derive(Debug)]
5733pub enum DictionaryRequest {
5734    /// An interaction was received which does not match any known method.
5735    #[non_exhaustive]
5736    _UnknownMethod {
5737        /// Ordinal of the method that was called.
5738        ordinal: u64,
5739        control_handle: DictionaryControlHandle,
5740        method_type: fidl::MethodType,
5741    },
5742}
5743
5744impl DictionaryRequest {
5745    /// Name of the method defined in FIDL
5746    pub fn method_name(&self) -> &'static str {
5747        match *self {
5748            DictionaryRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
5749                "unknown one-way method"
5750            }
5751            DictionaryRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
5752                "unknown two-way method"
5753            }
5754        }
5755    }
5756}
5757
5758#[derive(Debug, Clone)]
5759pub struct DictionaryControlHandle {
5760    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5761}
5762
5763impl fidl::endpoints::ControlHandle for DictionaryControlHandle {
5764    fn shutdown(&self) {
5765        self.inner.shutdown()
5766    }
5767    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
5768        self.inner.shutdown_with_epitaph(status)
5769    }
5770
5771    fn is_closed(&self) -> bool {
5772        self.inner.channel().is_closed()
5773    }
5774    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
5775        self.inner.channel().on_closed()
5776    }
5777
5778    #[cfg(target_os = "fuchsia")]
5779    fn signal_peer(
5780        &self,
5781        clear_mask: zx::Signals,
5782        set_mask: zx::Signals,
5783    ) -> Result<(), zx_status::Status> {
5784        use fidl::Peered;
5785        self.inner.channel().signal_peer(clear_mask, set_mask)
5786    }
5787}
5788
5789impl DictionaryControlHandle {}
5790
5791#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5792pub struct DictionaryDrainIteratorMarker;
5793
5794impl fidl::endpoints::ProtocolMarker for DictionaryDrainIteratorMarker {
5795    type Proxy = DictionaryDrainIteratorProxy;
5796    type RequestStream = DictionaryDrainIteratorRequestStream;
5797    #[cfg(target_os = "fuchsia")]
5798    type SynchronousProxy = DictionaryDrainIteratorSynchronousProxy;
5799
5800    const DEBUG_NAME: &'static str = "(anonymous) DictionaryDrainIterator";
5801}
5802pub type DictionaryDrainIteratorGetNextResult =
5803    Result<(Vec<DictionaryItem>, u64), CapabilityStoreError>;
5804
5805pub trait DictionaryDrainIteratorProxyInterface: Send + Sync {
5806    type GetNextResponseFut: std::future::Future<Output = Result<DictionaryDrainIteratorGetNextResult, fidl::Error>>
5807        + Send;
5808    fn r#get_next(&self, start_id: u64, limit: u32) -> Self::GetNextResponseFut;
5809}
5810#[derive(Debug)]
5811#[cfg(target_os = "fuchsia")]
5812pub struct DictionaryDrainIteratorSynchronousProxy {
5813    client: fidl::client::sync::Client,
5814}
5815
5816#[cfg(target_os = "fuchsia")]
5817impl fidl::endpoints::SynchronousProxy for DictionaryDrainIteratorSynchronousProxy {
5818    type Proxy = DictionaryDrainIteratorProxy;
5819    type Protocol = DictionaryDrainIteratorMarker;
5820
5821    fn from_channel(inner: fidl::Channel) -> Self {
5822        Self::new(inner)
5823    }
5824
5825    fn into_channel(self) -> fidl::Channel {
5826        self.client.into_channel()
5827    }
5828
5829    fn as_channel(&self) -> &fidl::Channel {
5830        self.client.as_channel()
5831    }
5832}
5833
5834#[cfg(target_os = "fuchsia")]
5835impl DictionaryDrainIteratorSynchronousProxy {
5836    pub fn new(channel: fidl::Channel) -> Self {
5837        let protocol_name =
5838            <DictionaryDrainIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5839        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
5840    }
5841
5842    pub fn into_channel(self) -> fidl::Channel {
5843        self.client.into_channel()
5844    }
5845
5846    /// Waits until an event arrives and returns it. It is safe for other
5847    /// threads to make concurrent requests while waiting for an event.
5848    pub fn wait_for_event(
5849        &self,
5850        deadline: zx::MonotonicInstant,
5851    ) -> Result<DictionaryDrainIteratorEvent, fidl::Error> {
5852        DictionaryDrainIteratorEvent::decode(self.client.wait_for_event(deadline)?)
5853    }
5854
5855    /// Returns the next batch of results for a [Dictionary.Drain] call, returning up to
5856    /// `limit` results. `limit` can be at most [MAX_DICTIONARY_ITERATOR_CHUNK].
5857    ///
5858    /// Each returned capability will be assigned a monotonically increasing [CapabilityId] starting
5859    /// from `start_id`.
5860    ///
5861    /// In addition to the `items`, returns `end_id`, which is one more than the highest id reserved
5862    /// by [GetNext]. `end_id` can be used as the `start_id` for the next call to [GetNext].
5863    ///
5864    /// If [GetNext] returns an error, the server will also close the channel.
5865    ///
5866    /// Errors:
5867    ///
5868    /// - `ID_ALREADY_EXISTS` if some id in the range `[start_id, limit)` already exists in this
5869    ///   store.
5870    /// - `INVALID_ARGS` if `limit` was `0` or greater than `MAX_DICTIONARY_ITERATOR_CHUNK`.
5871    pub fn r#get_next(
5872        &self,
5873        mut start_id: u64,
5874        mut limit: u32,
5875        ___deadline: zx::MonotonicInstant,
5876    ) -> Result<DictionaryDrainIteratorGetNextResult, fidl::Error> {
5877        let _response = self
5878            .client
5879            .send_query::<DictionaryDrainIteratorGetNextRequest, fidl::encoding::FlexibleResultType<
5880                DictionaryDrainIteratorGetNextResponse,
5881                CapabilityStoreError,
5882            >>(
5883                (start_id, limit),
5884                0x4f8082ca1ee26061,
5885                fidl::encoding::DynamicFlags::FLEXIBLE,
5886                ___deadline,
5887            )?
5888            .into_result::<DictionaryDrainIteratorMarker>("get_next")?;
5889        Ok(_response.map(|x| (x.items, x.end_id)))
5890    }
5891}
5892
5893#[cfg(target_os = "fuchsia")]
5894impl From<DictionaryDrainIteratorSynchronousProxy> for zx::Handle {
5895    fn from(value: DictionaryDrainIteratorSynchronousProxy) -> Self {
5896        value.into_channel().into()
5897    }
5898}
5899
5900#[cfg(target_os = "fuchsia")]
5901impl From<fidl::Channel> for DictionaryDrainIteratorSynchronousProxy {
5902    fn from(value: fidl::Channel) -> Self {
5903        Self::new(value)
5904    }
5905}
5906
5907#[derive(Debug, Clone)]
5908pub struct DictionaryDrainIteratorProxy {
5909    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
5910}
5911
5912impl fidl::endpoints::Proxy for DictionaryDrainIteratorProxy {
5913    type Protocol = DictionaryDrainIteratorMarker;
5914
5915    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
5916        Self::new(inner)
5917    }
5918
5919    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
5920        self.client.into_channel().map_err(|client| Self { client })
5921    }
5922
5923    fn as_channel(&self) -> &::fidl::AsyncChannel {
5924        self.client.as_channel()
5925    }
5926}
5927
5928impl DictionaryDrainIteratorProxy {
5929    /// Create a new Proxy for fuchsia.component.sandbox/DictionaryDrainIterator.
5930    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5931        let protocol_name =
5932            <DictionaryDrainIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5933        Self { client: fidl::client::Client::new(channel, protocol_name) }
5934    }
5935
5936    /// Get a Stream of events from the remote end of the protocol.
5937    ///
5938    /// # Panics
5939    ///
5940    /// Panics if the event stream was already taken.
5941    pub fn take_event_stream(&self) -> DictionaryDrainIteratorEventStream {
5942        DictionaryDrainIteratorEventStream { event_receiver: self.client.take_event_receiver() }
5943    }
5944
5945    /// Returns the next batch of results for a [Dictionary.Drain] call, returning up to
5946    /// `limit` results. `limit` can be at most [MAX_DICTIONARY_ITERATOR_CHUNK].
5947    ///
5948    /// Each returned capability will be assigned a monotonically increasing [CapabilityId] starting
5949    /// from `start_id`.
5950    ///
5951    /// In addition to the `items`, returns `end_id`, which is one more than the highest id reserved
5952    /// by [GetNext]. `end_id` can be used as the `start_id` for the next call to [GetNext].
5953    ///
5954    /// If [GetNext] returns an error, the server will also close the channel.
5955    ///
5956    /// Errors:
5957    ///
5958    /// - `ID_ALREADY_EXISTS` if some id in the range `[start_id, limit)` already exists in this
5959    ///   store.
5960    /// - `INVALID_ARGS` if `limit` was `0` or greater than `MAX_DICTIONARY_ITERATOR_CHUNK`.
5961    pub fn r#get_next(
5962        &self,
5963        mut start_id: u64,
5964        mut limit: u32,
5965    ) -> fidl::client::QueryResponseFut<
5966        DictionaryDrainIteratorGetNextResult,
5967        fidl::encoding::DefaultFuchsiaResourceDialect,
5968    > {
5969        DictionaryDrainIteratorProxyInterface::r#get_next(self, start_id, limit)
5970    }
5971}
5972
5973impl DictionaryDrainIteratorProxyInterface for DictionaryDrainIteratorProxy {
5974    type GetNextResponseFut = fidl::client::QueryResponseFut<
5975        DictionaryDrainIteratorGetNextResult,
5976        fidl::encoding::DefaultFuchsiaResourceDialect,
5977    >;
5978    fn r#get_next(&self, mut start_id: u64, mut limit: u32) -> Self::GetNextResponseFut {
5979        fn _decode(
5980            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5981        ) -> Result<DictionaryDrainIteratorGetNextResult, fidl::Error> {
5982            let _response = fidl::client::decode_transaction_body::<
5983                fidl::encoding::FlexibleResultType<
5984                    DictionaryDrainIteratorGetNextResponse,
5985                    CapabilityStoreError,
5986                >,
5987                fidl::encoding::DefaultFuchsiaResourceDialect,
5988                0x4f8082ca1ee26061,
5989            >(_buf?)?
5990            .into_result::<DictionaryDrainIteratorMarker>("get_next")?;
5991            Ok(_response.map(|x| (x.items, x.end_id)))
5992        }
5993        self.client.send_query_and_decode::<
5994            DictionaryDrainIteratorGetNextRequest,
5995            DictionaryDrainIteratorGetNextResult,
5996        >(
5997            (start_id, limit,),
5998            0x4f8082ca1ee26061,
5999            fidl::encoding::DynamicFlags::FLEXIBLE,
6000            _decode,
6001        )
6002    }
6003}
6004
6005pub struct DictionaryDrainIteratorEventStream {
6006    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6007}
6008
6009impl std::marker::Unpin for DictionaryDrainIteratorEventStream {}
6010
6011impl futures::stream::FusedStream for DictionaryDrainIteratorEventStream {
6012    fn is_terminated(&self) -> bool {
6013        self.event_receiver.is_terminated()
6014    }
6015}
6016
6017impl futures::Stream for DictionaryDrainIteratorEventStream {
6018    type Item = Result<DictionaryDrainIteratorEvent, fidl::Error>;
6019
6020    fn poll_next(
6021        mut self: std::pin::Pin<&mut Self>,
6022        cx: &mut std::task::Context<'_>,
6023    ) -> std::task::Poll<Option<Self::Item>> {
6024        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6025            &mut self.event_receiver,
6026            cx
6027        )?) {
6028            Some(buf) => std::task::Poll::Ready(Some(DictionaryDrainIteratorEvent::decode(buf))),
6029            None => std::task::Poll::Ready(None),
6030        }
6031    }
6032}
6033
6034#[derive(Debug)]
6035pub enum DictionaryDrainIteratorEvent {
6036    #[non_exhaustive]
6037    _UnknownEvent {
6038        /// Ordinal of the event that was sent.
6039        ordinal: u64,
6040    },
6041}
6042
6043impl DictionaryDrainIteratorEvent {
6044    /// Decodes a message buffer as a [`DictionaryDrainIteratorEvent`].
6045    fn decode(
6046        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6047    ) -> Result<DictionaryDrainIteratorEvent, fidl::Error> {
6048        let (bytes, _handles) = buf.split_mut();
6049        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6050        debug_assert_eq!(tx_header.tx_id, 0);
6051        match tx_header.ordinal {
6052            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6053                Ok(DictionaryDrainIteratorEvent::_UnknownEvent { ordinal: tx_header.ordinal })
6054            }
6055            _ => Err(fidl::Error::UnknownOrdinal {
6056                ordinal: tx_header.ordinal,
6057                protocol_name:
6058                    <DictionaryDrainIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6059            }),
6060        }
6061    }
6062}
6063
6064/// A Stream of incoming requests for fuchsia.component.sandbox/DictionaryDrainIterator.
6065pub struct DictionaryDrainIteratorRequestStream {
6066    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6067    is_terminated: bool,
6068}
6069
6070impl std::marker::Unpin for DictionaryDrainIteratorRequestStream {}
6071
6072impl futures::stream::FusedStream for DictionaryDrainIteratorRequestStream {
6073    fn is_terminated(&self) -> bool {
6074        self.is_terminated
6075    }
6076}
6077
6078impl fidl::endpoints::RequestStream for DictionaryDrainIteratorRequestStream {
6079    type Protocol = DictionaryDrainIteratorMarker;
6080    type ControlHandle = DictionaryDrainIteratorControlHandle;
6081
6082    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6083        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6084    }
6085
6086    fn control_handle(&self) -> Self::ControlHandle {
6087        DictionaryDrainIteratorControlHandle { inner: self.inner.clone() }
6088    }
6089
6090    fn into_inner(
6091        self,
6092    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6093    {
6094        (self.inner, self.is_terminated)
6095    }
6096
6097    fn from_inner(
6098        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6099        is_terminated: bool,
6100    ) -> Self {
6101        Self { inner, is_terminated }
6102    }
6103}
6104
6105impl futures::Stream for DictionaryDrainIteratorRequestStream {
6106    type Item = Result<DictionaryDrainIteratorRequest, fidl::Error>;
6107
6108    fn poll_next(
6109        mut self: std::pin::Pin<&mut Self>,
6110        cx: &mut std::task::Context<'_>,
6111    ) -> std::task::Poll<Option<Self::Item>> {
6112        let this = &mut *self;
6113        if this.inner.check_shutdown(cx) {
6114            this.is_terminated = true;
6115            return std::task::Poll::Ready(None);
6116        }
6117        if this.is_terminated {
6118            panic!("polled DictionaryDrainIteratorRequestStream after completion");
6119        }
6120        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
6121            |bytes, handles| {
6122                match this.inner.channel().read_etc(cx, bytes, handles) {
6123                    std::task::Poll::Ready(Ok(())) => {}
6124                    std::task::Poll::Pending => return std::task::Poll::Pending,
6125                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
6126                        this.is_terminated = true;
6127                        return std::task::Poll::Ready(None);
6128                    }
6129                    std::task::Poll::Ready(Err(e)) => {
6130                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6131                            e.into(),
6132                        ))))
6133                    }
6134                }
6135
6136                // A message has been received from the channel
6137                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6138
6139                std::task::Poll::Ready(Some(match header.ordinal {
6140                0x4f8082ca1ee26061 => {
6141                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6142                    let mut req = fidl::new_empty!(DictionaryDrainIteratorGetNextRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
6143                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DictionaryDrainIteratorGetNextRequest>(&header, _body_bytes, handles, &mut req)?;
6144                    let control_handle = DictionaryDrainIteratorControlHandle {
6145                        inner: this.inner.clone(),
6146                    };
6147                    Ok(DictionaryDrainIteratorRequest::GetNext {start_id: req.start_id,
6148limit: req.limit,
6149
6150                        responder: DictionaryDrainIteratorGetNextResponder {
6151                            control_handle: std::mem::ManuallyDrop::new(control_handle),
6152                            tx_id: header.tx_id,
6153                        },
6154                    })
6155                }
6156                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6157                    Ok(DictionaryDrainIteratorRequest::_UnknownMethod {
6158                        ordinal: header.ordinal,
6159                        control_handle: DictionaryDrainIteratorControlHandle { inner: this.inner.clone() },
6160                        method_type: fidl::MethodType::OneWay,
6161                    })
6162                }
6163                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6164                    this.inner.send_framework_err(
6165                        fidl::encoding::FrameworkErr::UnknownMethod,
6166                        header.tx_id,
6167                        header.ordinal,
6168                        header.dynamic_flags(),
6169                        (bytes, handles),
6170                    )?;
6171                    Ok(DictionaryDrainIteratorRequest::_UnknownMethod {
6172                        ordinal: header.ordinal,
6173                        control_handle: DictionaryDrainIteratorControlHandle { inner: this.inner.clone() },
6174                        method_type: fidl::MethodType::TwoWay,
6175                    })
6176                }
6177                _ => Err(fidl::Error::UnknownOrdinal {
6178                    ordinal: header.ordinal,
6179                    protocol_name: <DictionaryDrainIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6180                }),
6181            }))
6182            },
6183        )
6184    }
6185}
6186
6187#[derive(Debug)]
6188pub enum DictionaryDrainIteratorRequest {
6189    /// Returns the next batch of results for a [Dictionary.Drain] call, returning up to
6190    /// `limit` results. `limit` can be at most [MAX_DICTIONARY_ITERATOR_CHUNK].
6191    ///
6192    /// Each returned capability will be assigned a monotonically increasing [CapabilityId] starting
6193    /// from `start_id`.
6194    ///
6195    /// In addition to the `items`, returns `end_id`, which is one more than the highest id reserved
6196    /// by [GetNext]. `end_id` can be used as the `start_id` for the next call to [GetNext].
6197    ///
6198    /// If [GetNext] returns an error, the server will also close the channel.
6199    ///
6200    /// Errors:
6201    ///
6202    /// - `ID_ALREADY_EXISTS` if some id in the range `[start_id, limit)` already exists in this
6203    ///   store.
6204    /// - `INVALID_ARGS` if `limit` was `0` or greater than `MAX_DICTIONARY_ITERATOR_CHUNK`.
6205    GetNext { start_id: u64, limit: u32, responder: DictionaryDrainIteratorGetNextResponder },
6206    /// An interaction was received which does not match any known method.
6207    #[non_exhaustive]
6208    _UnknownMethod {
6209        /// Ordinal of the method that was called.
6210        ordinal: u64,
6211        control_handle: DictionaryDrainIteratorControlHandle,
6212        method_type: fidl::MethodType,
6213    },
6214}
6215
6216impl DictionaryDrainIteratorRequest {
6217    #[allow(irrefutable_let_patterns)]
6218    pub fn into_get_next(self) -> Option<(u64, u32, DictionaryDrainIteratorGetNextResponder)> {
6219        if let DictionaryDrainIteratorRequest::GetNext { start_id, limit, responder } = self {
6220            Some((start_id, limit, responder))
6221        } else {
6222            None
6223        }
6224    }
6225
6226    /// Name of the method defined in FIDL
6227    pub fn method_name(&self) -> &'static str {
6228        match *self {
6229            DictionaryDrainIteratorRequest::GetNext { .. } => "get_next",
6230            DictionaryDrainIteratorRequest::_UnknownMethod {
6231                method_type: fidl::MethodType::OneWay,
6232                ..
6233            } => "unknown one-way method",
6234            DictionaryDrainIteratorRequest::_UnknownMethod {
6235                method_type: fidl::MethodType::TwoWay,
6236                ..
6237            } => "unknown two-way method",
6238        }
6239    }
6240}
6241
6242#[derive(Debug, Clone)]
6243pub struct DictionaryDrainIteratorControlHandle {
6244    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6245}
6246
6247impl fidl::endpoints::ControlHandle for DictionaryDrainIteratorControlHandle {
6248    fn shutdown(&self) {
6249        self.inner.shutdown()
6250    }
6251    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
6252        self.inner.shutdown_with_epitaph(status)
6253    }
6254
6255    fn is_closed(&self) -> bool {
6256        self.inner.channel().is_closed()
6257    }
6258    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6259        self.inner.channel().on_closed()
6260    }
6261
6262    #[cfg(target_os = "fuchsia")]
6263    fn signal_peer(
6264        &self,
6265        clear_mask: zx::Signals,
6266        set_mask: zx::Signals,
6267    ) -> Result<(), zx_status::Status> {
6268        use fidl::Peered;
6269        self.inner.channel().signal_peer(clear_mask, set_mask)
6270    }
6271}
6272
6273impl DictionaryDrainIteratorControlHandle {}
6274
6275#[must_use = "FIDL methods require a response to be sent"]
6276#[derive(Debug)]
6277pub struct DictionaryDrainIteratorGetNextResponder {
6278    control_handle: std::mem::ManuallyDrop<DictionaryDrainIteratorControlHandle>,
6279    tx_id: u32,
6280}
6281
6282/// Set the the channel to be shutdown (see [`DictionaryDrainIteratorControlHandle::shutdown`])
6283/// if the responder is dropped without sending a response, so that the client
6284/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6285impl std::ops::Drop for DictionaryDrainIteratorGetNextResponder {
6286    fn drop(&mut self) {
6287        self.control_handle.shutdown();
6288        // Safety: drops once, never accessed again
6289        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6290    }
6291}
6292
6293impl fidl::endpoints::Responder for DictionaryDrainIteratorGetNextResponder {
6294    type ControlHandle = DictionaryDrainIteratorControlHandle;
6295
6296    fn control_handle(&self) -> &DictionaryDrainIteratorControlHandle {
6297        &self.control_handle
6298    }
6299
6300    fn drop_without_shutdown(mut self) {
6301        // Safety: drops once, never accessed again due to mem::forget
6302        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6303        // Prevent Drop from running (which would shut down the channel)
6304        std::mem::forget(self);
6305    }
6306}
6307
6308impl DictionaryDrainIteratorGetNextResponder {
6309    /// Sends a response to the FIDL transaction.
6310    ///
6311    /// Sets the channel to shutdown if an error occurs.
6312    pub fn send(
6313        self,
6314        mut result: Result<(&[DictionaryItem], u64), CapabilityStoreError>,
6315    ) -> Result<(), fidl::Error> {
6316        let _result = self.send_raw(result);
6317        if _result.is_err() {
6318            self.control_handle.shutdown();
6319        }
6320        self.drop_without_shutdown();
6321        _result
6322    }
6323
6324    /// Similar to "send" but does not shutdown the channel if an error occurs.
6325    pub fn send_no_shutdown_on_err(
6326        self,
6327        mut result: Result<(&[DictionaryItem], u64), CapabilityStoreError>,
6328    ) -> Result<(), fidl::Error> {
6329        let _result = self.send_raw(result);
6330        self.drop_without_shutdown();
6331        _result
6332    }
6333
6334    fn send_raw(
6335        &self,
6336        mut result: Result<(&[DictionaryItem], u64), CapabilityStoreError>,
6337    ) -> Result<(), fidl::Error> {
6338        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
6339            DictionaryDrainIteratorGetNextResponse,
6340            CapabilityStoreError,
6341        >>(
6342            fidl::encoding::FlexibleResult::new(result),
6343            self.tx_id,
6344            0x4f8082ca1ee26061,
6345            fidl::encoding::DynamicFlags::FLEXIBLE,
6346        )
6347    }
6348}
6349
6350#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6351pub struct DictionaryEnumerateIteratorMarker;
6352
6353impl fidl::endpoints::ProtocolMarker for DictionaryEnumerateIteratorMarker {
6354    type Proxy = DictionaryEnumerateIteratorProxy;
6355    type RequestStream = DictionaryEnumerateIteratorRequestStream;
6356    #[cfg(target_os = "fuchsia")]
6357    type SynchronousProxy = DictionaryEnumerateIteratorSynchronousProxy;
6358
6359    const DEBUG_NAME: &'static str = "(anonymous) DictionaryEnumerateIterator";
6360}
6361pub type DictionaryEnumerateIteratorGetNextResult =
6362    Result<(Vec<DictionaryOptionalItem>, u64), CapabilityStoreError>;
6363
6364pub trait DictionaryEnumerateIteratorProxyInterface: Send + Sync {
6365    type GetNextResponseFut: std::future::Future<Output = Result<DictionaryEnumerateIteratorGetNextResult, fidl::Error>>
6366        + Send;
6367    fn r#get_next(&self, start_id: u64, limit: u32) -> Self::GetNextResponseFut;
6368}
6369#[derive(Debug)]
6370#[cfg(target_os = "fuchsia")]
6371pub struct DictionaryEnumerateIteratorSynchronousProxy {
6372    client: fidl::client::sync::Client,
6373}
6374
6375#[cfg(target_os = "fuchsia")]
6376impl fidl::endpoints::SynchronousProxy for DictionaryEnumerateIteratorSynchronousProxy {
6377    type Proxy = DictionaryEnumerateIteratorProxy;
6378    type Protocol = DictionaryEnumerateIteratorMarker;
6379
6380    fn from_channel(inner: fidl::Channel) -> Self {
6381        Self::new(inner)
6382    }
6383
6384    fn into_channel(self) -> fidl::Channel {
6385        self.client.into_channel()
6386    }
6387
6388    fn as_channel(&self) -> &fidl::Channel {
6389        self.client.as_channel()
6390    }
6391}
6392
6393#[cfg(target_os = "fuchsia")]
6394impl DictionaryEnumerateIteratorSynchronousProxy {
6395    pub fn new(channel: fidl::Channel) -> Self {
6396        let protocol_name =
6397            <DictionaryEnumerateIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6398        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
6399    }
6400
6401    pub fn into_channel(self) -> fidl::Channel {
6402        self.client.into_channel()
6403    }
6404
6405    /// Waits until an event arrives and returns it. It is safe for other
6406    /// threads to make concurrent requests while waiting for an event.
6407    pub fn wait_for_event(
6408        &self,
6409        deadline: zx::MonotonicInstant,
6410    ) -> Result<DictionaryEnumerateIteratorEvent, fidl::Error> {
6411        DictionaryEnumerateIteratorEvent::decode(self.client.wait_for_event(deadline)?)
6412    }
6413
6414    /// Returns the next batch of results for a [Dictionary.Enumerate] call, returning up to
6415    /// `limit` results. `limit` can be at most [MAX_DICTIONARY_ITERATOR_CHUNK].
6416    ///
6417    /// The value of each of `items` is a duplicate of the original capability
6418    /// ([CapabilityStore.Duplicate]), unless it could not be duplicated, it which case it will
6419    /// be null.
6420    ///
6421    /// Each returned capability will be assigned a monotonically increasing [CapabilityId] starting
6422    /// from `start_id`.
6423    ///
6424    /// In addition to the `items`, returns `end_id`, which is one more than the highest id reserved
6425    /// by [GetNext]. `end_id` can be used as the `start_id` for the next call to [GetNext].
6426    ///
6427    /// If [GetNext] returns an error, the server will also close the channel.
6428    ///
6429    /// Errors:
6430    ///
6431    /// - `ID_ALREADY_EXISTS` if some id in the range `[start_id, limit)` already exists in this
6432    ///   store.
6433    /// - `INVALID_ARGS` if `limit` was `0` or greater than `MAX_DICTIONARY_ITERATOR_CHUNK`.
6434    pub fn r#get_next(
6435        &self,
6436        mut start_id: u64,
6437        mut limit: u32,
6438        ___deadline: zx::MonotonicInstant,
6439    ) -> Result<DictionaryEnumerateIteratorGetNextResult, fidl::Error> {
6440        let _response = self.client.send_query::<
6441            DictionaryEnumerateIteratorGetNextRequest,
6442            fidl::encoding::FlexibleResultType<DictionaryEnumerateIteratorGetNextResponse, CapabilityStoreError>,
6443        >(
6444            (start_id, limit,),
6445            0x14f8bc286512f5cf,
6446            fidl::encoding::DynamicFlags::FLEXIBLE,
6447            ___deadline,
6448        )?
6449        .into_result::<DictionaryEnumerateIteratorMarker>("get_next")?;
6450        Ok(_response.map(|x| (x.items, x.end_id)))
6451    }
6452}
6453
6454#[cfg(target_os = "fuchsia")]
6455impl From<DictionaryEnumerateIteratorSynchronousProxy> for zx::Handle {
6456    fn from(value: DictionaryEnumerateIteratorSynchronousProxy) -> Self {
6457        value.into_channel().into()
6458    }
6459}
6460
6461#[cfg(target_os = "fuchsia")]
6462impl From<fidl::Channel> for DictionaryEnumerateIteratorSynchronousProxy {
6463    fn from(value: fidl::Channel) -> Self {
6464        Self::new(value)
6465    }
6466}
6467
6468#[derive(Debug, Clone)]
6469pub struct DictionaryEnumerateIteratorProxy {
6470    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6471}
6472
6473impl fidl::endpoints::Proxy for DictionaryEnumerateIteratorProxy {
6474    type Protocol = DictionaryEnumerateIteratorMarker;
6475
6476    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6477        Self::new(inner)
6478    }
6479
6480    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6481        self.client.into_channel().map_err(|client| Self { client })
6482    }
6483
6484    fn as_channel(&self) -> &::fidl::AsyncChannel {
6485        self.client.as_channel()
6486    }
6487}
6488
6489impl DictionaryEnumerateIteratorProxy {
6490    /// Create a new Proxy for fuchsia.component.sandbox/DictionaryEnumerateIterator.
6491    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6492        let protocol_name =
6493            <DictionaryEnumerateIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6494        Self { client: fidl::client::Client::new(channel, protocol_name) }
6495    }
6496
6497    /// Get a Stream of events from the remote end of the protocol.
6498    ///
6499    /// # Panics
6500    ///
6501    /// Panics if the event stream was already taken.
6502    pub fn take_event_stream(&self) -> DictionaryEnumerateIteratorEventStream {
6503        DictionaryEnumerateIteratorEventStream { event_receiver: self.client.take_event_receiver() }
6504    }
6505
6506    /// Returns the next batch of results for a [Dictionary.Enumerate] call, returning up to
6507    /// `limit` results. `limit` can be at most [MAX_DICTIONARY_ITERATOR_CHUNK].
6508    ///
6509    /// The value of each of `items` is a duplicate of the original capability
6510    /// ([CapabilityStore.Duplicate]), unless it could not be duplicated, it which case it will
6511    /// be null.
6512    ///
6513    /// Each returned capability will be assigned a monotonically increasing [CapabilityId] starting
6514    /// from `start_id`.
6515    ///
6516    /// In addition to the `items`, returns `end_id`, which is one more than the highest id reserved
6517    /// by [GetNext]. `end_id` can be used as the `start_id` for the next call to [GetNext].
6518    ///
6519    /// If [GetNext] returns an error, the server will also close the channel.
6520    ///
6521    /// Errors:
6522    ///
6523    /// - `ID_ALREADY_EXISTS` if some id in the range `[start_id, limit)` already exists in this
6524    ///   store.
6525    /// - `INVALID_ARGS` if `limit` was `0` or greater than `MAX_DICTIONARY_ITERATOR_CHUNK`.
6526    pub fn r#get_next(
6527        &self,
6528        mut start_id: u64,
6529        mut limit: u32,
6530    ) -> fidl::client::QueryResponseFut<
6531        DictionaryEnumerateIteratorGetNextResult,
6532        fidl::encoding::DefaultFuchsiaResourceDialect,
6533    > {
6534        DictionaryEnumerateIteratorProxyInterface::r#get_next(self, start_id, limit)
6535    }
6536}
6537
6538impl DictionaryEnumerateIteratorProxyInterface for DictionaryEnumerateIteratorProxy {
6539    type GetNextResponseFut = fidl::client::QueryResponseFut<
6540        DictionaryEnumerateIteratorGetNextResult,
6541        fidl::encoding::DefaultFuchsiaResourceDialect,
6542    >;
6543    fn r#get_next(&self, mut start_id: u64, mut limit: u32) -> Self::GetNextResponseFut {
6544        fn _decode(
6545            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6546        ) -> Result<DictionaryEnumerateIteratorGetNextResult, fidl::Error> {
6547            let _response = fidl::client::decode_transaction_body::<
6548                fidl::encoding::FlexibleResultType<
6549                    DictionaryEnumerateIteratorGetNextResponse,
6550                    CapabilityStoreError,
6551                >,
6552                fidl::encoding::DefaultFuchsiaResourceDialect,
6553                0x14f8bc286512f5cf,
6554            >(_buf?)?
6555            .into_result::<DictionaryEnumerateIteratorMarker>("get_next")?;
6556            Ok(_response.map(|x| (x.items, x.end_id)))
6557        }
6558        self.client.send_query_and_decode::<
6559            DictionaryEnumerateIteratorGetNextRequest,
6560            DictionaryEnumerateIteratorGetNextResult,
6561        >(
6562            (start_id, limit,),
6563            0x14f8bc286512f5cf,
6564            fidl::encoding::DynamicFlags::FLEXIBLE,
6565            _decode,
6566        )
6567    }
6568}
6569
6570pub struct DictionaryEnumerateIteratorEventStream {
6571    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6572}
6573
6574impl std::marker::Unpin for DictionaryEnumerateIteratorEventStream {}
6575
6576impl futures::stream::FusedStream for DictionaryEnumerateIteratorEventStream {
6577    fn is_terminated(&self) -> bool {
6578        self.event_receiver.is_terminated()
6579    }
6580}
6581
6582impl futures::Stream for DictionaryEnumerateIteratorEventStream {
6583    type Item = Result<DictionaryEnumerateIteratorEvent, fidl::Error>;
6584
6585    fn poll_next(
6586        mut self: std::pin::Pin<&mut Self>,
6587        cx: &mut std::task::Context<'_>,
6588    ) -> std::task::Poll<Option<Self::Item>> {
6589        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6590            &mut self.event_receiver,
6591            cx
6592        )?) {
6593            Some(buf) => {
6594                std::task::Poll::Ready(Some(DictionaryEnumerateIteratorEvent::decode(buf)))
6595            }
6596            None => std::task::Poll::Ready(None),
6597        }
6598    }
6599}
6600
6601#[derive(Debug)]
6602pub enum DictionaryEnumerateIteratorEvent {
6603    #[non_exhaustive]
6604    _UnknownEvent {
6605        /// Ordinal of the event that was sent.
6606        ordinal: u64,
6607    },
6608}
6609
6610impl DictionaryEnumerateIteratorEvent {
6611    /// Decodes a message buffer as a [`DictionaryEnumerateIteratorEvent`].
6612    fn decode(
6613        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6614    ) -> Result<DictionaryEnumerateIteratorEvent, fidl::Error> {
6615        let (bytes, _handles) = buf.split_mut();
6616        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6617        debug_assert_eq!(tx_header.tx_id, 0);
6618        match tx_header.ordinal {
6619            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6620                Ok(DictionaryEnumerateIteratorEvent::_UnknownEvent {
6621                    ordinal: tx_header.ordinal,
6622                })
6623            }
6624            _ => Err(fidl::Error::UnknownOrdinal {
6625                ordinal: tx_header.ordinal,
6626                protocol_name: <DictionaryEnumerateIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6627            })
6628        }
6629    }
6630}
6631
6632/// A Stream of incoming requests for fuchsia.component.sandbox/DictionaryEnumerateIterator.
6633pub struct DictionaryEnumerateIteratorRequestStream {
6634    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6635    is_terminated: bool,
6636}
6637
6638impl std::marker::Unpin for DictionaryEnumerateIteratorRequestStream {}
6639
6640impl futures::stream::FusedStream for DictionaryEnumerateIteratorRequestStream {
6641    fn is_terminated(&self) -> bool {
6642        self.is_terminated
6643    }
6644}
6645
6646impl fidl::endpoints::RequestStream for DictionaryEnumerateIteratorRequestStream {
6647    type Protocol = DictionaryEnumerateIteratorMarker;
6648    type ControlHandle = DictionaryEnumerateIteratorControlHandle;
6649
6650    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6651        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6652    }
6653
6654    fn control_handle(&self) -> Self::ControlHandle {
6655        DictionaryEnumerateIteratorControlHandle { inner: self.inner.clone() }
6656    }
6657
6658    fn into_inner(
6659        self,
6660    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6661    {
6662        (self.inner, self.is_terminated)
6663    }
6664
6665    fn from_inner(
6666        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6667        is_terminated: bool,
6668    ) -> Self {
6669        Self { inner, is_terminated }
6670    }
6671}
6672
6673impl futures::Stream for DictionaryEnumerateIteratorRequestStream {
6674    type Item = Result<DictionaryEnumerateIteratorRequest, fidl::Error>;
6675
6676    fn poll_next(
6677        mut self: std::pin::Pin<&mut Self>,
6678        cx: &mut std::task::Context<'_>,
6679    ) -> std::task::Poll<Option<Self::Item>> {
6680        let this = &mut *self;
6681        if this.inner.check_shutdown(cx) {
6682            this.is_terminated = true;
6683            return std::task::Poll::Ready(None);
6684        }
6685        if this.is_terminated {
6686            panic!("polled DictionaryEnumerateIteratorRequestStream after completion");
6687        }
6688        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
6689            |bytes, handles| {
6690                match this.inner.channel().read_etc(cx, bytes, handles) {
6691                    std::task::Poll::Ready(Ok(())) => {}
6692                    std::task::Poll::Pending => return std::task::Poll::Pending,
6693                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
6694                        this.is_terminated = true;
6695                        return std::task::Poll::Ready(None);
6696                    }
6697                    std::task::Poll::Ready(Err(e)) => {
6698                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6699                            e.into(),
6700                        ))))
6701                    }
6702                }
6703
6704                // A message has been received from the channel
6705                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6706
6707                std::task::Poll::Ready(Some(match header.ordinal {
6708                0x14f8bc286512f5cf => {
6709                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6710                    let mut req = fidl::new_empty!(DictionaryEnumerateIteratorGetNextRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
6711                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DictionaryEnumerateIteratorGetNextRequest>(&header, _body_bytes, handles, &mut req)?;
6712                    let control_handle = DictionaryEnumerateIteratorControlHandle {
6713                        inner: this.inner.clone(),
6714                    };
6715                    Ok(DictionaryEnumerateIteratorRequest::GetNext {start_id: req.start_id,
6716limit: req.limit,
6717
6718                        responder: DictionaryEnumerateIteratorGetNextResponder {
6719                            control_handle: std::mem::ManuallyDrop::new(control_handle),
6720                            tx_id: header.tx_id,
6721                        },
6722                    })
6723                }
6724                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6725                    Ok(DictionaryEnumerateIteratorRequest::_UnknownMethod {
6726                        ordinal: header.ordinal,
6727                        control_handle: DictionaryEnumerateIteratorControlHandle { inner: this.inner.clone() },
6728                        method_type: fidl::MethodType::OneWay,
6729                    })
6730                }
6731                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6732                    this.inner.send_framework_err(
6733                        fidl::encoding::FrameworkErr::UnknownMethod,
6734                        header.tx_id,
6735                        header.ordinal,
6736                        header.dynamic_flags(),
6737                        (bytes, handles),
6738                    )?;
6739                    Ok(DictionaryEnumerateIteratorRequest::_UnknownMethod {
6740                        ordinal: header.ordinal,
6741                        control_handle: DictionaryEnumerateIteratorControlHandle { inner: this.inner.clone() },
6742                        method_type: fidl::MethodType::TwoWay,
6743                    })
6744                }
6745                _ => Err(fidl::Error::UnknownOrdinal {
6746                    ordinal: header.ordinal,
6747                    protocol_name: <DictionaryEnumerateIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6748                }),
6749            }))
6750            },
6751        )
6752    }
6753}
6754
6755#[derive(Debug)]
6756pub enum DictionaryEnumerateIteratorRequest {
6757    /// Returns the next batch of results for a [Dictionary.Enumerate] call, returning up to
6758    /// `limit` results. `limit` can be at most [MAX_DICTIONARY_ITERATOR_CHUNK].
6759    ///
6760    /// The value of each of `items` is a duplicate of the original capability
6761    /// ([CapabilityStore.Duplicate]), unless it could not be duplicated, it which case it will
6762    /// be null.
6763    ///
6764    /// Each returned capability will be assigned a monotonically increasing [CapabilityId] starting
6765    /// from `start_id`.
6766    ///
6767    /// In addition to the `items`, returns `end_id`, which is one more than the highest id reserved
6768    /// by [GetNext]. `end_id` can be used as the `start_id` for the next call to [GetNext].
6769    ///
6770    /// If [GetNext] returns an error, the server will also close the channel.
6771    ///
6772    /// Errors:
6773    ///
6774    /// - `ID_ALREADY_EXISTS` if some id in the range `[start_id, limit)` already exists in this
6775    ///   store.
6776    /// - `INVALID_ARGS` if `limit` was `0` or greater than `MAX_DICTIONARY_ITERATOR_CHUNK`.
6777    GetNext { start_id: u64, limit: u32, responder: DictionaryEnumerateIteratorGetNextResponder },
6778    /// An interaction was received which does not match any known method.
6779    #[non_exhaustive]
6780    _UnknownMethod {
6781        /// Ordinal of the method that was called.
6782        ordinal: u64,
6783        control_handle: DictionaryEnumerateIteratorControlHandle,
6784        method_type: fidl::MethodType,
6785    },
6786}
6787
6788impl DictionaryEnumerateIteratorRequest {
6789    #[allow(irrefutable_let_patterns)]
6790    pub fn into_get_next(self) -> Option<(u64, u32, DictionaryEnumerateIteratorGetNextResponder)> {
6791        if let DictionaryEnumerateIteratorRequest::GetNext { start_id, limit, responder } = self {
6792            Some((start_id, limit, responder))
6793        } else {
6794            None
6795        }
6796    }
6797
6798    /// Name of the method defined in FIDL
6799    pub fn method_name(&self) -> &'static str {
6800        match *self {
6801            DictionaryEnumerateIteratorRequest::GetNext { .. } => "get_next",
6802            DictionaryEnumerateIteratorRequest::_UnknownMethod {
6803                method_type: fidl::MethodType::OneWay,
6804                ..
6805            } => "unknown one-way method",
6806            DictionaryEnumerateIteratorRequest::_UnknownMethod {
6807                method_type: fidl::MethodType::TwoWay,
6808                ..
6809            } => "unknown two-way method",
6810        }
6811    }
6812}
6813
6814#[derive(Debug, Clone)]
6815pub struct DictionaryEnumerateIteratorControlHandle {
6816    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6817}
6818
6819impl fidl::endpoints::ControlHandle for DictionaryEnumerateIteratorControlHandle {
6820    fn shutdown(&self) {
6821        self.inner.shutdown()
6822    }
6823    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
6824        self.inner.shutdown_with_epitaph(status)
6825    }
6826
6827    fn is_closed(&self) -> bool {
6828        self.inner.channel().is_closed()
6829    }
6830    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6831        self.inner.channel().on_closed()
6832    }
6833
6834    #[cfg(target_os = "fuchsia")]
6835    fn signal_peer(
6836        &self,
6837        clear_mask: zx::Signals,
6838        set_mask: zx::Signals,
6839    ) -> Result<(), zx_status::Status> {
6840        use fidl::Peered;
6841        self.inner.channel().signal_peer(clear_mask, set_mask)
6842    }
6843}
6844
6845impl DictionaryEnumerateIteratorControlHandle {}
6846
6847#[must_use = "FIDL methods require a response to be sent"]
6848#[derive(Debug)]
6849pub struct DictionaryEnumerateIteratorGetNextResponder {
6850    control_handle: std::mem::ManuallyDrop<DictionaryEnumerateIteratorControlHandle>,
6851    tx_id: u32,
6852}
6853
6854/// Set the the channel to be shutdown (see [`DictionaryEnumerateIteratorControlHandle::shutdown`])
6855/// if the responder is dropped without sending a response, so that the client
6856/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6857impl std::ops::Drop for DictionaryEnumerateIteratorGetNextResponder {
6858    fn drop(&mut self) {
6859        self.control_handle.shutdown();
6860        // Safety: drops once, never accessed again
6861        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6862    }
6863}
6864
6865impl fidl::endpoints::Responder for DictionaryEnumerateIteratorGetNextResponder {
6866    type ControlHandle = DictionaryEnumerateIteratorControlHandle;
6867
6868    fn control_handle(&self) -> &DictionaryEnumerateIteratorControlHandle {
6869        &self.control_handle
6870    }
6871
6872    fn drop_without_shutdown(mut self) {
6873        // Safety: drops once, never accessed again due to mem::forget
6874        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6875        // Prevent Drop from running (which would shut down the channel)
6876        std::mem::forget(self);
6877    }
6878}
6879
6880impl DictionaryEnumerateIteratorGetNextResponder {
6881    /// Sends a response to the FIDL transaction.
6882    ///
6883    /// Sets the channel to shutdown if an error occurs.
6884    pub fn send(
6885        self,
6886        mut result: Result<(Vec<DictionaryOptionalItem>, u64), CapabilityStoreError>,
6887    ) -> Result<(), fidl::Error> {
6888        let _result = self.send_raw(result);
6889        if _result.is_err() {
6890            self.control_handle.shutdown();
6891        }
6892        self.drop_without_shutdown();
6893        _result
6894    }
6895
6896    /// Similar to "send" but does not shutdown the channel if an error occurs.
6897    pub fn send_no_shutdown_on_err(
6898        self,
6899        mut result: Result<(Vec<DictionaryOptionalItem>, u64), CapabilityStoreError>,
6900    ) -> Result<(), fidl::Error> {
6901        let _result = self.send_raw(result);
6902        self.drop_without_shutdown();
6903        _result
6904    }
6905
6906    fn send_raw(
6907        &self,
6908        mut result: Result<(Vec<DictionaryOptionalItem>, u64), CapabilityStoreError>,
6909    ) -> Result<(), fidl::Error> {
6910        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
6911            DictionaryEnumerateIteratorGetNextResponse,
6912            CapabilityStoreError,
6913        >>(
6914            fidl::encoding::FlexibleResult::new(
6915                result
6916                    .as_mut()
6917                    .map_err(|e| *e)
6918                    .map(|(items, end_id)| (items.as_mut_slice(), *end_id)),
6919            ),
6920            self.tx_id,
6921            0x14f8bc286512f5cf,
6922            fidl::encoding::DynamicFlags::FLEXIBLE,
6923        )
6924    }
6925}
6926
6927#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6928pub struct DictionaryKeysIteratorMarker;
6929
6930impl fidl::endpoints::ProtocolMarker for DictionaryKeysIteratorMarker {
6931    type Proxy = DictionaryKeysIteratorProxy;
6932    type RequestStream = DictionaryKeysIteratorRequestStream;
6933    #[cfg(target_os = "fuchsia")]
6934    type SynchronousProxy = DictionaryKeysIteratorSynchronousProxy;
6935
6936    const DEBUG_NAME: &'static str = "(anonymous) DictionaryKeysIterator";
6937}
6938
6939pub trait DictionaryKeysIteratorProxyInterface: Send + Sync {
6940    type GetNextResponseFut: std::future::Future<Output = Result<Vec<String>, fidl::Error>> + Send;
6941    fn r#get_next(&self) -> Self::GetNextResponseFut;
6942}
6943#[derive(Debug)]
6944#[cfg(target_os = "fuchsia")]
6945pub struct DictionaryKeysIteratorSynchronousProxy {
6946    client: fidl::client::sync::Client,
6947}
6948
6949#[cfg(target_os = "fuchsia")]
6950impl fidl::endpoints::SynchronousProxy for DictionaryKeysIteratorSynchronousProxy {
6951    type Proxy = DictionaryKeysIteratorProxy;
6952    type Protocol = DictionaryKeysIteratorMarker;
6953
6954    fn from_channel(inner: fidl::Channel) -> Self {
6955        Self::new(inner)
6956    }
6957
6958    fn into_channel(self) -> fidl::Channel {
6959        self.client.into_channel()
6960    }
6961
6962    fn as_channel(&self) -> &fidl::Channel {
6963        self.client.as_channel()
6964    }
6965}
6966
6967#[cfg(target_os = "fuchsia")]
6968impl DictionaryKeysIteratorSynchronousProxy {
6969    pub fn new(channel: fidl::Channel) -> Self {
6970        let protocol_name =
6971            <DictionaryKeysIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6972        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
6973    }
6974
6975    pub fn into_channel(self) -> fidl::Channel {
6976        self.client.into_channel()
6977    }
6978
6979    /// Waits until an event arrives and returns it. It is safe for other
6980    /// threads to make concurrent requests while waiting for an event.
6981    pub fn wait_for_event(
6982        &self,
6983        deadline: zx::MonotonicInstant,
6984    ) -> Result<DictionaryKeysIteratorEvent, fidl::Error> {
6985        DictionaryKeysIteratorEvent::decode(self.client.wait_for_event(deadline)?)
6986    }
6987
6988    pub fn r#get_next(
6989        &self,
6990        ___deadline: zx::MonotonicInstant,
6991    ) -> Result<Vec<String>, fidl::Error> {
6992        let _response = self.client.send_query::<
6993            fidl::encoding::EmptyPayload,
6994            fidl::encoding::FlexibleType<DictionaryKeysIteratorGetNextResponse>,
6995        >(
6996            (),
6997            0x453828cbacca7d53,
6998            fidl::encoding::DynamicFlags::FLEXIBLE,
6999            ___deadline,
7000        )?
7001        .into_result::<DictionaryKeysIteratorMarker>("get_next")?;
7002        Ok(_response.keys)
7003    }
7004}
7005
7006#[cfg(target_os = "fuchsia")]
7007impl From<DictionaryKeysIteratorSynchronousProxy> for zx::Handle {
7008    fn from(value: DictionaryKeysIteratorSynchronousProxy) -> Self {
7009        value.into_channel().into()
7010    }
7011}
7012
7013#[cfg(target_os = "fuchsia")]
7014impl From<fidl::Channel> for DictionaryKeysIteratorSynchronousProxy {
7015    fn from(value: fidl::Channel) -> Self {
7016        Self::new(value)
7017    }
7018}
7019
7020#[derive(Debug, Clone)]
7021pub struct DictionaryKeysIteratorProxy {
7022    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
7023}
7024
7025impl fidl::endpoints::Proxy for DictionaryKeysIteratorProxy {
7026    type Protocol = DictionaryKeysIteratorMarker;
7027
7028    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
7029        Self::new(inner)
7030    }
7031
7032    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
7033        self.client.into_channel().map_err(|client| Self { client })
7034    }
7035
7036    fn as_channel(&self) -> &::fidl::AsyncChannel {
7037        self.client.as_channel()
7038    }
7039}
7040
7041impl DictionaryKeysIteratorProxy {
7042    /// Create a new Proxy for fuchsia.component.sandbox/DictionaryKeysIterator.
7043    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
7044        let protocol_name =
7045            <DictionaryKeysIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7046        Self { client: fidl::client::Client::new(channel, protocol_name) }
7047    }
7048
7049    /// Get a Stream of events from the remote end of the protocol.
7050    ///
7051    /// # Panics
7052    ///
7053    /// Panics if the event stream was already taken.
7054    pub fn take_event_stream(&self) -> DictionaryKeysIteratorEventStream {
7055        DictionaryKeysIteratorEventStream { event_receiver: self.client.take_event_receiver() }
7056    }
7057
7058    pub fn r#get_next(
7059        &self,
7060    ) -> fidl::client::QueryResponseFut<Vec<String>, fidl::encoding::DefaultFuchsiaResourceDialect>
7061    {
7062        DictionaryKeysIteratorProxyInterface::r#get_next(self)
7063    }
7064}
7065
7066impl DictionaryKeysIteratorProxyInterface for DictionaryKeysIteratorProxy {
7067    type GetNextResponseFut =
7068        fidl::client::QueryResponseFut<Vec<String>, fidl::encoding::DefaultFuchsiaResourceDialect>;
7069    fn r#get_next(&self) -> Self::GetNextResponseFut {
7070        fn _decode(
7071            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7072        ) -> Result<Vec<String>, fidl::Error> {
7073            let _response = fidl::client::decode_transaction_body::<
7074                fidl::encoding::FlexibleType<DictionaryKeysIteratorGetNextResponse>,
7075                fidl::encoding::DefaultFuchsiaResourceDialect,
7076                0x453828cbacca7d53,
7077            >(_buf?)?
7078            .into_result::<DictionaryKeysIteratorMarker>("get_next")?;
7079            Ok(_response.keys)
7080        }
7081        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<String>>(
7082            (),
7083            0x453828cbacca7d53,
7084            fidl::encoding::DynamicFlags::FLEXIBLE,
7085            _decode,
7086        )
7087    }
7088}
7089
7090pub struct DictionaryKeysIteratorEventStream {
7091    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
7092}
7093
7094impl std::marker::Unpin for DictionaryKeysIteratorEventStream {}
7095
7096impl futures::stream::FusedStream for DictionaryKeysIteratorEventStream {
7097    fn is_terminated(&self) -> bool {
7098        self.event_receiver.is_terminated()
7099    }
7100}
7101
7102impl futures::Stream for DictionaryKeysIteratorEventStream {
7103    type Item = Result<DictionaryKeysIteratorEvent, fidl::Error>;
7104
7105    fn poll_next(
7106        mut self: std::pin::Pin<&mut Self>,
7107        cx: &mut std::task::Context<'_>,
7108    ) -> std::task::Poll<Option<Self::Item>> {
7109        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7110            &mut self.event_receiver,
7111            cx
7112        )?) {
7113            Some(buf) => std::task::Poll::Ready(Some(DictionaryKeysIteratorEvent::decode(buf))),
7114            None => std::task::Poll::Ready(None),
7115        }
7116    }
7117}
7118
7119#[derive(Debug)]
7120pub enum DictionaryKeysIteratorEvent {
7121    #[non_exhaustive]
7122    _UnknownEvent {
7123        /// Ordinal of the event that was sent.
7124        ordinal: u64,
7125    },
7126}
7127
7128impl DictionaryKeysIteratorEvent {
7129    /// Decodes a message buffer as a [`DictionaryKeysIteratorEvent`].
7130    fn decode(
7131        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7132    ) -> Result<DictionaryKeysIteratorEvent, fidl::Error> {
7133        let (bytes, _handles) = buf.split_mut();
7134        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7135        debug_assert_eq!(tx_header.tx_id, 0);
7136        match tx_header.ordinal {
7137            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7138                Ok(DictionaryKeysIteratorEvent::_UnknownEvent { ordinal: tx_header.ordinal })
7139            }
7140            _ => Err(fidl::Error::UnknownOrdinal {
7141                ordinal: tx_header.ordinal,
7142                protocol_name:
7143                    <DictionaryKeysIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7144            }),
7145        }
7146    }
7147}
7148
7149/// A Stream of incoming requests for fuchsia.component.sandbox/DictionaryKeysIterator.
7150pub struct DictionaryKeysIteratorRequestStream {
7151    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7152    is_terminated: bool,
7153}
7154
7155impl std::marker::Unpin for DictionaryKeysIteratorRequestStream {}
7156
7157impl futures::stream::FusedStream for DictionaryKeysIteratorRequestStream {
7158    fn is_terminated(&self) -> bool {
7159        self.is_terminated
7160    }
7161}
7162
7163impl fidl::endpoints::RequestStream for DictionaryKeysIteratorRequestStream {
7164    type Protocol = DictionaryKeysIteratorMarker;
7165    type ControlHandle = DictionaryKeysIteratorControlHandle;
7166
7167    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
7168        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7169    }
7170
7171    fn control_handle(&self) -> Self::ControlHandle {
7172        DictionaryKeysIteratorControlHandle { inner: self.inner.clone() }
7173    }
7174
7175    fn into_inner(
7176        self,
7177    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
7178    {
7179        (self.inner, self.is_terminated)
7180    }
7181
7182    fn from_inner(
7183        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7184        is_terminated: bool,
7185    ) -> Self {
7186        Self { inner, is_terminated }
7187    }
7188}
7189
7190impl futures::Stream for DictionaryKeysIteratorRequestStream {
7191    type Item = Result<DictionaryKeysIteratorRequest, fidl::Error>;
7192
7193    fn poll_next(
7194        mut self: std::pin::Pin<&mut Self>,
7195        cx: &mut std::task::Context<'_>,
7196    ) -> std::task::Poll<Option<Self::Item>> {
7197        let this = &mut *self;
7198        if this.inner.check_shutdown(cx) {
7199            this.is_terminated = true;
7200            return std::task::Poll::Ready(None);
7201        }
7202        if this.is_terminated {
7203            panic!("polled DictionaryKeysIteratorRequestStream after completion");
7204        }
7205        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
7206            |bytes, handles| {
7207                match this.inner.channel().read_etc(cx, bytes, handles) {
7208                    std::task::Poll::Ready(Ok(())) => {}
7209                    std::task::Poll::Pending => return std::task::Poll::Pending,
7210                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
7211                        this.is_terminated = true;
7212                        return std::task::Poll::Ready(None);
7213                    }
7214                    std::task::Poll::Ready(Err(e)) => {
7215                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7216                            e.into(),
7217                        ))))
7218                    }
7219                }
7220
7221                // A message has been received from the channel
7222                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7223
7224                std::task::Poll::Ready(Some(match header.ordinal {
7225                0x453828cbacca7d53 => {
7226                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7227                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
7228                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7229                    let control_handle = DictionaryKeysIteratorControlHandle {
7230                        inner: this.inner.clone(),
7231                    };
7232                    Ok(DictionaryKeysIteratorRequest::GetNext {
7233                        responder: DictionaryKeysIteratorGetNextResponder {
7234                            control_handle: std::mem::ManuallyDrop::new(control_handle),
7235                            tx_id: header.tx_id,
7236                        },
7237                    })
7238                }
7239                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7240                    Ok(DictionaryKeysIteratorRequest::_UnknownMethod {
7241                        ordinal: header.ordinal,
7242                        control_handle: DictionaryKeysIteratorControlHandle { inner: this.inner.clone() },
7243                        method_type: fidl::MethodType::OneWay,
7244                    })
7245                }
7246                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7247                    this.inner.send_framework_err(
7248                        fidl::encoding::FrameworkErr::UnknownMethod,
7249                        header.tx_id,
7250                        header.ordinal,
7251                        header.dynamic_flags(),
7252                        (bytes, handles),
7253                    )?;
7254                    Ok(DictionaryKeysIteratorRequest::_UnknownMethod {
7255                        ordinal: header.ordinal,
7256                        control_handle: DictionaryKeysIteratorControlHandle { inner: this.inner.clone() },
7257                        method_type: fidl::MethodType::TwoWay,
7258                    })
7259                }
7260                _ => Err(fidl::Error::UnknownOrdinal {
7261                    ordinal: header.ordinal,
7262                    protocol_name: <DictionaryKeysIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7263                }),
7264            }))
7265            },
7266        )
7267    }
7268}
7269
7270#[derive(Debug)]
7271pub enum DictionaryKeysIteratorRequest {
7272    GetNext {
7273        responder: DictionaryKeysIteratorGetNextResponder,
7274    },
7275    /// An interaction was received which does not match any known method.
7276    #[non_exhaustive]
7277    _UnknownMethod {
7278        /// Ordinal of the method that was called.
7279        ordinal: u64,
7280        control_handle: DictionaryKeysIteratorControlHandle,
7281        method_type: fidl::MethodType,
7282    },
7283}
7284
7285impl DictionaryKeysIteratorRequest {
7286    #[allow(irrefutable_let_patterns)]
7287    pub fn into_get_next(self) -> Option<(DictionaryKeysIteratorGetNextResponder)> {
7288        if let DictionaryKeysIteratorRequest::GetNext { responder } = self {
7289            Some((responder))
7290        } else {
7291            None
7292        }
7293    }
7294
7295    /// Name of the method defined in FIDL
7296    pub fn method_name(&self) -> &'static str {
7297        match *self {
7298            DictionaryKeysIteratorRequest::GetNext { .. } => "get_next",
7299            DictionaryKeysIteratorRequest::_UnknownMethod {
7300                method_type: fidl::MethodType::OneWay,
7301                ..
7302            } => "unknown one-way method",
7303            DictionaryKeysIteratorRequest::_UnknownMethod {
7304                method_type: fidl::MethodType::TwoWay,
7305                ..
7306            } => "unknown two-way method",
7307        }
7308    }
7309}
7310
7311#[derive(Debug, Clone)]
7312pub struct DictionaryKeysIteratorControlHandle {
7313    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7314}
7315
7316impl fidl::endpoints::ControlHandle for DictionaryKeysIteratorControlHandle {
7317    fn shutdown(&self) {
7318        self.inner.shutdown()
7319    }
7320    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
7321        self.inner.shutdown_with_epitaph(status)
7322    }
7323
7324    fn is_closed(&self) -> bool {
7325        self.inner.channel().is_closed()
7326    }
7327    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
7328        self.inner.channel().on_closed()
7329    }
7330
7331    #[cfg(target_os = "fuchsia")]
7332    fn signal_peer(
7333        &self,
7334        clear_mask: zx::Signals,
7335        set_mask: zx::Signals,
7336    ) -> Result<(), zx_status::Status> {
7337        use fidl::Peered;
7338        self.inner.channel().signal_peer(clear_mask, set_mask)
7339    }
7340}
7341
7342impl DictionaryKeysIteratorControlHandle {}
7343
7344#[must_use = "FIDL methods require a response to be sent"]
7345#[derive(Debug)]
7346pub struct DictionaryKeysIteratorGetNextResponder {
7347    control_handle: std::mem::ManuallyDrop<DictionaryKeysIteratorControlHandle>,
7348    tx_id: u32,
7349}
7350
7351/// Set the the channel to be shutdown (see [`DictionaryKeysIteratorControlHandle::shutdown`])
7352/// if the responder is dropped without sending a response, so that the client
7353/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7354impl std::ops::Drop for DictionaryKeysIteratorGetNextResponder {
7355    fn drop(&mut self) {
7356        self.control_handle.shutdown();
7357        // Safety: drops once, never accessed again
7358        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7359    }
7360}
7361
7362impl fidl::endpoints::Responder for DictionaryKeysIteratorGetNextResponder {
7363    type ControlHandle = DictionaryKeysIteratorControlHandle;
7364
7365    fn control_handle(&self) -> &DictionaryKeysIteratorControlHandle {
7366        &self.control_handle
7367    }
7368
7369    fn drop_without_shutdown(mut self) {
7370        // Safety: drops once, never accessed again due to mem::forget
7371        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7372        // Prevent Drop from running (which would shut down the channel)
7373        std::mem::forget(self);
7374    }
7375}
7376
7377impl DictionaryKeysIteratorGetNextResponder {
7378    /// Sends a response to the FIDL transaction.
7379    ///
7380    /// Sets the channel to shutdown if an error occurs.
7381    pub fn send(self, mut keys: &[String]) -> Result<(), fidl::Error> {
7382        let _result = self.send_raw(keys);
7383        if _result.is_err() {
7384            self.control_handle.shutdown();
7385        }
7386        self.drop_without_shutdown();
7387        _result
7388    }
7389
7390    /// Similar to "send" but does not shutdown the channel if an error occurs.
7391    pub fn send_no_shutdown_on_err(self, mut keys: &[String]) -> Result<(), fidl::Error> {
7392        let _result = self.send_raw(keys);
7393        self.drop_without_shutdown();
7394        _result
7395    }
7396
7397    fn send_raw(&self, mut keys: &[String]) -> Result<(), fidl::Error> {
7398        self.control_handle
7399            .inner
7400            .send::<fidl::encoding::FlexibleType<DictionaryKeysIteratorGetNextResponse>>(
7401                fidl::encoding::Flexible::new((keys,)),
7402                self.tx_id,
7403                0x453828cbacca7d53,
7404                fidl::encoding::DynamicFlags::FLEXIBLE,
7405            )
7406    }
7407}
7408
7409#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
7410pub struct DictionaryRouterMarker;
7411
7412impl fidl::endpoints::ProtocolMarker for DictionaryRouterMarker {
7413    type Proxy = DictionaryRouterProxy;
7414    type RequestStream = DictionaryRouterRequestStream;
7415    #[cfg(target_os = "fuchsia")]
7416    type SynchronousProxy = DictionaryRouterSynchronousProxy;
7417
7418    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.DictionaryRouter";
7419}
7420impl fidl::endpoints::DiscoverableProtocolMarker for DictionaryRouterMarker {}
7421pub type DictionaryRouterRouteResult = Result<DictionaryRouterRouteResponse, RouterError>;
7422
7423pub trait DictionaryRouterProxyInterface: Send + Sync {
7424    type RouteResponseFut: std::future::Future<Output = Result<DictionaryRouterRouteResult, fidl::Error>>
7425        + Send;
7426    fn r#route(&self, payload: RouteRequest) -> Self::RouteResponseFut;
7427}
7428#[derive(Debug)]
7429#[cfg(target_os = "fuchsia")]
7430pub struct DictionaryRouterSynchronousProxy {
7431    client: fidl::client::sync::Client,
7432}
7433
7434#[cfg(target_os = "fuchsia")]
7435impl fidl::endpoints::SynchronousProxy for DictionaryRouterSynchronousProxy {
7436    type Proxy = DictionaryRouterProxy;
7437    type Protocol = DictionaryRouterMarker;
7438
7439    fn from_channel(inner: fidl::Channel) -> Self {
7440        Self::new(inner)
7441    }
7442
7443    fn into_channel(self) -> fidl::Channel {
7444        self.client.into_channel()
7445    }
7446
7447    fn as_channel(&self) -> &fidl::Channel {
7448        self.client.as_channel()
7449    }
7450}
7451
7452#[cfg(target_os = "fuchsia")]
7453impl DictionaryRouterSynchronousProxy {
7454    pub fn new(channel: fidl::Channel) -> Self {
7455        let protocol_name = <DictionaryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7456        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
7457    }
7458
7459    pub fn into_channel(self) -> fidl::Channel {
7460        self.client.into_channel()
7461    }
7462
7463    /// Waits until an event arrives and returns it. It is safe for other
7464    /// threads to make concurrent requests while waiting for an event.
7465    pub fn wait_for_event(
7466        &self,
7467        deadline: zx::MonotonicInstant,
7468    ) -> Result<DictionaryRouterEvent, fidl::Error> {
7469        DictionaryRouterEvent::decode(self.client.wait_for_event(deadline)?)
7470    }
7471
7472    pub fn r#route(
7473        &self,
7474        mut payload: RouteRequest,
7475        ___deadline: zx::MonotonicInstant,
7476    ) -> Result<DictionaryRouterRouteResult, fidl::Error> {
7477        let _response = self.client.send_query::<
7478            RouteRequest,
7479            fidl::encoding::FlexibleResultType<DictionaryRouterRouteResponse, RouterError>,
7480        >(
7481            &mut payload,
7482            0x714c65bfe54bd79f,
7483            fidl::encoding::DynamicFlags::FLEXIBLE,
7484            ___deadline,
7485        )?
7486        .into_result::<DictionaryRouterMarker>("route")?;
7487        Ok(_response.map(|x| x))
7488    }
7489}
7490
7491#[cfg(target_os = "fuchsia")]
7492impl From<DictionaryRouterSynchronousProxy> for zx::Handle {
7493    fn from(value: DictionaryRouterSynchronousProxy) -> Self {
7494        value.into_channel().into()
7495    }
7496}
7497
7498#[cfg(target_os = "fuchsia")]
7499impl From<fidl::Channel> for DictionaryRouterSynchronousProxy {
7500    fn from(value: fidl::Channel) -> Self {
7501        Self::new(value)
7502    }
7503}
7504
7505#[derive(Debug, Clone)]
7506pub struct DictionaryRouterProxy {
7507    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
7508}
7509
7510impl fidl::endpoints::Proxy for DictionaryRouterProxy {
7511    type Protocol = DictionaryRouterMarker;
7512
7513    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
7514        Self::new(inner)
7515    }
7516
7517    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
7518        self.client.into_channel().map_err(|client| Self { client })
7519    }
7520
7521    fn as_channel(&self) -> &::fidl::AsyncChannel {
7522        self.client.as_channel()
7523    }
7524}
7525
7526impl DictionaryRouterProxy {
7527    /// Create a new Proxy for fuchsia.component.sandbox/DictionaryRouter.
7528    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
7529        let protocol_name = <DictionaryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7530        Self { client: fidl::client::Client::new(channel, protocol_name) }
7531    }
7532
7533    /// Get a Stream of events from the remote end of the protocol.
7534    ///
7535    /// # Panics
7536    ///
7537    /// Panics if the event stream was already taken.
7538    pub fn take_event_stream(&self) -> DictionaryRouterEventStream {
7539        DictionaryRouterEventStream { event_receiver: self.client.take_event_receiver() }
7540    }
7541
7542    pub fn r#route(
7543        &self,
7544        mut payload: RouteRequest,
7545    ) -> fidl::client::QueryResponseFut<
7546        DictionaryRouterRouteResult,
7547        fidl::encoding::DefaultFuchsiaResourceDialect,
7548    > {
7549        DictionaryRouterProxyInterface::r#route(self, payload)
7550    }
7551}
7552
7553impl DictionaryRouterProxyInterface for DictionaryRouterProxy {
7554    type RouteResponseFut = fidl::client::QueryResponseFut<
7555        DictionaryRouterRouteResult,
7556        fidl::encoding::DefaultFuchsiaResourceDialect,
7557    >;
7558    fn r#route(&self, mut payload: RouteRequest) -> Self::RouteResponseFut {
7559        fn _decode(
7560            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7561        ) -> Result<DictionaryRouterRouteResult, fidl::Error> {
7562            let _response = fidl::client::decode_transaction_body::<
7563                fidl::encoding::FlexibleResultType<DictionaryRouterRouteResponse, RouterError>,
7564                fidl::encoding::DefaultFuchsiaResourceDialect,
7565                0x714c65bfe54bd79f,
7566            >(_buf?)?
7567            .into_result::<DictionaryRouterMarker>("route")?;
7568            Ok(_response.map(|x| x))
7569        }
7570        self.client.send_query_and_decode::<RouteRequest, DictionaryRouterRouteResult>(
7571            &mut payload,
7572            0x714c65bfe54bd79f,
7573            fidl::encoding::DynamicFlags::FLEXIBLE,
7574            _decode,
7575        )
7576    }
7577}
7578
7579pub struct DictionaryRouterEventStream {
7580    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
7581}
7582
7583impl std::marker::Unpin for DictionaryRouterEventStream {}
7584
7585impl futures::stream::FusedStream for DictionaryRouterEventStream {
7586    fn is_terminated(&self) -> bool {
7587        self.event_receiver.is_terminated()
7588    }
7589}
7590
7591impl futures::Stream for DictionaryRouterEventStream {
7592    type Item = Result<DictionaryRouterEvent, fidl::Error>;
7593
7594    fn poll_next(
7595        mut self: std::pin::Pin<&mut Self>,
7596        cx: &mut std::task::Context<'_>,
7597    ) -> std::task::Poll<Option<Self::Item>> {
7598        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7599            &mut self.event_receiver,
7600            cx
7601        )?) {
7602            Some(buf) => std::task::Poll::Ready(Some(DictionaryRouterEvent::decode(buf))),
7603            None => std::task::Poll::Ready(None),
7604        }
7605    }
7606}
7607
7608#[derive(Debug)]
7609pub enum DictionaryRouterEvent {
7610    #[non_exhaustive]
7611    _UnknownEvent {
7612        /// Ordinal of the event that was sent.
7613        ordinal: u64,
7614    },
7615}
7616
7617impl DictionaryRouterEvent {
7618    /// Decodes a message buffer as a [`DictionaryRouterEvent`].
7619    fn decode(
7620        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7621    ) -> Result<DictionaryRouterEvent, fidl::Error> {
7622        let (bytes, _handles) = buf.split_mut();
7623        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7624        debug_assert_eq!(tx_header.tx_id, 0);
7625        match tx_header.ordinal {
7626            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7627                Ok(DictionaryRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
7628            }
7629            _ => Err(fidl::Error::UnknownOrdinal {
7630                ordinal: tx_header.ordinal,
7631                protocol_name:
7632                    <DictionaryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7633            }),
7634        }
7635    }
7636}
7637
7638/// A Stream of incoming requests for fuchsia.component.sandbox/DictionaryRouter.
7639pub struct DictionaryRouterRequestStream {
7640    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7641    is_terminated: bool,
7642}
7643
7644impl std::marker::Unpin for DictionaryRouterRequestStream {}
7645
7646impl futures::stream::FusedStream for DictionaryRouterRequestStream {
7647    fn is_terminated(&self) -> bool {
7648        self.is_terminated
7649    }
7650}
7651
7652impl fidl::endpoints::RequestStream for DictionaryRouterRequestStream {
7653    type Protocol = DictionaryRouterMarker;
7654    type ControlHandle = DictionaryRouterControlHandle;
7655
7656    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
7657        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7658    }
7659
7660    fn control_handle(&self) -> Self::ControlHandle {
7661        DictionaryRouterControlHandle { inner: self.inner.clone() }
7662    }
7663
7664    fn into_inner(
7665        self,
7666    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
7667    {
7668        (self.inner, self.is_terminated)
7669    }
7670
7671    fn from_inner(
7672        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7673        is_terminated: bool,
7674    ) -> Self {
7675        Self { inner, is_terminated }
7676    }
7677}
7678
7679impl futures::Stream for DictionaryRouterRequestStream {
7680    type Item = Result<DictionaryRouterRequest, fidl::Error>;
7681
7682    fn poll_next(
7683        mut self: std::pin::Pin<&mut Self>,
7684        cx: &mut std::task::Context<'_>,
7685    ) -> std::task::Poll<Option<Self::Item>> {
7686        let this = &mut *self;
7687        if this.inner.check_shutdown(cx) {
7688            this.is_terminated = true;
7689            return std::task::Poll::Ready(None);
7690        }
7691        if this.is_terminated {
7692            panic!("polled DictionaryRouterRequestStream after completion");
7693        }
7694        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
7695            |bytes, handles| {
7696                match this.inner.channel().read_etc(cx, bytes, handles) {
7697                    std::task::Poll::Ready(Ok(())) => {}
7698                    std::task::Poll::Pending => return std::task::Poll::Pending,
7699                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
7700                        this.is_terminated = true;
7701                        return std::task::Poll::Ready(None);
7702                    }
7703                    std::task::Poll::Ready(Err(e)) => {
7704                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7705                            e.into(),
7706                        ))))
7707                    }
7708                }
7709
7710                // A message has been received from the channel
7711                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7712
7713                std::task::Poll::Ready(Some(match header.ordinal {
7714                    0x714c65bfe54bd79f => {
7715                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7716                        let mut req = fidl::new_empty!(
7717                            RouteRequest,
7718                            fidl::encoding::DefaultFuchsiaResourceDialect
7719                        );
7720                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RouteRequest>(&header, _body_bytes, handles, &mut req)?;
7721                        let control_handle =
7722                            DictionaryRouterControlHandle { inner: this.inner.clone() };
7723                        Ok(DictionaryRouterRequest::Route {
7724                            payload: req,
7725                            responder: DictionaryRouterRouteResponder {
7726                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7727                                tx_id: header.tx_id,
7728                            },
7729                        })
7730                    }
7731                    _ if header.tx_id == 0
7732                        && header
7733                            .dynamic_flags()
7734                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
7735                    {
7736                        Ok(DictionaryRouterRequest::_UnknownMethod {
7737                            ordinal: header.ordinal,
7738                            control_handle: DictionaryRouterControlHandle {
7739                                inner: this.inner.clone(),
7740                            },
7741                            method_type: fidl::MethodType::OneWay,
7742                        })
7743                    }
7744                    _ if header
7745                        .dynamic_flags()
7746                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
7747                    {
7748                        this.inner.send_framework_err(
7749                            fidl::encoding::FrameworkErr::UnknownMethod,
7750                            header.tx_id,
7751                            header.ordinal,
7752                            header.dynamic_flags(),
7753                            (bytes, handles),
7754                        )?;
7755                        Ok(DictionaryRouterRequest::_UnknownMethod {
7756                            ordinal: header.ordinal,
7757                            control_handle: DictionaryRouterControlHandle {
7758                                inner: this.inner.clone(),
7759                            },
7760                            method_type: fidl::MethodType::TwoWay,
7761                        })
7762                    }
7763                    _ => Err(fidl::Error::UnknownOrdinal {
7764                        ordinal: header.ordinal,
7765                        protocol_name:
7766                            <DictionaryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7767                    }),
7768                }))
7769            },
7770        )
7771    }
7772}
7773
7774#[derive(Debug)]
7775pub enum DictionaryRouterRequest {
7776    Route {
7777        payload: RouteRequest,
7778        responder: DictionaryRouterRouteResponder,
7779    },
7780    /// An interaction was received which does not match any known method.
7781    #[non_exhaustive]
7782    _UnknownMethod {
7783        /// Ordinal of the method that was called.
7784        ordinal: u64,
7785        control_handle: DictionaryRouterControlHandle,
7786        method_type: fidl::MethodType,
7787    },
7788}
7789
7790impl DictionaryRouterRequest {
7791    #[allow(irrefutable_let_patterns)]
7792    pub fn into_route(self) -> Option<(RouteRequest, DictionaryRouterRouteResponder)> {
7793        if let DictionaryRouterRequest::Route { payload, responder } = self {
7794            Some((payload, responder))
7795        } else {
7796            None
7797        }
7798    }
7799
7800    /// Name of the method defined in FIDL
7801    pub fn method_name(&self) -> &'static str {
7802        match *self {
7803            DictionaryRouterRequest::Route { .. } => "route",
7804            DictionaryRouterRequest::_UnknownMethod {
7805                method_type: fidl::MethodType::OneWay,
7806                ..
7807            } => "unknown one-way method",
7808            DictionaryRouterRequest::_UnknownMethod {
7809                method_type: fidl::MethodType::TwoWay,
7810                ..
7811            } => "unknown two-way method",
7812        }
7813    }
7814}
7815
7816#[derive(Debug, Clone)]
7817pub struct DictionaryRouterControlHandle {
7818    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7819}
7820
7821impl fidl::endpoints::ControlHandle for DictionaryRouterControlHandle {
7822    fn shutdown(&self) {
7823        self.inner.shutdown()
7824    }
7825    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
7826        self.inner.shutdown_with_epitaph(status)
7827    }
7828
7829    fn is_closed(&self) -> bool {
7830        self.inner.channel().is_closed()
7831    }
7832    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
7833        self.inner.channel().on_closed()
7834    }
7835
7836    #[cfg(target_os = "fuchsia")]
7837    fn signal_peer(
7838        &self,
7839        clear_mask: zx::Signals,
7840        set_mask: zx::Signals,
7841    ) -> Result<(), zx_status::Status> {
7842        use fidl::Peered;
7843        self.inner.channel().signal_peer(clear_mask, set_mask)
7844    }
7845}
7846
7847impl DictionaryRouterControlHandle {}
7848
7849#[must_use = "FIDL methods require a response to be sent"]
7850#[derive(Debug)]
7851pub struct DictionaryRouterRouteResponder {
7852    control_handle: std::mem::ManuallyDrop<DictionaryRouterControlHandle>,
7853    tx_id: u32,
7854}
7855
7856/// Set the the channel to be shutdown (see [`DictionaryRouterControlHandle::shutdown`])
7857/// if the responder is dropped without sending a response, so that the client
7858/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7859impl std::ops::Drop for DictionaryRouterRouteResponder {
7860    fn drop(&mut self) {
7861        self.control_handle.shutdown();
7862        // Safety: drops once, never accessed again
7863        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7864    }
7865}
7866
7867impl fidl::endpoints::Responder for DictionaryRouterRouteResponder {
7868    type ControlHandle = DictionaryRouterControlHandle;
7869
7870    fn control_handle(&self) -> &DictionaryRouterControlHandle {
7871        &self.control_handle
7872    }
7873
7874    fn drop_without_shutdown(mut self) {
7875        // Safety: drops once, never accessed again due to mem::forget
7876        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7877        // Prevent Drop from running (which would shut down the channel)
7878        std::mem::forget(self);
7879    }
7880}
7881
7882impl DictionaryRouterRouteResponder {
7883    /// Sends a response to the FIDL transaction.
7884    ///
7885    /// Sets the channel to shutdown if an error occurs.
7886    pub fn send(
7887        self,
7888        mut result: Result<DictionaryRouterRouteResponse, RouterError>,
7889    ) -> Result<(), fidl::Error> {
7890        let _result = self.send_raw(result);
7891        if _result.is_err() {
7892            self.control_handle.shutdown();
7893        }
7894        self.drop_without_shutdown();
7895        _result
7896    }
7897
7898    /// Similar to "send" but does not shutdown the channel if an error occurs.
7899    pub fn send_no_shutdown_on_err(
7900        self,
7901        mut result: Result<DictionaryRouterRouteResponse, RouterError>,
7902    ) -> Result<(), fidl::Error> {
7903        let _result = self.send_raw(result);
7904        self.drop_without_shutdown();
7905        _result
7906    }
7907
7908    fn send_raw(
7909        &self,
7910        mut result: Result<DictionaryRouterRouteResponse, RouterError>,
7911    ) -> Result<(), fidl::Error> {
7912        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
7913            DictionaryRouterRouteResponse,
7914            RouterError,
7915        >>(
7916            fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
7917            self.tx_id,
7918            0x714c65bfe54bd79f,
7919            fidl::encoding::DynamicFlags::FLEXIBLE,
7920        )
7921    }
7922}
7923
7924#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
7925pub struct DirConnectorRouterMarker;
7926
7927impl fidl::endpoints::ProtocolMarker for DirConnectorRouterMarker {
7928    type Proxy = DirConnectorRouterProxy;
7929    type RequestStream = DirConnectorRouterRequestStream;
7930    #[cfg(target_os = "fuchsia")]
7931    type SynchronousProxy = DirConnectorRouterSynchronousProxy;
7932
7933    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.DirConnectorRouter";
7934}
7935impl fidl::endpoints::DiscoverableProtocolMarker for DirConnectorRouterMarker {}
7936pub type DirConnectorRouterRouteResult = Result<DirConnectorRouterRouteResponse, RouterError>;
7937
7938pub trait DirConnectorRouterProxyInterface: Send + Sync {
7939    type RouteResponseFut: std::future::Future<Output = Result<DirConnectorRouterRouteResult, fidl::Error>>
7940        + Send;
7941    fn r#route(&self, payload: RouteRequest) -> Self::RouteResponseFut;
7942}
7943#[derive(Debug)]
7944#[cfg(target_os = "fuchsia")]
7945pub struct DirConnectorRouterSynchronousProxy {
7946    client: fidl::client::sync::Client,
7947}
7948
7949#[cfg(target_os = "fuchsia")]
7950impl fidl::endpoints::SynchronousProxy for DirConnectorRouterSynchronousProxy {
7951    type Proxy = DirConnectorRouterProxy;
7952    type Protocol = DirConnectorRouterMarker;
7953
7954    fn from_channel(inner: fidl::Channel) -> Self {
7955        Self::new(inner)
7956    }
7957
7958    fn into_channel(self) -> fidl::Channel {
7959        self.client.into_channel()
7960    }
7961
7962    fn as_channel(&self) -> &fidl::Channel {
7963        self.client.as_channel()
7964    }
7965}
7966
7967#[cfg(target_os = "fuchsia")]
7968impl DirConnectorRouterSynchronousProxy {
7969    pub fn new(channel: fidl::Channel) -> Self {
7970        let protocol_name =
7971            <DirConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7972        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
7973    }
7974
7975    pub fn into_channel(self) -> fidl::Channel {
7976        self.client.into_channel()
7977    }
7978
7979    /// Waits until an event arrives and returns it. It is safe for other
7980    /// threads to make concurrent requests while waiting for an event.
7981    pub fn wait_for_event(
7982        &self,
7983        deadline: zx::MonotonicInstant,
7984    ) -> Result<DirConnectorRouterEvent, fidl::Error> {
7985        DirConnectorRouterEvent::decode(self.client.wait_for_event(deadline)?)
7986    }
7987
7988    pub fn r#route(
7989        &self,
7990        mut payload: RouteRequest,
7991        ___deadline: zx::MonotonicInstant,
7992    ) -> Result<DirConnectorRouterRouteResult, fidl::Error> {
7993        let _response = self.client.send_query::<
7994            RouteRequest,
7995            fidl::encoding::FlexibleResultType<DirConnectorRouterRouteResponse, RouterError>,
7996        >(
7997            &mut payload,
7998            0xd7e0f01da2c8e40,
7999            fidl::encoding::DynamicFlags::FLEXIBLE,
8000            ___deadline,
8001        )?
8002        .into_result::<DirConnectorRouterMarker>("route")?;
8003        Ok(_response.map(|x| x))
8004    }
8005}
8006
8007#[cfg(target_os = "fuchsia")]
8008impl From<DirConnectorRouterSynchronousProxy> for zx::Handle {
8009    fn from(value: DirConnectorRouterSynchronousProxy) -> Self {
8010        value.into_channel().into()
8011    }
8012}
8013
8014#[cfg(target_os = "fuchsia")]
8015impl From<fidl::Channel> for DirConnectorRouterSynchronousProxy {
8016    fn from(value: fidl::Channel) -> Self {
8017        Self::new(value)
8018    }
8019}
8020
8021#[derive(Debug, Clone)]
8022pub struct DirConnectorRouterProxy {
8023    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
8024}
8025
8026impl fidl::endpoints::Proxy for DirConnectorRouterProxy {
8027    type Protocol = DirConnectorRouterMarker;
8028
8029    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
8030        Self::new(inner)
8031    }
8032
8033    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
8034        self.client.into_channel().map_err(|client| Self { client })
8035    }
8036
8037    fn as_channel(&self) -> &::fidl::AsyncChannel {
8038        self.client.as_channel()
8039    }
8040}
8041
8042impl DirConnectorRouterProxy {
8043    /// Create a new Proxy for fuchsia.component.sandbox/DirConnectorRouter.
8044    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
8045        let protocol_name =
8046            <DirConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8047        Self { client: fidl::client::Client::new(channel, protocol_name) }
8048    }
8049
8050    /// Get a Stream of events from the remote end of the protocol.
8051    ///
8052    /// # Panics
8053    ///
8054    /// Panics if the event stream was already taken.
8055    pub fn take_event_stream(&self) -> DirConnectorRouterEventStream {
8056        DirConnectorRouterEventStream { event_receiver: self.client.take_event_receiver() }
8057    }
8058
8059    pub fn r#route(
8060        &self,
8061        mut payload: RouteRequest,
8062    ) -> fidl::client::QueryResponseFut<
8063        DirConnectorRouterRouteResult,
8064        fidl::encoding::DefaultFuchsiaResourceDialect,
8065    > {
8066        DirConnectorRouterProxyInterface::r#route(self, payload)
8067    }
8068}
8069
8070impl DirConnectorRouterProxyInterface for DirConnectorRouterProxy {
8071    type RouteResponseFut = fidl::client::QueryResponseFut<
8072        DirConnectorRouterRouteResult,
8073        fidl::encoding::DefaultFuchsiaResourceDialect,
8074    >;
8075    fn r#route(&self, mut payload: RouteRequest) -> Self::RouteResponseFut {
8076        fn _decode(
8077            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8078        ) -> Result<DirConnectorRouterRouteResult, fidl::Error> {
8079            let _response = fidl::client::decode_transaction_body::<
8080                fidl::encoding::FlexibleResultType<DirConnectorRouterRouteResponse, RouterError>,
8081                fidl::encoding::DefaultFuchsiaResourceDialect,
8082                0xd7e0f01da2c8e40,
8083            >(_buf?)?
8084            .into_result::<DirConnectorRouterMarker>("route")?;
8085            Ok(_response.map(|x| x))
8086        }
8087        self.client.send_query_and_decode::<RouteRequest, DirConnectorRouterRouteResult>(
8088            &mut payload,
8089            0xd7e0f01da2c8e40,
8090            fidl::encoding::DynamicFlags::FLEXIBLE,
8091            _decode,
8092        )
8093    }
8094}
8095
8096pub struct DirConnectorRouterEventStream {
8097    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
8098}
8099
8100impl std::marker::Unpin for DirConnectorRouterEventStream {}
8101
8102impl futures::stream::FusedStream for DirConnectorRouterEventStream {
8103    fn is_terminated(&self) -> bool {
8104        self.event_receiver.is_terminated()
8105    }
8106}
8107
8108impl futures::Stream for DirConnectorRouterEventStream {
8109    type Item = Result<DirConnectorRouterEvent, fidl::Error>;
8110
8111    fn poll_next(
8112        mut self: std::pin::Pin<&mut Self>,
8113        cx: &mut std::task::Context<'_>,
8114    ) -> std::task::Poll<Option<Self::Item>> {
8115        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
8116            &mut self.event_receiver,
8117            cx
8118        )?) {
8119            Some(buf) => std::task::Poll::Ready(Some(DirConnectorRouterEvent::decode(buf))),
8120            None => std::task::Poll::Ready(None),
8121        }
8122    }
8123}
8124
8125#[derive(Debug)]
8126pub enum DirConnectorRouterEvent {
8127    #[non_exhaustive]
8128    _UnknownEvent {
8129        /// Ordinal of the event that was sent.
8130        ordinal: u64,
8131    },
8132}
8133
8134impl DirConnectorRouterEvent {
8135    /// Decodes a message buffer as a [`DirConnectorRouterEvent`].
8136    fn decode(
8137        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
8138    ) -> Result<DirConnectorRouterEvent, fidl::Error> {
8139        let (bytes, _handles) = buf.split_mut();
8140        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8141        debug_assert_eq!(tx_header.tx_id, 0);
8142        match tx_header.ordinal {
8143            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
8144                Ok(DirConnectorRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
8145            }
8146            _ => Err(fidl::Error::UnknownOrdinal {
8147                ordinal: tx_header.ordinal,
8148                protocol_name:
8149                    <DirConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8150            }),
8151        }
8152    }
8153}
8154
8155/// A Stream of incoming requests for fuchsia.component.sandbox/DirConnectorRouter.
8156pub struct DirConnectorRouterRequestStream {
8157    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8158    is_terminated: bool,
8159}
8160
8161impl std::marker::Unpin for DirConnectorRouterRequestStream {}
8162
8163impl futures::stream::FusedStream for DirConnectorRouterRequestStream {
8164    fn is_terminated(&self) -> bool {
8165        self.is_terminated
8166    }
8167}
8168
8169impl fidl::endpoints::RequestStream for DirConnectorRouterRequestStream {
8170    type Protocol = DirConnectorRouterMarker;
8171    type ControlHandle = DirConnectorRouterControlHandle;
8172
8173    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
8174        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
8175    }
8176
8177    fn control_handle(&self) -> Self::ControlHandle {
8178        DirConnectorRouterControlHandle { inner: self.inner.clone() }
8179    }
8180
8181    fn into_inner(
8182        self,
8183    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
8184    {
8185        (self.inner, self.is_terminated)
8186    }
8187
8188    fn from_inner(
8189        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8190        is_terminated: bool,
8191    ) -> Self {
8192        Self { inner, is_terminated }
8193    }
8194}
8195
8196impl futures::Stream for DirConnectorRouterRequestStream {
8197    type Item = Result<DirConnectorRouterRequest, fidl::Error>;
8198
8199    fn poll_next(
8200        mut self: std::pin::Pin<&mut Self>,
8201        cx: &mut std::task::Context<'_>,
8202    ) -> std::task::Poll<Option<Self::Item>> {
8203        let this = &mut *self;
8204        if this.inner.check_shutdown(cx) {
8205            this.is_terminated = true;
8206            return std::task::Poll::Ready(None);
8207        }
8208        if this.is_terminated {
8209            panic!("polled DirConnectorRouterRequestStream after completion");
8210        }
8211        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
8212            |bytes, handles| {
8213                match this.inner.channel().read_etc(cx, bytes, handles) {
8214                    std::task::Poll::Ready(Ok(())) => {}
8215                    std::task::Poll::Pending => return std::task::Poll::Pending,
8216                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
8217                        this.is_terminated = true;
8218                        return std::task::Poll::Ready(None);
8219                    }
8220                    std::task::Poll::Ready(Err(e)) => {
8221                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
8222                            e.into(),
8223                        ))))
8224                    }
8225                }
8226
8227                // A message has been received from the channel
8228                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8229
8230                std::task::Poll::Ready(Some(match header.ordinal {
8231                0xd7e0f01da2c8e40 => {
8232                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
8233                    let mut req = fidl::new_empty!(RouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
8234                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RouteRequest>(&header, _body_bytes, handles, &mut req)?;
8235                    let control_handle = DirConnectorRouterControlHandle {
8236                        inner: this.inner.clone(),
8237                    };
8238                    Ok(DirConnectorRouterRequest::Route {payload: req,
8239                        responder: DirConnectorRouterRouteResponder {
8240                            control_handle: std::mem::ManuallyDrop::new(control_handle),
8241                            tx_id: header.tx_id,
8242                        },
8243                    })
8244                }
8245                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
8246                    Ok(DirConnectorRouterRequest::_UnknownMethod {
8247                        ordinal: header.ordinal,
8248                        control_handle: DirConnectorRouterControlHandle { inner: this.inner.clone() },
8249                        method_type: fidl::MethodType::OneWay,
8250                    })
8251                }
8252                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
8253                    this.inner.send_framework_err(
8254                        fidl::encoding::FrameworkErr::UnknownMethod,
8255                        header.tx_id,
8256                        header.ordinal,
8257                        header.dynamic_flags(),
8258                        (bytes, handles),
8259                    )?;
8260                    Ok(DirConnectorRouterRequest::_UnknownMethod {
8261                        ordinal: header.ordinal,
8262                        control_handle: DirConnectorRouterControlHandle { inner: this.inner.clone() },
8263                        method_type: fidl::MethodType::TwoWay,
8264                    })
8265                }
8266                _ => Err(fidl::Error::UnknownOrdinal {
8267                    ordinal: header.ordinal,
8268                    protocol_name: <DirConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8269                }),
8270            }))
8271            },
8272        )
8273    }
8274}
8275
8276#[derive(Debug)]
8277pub enum DirConnectorRouterRequest {
8278    Route {
8279        payload: RouteRequest,
8280        responder: DirConnectorRouterRouteResponder,
8281    },
8282    /// An interaction was received which does not match any known method.
8283    #[non_exhaustive]
8284    _UnknownMethod {
8285        /// Ordinal of the method that was called.
8286        ordinal: u64,
8287        control_handle: DirConnectorRouterControlHandle,
8288        method_type: fidl::MethodType,
8289    },
8290}
8291
8292impl DirConnectorRouterRequest {
8293    #[allow(irrefutable_let_patterns)]
8294    pub fn into_route(self) -> Option<(RouteRequest, DirConnectorRouterRouteResponder)> {
8295        if let DirConnectorRouterRequest::Route { payload, responder } = self {
8296            Some((payload, responder))
8297        } else {
8298            None
8299        }
8300    }
8301
8302    /// Name of the method defined in FIDL
8303    pub fn method_name(&self) -> &'static str {
8304        match *self {
8305            DirConnectorRouterRequest::Route { .. } => "route",
8306            DirConnectorRouterRequest::_UnknownMethod {
8307                method_type: fidl::MethodType::OneWay,
8308                ..
8309            } => "unknown one-way method",
8310            DirConnectorRouterRequest::_UnknownMethod {
8311                method_type: fidl::MethodType::TwoWay,
8312                ..
8313            } => "unknown two-way method",
8314        }
8315    }
8316}
8317
8318#[derive(Debug, Clone)]
8319pub struct DirConnectorRouterControlHandle {
8320    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8321}
8322
8323impl fidl::endpoints::ControlHandle for DirConnectorRouterControlHandle {
8324    fn shutdown(&self) {
8325        self.inner.shutdown()
8326    }
8327    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
8328        self.inner.shutdown_with_epitaph(status)
8329    }
8330
8331    fn is_closed(&self) -> bool {
8332        self.inner.channel().is_closed()
8333    }
8334    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
8335        self.inner.channel().on_closed()
8336    }
8337
8338    #[cfg(target_os = "fuchsia")]
8339    fn signal_peer(
8340        &self,
8341        clear_mask: zx::Signals,
8342        set_mask: zx::Signals,
8343    ) -> Result<(), zx_status::Status> {
8344        use fidl::Peered;
8345        self.inner.channel().signal_peer(clear_mask, set_mask)
8346    }
8347}
8348
8349impl DirConnectorRouterControlHandle {}
8350
8351#[must_use = "FIDL methods require a response to be sent"]
8352#[derive(Debug)]
8353pub struct DirConnectorRouterRouteResponder {
8354    control_handle: std::mem::ManuallyDrop<DirConnectorRouterControlHandle>,
8355    tx_id: u32,
8356}
8357
8358/// Set the the channel to be shutdown (see [`DirConnectorRouterControlHandle::shutdown`])
8359/// if the responder is dropped without sending a response, so that the client
8360/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8361impl std::ops::Drop for DirConnectorRouterRouteResponder {
8362    fn drop(&mut self) {
8363        self.control_handle.shutdown();
8364        // Safety: drops once, never accessed again
8365        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8366    }
8367}
8368
8369impl fidl::endpoints::Responder for DirConnectorRouterRouteResponder {
8370    type ControlHandle = DirConnectorRouterControlHandle;
8371
8372    fn control_handle(&self) -> &DirConnectorRouterControlHandle {
8373        &self.control_handle
8374    }
8375
8376    fn drop_without_shutdown(mut self) {
8377        // Safety: drops once, never accessed again due to mem::forget
8378        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8379        // Prevent Drop from running (which would shut down the channel)
8380        std::mem::forget(self);
8381    }
8382}
8383
8384impl DirConnectorRouterRouteResponder {
8385    /// Sends a response to the FIDL transaction.
8386    ///
8387    /// Sets the channel to shutdown if an error occurs.
8388    pub fn send(
8389        self,
8390        mut result: Result<DirConnectorRouterRouteResponse, RouterError>,
8391    ) -> Result<(), fidl::Error> {
8392        let _result = self.send_raw(result);
8393        if _result.is_err() {
8394            self.control_handle.shutdown();
8395        }
8396        self.drop_without_shutdown();
8397        _result
8398    }
8399
8400    /// Similar to "send" but does not shutdown the channel if an error occurs.
8401    pub fn send_no_shutdown_on_err(
8402        self,
8403        mut result: Result<DirConnectorRouterRouteResponse, RouterError>,
8404    ) -> Result<(), fidl::Error> {
8405        let _result = self.send_raw(result);
8406        self.drop_without_shutdown();
8407        _result
8408    }
8409
8410    fn send_raw(
8411        &self,
8412        mut result: Result<DirConnectorRouterRouteResponse, RouterError>,
8413    ) -> Result<(), fidl::Error> {
8414        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
8415            DirConnectorRouterRouteResponse,
8416            RouterError,
8417        >>(
8418            fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
8419            self.tx_id,
8420            0xd7e0f01da2c8e40,
8421            fidl::encoding::DynamicFlags::FLEXIBLE,
8422        )
8423    }
8424}
8425
8426#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
8427pub struct DirEntryRouterMarker;
8428
8429impl fidl::endpoints::ProtocolMarker for DirEntryRouterMarker {
8430    type Proxy = DirEntryRouterProxy;
8431    type RequestStream = DirEntryRouterRequestStream;
8432    #[cfg(target_os = "fuchsia")]
8433    type SynchronousProxy = DirEntryRouterSynchronousProxy;
8434
8435    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.DirEntryRouter";
8436}
8437impl fidl::endpoints::DiscoverableProtocolMarker for DirEntryRouterMarker {}
8438pub type DirEntryRouterRouteResult = Result<DirEntryRouterRouteResponse, RouterError>;
8439
8440pub trait DirEntryRouterProxyInterface: Send + Sync {
8441    type RouteResponseFut: std::future::Future<Output = Result<DirEntryRouterRouteResult, fidl::Error>>
8442        + Send;
8443    fn r#route(&self, payload: RouteRequest) -> Self::RouteResponseFut;
8444}
8445#[derive(Debug)]
8446#[cfg(target_os = "fuchsia")]
8447pub struct DirEntryRouterSynchronousProxy {
8448    client: fidl::client::sync::Client,
8449}
8450
8451#[cfg(target_os = "fuchsia")]
8452impl fidl::endpoints::SynchronousProxy for DirEntryRouterSynchronousProxy {
8453    type Proxy = DirEntryRouterProxy;
8454    type Protocol = DirEntryRouterMarker;
8455
8456    fn from_channel(inner: fidl::Channel) -> Self {
8457        Self::new(inner)
8458    }
8459
8460    fn into_channel(self) -> fidl::Channel {
8461        self.client.into_channel()
8462    }
8463
8464    fn as_channel(&self) -> &fidl::Channel {
8465        self.client.as_channel()
8466    }
8467}
8468
8469#[cfg(target_os = "fuchsia")]
8470impl DirEntryRouterSynchronousProxy {
8471    pub fn new(channel: fidl::Channel) -> Self {
8472        let protocol_name = <DirEntryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8473        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
8474    }
8475
8476    pub fn into_channel(self) -> fidl::Channel {
8477        self.client.into_channel()
8478    }
8479
8480    /// Waits until an event arrives and returns it. It is safe for other
8481    /// threads to make concurrent requests while waiting for an event.
8482    pub fn wait_for_event(
8483        &self,
8484        deadline: zx::MonotonicInstant,
8485    ) -> Result<DirEntryRouterEvent, fidl::Error> {
8486        DirEntryRouterEvent::decode(self.client.wait_for_event(deadline)?)
8487    }
8488
8489    pub fn r#route(
8490        &self,
8491        mut payload: RouteRequest,
8492        ___deadline: zx::MonotonicInstant,
8493    ) -> Result<DirEntryRouterRouteResult, fidl::Error> {
8494        let _response = self.client.send_query::<
8495            RouteRequest,
8496            fidl::encoding::FlexibleResultType<DirEntryRouterRouteResponse, RouterError>,
8497        >(
8498            &mut payload,
8499            0x1ac694001c208bd2,
8500            fidl::encoding::DynamicFlags::FLEXIBLE,
8501            ___deadline,
8502        )?
8503        .into_result::<DirEntryRouterMarker>("route")?;
8504        Ok(_response.map(|x| x))
8505    }
8506}
8507
8508#[cfg(target_os = "fuchsia")]
8509impl From<DirEntryRouterSynchronousProxy> for zx::Handle {
8510    fn from(value: DirEntryRouterSynchronousProxy) -> Self {
8511        value.into_channel().into()
8512    }
8513}
8514
8515#[cfg(target_os = "fuchsia")]
8516impl From<fidl::Channel> for DirEntryRouterSynchronousProxy {
8517    fn from(value: fidl::Channel) -> Self {
8518        Self::new(value)
8519    }
8520}
8521
8522#[derive(Debug, Clone)]
8523pub struct DirEntryRouterProxy {
8524    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
8525}
8526
8527impl fidl::endpoints::Proxy for DirEntryRouterProxy {
8528    type Protocol = DirEntryRouterMarker;
8529
8530    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
8531        Self::new(inner)
8532    }
8533
8534    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
8535        self.client.into_channel().map_err(|client| Self { client })
8536    }
8537
8538    fn as_channel(&self) -> &::fidl::AsyncChannel {
8539        self.client.as_channel()
8540    }
8541}
8542
8543impl DirEntryRouterProxy {
8544    /// Create a new Proxy for fuchsia.component.sandbox/DirEntryRouter.
8545    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
8546        let protocol_name = <DirEntryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8547        Self { client: fidl::client::Client::new(channel, protocol_name) }
8548    }
8549
8550    /// Get a Stream of events from the remote end of the protocol.
8551    ///
8552    /// # Panics
8553    ///
8554    /// Panics if the event stream was already taken.
8555    pub fn take_event_stream(&self) -> DirEntryRouterEventStream {
8556        DirEntryRouterEventStream { event_receiver: self.client.take_event_receiver() }
8557    }
8558
8559    pub fn r#route(
8560        &self,
8561        mut payload: RouteRequest,
8562    ) -> fidl::client::QueryResponseFut<
8563        DirEntryRouterRouteResult,
8564        fidl::encoding::DefaultFuchsiaResourceDialect,
8565    > {
8566        DirEntryRouterProxyInterface::r#route(self, payload)
8567    }
8568}
8569
8570impl DirEntryRouterProxyInterface for DirEntryRouterProxy {
8571    type RouteResponseFut = fidl::client::QueryResponseFut<
8572        DirEntryRouterRouteResult,
8573        fidl::encoding::DefaultFuchsiaResourceDialect,
8574    >;
8575    fn r#route(&self, mut payload: RouteRequest) -> Self::RouteResponseFut {
8576        fn _decode(
8577            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8578        ) -> Result<DirEntryRouterRouteResult, fidl::Error> {
8579            let _response = fidl::client::decode_transaction_body::<
8580                fidl::encoding::FlexibleResultType<DirEntryRouterRouteResponse, RouterError>,
8581                fidl::encoding::DefaultFuchsiaResourceDialect,
8582                0x1ac694001c208bd2,
8583            >(_buf?)?
8584            .into_result::<DirEntryRouterMarker>("route")?;
8585            Ok(_response.map(|x| x))
8586        }
8587        self.client.send_query_and_decode::<RouteRequest, DirEntryRouterRouteResult>(
8588            &mut payload,
8589            0x1ac694001c208bd2,
8590            fidl::encoding::DynamicFlags::FLEXIBLE,
8591            _decode,
8592        )
8593    }
8594}
8595
8596pub struct DirEntryRouterEventStream {
8597    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
8598}
8599
8600impl std::marker::Unpin for DirEntryRouterEventStream {}
8601
8602impl futures::stream::FusedStream for DirEntryRouterEventStream {
8603    fn is_terminated(&self) -> bool {
8604        self.event_receiver.is_terminated()
8605    }
8606}
8607
8608impl futures::Stream for DirEntryRouterEventStream {
8609    type Item = Result<DirEntryRouterEvent, fidl::Error>;
8610
8611    fn poll_next(
8612        mut self: std::pin::Pin<&mut Self>,
8613        cx: &mut std::task::Context<'_>,
8614    ) -> std::task::Poll<Option<Self::Item>> {
8615        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
8616            &mut self.event_receiver,
8617            cx
8618        )?) {
8619            Some(buf) => std::task::Poll::Ready(Some(DirEntryRouterEvent::decode(buf))),
8620            None => std::task::Poll::Ready(None),
8621        }
8622    }
8623}
8624
8625#[derive(Debug)]
8626pub enum DirEntryRouterEvent {
8627    #[non_exhaustive]
8628    _UnknownEvent {
8629        /// Ordinal of the event that was sent.
8630        ordinal: u64,
8631    },
8632}
8633
8634impl DirEntryRouterEvent {
8635    /// Decodes a message buffer as a [`DirEntryRouterEvent`].
8636    fn decode(
8637        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
8638    ) -> Result<DirEntryRouterEvent, fidl::Error> {
8639        let (bytes, _handles) = buf.split_mut();
8640        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8641        debug_assert_eq!(tx_header.tx_id, 0);
8642        match tx_header.ordinal {
8643            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
8644                Ok(DirEntryRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
8645            }
8646            _ => Err(fidl::Error::UnknownOrdinal {
8647                ordinal: tx_header.ordinal,
8648                protocol_name:
8649                    <DirEntryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8650            }),
8651        }
8652    }
8653}
8654
8655/// A Stream of incoming requests for fuchsia.component.sandbox/DirEntryRouter.
8656pub struct DirEntryRouterRequestStream {
8657    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8658    is_terminated: bool,
8659}
8660
8661impl std::marker::Unpin for DirEntryRouterRequestStream {}
8662
8663impl futures::stream::FusedStream for DirEntryRouterRequestStream {
8664    fn is_terminated(&self) -> bool {
8665        self.is_terminated
8666    }
8667}
8668
8669impl fidl::endpoints::RequestStream for DirEntryRouterRequestStream {
8670    type Protocol = DirEntryRouterMarker;
8671    type ControlHandle = DirEntryRouterControlHandle;
8672
8673    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
8674        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
8675    }
8676
8677    fn control_handle(&self) -> Self::ControlHandle {
8678        DirEntryRouterControlHandle { inner: self.inner.clone() }
8679    }
8680
8681    fn into_inner(
8682        self,
8683    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
8684    {
8685        (self.inner, self.is_terminated)
8686    }
8687
8688    fn from_inner(
8689        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8690        is_terminated: bool,
8691    ) -> Self {
8692        Self { inner, is_terminated }
8693    }
8694}
8695
8696impl futures::Stream for DirEntryRouterRequestStream {
8697    type Item = Result<DirEntryRouterRequest, fidl::Error>;
8698
8699    fn poll_next(
8700        mut self: std::pin::Pin<&mut Self>,
8701        cx: &mut std::task::Context<'_>,
8702    ) -> std::task::Poll<Option<Self::Item>> {
8703        let this = &mut *self;
8704        if this.inner.check_shutdown(cx) {
8705            this.is_terminated = true;
8706            return std::task::Poll::Ready(None);
8707        }
8708        if this.is_terminated {
8709            panic!("polled DirEntryRouterRequestStream after completion");
8710        }
8711        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
8712            |bytes, handles| {
8713                match this.inner.channel().read_etc(cx, bytes, handles) {
8714                    std::task::Poll::Ready(Ok(())) => {}
8715                    std::task::Poll::Pending => return std::task::Poll::Pending,
8716                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
8717                        this.is_terminated = true;
8718                        return std::task::Poll::Ready(None);
8719                    }
8720                    std::task::Poll::Ready(Err(e)) => {
8721                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
8722                            e.into(),
8723                        ))))
8724                    }
8725                }
8726
8727                // A message has been received from the channel
8728                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8729
8730                std::task::Poll::Ready(Some(match header.ordinal {
8731                    0x1ac694001c208bd2 => {
8732                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
8733                        let mut req = fidl::new_empty!(
8734                            RouteRequest,
8735                            fidl::encoding::DefaultFuchsiaResourceDialect
8736                        );
8737                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RouteRequest>(&header, _body_bytes, handles, &mut req)?;
8738                        let control_handle =
8739                            DirEntryRouterControlHandle { inner: this.inner.clone() };
8740                        Ok(DirEntryRouterRequest::Route {
8741                            payload: req,
8742                            responder: DirEntryRouterRouteResponder {
8743                                control_handle: std::mem::ManuallyDrop::new(control_handle),
8744                                tx_id: header.tx_id,
8745                            },
8746                        })
8747                    }
8748                    _ if header.tx_id == 0
8749                        && header
8750                            .dynamic_flags()
8751                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
8752                    {
8753                        Ok(DirEntryRouterRequest::_UnknownMethod {
8754                            ordinal: header.ordinal,
8755                            control_handle: DirEntryRouterControlHandle {
8756                                inner: this.inner.clone(),
8757                            },
8758                            method_type: fidl::MethodType::OneWay,
8759                        })
8760                    }
8761                    _ if header
8762                        .dynamic_flags()
8763                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
8764                    {
8765                        this.inner.send_framework_err(
8766                            fidl::encoding::FrameworkErr::UnknownMethod,
8767                            header.tx_id,
8768                            header.ordinal,
8769                            header.dynamic_flags(),
8770                            (bytes, handles),
8771                        )?;
8772                        Ok(DirEntryRouterRequest::_UnknownMethod {
8773                            ordinal: header.ordinal,
8774                            control_handle: DirEntryRouterControlHandle {
8775                                inner: this.inner.clone(),
8776                            },
8777                            method_type: fidl::MethodType::TwoWay,
8778                        })
8779                    }
8780                    _ => Err(fidl::Error::UnknownOrdinal {
8781                        ordinal: header.ordinal,
8782                        protocol_name:
8783                            <DirEntryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8784                    }),
8785                }))
8786            },
8787        )
8788    }
8789}
8790
8791#[derive(Debug)]
8792pub enum DirEntryRouterRequest {
8793    Route {
8794        payload: RouteRequest,
8795        responder: DirEntryRouterRouteResponder,
8796    },
8797    /// An interaction was received which does not match any known method.
8798    #[non_exhaustive]
8799    _UnknownMethod {
8800        /// Ordinal of the method that was called.
8801        ordinal: u64,
8802        control_handle: DirEntryRouterControlHandle,
8803        method_type: fidl::MethodType,
8804    },
8805}
8806
8807impl DirEntryRouterRequest {
8808    #[allow(irrefutable_let_patterns)]
8809    pub fn into_route(self) -> Option<(RouteRequest, DirEntryRouterRouteResponder)> {
8810        if let DirEntryRouterRequest::Route { payload, responder } = self {
8811            Some((payload, responder))
8812        } else {
8813            None
8814        }
8815    }
8816
8817    /// Name of the method defined in FIDL
8818    pub fn method_name(&self) -> &'static str {
8819        match *self {
8820            DirEntryRouterRequest::Route { .. } => "route",
8821            DirEntryRouterRequest::_UnknownMethod {
8822                method_type: fidl::MethodType::OneWay, ..
8823            } => "unknown one-way method",
8824            DirEntryRouterRequest::_UnknownMethod {
8825                method_type: fidl::MethodType::TwoWay, ..
8826            } => "unknown two-way method",
8827        }
8828    }
8829}
8830
8831#[derive(Debug, Clone)]
8832pub struct DirEntryRouterControlHandle {
8833    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8834}
8835
8836impl fidl::endpoints::ControlHandle for DirEntryRouterControlHandle {
8837    fn shutdown(&self) {
8838        self.inner.shutdown()
8839    }
8840    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
8841        self.inner.shutdown_with_epitaph(status)
8842    }
8843
8844    fn is_closed(&self) -> bool {
8845        self.inner.channel().is_closed()
8846    }
8847    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
8848        self.inner.channel().on_closed()
8849    }
8850
8851    #[cfg(target_os = "fuchsia")]
8852    fn signal_peer(
8853        &self,
8854        clear_mask: zx::Signals,
8855        set_mask: zx::Signals,
8856    ) -> Result<(), zx_status::Status> {
8857        use fidl::Peered;
8858        self.inner.channel().signal_peer(clear_mask, set_mask)
8859    }
8860}
8861
8862impl DirEntryRouterControlHandle {}
8863
8864#[must_use = "FIDL methods require a response to be sent"]
8865#[derive(Debug)]
8866pub struct DirEntryRouterRouteResponder {
8867    control_handle: std::mem::ManuallyDrop<DirEntryRouterControlHandle>,
8868    tx_id: u32,
8869}
8870
8871/// Set the the channel to be shutdown (see [`DirEntryRouterControlHandle::shutdown`])
8872/// if the responder is dropped without sending a response, so that the client
8873/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8874impl std::ops::Drop for DirEntryRouterRouteResponder {
8875    fn drop(&mut self) {
8876        self.control_handle.shutdown();
8877        // Safety: drops once, never accessed again
8878        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8879    }
8880}
8881
8882impl fidl::endpoints::Responder for DirEntryRouterRouteResponder {
8883    type ControlHandle = DirEntryRouterControlHandle;
8884
8885    fn control_handle(&self) -> &DirEntryRouterControlHandle {
8886        &self.control_handle
8887    }
8888
8889    fn drop_without_shutdown(mut self) {
8890        // Safety: drops once, never accessed again due to mem::forget
8891        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8892        // Prevent Drop from running (which would shut down the channel)
8893        std::mem::forget(self);
8894    }
8895}
8896
8897impl DirEntryRouterRouteResponder {
8898    /// Sends a response to the FIDL transaction.
8899    ///
8900    /// Sets the channel to shutdown if an error occurs.
8901    pub fn send(
8902        self,
8903        mut result: Result<DirEntryRouterRouteResponse, RouterError>,
8904    ) -> Result<(), fidl::Error> {
8905        let _result = self.send_raw(result);
8906        if _result.is_err() {
8907            self.control_handle.shutdown();
8908        }
8909        self.drop_without_shutdown();
8910        _result
8911    }
8912
8913    /// Similar to "send" but does not shutdown the channel if an error occurs.
8914    pub fn send_no_shutdown_on_err(
8915        self,
8916        mut result: Result<DirEntryRouterRouteResponse, RouterError>,
8917    ) -> Result<(), fidl::Error> {
8918        let _result = self.send_raw(result);
8919        self.drop_without_shutdown();
8920        _result
8921    }
8922
8923    fn send_raw(
8924        &self,
8925        mut result: Result<DirEntryRouterRouteResponse, RouterError>,
8926    ) -> Result<(), fidl::Error> {
8927        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
8928            DirEntryRouterRouteResponse,
8929            RouterError,
8930        >>(
8931            fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
8932            self.tx_id,
8933            0x1ac694001c208bd2,
8934            fidl::encoding::DynamicFlags::FLEXIBLE,
8935        )
8936    }
8937}
8938
8939#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
8940pub struct DirReceiverMarker;
8941
8942impl fidl::endpoints::ProtocolMarker for DirReceiverMarker {
8943    type Proxy = DirReceiverProxy;
8944    type RequestStream = DirReceiverRequestStream;
8945    #[cfg(target_os = "fuchsia")]
8946    type SynchronousProxy = DirReceiverSynchronousProxy;
8947
8948    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.DirReceiver";
8949}
8950impl fidl::endpoints::DiscoverableProtocolMarker for DirReceiverMarker {}
8951
8952pub trait DirReceiverProxyInterface: Send + Sync {
8953    fn r#receive(
8954        &self,
8955        channel: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
8956    ) -> Result<(), fidl::Error>;
8957}
8958#[derive(Debug)]
8959#[cfg(target_os = "fuchsia")]
8960pub struct DirReceiverSynchronousProxy {
8961    client: fidl::client::sync::Client,
8962}
8963
8964#[cfg(target_os = "fuchsia")]
8965impl fidl::endpoints::SynchronousProxy for DirReceiverSynchronousProxy {
8966    type Proxy = DirReceiverProxy;
8967    type Protocol = DirReceiverMarker;
8968
8969    fn from_channel(inner: fidl::Channel) -> Self {
8970        Self::new(inner)
8971    }
8972
8973    fn into_channel(self) -> fidl::Channel {
8974        self.client.into_channel()
8975    }
8976
8977    fn as_channel(&self) -> &fidl::Channel {
8978        self.client.as_channel()
8979    }
8980}
8981
8982#[cfg(target_os = "fuchsia")]
8983impl DirReceiverSynchronousProxy {
8984    pub fn new(channel: fidl::Channel) -> Self {
8985        let protocol_name = <DirReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8986        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
8987    }
8988
8989    pub fn into_channel(self) -> fidl::Channel {
8990        self.client.into_channel()
8991    }
8992
8993    /// Waits until an event arrives and returns it. It is safe for other
8994    /// threads to make concurrent requests while waiting for an event.
8995    pub fn wait_for_event(
8996        &self,
8997        deadline: zx::MonotonicInstant,
8998    ) -> Result<DirReceiverEvent, fidl::Error> {
8999        DirReceiverEvent::decode(self.client.wait_for_event(deadline)?)
9000    }
9001
9002    /// Sends a directory channel to this receiver.
9003    ///
9004    /// The server should implement this method by forwarding `channel` to a vfs instance
9005    /// of the language appropriate `vfs` library. To keep this interface decoupled from
9006    /// `fuchsia.io`, it deliberately omits `Open`/`Open3` parameters such as `flags` and
9007    /// `path`. If a client wishes to specify these, they can obtain an initial
9008    /// [fuchsia.io/Directory] channel first and then call `Open`/`Open3` on it.
9009    pub fn r#receive(
9010        &self,
9011        mut channel: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
9012    ) -> Result<(), fidl::Error> {
9013        self.client.send::<DirReceiverReceiveRequest>(
9014            (channel,),
9015            0xcdc3e9b89fe7bb4,
9016            fidl::encoding::DynamicFlags::FLEXIBLE,
9017        )
9018    }
9019}
9020
9021#[cfg(target_os = "fuchsia")]
9022impl From<DirReceiverSynchronousProxy> for zx::Handle {
9023    fn from(value: DirReceiverSynchronousProxy) -> Self {
9024        value.into_channel().into()
9025    }
9026}
9027
9028#[cfg(target_os = "fuchsia")]
9029impl From<fidl::Channel> for DirReceiverSynchronousProxy {
9030    fn from(value: fidl::Channel) -> Self {
9031        Self::new(value)
9032    }
9033}
9034
9035#[derive(Debug, Clone)]
9036pub struct DirReceiverProxy {
9037    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
9038}
9039
9040impl fidl::endpoints::Proxy for DirReceiverProxy {
9041    type Protocol = DirReceiverMarker;
9042
9043    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
9044        Self::new(inner)
9045    }
9046
9047    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
9048        self.client.into_channel().map_err(|client| Self { client })
9049    }
9050
9051    fn as_channel(&self) -> &::fidl::AsyncChannel {
9052        self.client.as_channel()
9053    }
9054}
9055
9056impl DirReceiverProxy {
9057    /// Create a new Proxy for fuchsia.component.sandbox/DirReceiver.
9058    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
9059        let protocol_name = <DirReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
9060        Self { client: fidl::client::Client::new(channel, protocol_name) }
9061    }
9062
9063    /// Get a Stream of events from the remote end of the protocol.
9064    ///
9065    /// # Panics
9066    ///
9067    /// Panics if the event stream was already taken.
9068    pub fn take_event_stream(&self) -> DirReceiverEventStream {
9069        DirReceiverEventStream { event_receiver: self.client.take_event_receiver() }
9070    }
9071
9072    /// Sends a directory channel to this receiver.
9073    ///
9074    /// The server should implement this method by forwarding `channel` to a vfs instance
9075    /// of the language appropriate `vfs` library. To keep this interface decoupled from
9076    /// `fuchsia.io`, it deliberately omits `Open`/`Open3` parameters such as `flags` and
9077    /// `path`. If a client wishes to specify these, they can obtain an initial
9078    /// [fuchsia.io/Directory] channel first and then call `Open`/`Open3` on it.
9079    pub fn r#receive(
9080        &self,
9081        mut channel: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
9082    ) -> Result<(), fidl::Error> {
9083        DirReceiverProxyInterface::r#receive(self, channel)
9084    }
9085}
9086
9087impl DirReceiverProxyInterface for DirReceiverProxy {
9088    fn r#receive(
9089        &self,
9090        mut channel: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
9091    ) -> Result<(), fidl::Error> {
9092        self.client.send::<DirReceiverReceiveRequest>(
9093            (channel,),
9094            0xcdc3e9b89fe7bb4,
9095            fidl::encoding::DynamicFlags::FLEXIBLE,
9096        )
9097    }
9098}
9099
9100pub struct DirReceiverEventStream {
9101    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
9102}
9103
9104impl std::marker::Unpin for DirReceiverEventStream {}
9105
9106impl futures::stream::FusedStream for DirReceiverEventStream {
9107    fn is_terminated(&self) -> bool {
9108        self.event_receiver.is_terminated()
9109    }
9110}
9111
9112impl futures::Stream for DirReceiverEventStream {
9113    type Item = Result<DirReceiverEvent, fidl::Error>;
9114
9115    fn poll_next(
9116        mut self: std::pin::Pin<&mut Self>,
9117        cx: &mut std::task::Context<'_>,
9118    ) -> std::task::Poll<Option<Self::Item>> {
9119        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
9120            &mut self.event_receiver,
9121            cx
9122        )?) {
9123            Some(buf) => std::task::Poll::Ready(Some(DirReceiverEvent::decode(buf))),
9124            None => std::task::Poll::Ready(None),
9125        }
9126    }
9127}
9128
9129#[derive(Debug)]
9130pub enum DirReceiverEvent {
9131    #[non_exhaustive]
9132    _UnknownEvent {
9133        /// Ordinal of the event that was sent.
9134        ordinal: u64,
9135    },
9136}
9137
9138impl DirReceiverEvent {
9139    /// Decodes a message buffer as a [`DirReceiverEvent`].
9140    fn decode(
9141        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
9142    ) -> Result<DirReceiverEvent, fidl::Error> {
9143        let (bytes, _handles) = buf.split_mut();
9144        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9145        debug_assert_eq!(tx_header.tx_id, 0);
9146        match tx_header.ordinal {
9147            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
9148                Ok(DirReceiverEvent::_UnknownEvent { ordinal: tx_header.ordinal })
9149            }
9150            _ => Err(fidl::Error::UnknownOrdinal {
9151                ordinal: tx_header.ordinal,
9152                protocol_name: <DirReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9153            }),
9154        }
9155    }
9156}
9157
9158/// A Stream of incoming requests for fuchsia.component.sandbox/DirReceiver.
9159pub struct DirReceiverRequestStream {
9160    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9161    is_terminated: bool,
9162}
9163
9164impl std::marker::Unpin for DirReceiverRequestStream {}
9165
9166impl futures::stream::FusedStream for DirReceiverRequestStream {
9167    fn is_terminated(&self) -> bool {
9168        self.is_terminated
9169    }
9170}
9171
9172impl fidl::endpoints::RequestStream for DirReceiverRequestStream {
9173    type Protocol = DirReceiverMarker;
9174    type ControlHandle = DirReceiverControlHandle;
9175
9176    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
9177        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
9178    }
9179
9180    fn control_handle(&self) -> Self::ControlHandle {
9181        DirReceiverControlHandle { inner: self.inner.clone() }
9182    }
9183
9184    fn into_inner(
9185        self,
9186    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
9187    {
9188        (self.inner, self.is_terminated)
9189    }
9190
9191    fn from_inner(
9192        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9193        is_terminated: bool,
9194    ) -> Self {
9195        Self { inner, is_terminated }
9196    }
9197}
9198
9199impl futures::Stream for DirReceiverRequestStream {
9200    type Item = Result<DirReceiverRequest, fidl::Error>;
9201
9202    fn poll_next(
9203        mut self: std::pin::Pin<&mut Self>,
9204        cx: &mut std::task::Context<'_>,
9205    ) -> std::task::Poll<Option<Self::Item>> {
9206        let this = &mut *self;
9207        if this.inner.check_shutdown(cx) {
9208            this.is_terminated = true;
9209            return std::task::Poll::Ready(None);
9210        }
9211        if this.is_terminated {
9212            panic!("polled DirReceiverRequestStream after completion");
9213        }
9214        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
9215            |bytes, handles| {
9216                match this.inner.channel().read_etc(cx, bytes, handles) {
9217                    std::task::Poll::Ready(Ok(())) => {}
9218                    std::task::Poll::Pending => return std::task::Poll::Pending,
9219                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
9220                        this.is_terminated = true;
9221                        return std::task::Poll::Ready(None);
9222                    }
9223                    std::task::Poll::Ready(Err(e)) => {
9224                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
9225                            e.into(),
9226                        ))))
9227                    }
9228                }
9229
9230                // A message has been received from the channel
9231                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9232
9233                std::task::Poll::Ready(Some(match header.ordinal {
9234                    0xcdc3e9b89fe7bb4 => {
9235                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
9236                        let mut req = fidl::new_empty!(
9237                            DirReceiverReceiveRequest,
9238                            fidl::encoding::DefaultFuchsiaResourceDialect
9239                        );
9240                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirReceiverReceiveRequest>(&header, _body_bytes, handles, &mut req)?;
9241                        let control_handle = DirReceiverControlHandle { inner: this.inner.clone() };
9242                        Ok(DirReceiverRequest::Receive { channel: req.channel, control_handle })
9243                    }
9244                    _ if header.tx_id == 0
9245                        && header
9246                            .dynamic_flags()
9247                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
9248                    {
9249                        Ok(DirReceiverRequest::_UnknownMethod {
9250                            ordinal: header.ordinal,
9251                            control_handle: DirReceiverControlHandle { inner: this.inner.clone() },
9252                            method_type: fidl::MethodType::OneWay,
9253                        })
9254                    }
9255                    _ if header
9256                        .dynamic_flags()
9257                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
9258                    {
9259                        this.inner.send_framework_err(
9260                            fidl::encoding::FrameworkErr::UnknownMethod,
9261                            header.tx_id,
9262                            header.ordinal,
9263                            header.dynamic_flags(),
9264                            (bytes, handles),
9265                        )?;
9266                        Ok(DirReceiverRequest::_UnknownMethod {
9267                            ordinal: header.ordinal,
9268                            control_handle: DirReceiverControlHandle { inner: this.inner.clone() },
9269                            method_type: fidl::MethodType::TwoWay,
9270                        })
9271                    }
9272                    _ => Err(fidl::Error::UnknownOrdinal {
9273                        ordinal: header.ordinal,
9274                        protocol_name:
9275                            <DirReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9276                    }),
9277                }))
9278            },
9279        )
9280    }
9281}
9282
9283/// A receiver is served by components and allows them to receive directory channels
9284/// framework.
9285#[derive(Debug)]
9286pub enum DirReceiverRequest {
9287    /// Sends a directory channel to this receiver.
9288    ///
9289    /// The server should implement this method by forwarding `channel` to a vfs instance
9290    /// of the language appropriate `vfs` library. To keep this interface decoupled from
9291    /// `fuchsia.io`, it deliberately omits `Open`/`Open3` parameters such as `flags` and
9292    /// `path`. If a client wishes to specify these, they can obtain an initial
9293    /// [fuchsia.io/Directory] channel first and then call `Open`/`Open3` on it.
9294    Receive {
9295        channel: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
9296        control_handle: DirReceiverControlHandle,
9297    },
9298    /// An interaction was received which does not match any known method.
9299    #[non_exhaustive]
9300    _UnknownMethod {
9301        /// Ordinal of the method that was called.
9302        ordinal: u64,
9303        control_handle: DirReceiverControlHandle,
9304        method_type: fidl::MethodType,
9305    },
9306}
9307
9308impl DirReceiverRequest {
9309    #[allow(irrefutable_let_patterns)]
9310    pub fn into_receive(
9311        self,
9312    ) -> Option<(
9313        fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
9314        DirReceiverControlHandle,
9315    )> {
9316        if let DirReceiverRequest::Receive { channel, control_handle } = self {
9317            Some((channel, control_handle))
9318        } else {
9319            None
9320        }
9321    }
9322
9323    /// Name of the method defined in FIDL
9324    pub fn method_name(&self) -> &'static str {
9325        match *self {
9326            DirReceiverRequest::Receive { .. } => "receive",
9327            DirReceiverRequest::_UnknownMethod {
9328                method_type: fidl::MethodType::OneWay, ..
9329            } => "unknown one-way method",
9330            DirReceiverRequest::_UnknownMethod {
9331                method_type: fidl::MethodType::TwoWay, ..
9332            } => "unknown two-way method",
9333        }
9334    }
9335}
9336
9337#[derive(Debug, Clone)]
9338pub struct DirReceiverControlHandle {
9339    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9340}
9341
9342impl fidl::endpoints::ControlHandle for DirReceiverControlHandle {
9343    fn shutdown(&self) {
9344        self.inner.shutdown()
9345    }
9346    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
9347        self.inner.shutdown_with_epitaph(status)
9348    }
9349
9350    fn is_closed(&self) -> bool {
9351        self.inner.channel().is_closed()
9352    }
9353    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
9354        self.inner.channel().on_closed()
9355    }
9356
9357    #[cfg(target_os = "fuchsia")]
9358    fn signal_peer(
9359        &self,
9360        clear_mask: zx::Signals,
9361        set_mask: zx::Signals,
9362    ) -> Result<(), zx_status::Status> {
9363        use fidl::Peered;
9364        self.inner.channel().signal_peer(clear_mask, set_mask)
9365    }
9366}
9367
9368impl DirReceiverControlHandle {}
9369
9370#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
9371pub struct DirectoryRouterMarker;
9372
9373impl fidl::endpoints::ProtocolMarker for DirectoryRouterMarker {
9374    type Proxy = DirectoryRouterProxy;
9375    type RequestStream = DirectoryRouterRequestStream;
9376    #[cfg(target_os = "fuchsia")]
9377    type SynchronousProxy = DirectoryRouterSynchronousProxy;
9378
9379    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.DirectoryRouter";
9380}
9381impl fidl::endpoints::DiscoverableProtocolMarker for DirectoryRouterMarker {}
9382pub type DirectoryRouterRouteResult = Result<DirectoryRouterRouteResponse, RouterError>;
9383
9384pub trait DirectoryRouterProxyInterface: Send + Sync {
9385    type RouteResponseFut: std::future::Future<Output = Result<DirectoryRouterRouteResult, fidl::Error>>
9386        + Send;
9387    fn r#route(&self, payload: RouteRequest) -> Self::RouteResponseFut;
9388}
9389#[derive(Debug)]
9390#[cfg(target_os = "fuchsia")]
9391pub struct DirectoryRouterSynchronousProxy {
9392    client: fidl::client::sync::Client,
9393}
9394
9395#[cfg(target_os = "fuchsia")]
9396impl fidl::endpoints::SynchronousProxy for DirectoryRouterSynchronousProxy {
9397    type Proxy = DirectoryRouterProxy;
9398    type Protocol = DirectoryRouterMarker;
9399
9400    fn from_channel(inner: fidl::Channel) -> Self {
9401        Self::new(inner)
9402    }
9403
9404    fn into_channel(self) -> fidl::Channel {
9405        self.client.into_channel()
9406    }
9407
9408    fn as_channel(&self) -> &fidl::Channel {
9409        self.client.as_channel()
9410    }
9411}
9412
9413#[cfg(target_os = "fuchsia")]
9414impl DirectoryRouterSynchronousProxy {
9415    pub fn new(channel: fidl::Channel) -> Self {
9416        let protocol_name = <DirectoryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
9417        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
9418    }
9419
9420    pub fn into_channel(self) -> fidl::Channel {
9421        self.client.into_channel()
9422    }
9423
9424    /// Waits until an event arrives and returns it. It is safe for other
9425    /// threads to make concurrent requests while waiting for an event.
9426    pub fn wait_for_event(
9427        &self,
9428        deadline: zx::MonotonicInstant,
9429    ) -> Result<DirectoryRouterEvent, fidl::Error> {
9430        DirectoryRouterEvent::decode(self.client.wait_for_event(deadline)?)
9431    }
9432
9433    pub fn r#route(
9434        &self,
9435        mut payload: RouteRequest,
9436        ___deadline: zx::MonotonicInstant,
9437    ) -> Result<DirectoryRouterRouteResult, fidl::Error> {
9438        let _response = self.client.send_query::<
9439            RouteRequest,
9440            fidl::encoding::FlexibleResultType<DirectoryRouterRouteResponse, RouterError>,
9441        >(
9442            &mut payload,
9443            0x683b6c6be21b0f21,
9444            fidl::encoding::DynamicFlags::FLEXIBLE,
9445            ___deadline,
9446        )?
9447        .into_result::<DirectoryRouterMarker>("route")?;
9448        Ok(_response.map(|x| x))
9449    }
9450}
9451
9452#[cfg(target_os = "fuchsia")]
9453impl From<DirectoryRouterSynchronousProxy> for zx::Handle {
9454    fn from(value: DirectoryRouterSynchronousProxy) -> Self {
9455        value.into_channel().into()
9456    }
9457}
9458
9459#[cfg(target_os = "fuchsia")]
9460impl From<fidl::Channel> for DirectoryRouterSynchronousProxy {
9461    fn from(value: fidl::Channel) -> Self {
9462        Self::new(value)
9463    }
9464}
9465
9466#[derive(Debug, Clone)]
9467pub struct DirectoryRouterProxy {
9468    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
9469}
9470
9471impl fidl::endpoints::Proxy for DirectoryRouterProxy {
9472    type Protocol = DirectoryRouterMarker;
9473
9474    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
9475        Self::new(inner)
9476    }
9477
9478    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
9479        self.client.into_channel().map_err(|client| Self { client })
9480    }
9481
9482    fn as_channel(&self) -> &::fidl::AsyncChannel {
9483        self.client.as_channel()
9484    }
9485}
9486
9487impl DirectoryRouterProxy {
9488    /// Create a new Proxy for fuchsia.component.sandbox/DirectoryRouter.
9489    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
9490        let protocol_name = <DirectoryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
9491        Self { client: fidl::client::Client::new(channel, protocol_name) }
9492    }
9493
9494    /// Get a Stream of events from the remote end of the protocol.
9495    ///
9496    /// # Panics
9497    ///
9498    /// Panics if the event stream was already taken.
9499    pub fn take_event_stream(&self) -> DirectoryRouterEventStream {
9500        DirectoryRouterEventStream { event_receiver: self.client.take_event_receiver() }
9501    }
9502
9503    pub fn r#route(
9504        &self,
9505        mut payload: RouteRequest,
9506    ) -> fidl::client::QueryResponseFut<
9507        DirectoryRouterRouteResult,
9508        fidl::encoding::DefaultFuchsiaResourceDialect,
9509    > {
9510        DirectoryRouterProxyInterface::r#route(self, payload)
9511    }
9512}
9513
9514impl DirectoryRouterProxyInterface for DirectoryRouterProxy {
9515    type RouteResponseFut = fidl::client::QueryResponseFut<
9516        DirectoryRouterRouteResult,
9517        fidl::encoding::DefaultFuchsiaResourceDialect,
9518    >;
9519    fn r#route(&self, mut payload: RouteRequest) -> Self::RouteResponseFut {
9520        fn _decode(
9521            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9522        ) -> Result<DirectoryRouterRouteResult, fidl::Error> {
9523            let _response = fidl::client::decode_transaction_body::<
9524                fidl::encoding::FlexibleResultType<DirectoryRouterRouteResponse, RouterError>,
9525                fidl::encoding::DefaultFuchsiaResourceDialect,
9526                0x683b6c6be21b0f21,
9527            >(_buf?)?
9528            .into_result::<DirectoryRouterMarker>("route")?;
9529            Ok(_response.map(|x| x))
9530        }
9531        self.client.send_query_and_decode::<RouteRequest, DirectoryRouterRouteResult>(
9532            &mut payload,
9533            0x683b6c6be21b0f21,
9534            fidl::encoding::DynamicFlags::FLEXIBLE,
9535            _decode,
9536        )
9537    }
9538}
9539
9540pub struct DirectoryRouterEventStream {
9541    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
9542}
9543
9544impl std::marker::Unpin for DirectoryRouterEventStream {}
9545
9546impl futures::stream::FusedStream for DirectoryRouterEventStream {
9547    fn is_terminated(&self) -> bool {
9548        self.event_receiver.is_terminated()
9549    }
9550}
9551
9552impl futures::Stream for DirectoryRouterEventStream {
9553    type Item = Result<DirectoryRouterEvent, fidl::Error>;
9554
9555    fn poll_next(
9556        mut self: std::pin::Pin<&mut Self>,
9557        cx: &mut std::task::Context<'_>,
9558    ) -> std::task::Poll<Option<Self::Item>> {
9559        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
9560            &mut self.event_receiver,
9561            cx
9562        )?) {
9563            Some(buf) => std::task::Poll::Ready(Some(DirectoryRouterEvent::decode(buf))),
9564            None => std::task::Poll::Ready(None),
9565        }
9566    }
9567}
9568
9569#[derive(Debug)]
9570pub enum DirectoryRouterEvent {
9571    #[non_exhaustive]
9572    _UnknownEvent {
9573        /// Ordinal of the event that was sent.
9574        ordinal: u64,
9575    },
9576}
9577
9578impl DirectoryRouterEvent {
9579    /// Decodes a message buffer as a [`DirectoryRouterEvent`].
9580    fn decode(
9581        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
9582    ) -> Result<DirectoryRouterEvent, fidl::Error> {
9583        let (bytes, _handles) = buf.split_mut();
9584        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9585        debug_assert_eq!(tx_header.tx_id, 0);
9586        match tx_header.ordinal {
9587            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
9588                Ok(DirectoryRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
9589            }
9590            _ => Err(fidl::Error::UnknownOrdinal {
9591                ordinal: tx_header.ordinal,
9592                protocol_name:
9593                    <DirectoryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9594            }),
9595        }
9596    }
9597}
9598
9599/// A Stream of incoming requests for fuchsia.component.sandbox/DirectoryRouter.
9600pub struct DirectoryRouterRequestStream {
9601    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9602    is_terminated: bool,
9603}
9604
9605impl std::marker::Unpin for DirectoryRouterRequestStream {}
9606
9607impl futures::stream::FusedStream for DirectoryRouterRequestStream {
9608    fn is_terminated(&self) -> bool {
9609        self.is_terminated
9610    }
9611}
9612
9613impl fidl::endpoints::RequestStream for DirectoryRouterRequestStream {
9614    type Protocol = DirectoryRouterMarker;
9615    type ControlHandle = DirectoryRouterControlHandle;
9616
9617    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
9618        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
9619    }
9620
9621    fn control_handle(&self) -> Self::ControlHandle {
9622        DirectoryRouterControlHandle { inner: self.inner.clone() }
9623    }
9624
9625    fn into_inner(
9626        self,
9627    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
9628    {
9629        (self.inner, self.is_terminated)
9630    }
9631
9632    fn from_inner(
9633        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9634        is_terminated: bool,
9635    ) -> Self {
9636        Self { inner, is_terminated }
9637    }
9638}
9639
9640impl futures::Stream for DirectoryRouterRequestStream {
9641    type Item = Result<DirectoryRouterRequest, fidl::Error>;
9642
9643    fn poll_next(
9644        mut self: std::pin::Pin<&mut Self>,
9645        cx: &mut std::task::Context<'_>,
9646    ) -> std::task::Poll<Option<Self::Item>> {
9647        let this = &mut *self;
9648        if this.inner.check_shutdown(cx) {
9649            this.is_terminated = true;
9650            return std::task::Poll::Ready(None);
9651        }
9652        if this.is_terminated {
9653            panic!("polled DirectoryRouterRequestStream after completion");
9654        }
9655        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
9656            |bytes, handles| {
9657                match this.inner.channel().read_etc(cx, bytes, handles) {
9658                    std::task::Poll::Ready(Ok(())) => {}
9659                    std::task::Poll::Pending => return std::task::Poll::Pending,
9660                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
9661                        this.is_terminated = true;
9662                        return std::task::Poll::Ready(None);
9663                    }
9664                    std::task::Poll::Ready(Err(e)) => {
9665                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
9666                            e.into(),
9667                        ))))
9668                    }
9669                }
9670
9671                // A message has been received from the channel
9672                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9673
9674                std::task::Poll::Ready(Some(match header.ordinal {
9675                    0x683b6c6be21b0f21 => {
9676                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9677                        let mut req = fidl::new_empty!(
9678                            RouteRequest,
9679                            fidl::encoding::DefaultFuchsiaResourceDialect
9680                        );
9681                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RouteRequest>(&header, _body_bytes, handles, &mut req)?;
9682                        let control_handle =
9683                            DirectoryRouterControlHandle { inner: this.inner.clone() };
9684                        Ok(DirectoryRouterRequest::Route {
9685                            payload: req,
9686                            responder: DirectoryRouterRouteResponder {
9687                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9688                                tx_id: header.tx_id,
9689                            },
9690                        })
9691                    }
9692                    _ if header.tx_id == 0
9693                        && header
9694                            .dynamic_flags()
9695                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
9696                    {
9697                        Ok(DirectoryRouterRequest::_UnknownMethod {
9698                            ordinal: header.ordinal,
9699                            control_handle: DirectoryRouterControlHandle {
9700                                inner: this.inner.clone(),
9701                            },
9702                            method_type: fidl::MethodType::OneWay,
9703                        })
9704                    }
9705                    _ if header
9706                        .dynamic_flags()
9707                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
9708                    {
9709                        this.inner.send_framework_err(
9710                            fidl::encoding::FrameworkErr::UnknownMethod,
9711                            header.tx_id,
9712                            header.ordinal,
9713                            header.dynamic_flags(),
9714                            (bytes, handles),
9715                        )?;
9716                        Ok(DirectoryRouterRequest::_UnknownMethod {
9717                            ordinal: header.ordinal,
9718                            control_handle: DirectoryRouterControlHandle {
9719                                inner: this.inner.clone(),
9720                            },
9721                            method_type: fidl::MethodType::TwoWay,
9722                        })
9723                    }
9724                    _ => Err(fidl::Error::UnknownOrdinal {
9725                        ordinal: header.ordinal,
9726                        protocol_name:
9727                            <DirectoryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9728                    }),
9729                }))
9730            },
9731        )
9732    }
9733}
9734
9735#[derive(Debug)]
9736pub enum DirectoryRouterRequest {
9737    Route {
9738        payload: RouteRequest,
9739        responder: DirectoryRouterRouteResponder,
9740    },
9741    /// An interaction was received which does not match any known method.
9742    #[non_exhaustive]
9743    _UnknownMethod {
9744        /// Ordinal of the method that was called.
9745        ordinal: u64,
9746        control_handle: DirectoryRouterControlHandle,
9747        method_type: fidl::MethodType,
9748    },
9749}
9750
9751impl DirectoryRouterRequest {
9752    #[allow(irrefutable_let_patterns)]
9753    pub fn into_route(self) -> Option<(RouteRequest, DirectoryRouterRouteResponder)> {
9754        if let DirectoryRouterRequest::Route { payload, responder } = self {
9755            Some((payload, responder))
9756        } else {
9757            None
9758        }
9759    }
9760
9761    /// Name of the method defined in FIDL
9762    pub fn method_name(&self) -> &'static str {
9763        match *self {
9764            DirectoryRouterRequest::Route { .. } => "route",
9765            DirectoryRouterRequest::_UnknownMethod {
9766                method_type: fidl::MethodType::OneWay,
9767                ..
9768            } => "unknown one-way method",
9769            DirectoryRouterRequest::_UnknownMethod {
9770                method_type: fidl::MethodType::TwoWay,
9771                ..
9772            } => "unknown two-way method",
9773        }
9774    }
9775}
9776
9777#[derive(Debug, Clone)]
9778pub struct DirectoryRouterControlHandle {
9779    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9780}
9781
9782impl fidl::endpoints::ControlHandle for DirectoryRouterControlHandle {
9783    fn shutdown(&self) {
9784        self.inner.shutdown()
9785    }
9786    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
9787        self.inner.shutdown_with_epitaph(status)
9788    }
9789
9790    fn is_closed(&self) -> bool {
9791        self.inner.channel().is_closed()
9792    }
9793    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
9794        self.inner.channel().on_closed()
9795    }
9796
9797    #[cfg(target_os = "fuchsia")]
9798    fn signal_peer(
9799        &self,
9800        clear_mask: zx::Signals,
9801        set_mask: zx::Signals,
9802    ) -> Result<(), zx_status::Status> {
9803        use fidl::Peered;
9804        self.inner.channel().signal_peer(clear_mask, set_mask)
9805    }
9806}
9807
9808impl DirectoryRouterControlHandle {}
9809
9810#[must_use = "FIDL methods require a response to be sent"]
9811#[derive(Debug)]
9812pub struct DirectoryRouterRouteResponder {
9813    control_handle: std::mem::ManuallyDrop<DirectoryRouterControlHandle>,
9814    tx_id: u32,
9815}
9816
9817/// Set the the channel to be shutdown (see [`DirectoryRouterControlHandle::shutdown`])
9818/// if the responder is dropped without sending a response, so that the client
9819/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9820impl std::ops::Drop for DirectoryRouterRouteResponder {
9821    fn drop(&mut self) {
9822        self.control_handle.shutdown();
9823        // Safety: drops once, never accessed again
9824        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9825    }
9826}
9827
9828impl fidl::endpoints::Responder for DirectoryRouterRouteResponder {
9829    type ControlHandle = DirectoryRouterControlHandle;
9830
9831    fn control_handle(&self) -> &DirectoryRouterControlHandle {
9832        &self.control_handle
9833    }
9834
9835    fn drop_without_shutdown(mut self) {
9836        // Safety: drops once, never accessed again due to mem::forget
9837        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9838        // Prevent Drop from running (which would shut down the channel)
9839        std::mem::forget(self);
9840    }
9841}
9842
9843impl DirectoryRouterRouteResponder {
9844    /// Sends a response to the FIDL transaction.
9845    ///
9846    /// Sets the channel to shutdown if an error occurs.
9847    pub fn send(
9848        self,
9849        mut result: Result<DirectoryRouterRouteResponse, RouterError>,
9850    ) -> Result<(), fidl::Error> {
9851        let _result = self.send_raw(result);
9852        if _result.is_err() {
9853            self.control_handle.shutdown();
9854        }
9855        self.drop_without_shutdown();
9856        _result
9857    }
9858
9859    /// Similar to "send" but does not shutdown the channel if an error occurs.
9860    pub fn send_no_shutdown_on_err(
9861        self,
9862        mut result: Result<DirectoryRouterRouteResponse, RouterError>,
9863    ) -> Result<(), fidl::Error> {
9864        let _result = self.send_raw(result);
9865        self.drop_without_shutdown();
9866        _result
9867    }
9868
9869    fn send_raw(
9870        &self,
9871        mut result: Result<DirectoryRouterRouteResponse, RouterError>,
9872    ) -> Result<(), fidl::Error> {
9873        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
9874            DirectoryRouterRouteResponse,
9875            RouterError,
9876        >>(
9877            fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
9878            self.tx_id,
9879            0x683b6c6be21b0f21,
9880            fidl::encoding::DynamicFlags::FLEXIBLE,
9881        )
9882    }
9883}
9884
9885#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
9886pub struct ReceiverMarker;
9887
9888impl fidl::endpoints::ProtocolMarker for ReceiverMarker {
9889    type Proxy = ReceiverProxy;
9890    type RequestStream = ReceiverRequestStream;
9891    #[cfg(target_os = "fuchsia")]
9892    type SynchronousProxy = ReceiverSynchronousProxy;
9893
9894    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.Receiver";
9895}
9896impl fidl::endpoints::DiscoverableProtocolMarker for ReceiverMarker {}
9897
9898pub trait ReceiverProxyInterface: Send + Sync {
9899    fn r#receive(&self, channel: fidl::Channel) -> Result<(), fidl::Error>;
9900}
9901#[derive(Debug)]
9902#[cfg(target_os = "fuchsia")]
9903pub struct ReceiverSynchronousProxy {
9904    client: fidl::client::sync::Client,
9905}
9906
9907#[cfg(target_os = "fuchsia")]
9908impl fidl::endpoints::SynchronousProxy for ReceiverSynchronousProxy {
9909    type Proxy = ReceiverProxy;
9910    type Protocol = ReceiverMarker;
9911
9912    fn from_channel(inner: fidl::Channel) -> Self {
9913        Self::new(inner)
9914    }
9915
9916    fn into_channel(self) -> fidl::Channel {
9917        self.client.into_channel()
9918    }
9919
9920    fn as_channel(&self) -> &fidl::Channel {
9921        self.client.as_channel()
9922    }
9923}
9924
9925#[cfg(target_os = "fuchsia")]
9926impl ReceiverSynchronousProxy {
9927    pub fn new(channel: fidl::Channel) -> Self {
9928        let protocol_name = <ReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
9929        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
9930    }
9931
9932    pub fn into_channel(self) -> fidl::Channel {
9933        self.client.into_channel()
9934    }
9935
9936    /// Waits until an event arrives and returns it. It is safe for other
9937    /// threads to make concurrent requests while waiting for an event.
9938    pub fn wait_for_event(
9939        &self,
9940        deadline: zx::MonotonicInstant,
9941    ) -> Result<ReceiverEvent, fidl::Error> {
9942        ReceiverEvent::decode(self.client.wait_for_event(deadline)?)
9943    }
9944
9945    /// Sends a channel to this receiver.
9946    pub fn r#receive(&self, mut channel: fidl::Channel) -> Result<(), fidl::Error> {
9947        self.client.send::<ProtocolPayload>(
9948            (channel,),
9949            0x4bae18ab7aa1a94,
9950            fidl::encoding::DynamicFlags::FLEXIBLE,
9951        )
9952    }
9953}
9954
9955#[cfg(target_os = "fuchsia")]
9956impl From<ReceiverSynchronousProxy> for zx::Handle {
9957    fn from(value: ReceiverSynchronousProxy) -> Self {
9958        value.into_channel().into()
9959    }
9960}
9961
9962#[cfg(target_os = "fuchsia")]
9963impl From<fidl::Channel> for ReceiverSynchronousProxy {
9964    fn from(value: fidl::Channel) -> Self {
9965        Self::new(value)
9966    }
9967}
9968
9969#[derive(Debug, Clone)]
9970pub struct ReceiverProxy {
9971    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
9972}
9973
9974impl fidl::endpoints::Proxy for ReceiverProxy {
9975    type Protocol = ReceiverMarker;
9976
9977    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
9978        Self::new(inner)
9979    }
9980
9981    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
9982        self.client.into_channel().map_err(|client| Self { client })
9983    }
9984
9985    fn as_channel(&self) -> &::fidl::AsyncChannel {
9986        self.client.as_channel()
9987    }
9988}
9989
9990impl ReceiverProxy {
9991    /// Create a new Proxy for fuchsia.component.sandbox/Receiver.
9992    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
9993        let protocol_name = <ReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
9994        Self { client: fidl::client::Client::new(channel, protocol_name) }
9995    }
9996
9997    /// Get a Stream of events from the remote end of the protocol.
9998    ///
9999    /// # Panics
10000    ///
10001    /// Panics if the event stream was already taken.
10002    pub fn take_event_stream(&self) -> ReceiverEventStream {
10003        ReceiverEventStream { event_receiver: self.client.take_event_receiver() }
10004    }
10005
10006    /// Sends a channel to this receiver.
10007    pub fn r#receive(&self, mut channel: fidl::Channel) -> Result<(), fidl::Error> {
10008        ReceiverProxyInterface::r#receive(self, channel)
10009    }
10010}
10011
10012impl ReceiverProxyInterface for ReceiverProxy {
10013    fn r#receive(&self, mut channel: fidl::Channel) -> Result<(), fidl::Error> {
10014        self.client.send::<ProtocolPayload>(
10015            (channel,),
10016            0x4bae18ab7aa1a94,
10017            fidl::encoding::DynamicFlags::FLEXIBLE,
10018        )
10019    }
10020}
10021
10022pub struct ReceiverEventStream {
10023    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
10024}
10025
10026impl std::marker::Unpin for ReceiverEventStream {}
10027
10028impl futures::stream::FusedStream for ReceiverEventStream {
10029    fn is_terminated(&self) -> bool {
10030        self.event_receiver.is_terminated()
10031    }
10032}
10033
10034impl futures::Stream for ReceiverEventStream {
10035    type Item = Result<ReceiverEvent, fidl::Error>;
10036
10037    fn poll_next(
10038        mut self: std::pin::Pin<&mut Self>,
10039        cx: &mut std::task::Context<'_>,
10040    ) -> std::task::Poll<Option<Self::Item>> {
10041        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
10042            &mut self.event_receiver,
10043            cx
10044        )?) {
10045            Some(buf) => std::task::Poll::Ready(Some(ReceiverEvent::decode(buf))),
10046            None => std::task::Poll::Ready(None),
10047        }
10048    }
10049}
10050
10051#[derive(Debug)]
10052pub enum ReceiverEvent {
10053    #[non_exhaustive]
10054    _UnknownEvent {
10055        /// Ordinal of the event that was sent.
10056        ordinal: u64,
10057    },
10058}
10059
10060impl ReceiverEvent {
10061    /// Decodes a message buffer as a [`ReceiverEvent`].
10062    fn decode(
10063        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
10064    ) -> Result<ReceiverEvent, fidl::Error> {
10065        let (bytes, _handles) = buf.split_mut();
10066        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
10067        debug_assert_eq!(tx_header.tx_id, 0);
10068        match tx_header.ordinal {
10069            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
10070                Ok(ReceiverEvent::_UnknownEvent { ordinal: tx_header.ordinal })
10071            }
10072            _ => Err(fidl::Error::UnknownOrdinal {
10073                ordinal: tx_header.ordinal,
10074                protocol_name: <ReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
10075            }),
10076        }
10077    }
10078}
10079
10080/// A Stream of incoming requests for fuchsia.component.sandbox/Receiver.
10081pub struct ReceiverRequestStream {
10082    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10083    is_terminated: bool,
10084}
10085
10086impl std::marker::Unpin for ReceiverRequestStream {}
10087
10088impl futures::stream::FusedStream for ReceiverRequestStream {
10089    fn is_terminated(&self) -> bool {
10090        self.is_terminated
10091    }
10092}
10093
10094impl fidl::endpoints::RequestStream for ReceiverRequestStream {
10095    type Protocol = ReceiverMarker;
10096    type ControlHandle = ReceiverControlHandle;
10097
10098    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
10099        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
10100    }
10101
10102    fn control_handle(&self) -> Self::ControlHandle {
10103        ReceiverControlHandle { inner: self.inner.clone() }
10104    }
10105
10106    fn into_inner(
10107        self,
10108    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
10109    {
10110        (self.inner, self.is_terminated)
10111    }
10112
10113    fn from_inner(
10114        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10115        is_terminated: bool,
10116    ) -> Self {
10117        Self { inner, is_terminated }
10118    }
10119}
10120
10121impl futures::Stream for ReceiverRequestStream {
10122    type Item = Result<ReceiverRequest, fidl::Error>;
10123
10124    fn poll_next(
10125        mut self: std::pin::Pin<&mut Self>,
10126        cx: &mut std::task::Context<'_>,
10127    ) -> std::task::Poll<Option<Self::Item>> {
10128        let this = &mut *self;
10129        if this.inner.check_shutdown(cx) {
10130            this.is_terminated = true;
10131            return std::task::Poll::Ready(None);
10132        }
10133        if this.is_terminated {
10134            panic!("polled ReceiverRequestStream after completion");
10135        }
10136        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
10137            |bytes, handles| {
10138                match this.inner.channel().read_etc(cx, bytes, handles) {
10139                    std::task::Poll::Ready(Ok(())) => {}
10140                    std::task::Poll::Pending => return std::task::Poll::Pending,
10141                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
10142                        this.is_terminated = true;
10143                        return std::task::Poll::Ready(None);
10144                    }
10145                    std::task::Poll::Ready(Err(e)) => {
10146                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
10147                            e.into(),
10148                        ))))
10149                    }
10150                }
10151
10152                // A message has been received from the channel
10153                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
10154
10155                std::task::Poll::Ready(Some(match header.ordinal {
10156                    0x4bae18ab7aa1a94 => {
10157                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
10158                        let mut req = fidl::new_empty!(
10159                            ProtocolPayload,
10160                            fidl::encoding::DefaultFuchsiaResourceDialect
10161                        );
10162                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ProtocolPayload>(&header, _body_bytes, handles, &mut req)?;
10163                        let control_handle = ReceiverControlHandle { inner: this.inner.clone() };
10164                        Ok(ReceiverRequest::Receive { channel: req.channel, control_handle })
10165                    }
10166                    _ if header.tx_id == 0
10167                        && header
10168                            .dynamic_flags()
10169                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
10170                    {
10171                        Ok(ReceiverRequest::_UnknownMethod {
10172                            ordinal: header.ordinal,
10173                            control_handle: ReceiverControlHandle { inner: this.inner.clone() },
10174                            method_type: fidl::MethodType::OneWay,
10175                        })
10176                    }
10177                    _ if header
10178                        .dynamic_flags()
10179                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
10180                    {
10181                        this.inner.send_framework_err(
10182                            fidl::encoding::FrameworkErr::UnknownMethod,
10183                            header.tx_id,
10184                            header.ordinal,
10185                            header.dynamic_flags(),
10186                            (bytes, handles),
10187                        )?;
10188                        Ok(ReceiverRequest::_UnknownMethod {
10189                            ordinal: header.ordinal,
10190                            control_handle: ReceiverControlHandle { inner: this.inner.clone() },
10191                            method_type: fidl::MethodType::TwoWay,
10192                        })
10193                    }
10194                    _ => Err(fidl::Error::UnknownOrdinal {
10195                        ordinal: header.ordinal,
10196                        protocol_name:
10197                            <ReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
10198                    }),
10199                }))
10200            },
10201        )
10202    }
10203}
10204
10205/// A receiver is served by components and allows them to receive channels
10206/// from the framework.
10207#[derive(Debug)]
10208pub enum ReceiverRequest {
10209    /// Sends a channel to this receiver.
10210    Receive { channel: fidl::Channel, control_handle: ReceiverControlHandle },
10211    /// An interaction was received which does not match any known method.
10212    #[non_exhaustive]
10213    _UnknownMethod {
10214        /// Ordinal of the method that was called.
10215        ordinal: u64,
10216        control_handle: ReceiverControlHandle,
10217        method_type: fidl::MethodType,
10218    },
10219}
10220
10221impl ReceiverRequest {
10222    #[allow(irrefutable_let_patterns)]
10223    pub fn into_receive(self) -> Option<(fidl::Channel, ReceiverControlHandle)> {
10224        if let ReceiverRequest::Receive { channel, control_handle } = self {
10225            Some((channel, control_handle))
10226        } else {
10227            None
10228        }
10229    }
10230
10231    /// Name of the method defined in FIDL
10232    pub fn method_name(&self) -> &'static str {
10233        match *self {
10234            ReceiverRequest::Receive { .. } => "receive",
10235            ReceiverRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
10236                "unknown one-way method"
10237            }
10238            ReceiverRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
10239                "unknown two-way method"
10240            }
10241        }
10242    }
10243}
10244
10245#[derive(Debug, Clone)]
10246pub struct ReceiverControlHandle {
10247    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10248}
10249
10250impl fidl::endpoints::ControlHandle for ReceiverControlHandle {
10251    fn shutdown(&self) {
10252        self.inner.shutdown()
10253    }
10254    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
10255        self.inner.shutdown_with_epitaph(status)
10256    }
10257
10258    fn is_closed(&self) -> bool {
10259        self.inner.channel().is_closed()
10260    }
10261    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
10262        self.inner.channel().on_closed()
10263    }
10264
10265    #[cfg(target_os = "fuchsia")]
10266    fn signal_peer(
10267        &self,
10268        clear_mask: zx::Signals,
10269        set_mask: zx::Signals,
10270    ) -> Result<(), zx_status::Status> {
10271        use fidl::Peered;
10272        self.inner.channel().signal_peer(clear_mask, set_mask)
10273    }
10274}
10275
10276impl ReceiverControlHandle {}
10277
10278mod internal {
10279    use super::*;
10280
10281    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreConnectorCreateRequest {
10282        type Borrowed<'a> = &'a mut Self;
10283        fn take_or_borrow<'a>(
10284            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10285        ) -> Self::Borrowed<'a> {
10286            value
10287        }
10288    }
10289
10290    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreConnectorCreateRequest {
10291        type Owned = Self;
10292
10293        #[inline(always)]
10294        fn inline_align(_context: fidl::encoding::Context) -> usize {
10295            8
10296        }
10297
10298        #[inline(always)]
10299        fn inline_size(_context: fidl::encoding::Context) -> usize {
10300            16
10301        }
10302    }
10303
10304    unsafe impl
10305        fidl::encoding::Encode<
10306            CapabilityStoreConnectorCreateRequest,
10307            fidl::encoding::DefaultFuchsiaResourceDialect,
10308        > for &mut CapabilityStoreConnectorCreateRequest
10309    {
10310        #[inline]
10311        unsafe fn encode(
10312            self,
10313            encoder: &mut fidl::encoding::Encoder<
10314                '_,
10315                fidl::encoding::DefaultFuchsiaResourceDialect,
10316            >,
10317            offset: usize,
10318            _depth: fidl::encoding::Depth,
10319        ) -> fidl::Result<()> {
10320            encoder.debug_check_bounds::<CapabilityStoreConnectorCreateRequest>(offset);
10321            // Delegate to tuple encoding.
10322            fidl::encoding::Encode::<CapabilityStoreConnectorCreateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10323                (
10324                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
10325                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ReceiverMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.receiver),
10326                ),
10327                encoder, offset, _depth
10328            )
10329        }
10330    }
10331    unsafe impl<
10332            T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
10333            T1: fidl::encoding::Encode<
10334                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ReceiverMarker>>,
10335                fidl::encoding::DefaultFuchsiaResourceDialect,
10336            >,
10337        >
10338        fidl::encoding::Encode<
10339            CapabilityStoreConnectorCreateRequest,
10340            fidl::encoding::DefaultFuchsiaResourceDialect,
10341        > for (T0, T1)
10342    {
10343        #[inline]
10344        unsafe fn encode(
10345            self,
10346            encoder: &mut fidl::encoding::Encoder<
10347                '_,
10348                fidl::encoding::DefaultFuchsiaResourceDialect,
10349            >,
10350            offset: usize,
10351            depth: fidl::encoding::Depth,
10352        ) -> fidl::Result<()> {
10353            encoder.debug_check_bounds::<CapabilityStoreConnectorCreateRequest>(offset);
10354            // Zero out padding regions. There's no need to apply masks
10355            // because the unmasked parts will be overwritten by fields.
10356            unsafe {
10357                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
10358                (ptr as *mut u64).write_unaligned(0);
10359            }
10360            // Write the fields.
10361            self.0.encode(encoder, offset + 0, depth)?;
10362            self.1.encode(encoder, offset + 8, depth)?;
10363            Ok(())
10364        }
10365    }
10366
10367    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10368        for CapabilityStoreConnectorCreateRequest
10369    {
10370        #[inline(always)]
10371        fn new_empty() -> Self {
10372            Self {
10373                id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
10374                receiver: fidl::new_empty!(
10375                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ReceiverMarker>>,
10376                    fidl::encoding::DefaultFuchsiaResourceDialect
10377                ),
10378            }
10379        }
10380
10381        #[inline]
10382        unsafe fn decode(
10383            &mut self,
10384            decoder: &mut fidl::encoding::Decoder<
10385                '_,
10386                fidl::encoding::DefaultFuchsiaResourceDialect,
10387            >,
10388            offset: usize,
10389            _depth: fidl::encoding::Depth,
10390        ) -> fidl::Result<()> {
10391            decoder.debug_check_bounds::<Self>(offset);
10392            // Verify that padding bytes are zero.
10393            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
10394            let padval = unsafe { (ptr as *const u64).read_unaligned() };
10395            let mask = 0xffffffff00000000u64;
10396            let maskedval = padval & mask;
10397            if maskedval != 0 {
10398                return Err(fidl::Error::NonZeroPadding {
10399                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
10400                });
10401            }
10402            fidl::decode!(
10403                u64,
10404                fidl::encoding::DefaultFuchsiaResourceDialect,
10405                &mut self.id,
10406                decoder,
10407                offset + 0,
10408                _depth
10409            )?;
10410            fidl::decode!(
10411                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ReceiverMarker>>,
10412                fidl::encoding::DefaultFuchsiaResourceDialect,
10413                &mut self.receiver,
10414                decoder,
10415                offset + 8,
10416                _depth
10417            )?;
10418            Ok(())
10419        }
10420    }
10421
10422    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreConnectorOpenRequest {
10423        type Borrowed<'a> = &'a mut Self;
10424        fn take_or_borrow<'a>(
10425            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10426        ) -> Self::Borrowed<'a> {
10427            value
10428        }
10429    }
10430
10431    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreConnectorOpenRequest {
10432        type Owned = Self;
10433
10434        #[inline(always)]
10435        fn inline_align(_context: fidl::encoding::Context) -> usize {
10436            8
10437        }
10438
10439        #[inline(always)]
10440        fn inline_size(_context: fidl::encoding::Context) -> usize {
10441            16
10442        }
10443    }
10444
10445    unsafe impl
10446        fidl::encoding::Encode<
10447            CapabilityStoreConnectorOpenRequest,
10448            fidl::encoding::DefaultFuchsiaResourceDialect,
10449        > for &mut CapabilityStoreConnectorOpenRequest
10450    {
10451        #[inline]
10452        unsafe fn encode(
10453            self,
10454            encoder: &mut fidl::encoding::Encoder<
10455                '_,
10456                fidl::encoding::DefaultFuchsiaResourceDialect,
10457            >,
10458            offset: usize,
10459            _depth: fidl::encoding::Depth,
10460        ) -> fidl::Result<()> {
10461            encoder.debug_check_bounds::<CapabilityStoreConnectorOpenRequest>(offset);
10462            // Delegate to tuple encoding.
10463            fidl::encoding::Encode::<
10464                CapabilityStoreConnectorOpenRequest,
10465                fidl::encoding::DefaultFuchsiaResourceDialect,
10466            >::encode(
10467                (
10468                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
10469                    <fidl::encoding::HandleType<
10470                        fidl::Channel,
10471                        { fidl::ObjectType::CHANNEL.into_raw() },
10472                        2147483648,
10473                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10474                        &mut self.server_end
10475                    ),
10476                ),
10477                encoder,
10478                offset,
10479                _depth,
10480            )
10481        }
10482    }
10483    unsafe impl<
10484            T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
10485            T1: fidl::encoding::Encode<
10486                fidl::encoding::HandleType<
10487                    fidl::Channel,
10488                    { fidl::ObjectType::CHANNEL.into_raw() },
10489                    2147483648,
10490                >,
10491                fidl::encoding::DefaultFuchsiaResourceDialect,
10492            >,
10493        >
10494        fidl::encoding::Encode<
10495            CapabilityStoreConnectorOpenRequest,
10496            fidl::encoding::DefaultFuchsiaResourceDialect,
10497        > for (T0, T1)
10498    {
10499        #[inline]
10500        unsafe fn encode(
10501            self,
10502            encoder: &mut fidl::encoding::Encoder<
10503                '_,
10504                fidl::encoding::DefaultFuchsiaResourceDialect,
10505            >,
10506            offset: usize,
10507            depth: fidl::encoding::Depth,
10508        ) -> fidl::Result<()> {
10509            encoder.debug_check_bounds::<CapabilityStoreConnectorOpenRequest>(offset);
10510            // Zero out padding regions. There's no need to apply masks
10511            // because the unmasked parts will be overwritten by fields.
10512            unsafe {
10513                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
10514                (ptr as *mut u64).write_unaligned(0);
10515            }
10516            // Write the fields.
10517            self.0.encode(encoder, offset + 0, depth)?;
10518            self.1.encode(encoder, offset + 8, depth)?;
10519            Ok(())
10520        }
10521    }
10522
10523    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10524        for CapabilityStoreConnectorOpenRequest
10525    {
10526        #[inline(always)]
10527        fn new_empty() -> Self {
10528            Self {
10529                id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
10530                server_end: fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
10531            }
10532        }
10533
10534        #[inline]
10535        unsafe fn decode(
10536            &mut self,
10537            decoder: &mut fidl::encoding::Decoder<
10538                '_,
10539                fidl::encoding::DefaultFuchsiaResourceDialect,
10540            >,
10541            offset: usize,
10542            _depth: fidl::encoding::Depth,
10543        ) -> fidl::Result<()> {
10544            decoder.debug_check_bounds::<Self>(offset);
10545            // Verify that padding bytes are zero.
10546            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
10547            let padval = unsafe { (ptr as *const u64).read_unaligned() };
10548            let mask = 0xffffffff00000000u64;
10549            let maskedval = padval & mask;
10550            if maskedval != 0 {
10551                return Err(fidl::Error::NonZeroPadding {
10552                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
10553                });
10554            }
10555            fidl::decode!(
10556                u64,
10557                fidl::encoding::DefaultFuchsiaResourceDialect,
10558                &mut self.id,
10559                decoder,
10560                offset + 0,
10561                _depth
10562            )?;
10563            fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.server_end, decoder, offset + 8, _depth)?;
10564            Ok(())
10565        }
10566    }
10567
10568    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDictionaryDrainRequest {
10569        type Borrowed<'a> = &'a mut Self;
10570        fn take_or_borrow<'a>(
10571            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10572        ) -> Self::Borrowed<'a> {
10573            value
10574        }
10575    }
10576
10577    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDictionaryDrainRequest {
10578        type Owned = Self;
10579
10580        #[inline(always)]
10581        fn inline_align(_context: fidl::encoding::Context) -> usize {
10582            8
10583        }
10584
10585        #[inline(always)]
10586        fn inline_size(_context: fidl::encoding::Context) -> usize {
10587            16
10588        }
10589    }
10590
10591    unsafe impl
10592        fidl::encoding::Encode<
10593            CapabilityStoreDictionaryDrainRequest,
10594            fidl::encoding::DefaultFuchsiaResourceDialect,
10595        > for &mut CapabilityStoreDictionaryDrainRequest
10596    {
10597        #[inline]
10598        unsafe fn encode(
10599            self,
10600            encoder: &mut fidl::encoding::Encoder<
10601                '_,
10602                fidl::encoding::DefaultFuchsiaResourceDialect,
10603            >,
10604            offset: usize,
10605            _depth: fidl::encoding::Depth,
10606        ) -> fidl::Result<()> {
10607            encoder.debug_check_bounds::<CapabilityStoreDictionaryDrainRequest>(offset);
10608            // Delegate to tuple encoding.
10609            fidl::encoding::Encode::<
10610                CapabilityStoreDictionaryDrainRequest,
10611                fidl::encoding::DefaultFuchsiaResourceDialect,
10612            >::encode(
10613                (
10614                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
10615                    <fidl::encoding::Optional<
10616                        fidl::encoding::Endpoint<
10617                            fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>,
10618                        >,
10619                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10620                        &mut self.iterator
10621                    ),
10622                ),
10623                encoder,
10624                offset,
10625                _depth,
10626            )
10627        }
10628    }
10629    unsafe impl<
10630            T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
10631            T1: fidl::encoding::Encode<
10632                fidl::encoding::Optional<
10633                    fidl::encoding::Endpoint<
10634                        fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>,
10635                    >,
10636                >,
10637                fidl::encoding::DefaultFuchsiaResourceDialect,
10638            >,
10639        >
10640        fidl::encoding::Encode<
10641            CapabilityStoreDictionaryDrainRequest,
10642            fidl::encoding::DefaultFuchsiaResourceDialect,
10643        > for (T0, T1)
10644    {
10645        #[inline]
10646        unsafe fn encode(
10647            self,
10648            encoder: &mut fidl::encoding::Encoder<
10649                '_,
10650                fidl::encoding::DefaultFuchsiaResourceDialect,
10651            >,
10652            offset: usize,
10653            depth: fidl::encoding::Depth,
10654        ) -> fidl::Result<()> {
10655            encoder.debug_check_bounds::<CapabilityStoreDictionaryDrainRequest>(offset);
10656            // Zero out padding regions. There's no need to apply masks
10657            // because the unmasked parts will be overwritten by fields.
10658            unsafe {
10659                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
10660                (ptr as *mut u64).write_unaligned(0);
10661            }
10662            // Write the fields.
10663            self.0.encode(encoder, offset + 0, depth)?;
10664            self.1.encode(encoder, offset + 8, depth)?;
10665            Ok(())
10666        }
10667    }
10668
10669    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10670        for CapabilityStoreDictionaryDrainRequest
10671    {
10672        #[inline(always)]
10673        fn new_empty() -> Self {
10674            Self {
10675                id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
10676                iterator: fidl::new_empty!(
10677                    fidl::encoding::Optional<
10678                        fidl::encoding::Endpoint<
10679                            fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>,
10680                        >,
10681                    >,
10682                    fidl::encoding::DefaultFuchsiaResourceDialect
10683                ),
10684            }
10685        }
10686
10687        #[inline]
10688        unsafe fn decode(
10689            &mut self,
10690            decoder: &mut fidl::encoding::Decoder<
10691                '_,
10692                fidl::encoding::DefaultFuchsiaResourceDialect,
10693            >,
10694            offset: usize,
10695            _depth: fidl::encoding::Depth,
10696        ) -> fidl::Result<()> {
10697            decoder.debug_check_bounds::<Self>(offset);
10698            // Verify that padding bytes are zero.
10699            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
10700            let padval = unsafe { (ptr as *const u64).read_unaligned() };
10701            let mask = 0xffffffff00000000u64;
10702            let maskedval = padval & mask;
10703            if maskedval != 0 {
10704                return Err(fidl::Error::NonZeroPadding {
10705                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
10706                });
10707            }
10708            fidl::decode!(
10709                u64,
10710                fidl::encoding::DefaultFuchsiaResourceDialect,
10711                &mut self.id,
10712                decoder,
10713                offset + 0,
10714                _depth
10715            )?;
10716            fidl::decode!(
10717                fidl::encoding::Optional<
10718                    fidl::encoding::Endpoint<
10719                        fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>,
10720                    >,
10721                >,
10722                fidl::encoding::DefaultFuchsiaResourceDialect,
10723                &mut self.iterator,
10724                decoder,
10725                offset + 8,
10726                _depth
10727            )?;
10728            Ok(())
10729        }
10730    }
10731
10732    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDictionaryEnumerateRequest {
10733        type Borrowed<'a> = &'a mut Self;
10734        fn take_or_borrow<'a>(
10735            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10736        ) -> Self::Borrowed<'a> {
10737            value
10738        }
10739    }
10740
10741    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDictionaryEnumerateRequest {
10742        type Owned = Self;
10743
10744        #[inline(always)]
10745        fn inline_align(_context: fidl::encoding::Context) -> usize {
10746            8
10747        }
10748
10749        #[inline(always)]
10750        fn inline_size(_context: fidl::encoding::Context) -> usize {
10751            16
10752        }
10753    }
10754
10755    unsafe impl
10756        fidl::encoding::Encode<
10757            CapabilityStoreDictionaryEnumerateRequest,
10758            fidl::encoding::DefaultFuchsiaResourceDialect,
10759        > for &mut CapabilityStoreDictionaryEnumerateRequest
10760    {
10761        #[inline]
10762        unsafe fn encode(
10763            self,
10764            encoder: &mut fidl::encoding::Encoder<
10765                '_,
10766                fidl::encoding::DefaultFuchsiaResourceDialect,
10767            >,
10768            offset: usize,
10769            _depth: fidl::encoding::Depth,
10770        ) -> fidl::Result<()> {
10771            encoder.debug_check_bounds::<CapabilityStoreDictionaryEnumerateRequest>(offset);
10772            // Delegate to tuple encoding.
10773            fidl::encoding::Encode::<
10774                CapabilityStoreDictionaryEnumerateRequest,
10775                fidl::encoding::DefaultFuchsiaResourceDialect,
10776            >::encode(
10777                (
10778                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
10779                    <fidl::encoding::Endpoint<
10780                        fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
10781                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10782                        &mut self.iterator
10783                    ),
10784                ),
10785                encoder,
10786                offset,
10787                _depth,
10788            )
10789        }
10790    }
10791    unsafe impl<
10792            T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
10793            T1: fidl::encoding::Encode<
10794                fidl::encoding::Endpoint<
10795                    fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
10796                >,
10797                fidl::encoding::DefaultFuchsiaResourceDialect,
10798            >,
10799        >
10800        fidl::encoding::Encode<
10801            CapabilityStoreDictionaryEnumerateRequest,
10802            fidl::encoding::DefaultFuchsiaResourceDialect,
10803        > for (T0, T1)
10804    {
10805        #[inline]
10806        unsafe fn encode(
10807            self,
10808            encoder: &mut fidl::encoding::Encoder<
10809                '_,
10810                fidl::encoding::DefaultFuchsiaResourceDialect,
10811            >,
10812            offset: usize,
10813            depth: fidl::encoding::Depth,
10814        ) -> fidl::Result<()> {
10815            encoder.debug_check_bounds::<CapabilityStoreDictionaryEnumerateRequest>(offset);
10816            // Zero out padding regions. There's no need to apply masks
10817            // because the unmasked parts will be overwritten by fields.
10818            unsafe {
10819                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
10820                (ptr as *mut u64).write_unaligned(0);
10821            }
10822            // Write the fields.
10823            self.0.encode(encoder, offset + 0, depth)?;
10824            self.1.encode(encoder, offset + 8, depth)?;
10825            Ok(())
10826        }
10827    }
10828
10829    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10830        for CapabilityStoreDictionaryEnumerateRequest
10831    {
10832        #[inline(always)]
10833        fn new_empty() -> Self {
10834            Self {
10835                id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
10836                iterator: fidl::new_empty!(
10837                    fidl::encoding::Endpoint<
10838                        fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
10839                    >,
10840                    fidl::encoding::DefaultFuchsiaResourceDialect
10841                ),
10842            }
10843        }
10844
10845        #[inline]
10846        unsafe fn decode(
10847            &mut self,
10848            decoder: &mut fidl::encoding::Decoder<
10849                '_,
10850                fidl::encoding::DefaultFuchsiaResourceDialect,
10851            >,
10852            offset: usize,
10853            _depth: fidl::encoding::Depth,
10854        ) -> fidl::Result<()> {
10855            decoder.debug_check_bounds::<Self>(offset);
10856            // Verify that padding bytes are zero.
10857            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
10858            let padval = unsafe { (ptr as *const u64).read_unaligned() };
10859            let mask = 0xffffffff00000000u64;
10860            let maskedval = padval & mask;
10861            if maskedval != 0 {
10862                return Err(fidl::Error::NonZeroPadding {
10863                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
10864                });
10865            }
10866            fidl::decode!(
10867                u64,
10868                fidl::encoding::DefaultFuchsiaResourceDialect,
10869                &mut self.id,
10870                decoder,
10871                offset + 0,
10872                _depth
10873            )?;
10874            fidl::decode!(
10875                fidl::encoding::Endpoint<
10876                    fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
10877                >,
10878                fidl::encoding::DefaultFuchsiaResourceDialect,
10879                &mut self.iterator,
10880                decoder,
10881                offset + 8,
10882                _depth
10883            )?;
10884            Ok(())
10885        }
10886    }
10887
10888    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDictionaryKeysRequest {
10889        type Borrowed<'a> = &'a mut Self;
10890        fn take_or_borrow<'a>(
10891            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10892        ) -> Self::Borrowed<'a> {
10893            value
10894        }
10895    }
10896
10897    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDictionaryKeysRequest {
10898        type Owned = Self;
10899
10900        #[inline(always)]
10901        fn inline_align(_context: fidl::encoding::Context) -> usize {
10902            8
10903        }
10904
10905        #[inline(always)]
10906        fn inline_size(_context: fidl::encoding::Context) -> usize {
10907            16
10908        }
10909    }
10910
10911    unsafe impl
10912        fidl::encoding::Encode<
10913            CapabilityStoreDictionaryKeysRequest,
10914            fidl::encoding::DefaultFuchsiaResourceDialect,
10915        > for &mut CapabilityStoreDictionaryKeysRequest
10916    {
10917        #[inline]
10918        unsafe fn encode(
10919            self,
10920            encoder: &mut fidl::encoding::Encoder<
10921                '_,
10922                fidl::encoding::DefaultFuchsiaResourceDialect,
10923            >,
10924            offset: usize,
10925            _depth: fidl::encoding::Depth,
10926        ) -> fidl::Result<()> {
10927            encoder.debug_check_bounds::<CapabilityStoreDictionaryKeysRequest>(offset);
10928            // Delegate to tuple encoding.
10929            fidl::encoding::Encode::<
10930                CapabilityStoreDictionaryKeysRequest,
10931                fidl::encoding::DefaultFuchsiaResourceDialect,
10932            >::encode(
10933                (
10934                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
10935                    <fidl::encoding::Endpoint<
10936                        fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>,
10937                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10938                        &mut self.iterator
10939                    ),
10940                ),
10941                encoder,
10942                offset,
10943                _depth,
10944            )
10945        }
10946    }
10947    unsafe impl<
10948            T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
10949            T1: fidl::encoding::Encode<
10950                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>>,
10951                fidl::encoding::DefaultFuchsiaResourceDialect,
10952            >,
10953        >
10954        fidl::encoding::Encode<
10955            CapabilityStoreDictionaryKeysRequest,
10956            fidl::encoding::DefaultFuchsiaResourceDialect,
10957        > for (T0, T1)
10958    {
10959        #[inline]
10960        unsafe fn encode(
10961            self,
10962            encoder: &mut fidl::encoding::Encoder<
10963                '_,
10964                fidl::encoding::DefaultFuchsiaResourceDialect,
10965            >,
10966            offset: usize,
10967            depth: fidl::encoding::Depth,
10968        ) -> fidl::Result<()> {
10969            encoder.debug_check_bounds::<CapabilityStoreDictionaryKeysRequest>(offset);
10970            // Zero out padding regions. There's no need to apply masks
10971            // because the unmasked parts will be overwritten by fields.
10972            unsafe {
10973                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
10974                (ptr as *mut u64).write_unaligned(0);
10975            }
10976            // Write the fields.
10977            self.0.encode(encoder, offset + 0, depth)?;
10978            self.1.encode(encoder, offset + 8, depth)?;
10979            Ok(())
10980        }
10981    }
10982
10983    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10984        for CapabilityStoreDictionaryKeysRequest
10985    {
10986        #[inline(always)]
10987        fn new_empty() -> Self {
10988            Self {
10989                id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
10990                iterator: fidl::new_empty!(
10991                    fidl::encoding::Endpoint<
10992                        fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>,
10993                    >,
10994                    fidl::encoding::DefaultFuchsiaResourceDialect
10995                ),
10996            }
10997        }
10998
10999        #[inline]
11000        unsafe fn decode(
11001            &mut self,
11002            decoder: &mut fidl::encoding::Decoder<
11003                '_,
11004                fidl::encoding::DefaultFuchsiaResourceDialect,
11005            >,
11006            offset: usize,
11007            _depth: fidl::encoding::Depth,
11008        ) -> fidl::Result<()> {
11009            decoder.debug_check_bounds::<Self>(offset);
11010            // Verify that padding bytes are zero.
11011            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
11012            let padval = unsafe { (ptr as *const u64).read_unaligned() };
11013            let mask = 0xffffffff00000000u64;
11014            let maskedval = padval & mask;
11015            if maskedval != 0 {
11016                return Err(fidl::Error::NonZeroPadding {
11017                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
11018                });
11019            }
11020            fidl::decode!(
11021                u64,
11022                fidl::encoding::DefaultFuchsiaResourceDialect,
11023                &mut self.id,
11024                decoder,
11025                offset + 0,
11026                _depth
11027            )?;
11028            fidl::decode!(
11029                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>>,
11030                fidl::encoding::DefaultFuchsiaResourceDialect,
11031                &mut self.iterator,
11032                decoder,
11033                offset + 8,
11034                _depth
11035            )?;
11036            Ok(())
11037        }
11038    }
11039
11040    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDictionaryLegacyExportRequest {
11041        type Borrowed<'a> = &'a mut Self;
11042        fn take_or_borrow<'a>(
11043            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11044        ) -> Self::Borrowed<'a> {
11045            value
11046        }
11047    }
11048
11049    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDictionaryLegacyExportRequest {
11050        type Owned = Self;
11051
11052        #[inline(always)]
11053        fn inline_align(_context: fidl::encoding::Context) -> usize {
11054            8
11055        }
11056
11057        #[inline(always)]
11058        fn inline_size(_context: fidl::encoding::Context) -> usize {
11059            16
11060        }
11061    }
11062
11063    unsafe impl
11064        fidl::encoding::Encode<
11065            CapabilityStoreDictionaryLegacyExportRequest,
11066            fidl::encoding::DefaultFuchsiaResourceDialect,
11067        > for &mut CapabilityStoreDictionaryLegacyExportRequest
11068    {
11069        #[inline]
11070        unsafe fn encode(
11071            self,
11072            encoder: &mut fidl::encoding::Encoder<
11073                '_,
11074                fidl::encoding::DefaultFuchsiaResourceDialect,
11075            >,
11076            offset: usize,
11077            _depth: fidl::encoding::Depth,
11078        ) -> fidl::Result<()> {
11079            encoder.debug_check_bounds::<CapabilityStoreDictionaryLegacyExportRequest>(offset);
11080            // Delegate to tuple encoding.
11081            fidl::encoding::Encode::<
11082                CapabilityStoreDictionaryLegacyExportRequest,
11083                fidl::encoding::DefaultFuchsiaResourceDialect,
11084            >::encode(
11085                (
11086                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
11087                    <fidl::encoding::HandleType<
11088                        fidl::Channel,
11089                        { fidl::ObjectType::CHANNEL.into_raw() },
11090                        2147483648,
11091                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11092                        &mut self.server_end
11093                    ),
11094                ),
11095                encoder,
11096                offset,
11097                _depth,
11098            )
11099        }
11100    }
11101    unsafe impl<
11102            T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
11103            T1: fidl::encoding::Encode<
11104                fidl::encoding::HandleType<
11105                    fidl::Channel,
11106                    { fidl::ObjectType::CHANNEL.into_raw() },
11107                    2147483648,
11108                >,
11109                fidl::encoding::DefaultFuchsiaResourceDialect,
11110            >,
11111        >
11112        fidl::encoding::Encode<
11113            CapabilityStoreDictionaryLegacyExportRequest,
11114            fidl::encoding::DefaultFuchsiaResourceDialect,
11115        > for (T0, T1)
11116    {
11117        #[inline]
11118        unsafe fn encode(
11119            self,
11120            encoder: &mut fidl::encoding::Encoder<
11121                '_,
11122                fidl::encoding::DefaultFuchsiaResourceDialect,
11123            >,
11124            offset: usize,
11125            depth: fidl::encoding::Depth,
11126        ) -> fidl::Result<()> {
11127            encoder.debug_check_bounds::<CapabilityStoreDictionaryLegacyExportRequest>(offset);
11128            // Zero out padding regions. There's no need to apply masks
11129            // because the unmasked parts will be overwritten by fields.
11130            unsafe {
11131                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
11132                (ptr as *mut u64).write_unaligned(0);
11133            }
11134            // Write the fields.
11135            self.0.encode(encoder, offset + 0, depth)?;
11136            self.1.encode(encoder, offset + 8, depth)?;
11137            Ok(())
11138        }
11139    }
11140
11141    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11142        for CapabilityStoreDictionaryLegacyExportRequest
11143    {
11144        #[inline(always)]
11145        fn new_empty() -> Self {
11146            Self {
11147                id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
11148                server_end: fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11149            }
11150        }
11151
11152        #[inline]
11153        unsafe fn decode(
11154            &mut self,
11155            decoder: &mut fidl::encoding::Decoder<
11156                '_,
11157                fidl::encoding::DefaultFuchsiaResourceDialect,
11158            >,
11159            offset: usize,
11160            _depth: fidl::encoding::Depth,
11161        ) -> fidl::Result<()> {
11162            decoder.debug_check_bounds::<Self>(offset);
11163            // Verify that padding bytes are zero.
11164            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
11165            let padval = unsafe { (ptr as *const u64).read_unaligned() };
11166            let mask = 0xffffffff00000000u64;
11167            let maskedval = padval & mask;
11168            if maskedval != 0 {
11169                return Err(fidl::Error::NonZeroPadding {
11170                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
11171                });
11172            }
11173            fidl::decode!(
11174                u64,
11175                fidl::encoding::DefaultFuchsiaResourceDialect,
11176                &mut self.id,
11177                decoder,
11178                offset + 0,
11179                _depth
11180            )?;
11181            fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.server_end, decoder, offset + 8, _depth)?;
11182            Ok(())
11183        }
11184    }
11185
11186    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDictionaryLegacyImportRequest {
11187        type Borrowed<'a> = &'a mut Self;
11188        fn take_or_borrow<'a>(
11189            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11190        ) -> Self::Borrowed<'a> {
11191            value
11192        }
11193    }
11194
11195    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDictionaryLegacyImportRequest {
11196        type Owned = Self;
11197
11198        #[inline(always)]
11199        fn inline_align(_context: fidl::encoding::Context) -> usize {
11200            8
11201        }
11202
11203        #[inline(always)]
11204        fn inline_size(_context: fidl::encoding::Context) -> usize {
11205            16
11206        }
11207    }
11208
11209    unsafe impl
11210        fidl::encoding::Encode<
11211            CapabilityStoreDictionaryLegacyImportRequest,
11212            fidl::encoding::DefaultFuchsiaResourceDialect,
11213        > for &mut CapabilityStoreDictionaryLegacyImportRequest
11214    {
11215        #[inline]
11216        unsafe fn encode(
11217            self,
11218            encoder: &mut fidl::encoding::Encoder<
11219                '_,
11220                fidl::encoding::DefaultFuchsiaResourceDialect,
11221            >,
11222            offset: usize,
11223            _depth: fidl::encoding::Depth,
11224        ) -> fidl::Result<()> {
11225            encoder.debug_check_bounds::<CapabilityStoreDictionaryLegacyImportRequest>(offset);
11226            // Delegate to tuple encoding.
11227            fidl::encoding::Encode::<
11228                CapabilityStoreDictionaryLegacyImportRequest,
11229                fidl::encoding::DefaultFuchsiaResourceDialect,
11230            >::encode(
11231                (
11232                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
11233                    <fidl::encoding::HandleType<
11234                        fidl::Channel,
11235                        { fidl::ObjectType::CHANNEL.into_raw() },
11236                        2147483648,
11237                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11238                        &mut self.client_end
11239                    ),
11240                ),
11241                encoder,
11242                offset,
11243                _depth,
11244            )
11245        }
11246    }
11247    unsafe impl<
11248            T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
11249            T1: fidl::encoding::Encode<
11250                fidl::encoding::HandleType<
11251                    fidl::Channel,
11252                    { fidl::ObjectType::CHANNEL.into_raw() },
11253                    2147483648,
11254                >,
11255                fidl::encoding::DefaultFuchsiaResourceDialect,
11256            >,
11257        >
11258        fidl::encoding::Encode<
11259            CapabilityStoreDictionaryLegacyImportRequest,
11260            fidl::encoding::DefaultFuchsiaResourceDialect,
11261        > for (T0, T1)
11262    {
11263        #[inline]
11264        unsafe fn encode(
11265            self,
11266            encoder: &mut fidl::encoding::Encoder<
11267                '_,
11268                fidl::encoding::DefaultFuchsiaResourceDialect,
11269            >,
11270            offset: usize,
11271            depth: fidl::encoding::Depth,
11272        ) -> fidl::Result<()> {
11273            encoder.debug_check_bounds::<CapabilityStoreDictionaryLegacyImportRequest>(offset);
11274            // Zero out padding regions. There's no need to apply masks
11275            // because the unmasked parts will be overwritten by fields.
11276            unsafe {
11277                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
11278                (ptr as *mut u64).write_unaligned(0);
11279            }
11280            // Write the fields.
11281            self.0.encode(encoder, offset + 0, depth)?;
11282            self.1.encode(encoder, offset + 8, depth)?;
11283            Ok(())
11284        }
11285    }
11286
11287    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11288        for CapabilityStoreDictionaryLegacyImportRequest
11289    {
11290        #[inline(always)]
11291        fn new_empty() -> Self {
11292            Self {
11293                id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
11294                client_end: fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11295            }
11296        }
11297
11298        #[inline]
11299        unsafe fn decode(
11300            &mut self,
11301            decoder: &mut fidl::encoding::Decoder<
11302                '_,
11303                fidl::encoding::DefaultFuchsiaResourceDialect,
11304            >,
11305            offset: usize,
11306            _depth: fidl::encoding::Depth,
11307        ) -> fidl::Result<()> {
11308            decoder.debug_check_bounds::<Self>(offset);
11309            // Verify that padding bytes are zero.
11310            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
11311            let padval = unsafe { (ptr as *const u64).read_unaligned() };
11312            let mask = 0xffffffff00000000u64;
11313            let maskedval = padval & mask;
11314            if maskedval != 0 {
11315                return Err(fidl::Error::NonZeroPadding {
11316                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
11317                });
11318            }
11319            fidl::decode!(
11320                u64,
11321                fidl::encoding::DefaultFuchsiaResourceDialect,
11322                &mut self.id,
11323                decoder,
11324                offset + 0,
11325                _depth
11326            )?;
11327            fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.client_end, decoder, offset + 8, _depth)?;
11328            Ok(())
11329        }
11330    }
11331
11332    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDirConnectorCreateRequest {
11333        type Borrowed<'a> = &'a mut Self;
11334        fn take_or_borrow<'a>(
11335            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11336        ) -> Self::Borrowed<'a> {
11337            value
11338        }
11339    }
11340
11341    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDirConnectorCreateRequest {
11342        type Owned = Self;
11343
11344        #[inline(always)]
11345        fn inline_align(_context: fidl::encoding::Context) -> usize {
11346            8
11347        }
11348
11349        #[inline(always)]
11350        fn inline_size(_context: fidl::encoding::Context) -> usize {
11351            16
11352        }
11353    }
11354
11355    unsafe impl
11356        fidl::encoding::Encode<
11357            CapabilityStoreDirConnectorCreateRequest,
11358            fidl::encoding::DefaultFuchsiaResourceDialect,
11359        > for &mut CapabilityStoreDirConnectorCreateRequest
11360    {
11361        #[inline]
11362        unsafe fn encode(
11363            self,
11364            encoder: &mut fidl::encoding::Encoder<
11365                '_,
11366                fidl::encoding::DefaultFuchsiaResourceDialect,
11367            >,
11368            offset: usize,
11369            _depth: fidl::encoding::Depth,
11370        ) -> fidl::Result<()> {
11371            encoder.debug_check_bounds::<CapabilityStoreDirConnectorCreateRequest>(offset);
11372            // Delegate to tuple encoding.
11373            fidl::encoding::Encode::<CapabilityStoreDirConnectorCreateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
11374                (
11375                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
11376                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirReceiverMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.receiver),
11377                ),
11378                encoder, offset, _depth
11379            )
11380        }
11381    }
11382    unsafe impl<
11383            T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
11384            T1: fidl::encoding::Encode<
11385                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirReceiverMarker>>,
11386                fidl::encoding::DefaultFuchsiaResourceDialect,
11387            >,
11388        >
11389        fidl::encoding::Encode<
11390            CapabilityStoreDirConnectorCreateRequest,
11391            fidl::encoding::DefaultFuchsiaResourceDialect,
11392        > for (T0, T1)
11393    {
11394        #[inline]
11395        unsafe fn encode(
11396            self,
11397            encoder: &mut fidl::encoding::Encoder<
11398                '_,
11399                fidl::encoding::DefaultFuchsiaResourceDialect,
11400            >,
11401            offset: usize,
11402            depth: fidl::encoding::Depth,
11403        ) -> fidl::Result<()> {
11404            encoder.debug_check_bounds::<CapabilityStoreDirConnectorCreateRequest>(offset);
11405            // Zero out padding regions. There's no need to apply masks
11406            // because the unmasked parts will be overwritten by fields.
11407            unsafe {
11408                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
11409                (ptr as *mut u64).write_unaligned(0);
11410            }
11411            // Write the fields.
11412            self.0.encode(encoder, offset + 0, depth)?;
11413            self.1.encode(encoder, offset + 8, depth)?;
11414            Ok(())
11415        }
11416    }
11417
11418    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11419        for CapabilityStoreDirConnectorCreateRequest
11420    {
11421        #[inline(always)]
11422        fn new_empty() -> Self {
11423            Self {
11424                id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
11425                receiver: fidl::new_empty!(
11426                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirReceiverMarker>>,
11427                    fidl::encoding::DefaultFuchsiaResourceDialect
11428                ),
11429            }
11430        }
11431
11432        #[inline]
11433        unsafe fn decode(
11434            &mut self,
11435            decoder: &mut fidl::encoding::Decoder<
11436                '_,
11437                fidl::encoding::DefaultFuchsiaResourceDialect,
11438            >,
11439            offset: usize,
11440            _depth: fidl::encoding::Depth,
11441        ) -> fidl::Result<()> {
11442            decoder.debug_check_bounds::<Self>(offset);
11443            // Verify that padding bytes are zero.
11444            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
11445            let padval = unsafe { (ptr as *const u64).read_unaligned() };
11446            let mask = 0xffffffff00000000u64;
11447            let maskedval = padval & mask;
11448            if maskedval != 0 {
11449                return Err(fidl::Error::NonZeroPadding {
11450                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
11451                });
11452            }
11453            fidl::decode!(
11454                u64,
11455                fidl::encoding::DefaultFuchsiaResourceDialect,
11456                &mut self.id,
11457                decoder,
11458                offset + 0,
11459                _depth
11460            )?;
11461            fidl::decode!(
11462                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirReceiverMarker>>,
11463                fidl::encoding::DefaultFuchsiaResourceDialect,
11464                &mut self.receiver,
11465                decoder,
11466                offset + 8,
11467                _depth
11468            )?;
11469            Ok(())
11470        }
11471    }
11472
11473    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDirConnectorOpenRequest {
11474        type Borrowed<'a> = &'a mut Self;
11475        fn take_or_borrow<'a>(
11476            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11477        ) -> Self::Borrowed<'a> {
11478            value
11479        }
11480    }
11481
11482    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDirConnectorOpenRequest {
11483        type Owned = Self;
11484
11485        #[inline(always)]
11486        fn inline_align(_context: fidl::encoding::Context) -> usize {
11487            8
11488        }
11489
11490        #[inline(always)]
11491        fn inline_size(_context: fidl::encoding::Context) -> usize {
11492            16
11493        }
11494    }
11495
11496    unsafe impl
11497        fidl::encoding::Encode<
11498            CapabilityStoreDirConnectorOpenRequest,
11499            fidl::encoding::DefaultFuchsiaResourceDialect,
11500        > for &mut CapabilityStoreDirConnectorOpenRequest
11501    {
11502        #[inline]
11503        unsafe fn encode(
11504            self,
11505            encoder: &mut fidl::encoding::Encoder<
11506                '_,
11507                fidl::encoding::DefaultFuchsiaResourceDialect,
11508            >,
11509            offset: usize,
11510            _depth: fidl::encoding::Depth,
11511        ) -> fidl::Result<()> {
11512            encoder.debug_check_bounds::<CapabilityStoreDirConnectorOpenRequest>(offset);
11513            // Delegate to tuple encoding.
11514            fidl::encoding::Encode::<
11515                CapabilityStoreDirConnectorOpenRequest,
11516                fidl::encoding::DefaultFuchsiaResourceDialect,
11517            >::encode(
11518                (
11519                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
11520                    <fidl::encoding::Endpoint<
11521                        fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
11522                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11523                        &mut self.server_end
11524                    ),
11525                ),
11526                encoder,
11527                offset,
11528                _depth,
11529            )
11530        }
11531    }
11532    unsafe impl<
11533            T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
11534            T1: fidl::encoding::Encode<
11535                fidl::encoding::Endpoint<
11536                    fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
11537                >,
11538                fidl::encoding::DefaultFuchsiaResourceDialect,
11539            >,
11540        >
11541        fidl::encoding::Encode<
11542            CapabilityStoreDirConnectorOpenRequest,
11543            fidl::encoding::DefaultFuchsiaResourceDialect,
11544        > for (T0, T1)
11545    {
11546        #[inline]
11547        unsafe fn encode(
11548            self,
11549            encoder: &mut fidl::encoding::Encoder<
11550                '_,
11551                fidl::encoding::DefaultFuchsiaResourceDialect,
11552            >,
11553            offset: usize,
11554            depth: fidl::encoding::Depth,
11555        ) -> fidl::Result<()> {
11556            encoder.debug_check_bounds::<CapabilityStoreDirConnectorOpenRequest>(offset);
11557            // Zero out padding regions. There's no need to apply masks
11558            // because the unmasked parts will be overwritten by fields.
11559            unsafe {
11560                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
11561                (ptr as *mut u64).write_unaligned(0);
11562            }
11563            // Write the fields.
11564            self.0.encode(encoder, offset + 0, depth)?;
11565            self.1.encode(encoder, offset + 8, depth)?;
11566            Ok(())
11567        }
11568    }
11569
11570    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11571        for CapabilityStoreDirConnectorOpenRequest
11572    {
11573        #[inline(always)]
11574        fn new_empty() -> Self {
11575            Self {
11576                id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
11577                server_end: fidl::new_empty!(
11578                    fidl::encoding::Endpoint<
11579                        fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
11580                    >,
11581                    fidl::encoding::DefaultFuchsiaResourceDialect
11582                ),
11583            }
11584        }
11585
11586        #[inline]
11587        unsafe fn decode(
11588            &mut self,
11589            decoder: &mut fidl::encoding::Decoder<
11590                '_,
11591                fidl::encoding::DefaultFuchsiaResourceDialect,
11592            >,
11593            offset: usize,
11594            _depth: fidl::encoding::Depth,
11595        ) -> fidl::Result<()> {
11596            decoder.debug_check_bounds::<Self>(offset);
11597            // Verify that padding bytes are zero.
11598            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
11599            let padval = unsafe { (ptr as *const u64).read_unaligned() };
11600            let mask = 0xffffffff00000000u64;
11601            let maskedval = padval & mask;
11602            if maskedval != 0 {
11603                return Err(fidl::Error::NonZeroPadding {
11604                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
11605                });
11606            }
11607            fidl::decode!(
11608                u64,
11609                fidl::encoding::DefaultFuchsiaResourceDialect,
11610                &mut self.id,
11611                decoder,
11612                offset + 0,
11613                _depth
11614            )?;
11615            fidl::decode!(
11616                fidl::encoding::Endpoint<
11617                    fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
11618                >,
11619                fidl::encoding::DefaultFuchsiaResourceDialect,
11620                &mut self.server_end,
11621                decoder,
11622                offset + 8,
11623                _depth
11624            )?;
11625            Ok(())
11626        }
11627    }
11628
11629    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreImportRequest {
11630        type Borrowed<'a> = &'a mut Self;
11631        fn take_or_borrow<'a>(
11632            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11633        ) -> Self::Borrowed<'a> {
11634            value
11635        }
11636    }
11637
11638    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreImportRequest {
11639        type Owned = Self;
11640
11641        #[inline(always)]
11642        fn inline_align(_context: fidl::encoding::Context) -> usize {
11643            8
11644        }
11645
11646        #[inline(always)]
11647        fn inline_size(_context: fidl::encoding::Context) -> usize {
11648            24
11649        }
11650    }
11651
11652    unsafe impl
11653        fidl::encoding::Encode<
11654            CapabilityStoreImportRequest,
11655            fidl::encoding::DefaultFuchsiaResourceDialect,
11656        > for &mut CapabilityStoreImportRequest
11657    {
11658        #[inline]
11659        unsafe fn encode(
11660            self,
11661            encoder: &mut fidl::encoding::Encoder<
11662                '_,
11663                fidl::encoding::DefaultFuchsiaResourceDialect,
11664            >,
11665            offset: usize,
11666            _depth: fidl::encoding::Depth,
11667        ) -> fidl::Result<()> {
11668            encoder.debug_check_bounds::<CapabilityStoreImportRequest>(offset);
11669            // Delegate to tuple encoding.
11670            fidl::encoding::Encode::<
11671                CapabilityStoreImportRequest,
11672                fidl::encoding::DefaultFuchsiaResourceDialect,
11673            >::encode(
11674                (
11675                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
11676                    <Capability as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11677                        &mut self.capability,
11678                    ),
11679                ),
11680                encoder,
11681                offset,
11682                _depth,
11683            )
11684        }
11685    }
11686    unsafe impl<
11687            T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
11688            T1: fidl::encoding::Encode<Capability, fidl::encoding::DefaultFuchsiaResourceDialect>,
11689        >
11690        fidl::encoding::Encode<
11691            CapabilityStoreImportRequest,
11692            fidl::encoding::DefaultFuchsiaResourceDialect,
11693        > for (T0, T1)
11694    {
11695        #[inline]
11696        unsafe fn encode(
11697            self,
11698            encoder: &mut fidl::encoding::Encoder<
11699                '_,
11700                fidl::encoding::DefaultFuchsiaResourceDialect,
11701            >,
11702            offset: usize,
11703            depth: fidl::encoding::Depth,
11704        ) -> fidl::Result<()> {
11705            encoder.debug_check_bounds::<CapabilityStoreImportRequest>(offset);
11706            // Zero out padding regions. There's no need to apply masks
11707            // because the unmasked parts will be overwritten by fields.
11708            // Write the fields.
11709            self.0.encode(encoder, offset + 0, depth)?;
11710            self.1.encode(encoder, offset + 8, depth)?;
11711            Ok(())
11712        }
11713    }
11714
11715    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11716        for CapabilityStoreImportRequest
11717    {
11718        #[inline(always)]
11719        fn new_empty() -> Self {
11720            Self {
11721                id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
11722                capability: fidl::new_empty!(
11723                    Capability,
11724                    fidl::encoding::DefaultFuchsiaResourceDialect
11725                ),
11726            }
11727        }
11728
11729        #[inline]
11730        unsafe fn decode(
11731            &mut self,
11732            decoder: &mut fidl::encoding::Decoder<
11733                '_,
11734                fidl::encoding::DefaultFuchsiaResourceDialect,
11735            >,
11736            offset: usize,
11737            _depth: fidl::encoding::Depth,
11738        ) -> fidl::Result<()> {
11739            decoder.debug_check_bounds::<Self>(offset);
11740            // Verify that padding bytes are zero.
11741            fidl::decode!(
11742                u64,
11743                fidl::encoding::DefaultFuchsiaResourceDialect,
11744                &mut self.id,
11745                decoder,
11746                offset + 0,
11747                _depth
11748            )?;
11749            fidl::decode!(
11750                Capability,
11751                fidl::encoding::DefaultFuchsiaResourceDialect,
11752                &mut self.capability,
11753                decoder,
11754                offset + 8,
11755                _depth
11756            )?;
11757            Ok(())
11758        }
11759    }
11760
11761    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreExportResponse {
11762        type Borrowed<'a> = &'a mut Self;
11763        fn take_or_borrow<'a>(
11764            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11765        ) -> Self::Borrowed<'a> {
11766            value
11767        }
11768    }
11769
11770    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreExportResponse {
11771        type Owned = Self;
11772
11773        #[inline(always)]
11774        fn inline_align(_context: fidl::encoding::Context) -> usize {
11775            8
11776        }
11777
11778        #[inline(always)]
11779        fn inline_size(_context: fidl::encoding::Context) -> usize {
11780            16
11781        }
11782    }
11783
11784    unsafe impl
11785        fidl::encoding::Encode<
11786            CapabilityStoreExportResponse,
11787            fidl::encoding::DefaultFuchsiaResourceDialect,
11788        > for &mut CapabilityStoreExportResponse
11789    {
11790        #[inline]
11791        unsafe fn encode(
11792            self,
11793            encoder: &mut fidl::encoding::Encoder<
11794                '_,
11795                fidl::encoding::DefaultFuchsiaResourceDialect,
11796            >,
11797            offset: usize,
11798            _depth: fidl::encoding::Depth,
11799        ) -> fidl::Result<()> {
11800            encoder.debug_check_bounds::<CapabilityStoreExportResponse>(offset);
11801            // Delegate to tuple encoding.
11802            fidl::encoding::Encode::<
11803                CapabilityStoreExportResponse,
11804                fidl::encoding::DefaultFuchsiaResourceDialect,
11805            >::encode(
11806                (<Capability as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11807                    &mut self.capability,
11808                ),),
11809                encoder,
11810                offset,
11811                _depth,
11812            )
11813        }
11814    }
11815    unsafe impl<T0: fidl::encoding::Encode<Capability, fidl::encoding::DefaultFuchsiaResourceDialect>>
11816        fidl::encoding::Encode<
11817            CapabilityStoreExportResponse,
11818            fidl::encoding::DefaultFuchsiaResourceDialect,
11819        > for (T0,)
11820    {
11821        #[inline]
11822        unsafe fn encode(
11823            self,
11824            encoder: &mut fidl::encoding::Encoder<
11825                '_,
11826                fidl::encoding::DefaultFuchsiaResourceDialect,
11827            >,
11828            offset: usize,
11829            depth: fidl::encoding::Depth,
11830        ) -> fidl::Result<()> {
11831            encoder.debug_check_bounds::<CapabilityStoreExportResponse>(offset);
11832            // Zero out padding regions. There's no need to apply masks
11833            // because the unmasked parts will be overwritten by fields.
11834            // Write the fields.
11835            self.0.encode(encoder, offset + 0, depth)?;
11836            Ok(())
11837        }
11838    }
11839
11840    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11841        for CapabilityStoreExportResponse
11842    {
11843        #[inline(always)]
11844        fn new_empty() -> Self {
11845            Self {
11846                capability: fidl::new_empty!(
11847                    Capability,
11848                    fidl::encoding::DefaultFuchsiaResourceDialect
11849                ),
11850            }
11851        }
11852
11853        #[inline]
11854        unsafe fn decode(
11855            &mut self,
11856            decoder: &mut fidl::encoding::Decoder<
11857                '_,
11858                fidl::encoding::DefaultFuchsiaResourceDialect,
11859            >,
11860            offset: usize,
11861            _depth: fidl::encoding::Depth,
11862        ) -> fidl::Result<()> {
11863            decoder.debug_check_bounds::<Self>(offset);
11864            // Verify that padding bytes are zero.
11865            fidl::decode!(
11866                Capability,
11867                fidl::encoding::DefaultFuchsiaResourceDialect,
11868                &mut self.capability,
11869                decoder,
11870                offset + 0,
11871                _depth
11872            )?;
11873            Ok(())
11874        }
11875    }
11876
11877    impl fidl::encoding::ResourceTypeMarker for Connector {
11878        type Borrowed<'a> = &'a mut Self;
11879        fn take_or_borrow<'a>(
11880            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11881        ) -> Self::Borrowed<'a> {
11882            value
11883        }
11884    }
11885
11886    unsafe impl fidl::encoding::TypeMarker for Connector {
11887        type Owned = Self;
11888
11889        #[inline(always)]
11890        fn inline_align(_context: fidl::encoding::Context) -> usize {
11891            4
11892        }
11893
11894        #[inline(always)]
11895        fn inline_size(_context: fidl::encoding::Context) -> usize {
11896            4
11897        }
11898    }
11899
11900    unsafe impl fidl::encoding::Encode<Connector, fidl::encoding::DefaultFuchsiaResourceDialect>
11901        for &mut Connector
11902    {
11903        #[inline]
11904        unsafe fn encode(
11905            self,
11906            encoder: &mut fidl::encoding::Encoder<
11907                '_,
11908                fidl::encoding::DefaultFuchsiaResourceDialect,
11909            >,
11910            offset: usize,
11911            _depth: fidl::encoding::Depth,
11912        ) -> fidl::Result<()> {
11913            encoder.debug_check_bounds::<Connector>(offset);
11914            // Delegate to tuple encoding.
11915            fidl::encoding::Encode::<Connector, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
11916                (
11917                    <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.token),
11918                ),
11919                encoder, offset, _depth
11920            )
11921        }
11922    }
11923    unsafe impl<
11924            T0: fidl::encoding::Encode<
11925                fidl::encoding::HandleType<
11926                    fidl::EventPair,
11927                    { fidl::ObjectType::EVENTPAIR.into_raw() },
11928                    2147483648,
11929                >,
11930                fidl::encoding::DefaultFuchsiaResourceDialect,
11931            >,
11932        > fidl::encoding::Encode<Connector, fidl::encoding::DefaultFuchsiaResourceDialect>
11933        for (T0,)
11934    {
11935        #[inline]
11936        unsafe fn encode(
11937            self,
11938            encoder: &mut fidl::encoding::Encoder<
11939                '_,
11940                fidl::encoding::DefaultFuchsiaResourceDialect,
11941            >,
11942            offset: usize,
11943            depth: fidl::encoding::Depth,
11944        ) -> fidl::Result<()> {
11945            encoder.debug_check_bounds::<Connector>(offset);
11946            // Zero out padding regions. There's no need to apply masks
11947            // because the unmasked parts will be overwritten by fields.
11948            // Write the fields.
11949            self.0.encode(encoder, offset + 0, depth)?;
11950            Ok(())
11951        }
11952    }
11953
11954    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Connector {
11955        #[inline(always)]
11956        fn new_empty() -> Self {
11957            Self {
11958                token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11959            }
11960        }
11961
11962        #[inline]
11963        unsafe fn decode(
11964            &mut self,
11965            decoder: &mut fidl::encoding::Decoder<
11966                '_,
11967                fidl::encoding::DefaultFuchsiaResourceDialect,
11968            >,
11969            offset: usize,
11970            _depth: fidl::encoding::Depth,
11971        ) -> fidl::Result<()> {
11972            decoder.debug_check_bounds::<Self>(offset);
11973            // Verify that padding bytes are zero.
11974            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.token, decoder, offset + 0, _depth)?;
11975            Ok(())
11976        }
11977    }
11978
11979    impl fidl::encoding::ResourceTypeMarker for DictionaryDrainIteratorGetNextResponse {
11980        type Borrowed<'a> = &'a mut Self;
11981        fn take_or_borrow<'a>(
11982            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11983        ) -> Self::Borrowed<'a> {
11984            value
11985        }
11986    }
11987
11988    unsafe impl fidl::encoding::TypeMarker for DictionaryDrainIteratorGetNextResponse {
11989        type Owned = Self;
11990
11991        #[inline(always)]
11992        fn inline_align(_context: fidl::encoding::Context) -> usize {
11993            8
11994        }
11995
11996        #[inline(always)]
11997        fn inline_size(_context: fidl::encoding::Context) -> usize {
11998            24
11999        }
12000    }
12001
12002    unsafe impl
12003        fidl::encoding::Encode<
12004            DictionaryDrainIteratorGetNextResponse,
12005            fidl::encoding::DefaultFuchsiaResourceDialect,
12006        > for &mut DictionaryDrainIteratorGetNextResponse
12007    {
12008        #[inline]
12009        unsafe fn encode(
12010            self,
12011            encoder: &mut fidl::encoding::Encoder<
12012                '_,
12013                fidl::encoding::DefaultFuchsiaResourceDialect,
12014            >,
12015            offset: usize,
12016            _depth: fidl::encoding::Depth,
12017        ) -> fidl::Result<()> {
12018            encoder.debug_check_bounds::<DictionaryDrainIteratorGetNextResponse>(offset);
12019            // Delegate to tuple encoding.
12020            fidl::encoding::Encode::<DictionaryDrainIteratorGetNextResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
12021                (
12022                    <fidl::encoding::Vector<DictionaryItem, 128> as fidl::encoding::ValueTypeMarker>::borrow(&self.items),
12023                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.end_id),
12024                ),
12025                encoder, offset, _depth
12026            )
12027        }
12028    }
12029    unsafe impl<
12030            T0: fidl::encoding::Encode<
12031                fidl::encoding::Vector<DictionaryItem, 128>,
12032                fidl::encoding::DefaultFuchsiaResourceDialect,
12033            >,
12034            T1: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
12035        >
12036        fidl::encoding::Encode<
12037            DictionaryDrainIteratorGetNextResponse,
12038            fidl::encoding::DefaultFuchsiaResourceDialect,
12039        > for (T0, T1)
12040    {
12041        #[inline]
12042        unsafe fn encode(
12043            self,
12044            encoder: &mut fidl::encoding::Encoder<
12045                '_,
12046                fidl::encoding::DefaultFuchsiaResourceDialect,
12047            >,
12048            offset: usize,
12049            depth: fidl::encoding::Depth,
12050        ) -> fidl::Result<()> {
12051            encoder.debug_check_bounds::<DictionaryDrainIteratorGetNextResponse>(offset);
12052            // Zero out padding regions. There's no need to apply masks
12053            // because the unmasked parts will be overwritten by fields.
12054            // Write the fields.
12055            self.0.encode(encoder, offset + 0, depth)?;
12056            self.1.encode(encoder, offset + 16, depth)?;
12057            Ok(())
12058        }
12059    }
12060
12061    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12062        for DictionaryDrainIteratorGetNextResponse
12063    {
12064        #[inline(always)]
12065        fn new_empty() -> Self {
12066            Self {
12067                items: fidl::new_empty!(fidl::encoding::Vector<DictionaryItem, 128>, fidl::encoding::DefaultFuchsiaResourceDialect),
12068                end_id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
12069            }
12070        }
12071
12072        #[inline]
12073        unsafe fn decode(
12074            &mut self,
12075            decoder: &mut fidl::encoding::Decoder<
12076                '_,
12077                fidl::encoding::DefaultFuchsiaResourceDialect,
12078            >,
12079            offset: usize,
12080            _depth: fidl::encoding::Depth,
12081        ) -> fidl::Result<()> {
12082            decoder.debug_check_bounds::<Self>(offset);
12083            // Verify that padding bytes are zero.
12084            fidl::decode!(fidl::encoding::Vector<DictionaryItem, 128>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.items, decoder, offset + 0, _depth)?;
12085            fidl::decode!(
12086                u64,
12087                fidl::encoding::DefaultFuchsiaResourceDialect,
12088                &mut self.end_id,
12089                decoder,
12090                offset + 16,
12091                _depth
12092            )?;
12093            Ok(())
12094        }
12095    }
12096
12097    impl fidl::encoding::ResourceTypeMarker for DictionaryEnumerateIteratorGetNextResponse {
12098        type Borrowed<'a> = &'a mut Self;
12099        fn take_or_borrow<'a>(
12100            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12101        ) -> Self::Borrowed<'a> {
12102            value
12103        }
12104    }
12105
12106    unsafe impl fidl::encoding::TypeMarker for DictionaryEnumerateIteratorGetNextResponse {
12107        type Owned = Self;
12108
12109        #[inline(always)]
12110        fn inline_align(_context: fidl::encoding::Context) -> usize {
12111            8
12112        }
12113
12114        #[inline(always)]
12115        fn inline_size(_context: fidl::encoding::Context) -> usize {
12116            24
12117        }
12118    }
12119
12120    unsafe impl
12121        fidl::encoding::Encode<
12122            DictionaryEnumerateIteratorGetNextResponse,
12123            fidl::encoding::DefaultFuchsiaResourceDialect,
12124        > for &mut DictionaryEnumerateIteratorGetNextResponse
12125    {
12126        #[inline]
12127        unsafe fn encode(
12128            self,
12129            encoder: &mut fidl::encoding::Encoder<
12130                '_,
12131                fidl::encoding::DefaultFuchsiaResourceDialect,
12132            >,
12133            offset: usize,
12134            _depth: fidl::encoding::Depth,
12135        ) -> fidl::Result<()> {
12136            encoder.debug_check_bounds::<DictionaryEnumerateIteratorGetNextResponse>(offset);
12137            // Delegate to tuple encoding.
12138            fidl::encoding::Encode::<DictionaryEnumerateIteratorGetNextResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
12139                (
12140                    <fidl::encoding::Vector<DictionaryOptionalItem, 128> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.items),
12141                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.end_id),
12142                ),
12143                encoder, offset, _depth
12144            )
12145        }
12146    }
12147    unsafe impl<
12148            T0: fidl::encoding::Encode<
12149                fidl::encoding::Vector<DictionaryOptionalItem, 128>,
12150                fidl::encoding::DefaultFuchsiaResourceDialect,
12151            >,
12152            T1: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
12153        >
12154        fidl::encoding::Encode<
12155            DictionaryEnumerateIteratorGetNextResponse,
12156            fidl::encoding::DefaultFuchsiaResourceDialect,
12157        > for (T0, T1)
12158    {
12159        #[inline]
12160        unsafe fn encode(
12161            self,
12162            encoder: &mut fidl::encoding::Encoder<
12163                '_,
12164                fidl::encoding::DefaultFuchsiaResourceDialect,
12165            >,
12166            offset: usize,
12167            depth: fidl::encoding::Depth,
12168        ) -> fidl::Result<()> {
12169            encoder.debug_check_bounds::<DictionaryEnumerateIteratorGetNextResponse>(offset);
12170            // Zero out padding regions. There's no need to apply masks
12171            // because the unmasked parts will be overwritten by fields.
12172            // Write the fields.
12173            self.0.encode(encoder, offset + 0, depth)?;
12174            self.1.encode(encoder, offset + 16, depth)?;
12175            Ok(())
12176        }
12177    }
12178
12179    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12180        for DictionaryEnumerateIteratorGetNextResponse
12181    {
12182        #[inline(always)]
12183        fn new_empty() -> Self {
12184            Self {
12185                items: fidl::new_empty!(fidl::encoding::Vector<DictionaryOptionalItem, 128>, fidl::encoding::DefaultFuchsiaResourceDialect),
12186                end_id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
12187            }
12188        }
12189
12190        #[inline]
12191        unsafe fn decode(
12192            &mut self,
12193            decoder: &mut fidl::encoding::Decoder<
12194                '_,
12195                fidl::encoding::DefaultFuchsiaResourceDialect,
12196            >,
12197            offset: usize,
12198            _depth: fidl::encoding::Depth,
12199        ) -> fidl::Result<()> {
12200            decoder.debug_check_bounds::<Self>(offset);
12201            // Verify that padding bytes are zero.
12202            fidl::decode!(fidl::encoding::Vector<DictionaryOptionalItem, 128>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.items, decoder, offset + 0, _depth)?;
12203            fidl::decode!(
12204                u64,
12205                fidl::encoding::DefaultFuchsiaResourceDialect,
12206                &mut self.end_id,
12207                decoder,
12208                offset + 16,
12209                _depth
12210            )?;
12211            Ok(())
12212        }
12213    }
12214
12215    impl fidl::encoding::ResourceTypeMarker for DictionaryKeysIteratorGetNextResponse {
12216        type Borrowed<'a> = &'a mut Self;
12217        fn take_or_borrow<'a>(
12218            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12219        ) -> Self::Borrowed<'a> {
12220            value
12221        }
12222    }
12223
12224    unsafe impl fidl::encoding::TypeMarker for DictionaryKeysIteratorGetNextResponse {
12225        type Owned = Self;
12226
12227        #[inline(always)]
12228        fn inline_align(_context: fidl::encoding::Context) -> usize {
12229            8
12230        }
12231
12232        #[inline(always)]
12233        fn inline_size(_context: fidl::encoding::Context) -> usize {
12234            16
12235        }
12236    }
12237
12238    unsafe impl
12239        fidl::encoding::Encode<
12240            DictionaryKeysIteratorGetNextResponse,
12241            fidl::encoding::DefaultFuchsiaResourceDialect,
12242        > for &mut DictionaryKeysIteratorGetNextResponse
12243    {
12244        #[inline]
12245        unsafe fn encode(
12246            self,
12247            encoder: &mut fidl::encoding::Encoder<
12248                '_,
12249                fidl::encoding::DefaultFuchsiaResourceDialect,
12250            >,
12251            offset: usize,
12252            _depth: fidl::encoding::Depth,
12253        ) -> fidl::Result<()> {
12254            encoder.debug_check_bounds::<DictionaryKeysIteratorGetNextResponse>(offset);
12255            // Delegate to tuple encoding.
12256            fidl::encoding::Encode::<DictionaryKeysIteratorGetNextResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
12257                (
12258                    <fidl::encoding::Vector<fidl::encoding::BoundedString<255>, 128> as fidl::encoding::ValueTypeMarker>::borrow(&self.keys),
12259                ),
12260                encoder, offset, _depth
12261            )
12262        }
12263    }
12264    unsafe impl<
12265            T0: fidl::encoding::Encode<
12266                fidl::encoding::Vector<fidl::encoding::BoundedString<255>, 128>,
12267                fidl::encoding::DefaultFuchsiaResourceDialect,
12268            >,
12269        >
12270        fidl::encoding::Encode<
12271            DictionaryKeysIteratorGetNextResponse,
12272            fidl::encoding::DefaultFuchsiaResourceDialect,
12273        > for (T0,)
12274    {
12275        #[inline]
12276        unsafe fn encode(
12277            self,
12278            encoder: &mut fidl::encoding::Encoder<
12279                '_,
12280                fidl::encoding::DefaultFuchsiaResourceDialect,
12281            >,
12282            offset: usize,
12283            depth: fidl::encoding::Depth,
12284        ) -> fidl::Result<()> {
12285            encoder.debug_check_bounds::<DictionaryKeysIteratorGetNextResponse>(offset);
12286            // Zero out padding regions. There's no need to apply masks
12287            // because the unmasked parts will be overwritten by fields.
12288            // Write the fields.
12289            self.0.encode(encoder, offset + 0, depth)?;
12290            Ok(())
12291        }
12292    }
12293
12294    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12295        for DictionaryKeysIteratorGetNextResponse
12296    {
12297        #[inline(always)]
12298        fn new_empty() -> Self {
12299            Self {
12300                keys: fidl::new_empty!(
12301                    fidl::encoding::Vector<fidl::encoding::BoundedString<255>, 128>,
12302                    fidl::encoding::DefaultFuchsiaResourceDialect
12303                ),
12304            }
12305        }
12306
12307        #[inline]
12308        unsafe fn decode(
12309            &mut self,
12310            decoder: &mut fidl::encoding::Decoder<
12311                '_,
12312                fidl::encoding::DefaultFuchsiaResourceDialect,
12313            >,
12314            offset: usize,
12315            _depth: fidl::encoding::Depth,
12316        ) -> fidl::Result<()> {
12317            decoder.debug_check_bounds::<Self>(offset);
12318            // Verify that padding bytes are zero.
12319            fidl::decode!(
12320                fidl::encoding::Vector<fidl::encoding::BoundedString<255>, 128>,
12321                fidl::encoding::DefaultFuchsiaResourceDialect,
12322                &mut self.keys,
12323                decoder,
12324                offset + 0,
12325                _depth
12326            )?;
12327            Ok(())
12328        }
12329    }
12330
12331    impl fidl::encoding::ResourceTypeMarker for DictionaryOptionalItem {
12332        type Borrowed<'a> = &'a mut Self;
12333        fn take_or_borrow<'a>(
12334            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12335        ) -> Self::Borrowed<'a> {
12336            value
12337        }
12338    }
12339
12340    unsafe impl fidl::encoding::TypeMarker for DictionaryOptionalItem {
12341        type Owned = Self;
12342
12343        #[inline(always)]
12344        fn inline_align(_context: fidl::encoding::Context) -> usize {
12345            8
12346        }
12347
12348        #[inline(always)]
12349        fn inline_size(_context: fidl::encoding::Context) -> usize {
12350            24
12351        }
12352    }
12353
12354    unsafe impl
12355        fidl::encoding::Encode<
12356            DictionaryOptionalItem,
12357            fidl::encoding::DefaultFuchsiaResourceDialect,
12358        > for &mut DictionaryOptionalItem
12359    {
12360        #[inline]
12361        unsafe fn encode(
12362            self,
12363            encoder: &mut fidl::encoding::Encoder<
12364                '_,
12365                fidl::encoding::DefaultFuchsiaResourceDialect,
12366            >,
12367            offset: usize,
12368            _depth: fidl::encoding::Depth,
12369        ) -> fidl::Result<()> {
12370            encoder.debug_check_bounds::<DictionaryOptionalItem>(offset);
12371            // Delegate to tuple encoding.
12372            fidl::encoding::Encode::<DictionaryOptionalItem, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
12373                (
12374                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(&self.key),
12375                    <fidl::encoding::Boxed<WrappedCapabilityId> as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
12376                ),
12377                encoder, offset, _depth
12378            )
12379        }
12380    }
12381    unsafe impl<
12382            T0: fidl::encoding::Encode<
12383                fidl::encoding::BoundedString<255>,
12384                fidl::encoding::DefaultFuchsiaResourceDialect,
12385            >,
12386            T1: fidl::encoding::Encode<
12387                fidl::encoding::Boxed<WrappedCapabilityId>,
12388                fidl::encoding::DefaultFuchsiaResourceDialect,
12389            >,
12390        >
12391        fidl::encoding::Encode<
12392            DictionaryOptionalItem,
12393            fidl::encoding::DefaultFuchsiaResourceDialect,
12394        > for (T0, T1)
12395    {
12396        #[inline]
12397        unsafe fn encode(
12398            self,
12399            encoder: &mut fidl::encoding::Encoder<
12400                '_,
12401                fidl::encoding::DefaultFuchsiaResourceDialect,
12402            >,
12403            offset: usize,
12404            depth: fidl::encoding::Depth,
12405        ) -> fidl::Result<()> {
12406            encoder.debug_check_bounds::<DictionaryOptionalItem>(offset);
12407            // Zero out padding regions. There's no need to apply masks
12408            // because the unmasked parts will be overwritten by fields.
12409            // Write the fields.
12410            self.0.encode(encoder, offset + 0, depth)?;
12411            self.1.encode(encoder, offset + 16, depth)?;
12412            Ok(())
12413        }
12414    }
12415
12416    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12417        for DictionaryOptionalItem
12418    {
12419        #[inline(always)]
12420        fn new_empty() -> Self {
12421            Self {
12422                key: fidl::new_empty!(
12423                    fidl::encoding::BoundedString<255>,
12424                    fidl::encoding::DefaultFuchsiaResourceDialect
12425                ),
12426                value: fidl::new_empty!(
12427                    fidl::encoding::Boxed<WrappedCapabilityId>,
12428                    fidl::encoding::DefaultFuchsiaResourceDialect
12429                ),
12430            }
12431        }
12432
12433        #[inline]
12434        unsafe fn decode(
12435            &mut self,
12436            decoder: &mut fidl::encoding::Decoder<
12437                '_,
12438                fidl::encoding::DefaultFuchsiaResourceDialect,
12439            >,
12440            offset: usize,
12441            _depth: fidl::encoding::Depth,
12442        ) -> fidl::Result<()> {
12443            decoder.debug_check_bounds::<Self>(offset);
12444            // Verify that padding bytes are zero.
12445            fidl::decode!(
12446                fidl::encoding::BoundedString<255>,
12447                fidl::encoding::DefaultFuchsiaResourceDialect,
12448                &mut self.key,
12449                decoder,
12450                offset + 0,
12451                _depth
12452            )?;
12453            fidl::decode!(
12454                fidl::encoding::Boxed<WrappedCapabilityId>,
12455                fidl::encoding::DefaultFuchsiaResourceDialect,
12456                &mut self.value,
12457                decoder,
12458                offset + 16,
12459                _depth
12460            )?;
12461            Ok(())
12462        }
12463    }
12464
12465    impl fidl::encoding::ResourceTypeMarker for DictionaryRef {
12466        type Borrowed<'a> = &'a mut Self;
12467        fn take_or_borrow<'a>(
12468            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12469        ) -> Self::Borrowed<'a> {
12470            value
12471        }
12472    }
12473
12474    unsafe impl fidl::encoding::TypeMarker for DictionaryRef {
12475        type Owned = Self;
12476
12477        #[inline(always)]
12478        fn inline_align(_context: fidl::encoding::Context) -> usize {
12479            4
12480        }
12481
12482        #[inline(always)]
12483        fn inline_size(_context: fidl::encoding::Context) -> usize {
12484            4
12485        }
12486    }
12487
12488    unsafe impl fidl::encoding::Encode<DictionaryRef, fidl::encoding::DefaultFuchsiaResourceDialect>
12489        for &mut DictionaryRef
12490    {
12491        #[inline]
12492        unsafe fn encode(
12493            self,
12494            encoder: &mut fidl::encoding::Encoder<
12495                '_,
12496                fidl::encoding::DefaultFuchsiaResourceDialect,
12497            >,
12498            offset: usize,
12499            _depth: fidl::encoding::Depth,
12500        ) -> fidl::Result<()> {
12501            encoder.debug_check_bounds::<DictionaryRef>(offset);
12502            // Delegate to tuple encoding.
12503            fidl::encoding::Encode::<DictionaryRef, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
12504                (
12505                    <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.token),
12506                ),
12507                encoder, offset, _depth
12508            )
12509        }
12510    }
12511    unsafe impl<
12512            T0: fidl::encoding::Encode<
12513                fidl::encoding::HandleType<
12514                    fidl::EventPair,
12515                    { fidl::ObjectType::EVENTPAIR.into_raw() },
12516                    2147483648,
12517                >,
12518                fidl::encoding::DefaultFuchsiaResourceDialect,
12519            >,
12520        > fidl::encoding::Encode<DictionaryRef, fidl::encoding::DefaultFuchsiaResourceDialect>
12521        for (T0,)
12522    {
12523        #[inline]
12524        unsafe fn encode(
12525            self,
12526            encoder: &mut fidl::encoding::Encoder<
12527                '_,
12528                fidl::encoding::DefaultFuchsiaResourceDialect,
12529            >,
12530            offset: usize,
12531            depth: fidl::encoding::Depth,
12532        ) -> fidl::Result<()> {
12533            encoder.debug_check_bounds::<DictionaryRef>(offset);
12534            // Zero out padding regions. There's no need to apply masks
12535            // because the unmasked parts will be overwritten by fields.
12536            // Write the fields.
12537            self.0.encode(encoder, offset + 0, depth)?;
12538            Ok(())
12539        }
12540    }
12541
12542    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for DictionaryRef {
12543        #[inline(always)]
12544        fn new_empty() -> Self {
12545            Self {
12546                token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
12547            }
12548        }
12549
12550        #[inline]
12551        unsafe fn decode(
12552            &mut self,
12553            decoder: &mut fidl::encoding::Decoder<
12554                '_,
12555                fidl::encoding::DefaultFuchsiaResourceDialect,
12556            >,
12557            offset: usize,
12558            _depth: fidl::encoding::Depth,
12559        ) -> fidl::Result<()> {
12560            decoder.debug_check_bounds::<Self>(offset);
12561            // Verify that padding bytes are zero.
12562            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.token, decoder, offset + 0, _depth)?;
12563            Ok(())
12564        }
12565    }
12566
12567    impl fidl::encoding::ResourceTypeMarker for DirConnector {
12568        type Borrowed<'a> = &'a mut Self;
12569        fn take_or_borrow<'a>(
12570            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12571        ) -> Self::Borrowed<'a> {
12572            value
12573        }
12574    }
12575
12576    unsafe impl fidl::encoding::TypeMarker for DirConnector {
12577        type Owned = Self;
12578
12579        #[inline(always)]
12580        fn inline_align(_context: fidl::encoding::Context) -> usize {
12581            4
12582        }
12583
12584        #[inline(always)]
12585        fn inline_size(_context: fidl::encoding::Context) -> usize {
12586            4
12587        }
12588    }
12589
12590    unsafe impl fidl::encoding::Encode<DirConnector, fidl::encoding::DefaultFuchsiaResourceDialect>
12591        for &mut DirConnector
12592    {
12593        #[inline]
12594        unsafe fn encode(
12595            self,
12596            encoder: &mut fidl::encoding::Encoder<
12597                '_,
12598                fidl::encoding::DefaultFuchsiaResourceDialect,
12599            >,
12600            offset: usize,
12601            _depth: fidl::encoding::Depth,
12602        ) -> fidl::Result<()> {
12603            encoder.debug_check_bounds::<DirConnector>(offset);
12604            // Delegate to tuple encoding.
12605            fidl::encoding::Encode::<DirConnector, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
12606                (
12607                    <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.token),
12608                ),
12609                encoder, offset, _depth
12610            )
12611        }
12612    }
12613    unsafe impl<
12614            T0: fidl::encoding::Encode<
12615                fidl::encoding::HandleType<
12616                    fidl::EventPair,
12617                    { fidl::ObjectType::EVENTPAIR.into_raw() },
12618                    2147483648,
12619                >,
12620                fidl::encoding::DefaultFuchsiaResourceDialect,
12621            >,
12622        > fidl::encoding::Encode<DirConnector, fidl::encoding::DefaultFuchsiaResourceDialect>
12623        for (T0,)
12624    {
12625        #[inline]
12626        unsafe fn encode(
12627            self,
12628            encoder: &mut fidl::encoding::Encoder<
12629                '_,
12630                fidl::encoding::DefaultFuchsiaResourceDialect,
12631            >,
12632            offset: usize,
12633            depth: fidl::encoding::Depth,
12634        ) -> fidl::Result<()> {
12635            encoder.debug_check_bounds::<DirConnector>(offset);
12636            // Zero out padding regions. There's no need to apply masks
12637            // because the unmasked parts will be overwritten by fields.
12638            // Write the fields.
12639            self.0.encode(encoder, offset + 0, depth)?;
12640            Ok(())
12641        }
12642    }
12643
12644    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for DirConnector {
12645        #[inline(always)]
12646        fn new_empty() -> Self {
12647            Self {
12648                token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
12649            }
12650        }
12651
12652        #[inline]
12653        unsafe fn decode(
12654            &mut self,
12655            decoder: &mut fidl::encoding::Decoder<
12656                '_,
12657                fidl::encoding::DefaultFuchsiaResourceDialect,
12658            >,
12659            offset: usize,
12660            _depth: fidl::encoding::Depth,
12661        ) -> fidl::Result<()> {
12662            decoder.debug_check_bounds::<Self>(offset);
12663            // Verify that padding bytes are zero.
12664            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.token, decoder, offset + 0, _depth)?;
12665            Ok(())
12666        }
12667    }
12668
12669    impl fidl::encoding::ResourceTypeMarker for DirEntry {
12670        type Borrowed<'a> = &'a mut Self;
12671        fn take_or_borrow<'a>(
12672            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12673        ) -> Self::Borrowed<'a> {
12674            value
12675        }
12676    }
12677
12678    unsafe impl fidl::encoding::TypeMarker for DirEntry {
12679        type Owned = Self;
12680
12681        #[inline(always)]
12682        fn inline_align(_context: fidl::encoding::Context) -> usize {
12683            4
12684        }
12685
12686        #[inline(always)]
12687        fn inline_size(_context: fidl::encoding::Context) -> usize {
12688            4
12689        }
12690    }
12691
12692    unsafe impl fidl::encoding::Encode<DirEntry, fidl::encoding::DefaultFuchsiaResourceDialect>
12693        for &mut DirEntry
12694    {
12695        #[inline]
12696        unsafe fn encode(
12697            self,
12698            encoder: &mut fidl::encoding::Encoder<
12699                '_,
12700                fidl::encoding::DefaultFuchsiaResourceDialect,
12701            >,
12702            offset: usize,
12703            _depth: fidl::encoding::Depth,
12704        ) -> fidl::Result<()> {
12705            encoder.debug_check_bounds::<DirEntry>(offset);
12706            // Delegate to tuple encoding.
12707            fidl::encoding::Encode::<DirEntry, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
12708                (
12709                    <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.token),
12710                ),
12711                encoder, offset, _depth
12712            )
12713        }
12714    }
12715    unsafe impl<
12716            T0: fidl::encoding::Encode<
12717                fidl::encoding::HandleType<
12718                    fidl::EventPair,
12719                    { fidl::ObjectType::EVENTPAIR.into_raw() },
12720                    2147483648,
12721                >,
12722                fidl::encoding::DefaultFuchsiaResourceDialect,
12723            >,
12724        > fidl::encoding::Encode<DirEntry, fidl::encoding::DefaultFuchsiaResourceDialect> for (T0,)
12725    {
12726        #[inline]
12727        unsafe fn encode(
12728            self,
12729            encoder: &mut fidl::encoding::Encoder<
12730                '_,
12731                fidl::encoding::DefaultFuchsiaResourceDialect,
12732            >,
12733            offset: usize,
12734            depth: fidl::encoding::Depth,
12735        ) -> fidl::Result<()> {
12736            encoder.debug_check_bounds::<DirEntry>(offset);
12737            // Zero out padding regions. There's no need to apply masks
12738            // because the unmasked parts will be overwritten by fields.
12739            // Write the fields.
12740            self.0.encode(encoder, offset + 0, depth)?;
12741            Ok(())
12742        }
12743    }
12744
12745    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for DirEntry {
12746        #[inline(always)]
12747        fn new_empty() -> Self {
12748            Self {
12749                token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
12750            }
12751        }
12752
12753        #[inline]
12754        unsafe fn decode(
12755            &mut self,
12756            decoder: &mut fidl::encoding::Decoder<
12757                '_,
12758                fidl::encoding::DefaultFuchsiaResourceDialect,
12759            >,
12760            offset: usize,
12761            _depth: fidl::encoding::Depth,
12762        ) -> fidl::Result<()> {
12763            decoder.debug_check_bounds::<Self>(offset);
12764            // Verify that padding bytes are zero.
12765            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.token, decoder, offset + 0, _depth)?;
12766            Ok(())
12767        }
12768    }
12769
12770    impl fidl::encoding::ResourceTypeMarker for DirReceiverReceiveRequest {
12771        type Borrowed<'a> = &'a mut Self;
12772        fn take_or_borrow<'a>(
12773            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12774        ) -> Self::Borrowed<'a> {
12775            value
12776        }
12777    }
12778
12779    unsafe impl fidl::encoding::TypeMarker for DirReceiverReceiveRequest {
12780        type Owned = Self;
12781
12782        #[inline(always)]
12783        fn inline_align(_context: fidl::encoding::Context) -> usize {
12784            4
12785        }
12786
12787        #[inline(always)]
12788        fn inline_size(_context: fidl::encoding::Context) -> usize {
12789            4
12790        }
12791    }
12792
12793    unsafe impl
12794        fidl::encoding::Encode<
12795            DirReceiverReceiveRequest,
12796            fidl::encoding::DefaultFuchsiaResourceDialect,
12797        > for &mut DirReceiverReceiveRequest
12798    {
12799        #[inline]
12800        unsafe fn encode(
12801            self,
12802            encoder: &mut fidl::encoding::Encoder<
12803                '_,
12804                fidl::encoding::DefaultFuchsiaResourceDialect,
12805            >,
12806            offset: usize,
12807            _depth: fidl::encoding::Depth,
12808        ) -> fidl::Result<()> {
12809            encoder.debug_check_bounds::<DirReceiverReceiveRequest>(offset);
12810            // Delegate to tuple encoding.
12811            fidl::encoding::Encode::<
12812                DirReceiverReceiveRequest,
12813                fidl::encoding::DefaultFuchsiaResourceDialect,
12814            >::encode(
12815                (<fidl::encoding::Endpoint<
12816                    fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
12817                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
12818                    &mut self.channel
12819                ),),
12820                encoder,
12821                offset,
12822                _depth,
12823            )
12824        }
12825    }
12826    unsafe impl<
12827            T0: fidl::encoding::Encode<
12828                fidl::encoding::Endpoint<
12829                    fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
12830                >,
12831                fidl::encoding::DefaultFuchsiaResourceDialect,
12832            >,
12833        >
12834        fidl::encoding::Encode<
12835            DirReceiverReceiveRequest,
12836            fidl::encoding::DefaultFuchsiaResourceDialect,
12837        > for (T0,)
12838    {
12839        #[inline]
12840        unsafe fn encode(
12841            self,
12842            encoder: &mut fidl::encoding::Encoder<
12843                '_,
12844                fidl::encoding::DefaultFuchsiaResourceDialect,
12845            >,
12846            offset: usize,
12847            depth: fidl::encoding::Depth,
12848        ) -> fidl::Result<()> {
12849            encoder.debug_check_bounds::<DirReceiverReceiveRequest>(offset);
12850            // Zero out padding regions. There's no need to apply masks
12851            // because the unmasked parts will be overwritten by fields.
12852            // Write the fields.
12853            self.0.encode(encoder, offset + 0, depth)?;
12854            Ok(())
12855        }
12856    }
12857
12858    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12859        for DirReceiverReceiveRequest
12860    {
12861        #[inline(always)]
12862        fn new_empty() -> Self {
12863            Self {
12864                channel: fidl::new_empty!(
12865                    fidl::encoding::Endpoint<
12866                        fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
12867                    >,
12868                    fidl::encoding::DefaultFuchsiaResourceDialect
12869                ),
12870            }
12871        }
12872
12873        #[inline]
12874        unsafe fn decode(
12875            &mut self,
12876            decoder: &mut fidl::encoding::Decoder<
12877                '_,
12878                fidl::encoding::DefaultFuchsiaResourceDialect,
12879            >,
12880            offset: usize,
12881            _depth: fidl::encoding::Depth,
12882        ) -> fidl::Result<()> {
12883            decoder.debug_check_bounds::<Self>(offset);
12884            // Verify that padding bytes are zero.
12885            fidl::decode!(
12886                fidl::encoding::Endpoint<
12887                    fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
12888                >,
12889                fidl::encoding::DefaultFuchsiaResourceDialect,
12890                &mut self.channel,
12891                decoder,
12892                offset + 0,
12893                _depth
12894            )?;
12895            Ok(())
12896        }
12897    }
12898
12899    impl fidl::encoding::ResourceTypeMarker for InstanceToken {
12900        type Borrowed<'a> = &'a mut Self;
12901        fn take_or_borrow<'a>(
12902            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12903        ) -> Self::Borrowed<'a> {
12904            value
12905        }
12906    }
12907
12908    unsafe impl fidl::encoding::TypeMarker for InstanceToken {
12909        type Owned = Self;
12910
12911        #[inline(always)]
12912        fn inline_align(_context: fidl::encoding::Context) -> usize {
12913            4
12914        }
12915
12916        #[inline(always)]
12917        fn inline_size(_context: fidl::encoding::Context) -> usize {
12918            4
12919        }
12920    }
12921
12922    unsafe impl fidl::encoding::Encode<InstanceToken, fidl::encoding::DefaultFuchsiaResourceDialect>
12923        for &mut InstanceToken
12924    {
12925        #[inline]
12926        unsafe fn encode(
12927            self,
12928            encoder: &mut fidl::encoding::Encoder<
12929                '_,
12930                fidl::encoding::DefaultFuchsiaResourceDialect,
12931            >,
12932            offset: usize,
12933            _depth: fidl::encoding::Depth,
12934        ) -> fidl::Result<()> {
12935            encoder.debug_check_bounds::<InstanceToken>(offset);
12936            // Delegate to tuple encoding.
12937            fidl::encoding::Encode::<InstanceToken, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
12938                (
12939                    <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.token),
12940                ),
12941                encoder, offset, _depth
12942            )
12943        }
12944    }
12945    unsafe impl<
12946            T0: fidl::encoding::Encode<
12947                fidl::encoding::HandleType<
12948                    fidl::EventPair,
12949                    { fidl::ObjectType::EVENTPAIR.into_raw() },
12950                    2147483648,
12951                >,
12952                fidl::encoding::DefaultFuchsiaResourceDialect,
12953            >,
12954        > fidl::encoding::Encode<InstanceToken, fidl::encoding::DefaultFuchsiaResourceDialect>
12955        for (T0,)
12956    {
12957        #[inline]
12958        unsafe fn encode(
12959            self,
12960            encoder: &mut fidl::encoding::Encoder<
12961                '_,
12962                fidl::encoding::DefaultFuchsiaResourceDialect,
12963            >,
12964            offset: usize,
12965            depth: fidl::encoding::Depth,
12966        ) -> fidl::Result<()> {
12967            encoder.debug_check_bounds::<InstanceToken>(offset);
12968            // Zero out padding regions. There's no need to apply masks
12969            // because the unmasked parts will be overwritten by fields.
12970            // Write the fields.
12971            self.0.encode(encoder, offset + 0, depth)?;
12972            Ok(())
12973        }
12974    }
12975
12976    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for InstanceToken {
12977        #[inline(always)]
12978        fn new_empty() -> Self {
12979            Self {
12980                token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
12981            }
12982        }
12983
12984        #[inline]
12985        unsafe fn decode(
12986            &mut self,
12987            decoder: &mut fidl::encoding::Decoder<
12988                '_,
12989                fidl::encoding::DefaultFuchsiaResourceDialect,
12990            >,
12991            offset: usize,
12992            _depth: fidl::encoding::Depth,
12993        ) -> fidl::Result<()> {
12994            decoder.debug_check_bounds::<Self>(offset);
12995            // Verify that padding bytes are zero.
12996            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.token, decoder, offset + 0, _depth)?;
12997            Ok(())
12998        }
12999    }
13000
13001    impl fidl::encoding::ResourceTypeMarker for ProtocolPayload {
13002        type Borrowed<'a> = &'a mut Self;
13003        fn take_or_borrow<'a>(
13004            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13005        ) -> Self::Borrowed<'a> {
13006            value
13007        }
13008    }
13009
13010    unsafe impl fidl::encoding::TypeMarker for ProtocolPayload {
13011        type Owned = Self;
13012
13013        #[inline(always)]
13014        fn inline_align(_context: fidl::encoding::Context) -> usize {
13015            4
13016        }
13017
13018        #[inline(always)]
13019        fn inline_size(_context: fidl::encoding::Context) -> usize {
13020            4
13021        }
13022    }
13023
13024    unsafe impl
13025        fidl::encoding::Encode<ProtocolPayload, fidl::encoding::DefaultFuchsiaResourceDialect>
13026        for &mut ProtocolPayload
13027    {
13028        #[inline]
13029        unsafe fn encode(
13030            self,
13031            encoder: &mut fidl::encoding::Encoder<
13032                '_,
13033                fidl::encoding::DefaultFuchsiaResourceDialect,
13034            >,
13035            offset: usize,
13036            _depth: fidl::encoding::Depth,
13037        ) -> fidl::Result<()> {
13038            encoder.debug_check_bounds::<ProtocolPayload>(offset);
13039            // Delegate to tuple encoding.
13040            fidl::encoding::Encode::<ProtocolPayload, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
13041                (
13042                    <fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.channel),
13043                ),
13044                encoder, offset, _depth
13045            )
13046        }
13047    }
13048    unsafe impl<
13049            T0: fidl::encoding::Encode<
13050                fidl::encoding::HandleType<
13051                    fidl::Channel,
13052                    { fidl::ObjectType::CHANNEL.into_raw() },
13053                    2147483648,
13054                >,
13055                fidl::encoding::DefaultFuchsiaResourceDialect,
13056            >,
13057        > fidl::encoding::Encode<ProtocolPayload, fidl::encoding::DefaultFuchsiaResourceDialect>
13058        for (T0,)
13059    {
13060        #[inline]
13061        unsafe fn encode(
13062            self,
13063            encoder: &mut fidl::encoding::Encoder<
13064                '_,
13065                fidl::encoding::DefaultFuchsiaResourceDialect,
13066            >,
13067            offset: usize,
13068            depth: fidl::encoding::Depth,
13069        ) -> fidl::Result<()> {
13070            encoder.debug_check_bounds::<ProtocolPayload>(offset);
13071            // Zero out padding regions. There's no need to apply masks
13072            // because the unmasked parts will be overwritten by fields.
13073            // Write the fields.
13074            self.0.encode(encoder, offset + 0, depth)?;
13075            Ok(())
13076        }
13077    }
13078
13079    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13080        for ProtocolPayload
13081    {
13082        #[inline(always)]
13083        fn new_empty() -> Self {
13084            Self {
13085                channel: fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
13086            }
13087        }
13088
13089        #[inline]
13090        unsafe fn decode(
13091            &mut self,
13092            decoder: &mut fidl::encoding::Decoder<
13093                '_,
13094                fidl::encoding::DefaultFuchsiaResourceDialect,
13095            >,
13096            offset: usize,
13097            _depth: fidl::encoding::Depth,
13098        ) -> fidl::Result<()> {
13099            decoder.debug_check_bounds::<Self>(offset);
13100            // Verify that padding bytes are zero.
13101            fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.channel, decoder, offset + 0, _depth)?;
13102            Ok(())
13103        }
13104    }
13105
13106    impl RouteRequest {
13107        #[inline(always)]
13108        fn max_ordinal_present(&self) -> u64 {
13109            if let Some(_) = self.metadata {
13110                return 2;
13111            }
13112            if let Some(_) = self.requesting {
13113                return 1;
13114            }
13115            0
13116        }
13117    }
13118
13119    impl fidl::encoding::ResourceTypeMarker for RouteRequest {
13120        type Borrowed<'a> = &'a mut Self;
13121        fn take_or_borrow<'a>(
13122            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13123        ) -> Self::Borrowed<'a> {
13124            value
13125        }
13126    }
13127
13128    unsafe impl fidl::encoding::TypeMarker for RouteRequest {
13129        type Owned = Self;
13130
13131        #[inline(always)]
13132        fn inline_align(_context: fidl::encoding::Context) -> usize {
13133            8
13134        }
13135
13136        #[inline(always)]
13137        fn inline_size(_context: fidl::encoding::Context) -> usize {
13138            16
13139        }
13140    }
13141
13142    unsafe impl fidl::encoding::Encode<RouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
13143        for &mut RouteRequest
13144    {
13145        unsafe fn encode(
13146            self,
13147            encoder: &mut fidl::encoding::Encoder<
13148                '_,
13149                fidl::encoding::DefaultFuchsiaResourceDialect,
13150            >,
13151            offset: usize,
13152            mut depth: fidl::encoding::Depth,
13153        ) -> fidl::Result<()> {
13154            encoder.debug_check_bounds::<RouteRequest>(offset);
13155            // Vector header
13156            let max_ordinal: u64 = self.max_ordinal_present();
13157            encoder.write_num(max_ordinal, offset);
13158            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
13159            // Calling encoder.out_of_line_offset(0) is not allowed.
13160            if max_ordinal == 0 {
13161                return Ok(());
13162            }
13163            depth.increment()?;
13164            let envelope_size = 8;
13165            let bytes_len = max_ordinal as usize * envelope_size;
13166            #[allow(unused_variables)]
13167            let offset = encoder.out_of_line_offset(bytes_len);
13168            let mut _prev_end_offset: usize = 0;
13169            if 1 > max_ordinal {
13170                return Ok(());
13171            }
13172
13173            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13174            // are envelope_size bytes.
13175            let cur_offset: usize = (1 - 1) * envelope_size;
13176
13177            // Zero reserved fields.
13178            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13179
13180            // Safety:
13181            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13182            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13183            //   envelope_size bytes, there is always sufficient room.
13184            fidl::encoding::encode_in_envelope_optional::<
13185                InstanceToken,
13186                fidl::encoding::DefaultFuchsiaResourceDialect,
13187            >(
13188                self.requesting
13189                    .as_mut()
13190                    .map(<InstanceToken as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
13191                encoder,
13192                offset + cur_offset,
13193                depth,
13194            )?;
13195
13196            _prev_end_offset = cur_offset + envelope_size;
13197            if 2 > max_ordinal {
13198                return Ok(());
13199            }
13200
13201            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13202            // are envelope_size bytes.
13203            let cur_offset: usize = (2 - 1) * envelope_size;
13204
13205            // Zero reserved fields.
13206            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13207
13208            // Safety:
13209            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13210            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13211            //   envelope_size bytes, there is always sufficient room.
13212            fidl::encoding::encode_in_envelope_optional::<
13213                DictionaryRef,
13214                fidl::encoding::DefaultFuchsiaResourceDialect,
13215            >(
13216                self.metadata
13217                    .as_mut()
13218                    .map(<DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
13219                encoder,
13220                offset + cur_offset,
13221                depth,
13222            )?;
13223
13224            _prev_end_offset = cur_offset + envelope_size;
13225
13226            Ok(())
13227        }
13228    }
13229
13230    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for RouteRequest {
13231        #[inline(always)]
13232        fn new_empty() -> Self {
13233            Self::default()
13234        }
13235
13236        unsafe fn decode(
13237            &mut self,
13238            decoder: &mut fidl::encoding::Decoder<
13239                '_,
13240                fidl::encoding::DefaultFuchsiaResourceDialect,
13241            >,
13242            offset: usize,
13243            mut depth: fidl::encoding::Depth,
13244        ) -> fidl::Result<()> {
13245            decoder.debug_check_bounds::<Self>(offset);
13246            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13247                None => return Err(fidl::Error::NotNullable),
13248                Some(len) => len,
13249            };
13250            // Calling decoder.out_of_line_offset(0) is not allowed.
13251            if len == 0 {
13252                return Ok(());
13253            };
13254            depth.increment()?;
13255            let envelope_size = 8;
13256            let bytes_len = len * envelope_size;
13257            let offset = decoder.out_of_line_offset(bytes_len)?;
13258            // Decode the envelope for each type.
13259            let mut _next_ordinal_to_read = 0;
13260            let mut next_offset = offset;
13261            let end_offset = offset + bytes_len;
13262            _next_ordinal_to_read += 1;
13263            if next_offset >= end_offset {
13264                return Ok(());
13265            }
13266
13267            // Decode unknown envelopes for gaps in ordinals.
13268            while _next_ordinal_to_read < 1 {
13269                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13270                _next_ordinal_to_read += 1;
13271                next_offset += envelope_size;
13272            }
13273
13274            let next_out_of_line = decoder.next_out_of_line();
13275            let handles_before = decoder.remaining_handles();
13276            if let Some((inlined, num_bytes, num_handles)) =
13277                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13278            {
13279                let member_inline_size =
13280                    <InstanceToken as fidl::encoding::TypeMarker>::inline_size(decoder.context);
13281                if inlined != (member_inline_size <= 4) {
13282                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13283                }
13284                let inner_offset;
13285                let mut inner_depth = depth.clone();
13286                if inlined {
13287                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13288                    inner_offset = next_offset;
13289                } else {
13290                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13291                    inner_depth.increment()?;
13292                }
13293                let val_ref = self.requesting.get_or_insert_with(|| {
13294                    fidl::new_empty!(InstanceToken, fidl::encoding::DefaultFuchsiaResourceDialect)
13295                });
13296                fidl::decode!(
13297                    InstanceToken,
13298                    fidl::encoding::DefaultFuchsiaResourceDialect,
13299                    val_ref,
13300                    decoder,
13301                    inner_offset,
13302                    inner_depth
13303                )?;
13304                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13305                {
13306                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13307                }
13308                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13309                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13310                }
13311            }
13312
13313            next_offset += envelope_size;
13314            _next_ordinal_to_read += 1;
13315            if next_offset >= end_offset {
13316                return Ok(());
13317            }
13318
13319            // Decode unknown envelopes for gaps in ordinals.
13320            while _next_ordinal_to_read < 2 {
13321                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13322                _next_ordinal_to_read += 1;
13323                next_offset += envelope_size;
13324            }
13325
13326            let next_out_of_line = decoder.next_out_of_line();
13327            let handles_before = decoder.remaining_handles();
13328            if let Some((inlined, num_bytes, num_handles)) =
13329                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13330            {
13331                let member_inline_size =
13332                    <DictionaryRef as fidl::encoding::TypeMarker>::inline_size(decoder.context);
13333                if inlined != (member_inline_size <= 4) {
13334                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13335                }
13336                let inner_offset;
13337                let mut inner_depth = depth.clone();
13338                if inlined {
13339                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13340                    inner_offset = next_offset;
13341                } else {
13342                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13343                    inner_depth.increment()?;
13344                }
13345                let val_ref = self.metadata.get_or_insert_with(|| {
13346                    fidl::new_empty!(DictionaryRef, fidl::encoding::DefaultFuchsiaResourceDialect)
13347                });
13348                fidl::decode!(
13349                    DictionaryRef,
13350                    fidl::encoding::DefaultFuchsiaResourceDialect,
13351                    val_ref,
13352                    decoder,
13353                    inner_offset,
13354                    inner_depth
13355                )?;
13356                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13357                {
13358                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13359                }
13360                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13361                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13362                }
13363            }
13364
13365            next_offset += envelope_size;
13366
13367            // Decode the remaining unknown envelopes.
13368            while next_offset < end_offset {
13369                _next_ordinal_to_read += 1;
13370                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13371                next_offset += envelope_size;
13372            }
13373
13374            Ok(())
13375        }
13376    }
13377
13378    impl fidl::encoding::ResourceTypeMarker for Capability {
13379        type Borrowed<'a> = &'a mut Self;
13380        fn take_or_borrow<'a>(
13381            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13382        ) -> Self::Borrowed<'a> {
13383            value
13384        }
13385    }
13386
13387    unsafe impl fidl::encoding::TypeMarker for Capability {
13388        type Owned = Self;
13389
13390        #[inline(always)]
13391        fn inline_align(_context: fidl::encoding::Context) -> usize {
13392            8
13393        }
13394
13395        #[inline(always)]
13396        fn inline_size(_context: fidl::encoding::Context) -> usize {
13397            16
13398        }
13399    }
13400
13401    unsafe impl fidl::encoding::Encode<Capability, fidl::encoding::DefaultFuchsiaResourceDialect>
13402        for &mut Capability
13403    {
13404        #[inline]
13405        unsafe fn encode(
13406            self,
13407            encoder: &mut fidl::encoding::Encoder<
13408                '_,
13409                fidl::encoding::DefaultFuchsiaResourceDialect,
13410            >,
13411            offset: usize,
13412            _depth: fidl::encoding::Depth,
13413        ) -> fidl::Result<()> {
13414            encoder.debug_check_bounds::<Capability>(offset);
13415            encoder.write_num::<u64>(self.ordinal(), offset);
13416            match self {
13417            Capability::Unit(ref val) => {
13418                fidl::encoding::encode_in_envelope::<Unit, fidl::encoding::DefaultFuchsiaResourceDialect>(
13419                    <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
13420                    encoder, offset + 8, _depth
13421                )
13422            }
13423            Capability::Handle(ref mut val) => {
13424                fidl::encoding::encode_in_envelope::<fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect>(
13425                    <fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
13426                    encoder, offset + 8, _depth
13427                )
13428            }
13429            Capability::Data(ref val) => {
13430                fidl::encoding::encode_in_envelope::<Data, fidl::encoding::DefaultFuchsiaResourceDialect>(
13431                    <Data as fidl::encoding::ValueTypeMarker>::borrow(val),
13432                    encoder, offset + 8, _depth
13433                )
13434            }
13435            Capability::Dictionary(ref mut val) => {
13436                fidl::encoding::encode_in_envelope::<DictionaryRef, fidl::encoding::DefaultFuchsiaResourceDialect>(
13437                    <DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
13438                    encoder, offset + 8, _depth
13439                )
13440            }
13441            Capability::Connector(ref mut val) => {
13442                fidl::encoding::encode_in_envelope::<Connector, fidl::encoding::DefaultFuchsiaResourceDialect>(
13443                    <Connector as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
13444                    encoder, offset + 8, _depth
13445                )
13446            }
13447            Capability::DirConnector(ref mut val) => {
13448                fidl::encoding::encode_in_envelope::<DirConnector, fidl::encoding::DefaultFuchsiaResourceDialect>(
13449                    <DirConnector as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
13450                    encoder, offset + 8, _depth
13451                )
13452            }
13453            Capability::Directory(ref mut val) => {
13454                fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
13455                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
13456                    encoder, offset + 8, _depth
13457                )
13458            }
13459            Capability::DirEntry(ref mut val) => {
13460                fidl::encoding::encode_in_envelope::<DirEntry, fidl::encoding::DefaultFuchsiaResourceDialect>(
13461                    <DirEntry as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
13462                    encoder, offset + 8, _depth
13463                )
13464            }
13465            Capability::ConnectorRouter(ref mut val) => {
13466                fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ConnectorRouterMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
13467                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ConnectorRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
13468                    encoder, offset + 8, _depth
13469                )
13470            }
13471            Capability::DictionaryRouter(ref mut val) => {
13472                fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DictionaryRouterMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
13473                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DictionaryRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
13474                    encoder, offset + 8, _depth
13475                )
13476            }
13477            Capability::DirEntryRouter(ref mut val) => {
13478                fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirEntryRouterMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
13479                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirEntryRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
13480                    encoder, offset + 8, _depth
13481                )
13482            }
13483            Capability::DataRouter(ref mut val) => {
13484                fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DataRouterMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
13485                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DataRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
13486                    encoder, offset + 8, _depth
13487                )
13488            }
13489            Capability::DirConnectorRouter(ref mut val) => {
13490                fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirConnectorRouterMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
13491                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirConnectorRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
13492                    encoder, offset + 8, _depth
13493                )
13494            }
13495            Capability::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
13496        }
13497        }
13498    }
13499
13500    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Capability {
13501        #[inline(always)]
13502        fn new_empty() -> Self {
13503            Self::__SourceBreaking { unknown_ordinal: 0 }
13504        }
13505
13506        #[inline]
13507        unsafe fn decode(
13508            &mut self,
13509            decoder: &mut fidl::encoding::Decoder<
13510                '_,
13511                fidl::encoding::DefaultFuchsiaResourceDialect,
13512            >,
13513            offset: usize,
13514            mut depth: fidl::encoding::Depth,
13515        ) -> fidl::Result<()> {
13516            decoder.debug_check_bounds::<Self>(offset);
13517            #[allow(unused_variables)]
13518            let next_out_of_line = decoder.next_out_of_line();
13519            let handles_before = decoder.remaining_handles();
13520            let (ordinal, inlined, num_bytes, num_handles) =
13521                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
13522
13523            let member_inline_size = match ordinal {
13524            1 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13525            2 => <fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13526            3 => <Data as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13527            4 => <DictionaryRef as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13528            5 => <Connector as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13529            6 => <DirConnector as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13530            7 => <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13531            8 => <DirEntry as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13532            9 => <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ConnectorRouterMarker>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13533            10 => <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DictionaryRouterMarker>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13534            11 => <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirEntryRouterMarker>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13535            12 => <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DataRouterMarker>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13536            13 => <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirConnectorRouterMarker>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13537            0 => return Err(fidl::Error::UnknownUnionTag),
13538            _ => num_bytes as usize,
13539        };
13540
13541            if inlined != (member_inline_size <= 4) {
13542                return Err(fidl::Error::InvalidInlineBitInEnvelope);
13543            }
13544            let _inner_offset;
13545            if inlined {
13546                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
13547                _inner_offset = offset + 8;
13548            } else {
13549                depth.increment()?;
13550                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13551            }
13552            match ordinal {
13553                1 => {
13554                    #[allow(irrefutable_let_patterns)]
13555                    if let Capability::Unit(_) = self {
13556                        // Do nothing, read the value into the object
13557                    } else {
13558                        // Initialize `self` to the right variant
13559                        *self = Capability::Unit(fidl::new_empty!(
13560                            Unit,
13561                            fidl::encoding::DefaultFuchsiaResourceDialect
13562                        ));
13563                    }
13564                    #[allow(irrefutable_let_patterns)]
13565                    if let Capability::Unit(ref mut val) = self {
13566                        fidl::decode!(
13567                            Unit,
13568                            fidl::encoding::DefaultFuchsiaResourceDialect,
13569                            val,
13570                            decoder,
13571                            _inner_offset,
13572                            depth
13573                        )?;
13574                    } else {
13575                        unreachable!()
13576                    }
13577                }
13578                2 => {
13579                    #[allow(irrefutable_let_patterns)]
13580                    if let Capability::Handle(_) = self {
13581                        // Do nothing, read the value into the object
13582                    } else {
13583                        // Initialize `self` to the right variant
13584                        *self = Capability::Handle(
13585                            fidl::new_empty!(fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
13586                        );
13587                    }
13588                    #[allow(irrefutable_let_patterns)]
13589                    if let Capability::Handle(ref mut val) = self {
13590                        fidl::decode!(fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val, decoder, _inner_offset, depth)?;
13591                    } else {
13592                        unreachable!()
13593                    }
13594                }
13595                3 => {
13596                    #[allow(irrefutable_let_patterns)]
13597                    if let Capability::Data(_) = self {
13598                        // Do nothing, read the value into the object
13599                    } else {
13600                        // Initialize `self` to the right variant
13601                        *self = Capability::Data(fidl::new_empty!(
13602                            Data,
13603                            fidl::encoding::DefaultFuchsiaResourceDialect
13604                        ));
13605                    }
13606                    #[allow(irrefutable_let_patterns)]
13607                    if let Capability::Data(ref mut val) = self {
13608                        fidl::decode!(
13609                            Data,
13610                            fidl::encoding::DefaultFuchsiaResourceDialect,
13611                            val,
13612                            decoder,
13613                            _inner_offset,
13614                            depth
13615                        )?;
13616                    } else {
13617                        unreachable!()
13618                    }
13619                }
13620                4 => {
13621                    #[allow(irrefutable_let_patterns)]
13622                    if let Capability::Dictionary(_) = self {
13623                        // Do nothing, read the value into the object
13624                    } else {
13625                        // Initialize `self` to the right variant
13626                        *self = Capability::Dictionary(fidl::new_empty!(
13627                            DictionaryRef,
13628                            fidl::encoding::DefaultFuchsiaResourceDialect
13629                        ));
13630                    }
13631                    #[allow(irrefutable_let_patterns)]
13632                    if let Capability::Dictionary(ref mut val) = self {
13633                        fidl::decode!(
13634                            DictionaryRef,
13635                            fidl::encoding::DefaultFuchsiaResourceDialect,
13636                            val,
13637                            decoder,
13638                            _inner_offset,
13639                            depth
13640                        )?;
13641                    } else {
13642                        unreachable!()
13643                    }
13644                }
13645                5 => {
13646                    #[allow(irrefutable_let_patterns)]
13647                    if let Capability::Connector(_) = self {
13648                        // Do nothing, read the value into the object
13649                    } else {
13650                        // Initialize `self` to the right variant
13651                        *self = Capability::Connector(fidl::new_empty!(
13652                            Connector,
13653                            fidl::encoding::DefaultFuchsiaResourceDialect
13654                        ));
13655                    }
13656                    #[allow(irrefutable_let_patterns)]
13657                    if let Capability::Connector(ref mut val) = self {
13658                        fidl::decode!(
13659                            Connector,
13660                            fidl::encoding::DefaultFuchsiaResourceDialect,
13661                            val,
13662                            decoder,
13663                            _inner_offset,
13664                            depth
13665                        )?;
13666                    } else {
13667                        unreachable!()
13668                    }
13669                }
13670                6 => {
13671                    #[allow(irrefutable_let_patterns)]
13672                    if let Capability::DirConnector(_) = self {
13673                        // Do nothing, read the value into the object
13674                    } else {
13675                        // Initialize `self` to the right variant
13676                        *self = Capability::DirConnector(fidl::new_empty!(
13677                            DirConnector,
13678                            fidl::encoding::DefaultFuchsiaResourceDialect
13679                        ));
13680                    }
13681                    #[allow(irrefutable_let_patterns)]
13682                    if let Capability::DirConnector(ref mut val) = self {
13683                        fidl::decode!(
13684                            DirConnector,
13685                            fidl::encoding::DefaultFuchsiaResourceDialect,
13686                            val,
13687                            decoder,
13688                            _inner_offset,
13689                            depth
13690                        )?;
13691                    } else {
13692                        unreachable!()
13693                    }
13694                }
13695                7 => {
13696                    #[allow(irrefutable_let_patterns)]
13697                    if let Capability::Directory(_) = self {
13698                        // Do nothing, read the value into the object
13699                    } else {
13700                        // Initialize `self` to the right variant
13701                        *self = Capability::Directory(fidl::new_empty!(
13702                            fidl::encoding::Endpoint<
13703                                fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
13704                            >,
13705                            fidl::encoding::DefaultFuchsiaResourceDialect
13706                        ));
13707                    }
13708                    #[allow(irrefutable_let_patterns)]
13709                    if let Capability::Directory(ref mut val) = self {
13710                        fidl::decode!(
13711                            fidl::encoding::Endpoint<
13712                                fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
13713                            >,
13714                            fidl::encoding::DefaultFuchsiaResourceDialect,
13715                            val,
13716                            decoder,
13717                            _inner_offset,
13718                            depth
13719                        )?;
13720                    } else {
13721                        unreachable!()
13722                    }
13723                }
13724                8 => {
13725                    #[allow(irrefutable_let_patterns)]
13726                    if let Capability::DirEntry(_) = self {
13727                        // Do nothing, read the value into the object
13728                    } else {
13729                        // Initialize `self` to the right variant
13730                        *self = Capability::DirEntry(fidl::new_empty!(
13731                            DirEntry,
13732                            fidl::encoding::DefaultFuchsiaResourceDialect
13733                        ));
13734                    }
13735                    #[allow(irrefutable_let_patterns)]
13736                    if let Capability::DirEntry(ref mut val) = self {
13737                        fidl::decode!(
13738                            DirEntry,
13739                            fidl::encoding::DefaultFuchsiaResourceDialect,
13740                            val,
13741                            decoder,
13742                            _inner_offset,
13743                            depth
13744                        )?;
13745                    } else {
13746                        unreachable!()
13747                    }
13748                }
13749                9 => {
13750                    #[allow(irrefutable_let_patterns)]
13751                    if let Capability::ConnectorRouter(_) = self {
13752                        // Do nothing, read the value into the object
13753                    } else {
13754                        // Initialize `self` to the right variant
13755                        *self = Capability::ConnectorRouter(fidl::new_empty!(
13756                            fidl::encoding::Endpoint<
13757                                fidl::endpoints::ClientEnd<ConnectorRouterMarker>,
13758                            >,
13759                            fidl::encoding::DefaultFuchsiaResourceDialect
13760                        ));
13761                    }
13762                    #[allow(irrefutable_let_patterns)]
13763                    if let Capability::ConnectorRouter(ref mut val) = self {
13764                        fidl::decode!(
13765                            fidl::encoding::Endpoint<
13766                                fidl::endpoints::ClientEnd<ConnectorRouterMarker>,
13767                            >,
13768                            fidl::encoding::DefaultFuchsiaResourceDialect,
13769                            val,
13770                            decoder,
13771                            _inner_offset,
13772                            depth
13773                        )?;
13774                    } else {
13775                        unreachable!()
13776                    }
13777                }
13778                10 => {
13779                    #[allow(irrefutable_let_patterns)]
13780                    if let Capability::DictionaryRouter(_) = self {
13781                        // Do nothing, read the value into the object
13782                    } else {
13783                        // Initialize `self` to the right variant
13784                        *self = Capability::DictionaryRouter(fidl::new_empty!(
13785                            fidl::encoding::Endpoint<
13786                                fidl::endpoints::ClientEnd<DictionaryRouterMarker>,
13787                            >,
13788                            fidl::encoding::DefaultFuchsiaResourceDialect
13789                        ));
13790                    }
13791                    #[allow(irrefutable_let_patterns)]
13792                    if let Capability::DictionaryRouter(ref mut val) = self {
13793                        fidl::decode!(
13794                            fidl::encoding::Endpoint<
13795                                fidl::endpoints::ClientEnd<DictionaryRouterMarker>,
13796                            >,
13797                            fidl::encoding::DefaultFuchsiaResourceDialect,
13798                            val,
13799                            decoder,
13800                            _inner_offset,
13801                            depth
13802                        )?;
13803                    } else {
13804                        unreachable!()
13805                    }
13806                }
13807                11 => {
13808                    #[allow(irrefutable_let_patterns)]
13809                    if let Capability::DirEntryRouter(_) = self {
13810                        // Do nothing, read the value into the object
13811                    } else {
13812                        // Initialize `self` to the right variant
13813                        *self = Capability::DirEntryRouter(fidl::new_empty!(
13814                            fidl::encoding::Endpoint<
13815                                fidl::endpoints::ClientEnd<DirEntryRouterMarker>,
13816                            >,
13817                            fidl::encoding::DefaultFuchsiaResourceDialect
13818                        ));
13819                    }
13820                    #[allow(irrefutable_let_patterns)]
13821                    if let Capability::DirEntryRouter(ref mut val) = self {
13822                        fidl::decode!(
13823                            fidl::encoding::Endpoint<
13824                                fidl::endpoints::ClientEnd<DirEntryRouterMarker>,
13825                            >,
13826                            fidl::encoding::DefaultFuchsiaResourceDialect,
13827                            val,
13828                            decoder,
13829                            _inner_offset,
13830                            depth
13831                        )?;
13832                    } else {
13833                        unreachable!()
13834                    }
13835                }
13836                12 => {
13837                    #[allow(irrefutable_let_patterns)]
13838                    if let Capability::DataRouter(_) = self {
13839                        // Do nothing, read the value into the object
13840                    } else {
13841                        // Initialize `self` to the right variant
13842                        *self = Capability::DataRouter(fidl::new_empty!(
13843                            fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DataRouterMarker>>,
13844                            fidl::encoding::DefaultFuchsiaResourceDialect
13845                        ));
13846                    }
13847                    #[allow(irrefutable_let_patterns)]
13848                    if let Capability::DataRouter(ref mut val) = self {
13849                        fidl::decode!(
13850                            fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DataRouterMarker>>,
13851                            fidl::encoding::DefaultFuchsiaResourceDialect,
13852                            val,
13853                            decoder,
13854                            _inner_offset,
13855                            depth
13856                        )?;
13857                    } else {
13858                        unreachable!()
13859                    }
13860                }
13861                13 => {
13862                    #[allow(irrefutable_let_patterns)]
13863                    if let Capability::DirConnectorRouter(_) = self {
13864                        // Do nothing, read the value into the object
13865                    } else {
13866                        // Initialize `self` to the right variant
13867                        *self = Capability::DirConnectorRouter(fidl::new_empty!(
13868                            fidl::encoding::Endpoint<
13869                                fidl::endpoints::ClientEnd<DirConnectorRouterMarker>,
13870                            >,
13871                            fidl::encoding::DefaultFuchsiaResourceDialect
13872                        ));
13873                    }
13874                    #[allow(irrefutable_let_patterns)]
13875                    if let Capability::DirConnectorRouter(ref mut val) = self {
13876                        fidl::decode!(
13877                            fidl::encoding::Endpoint<
13878                                fidl::endpoints::ClientEnd<DirConnectorRouterMarker>,
13879                            >,
13880                            fidl::encoding::DefaultFuchsiaResourceDialect,
13881                            val,
13882                            decoder,
13883                            _inner_offset,
13884                            depth
13885                        )?;
13886                    } else {
13887                        unreachable!()
13888                    }
13889                }
13890                #[allow(deprecated)]
13891                ordinal => {
13892                    for _ in 0..num_handles {
13893                        decoder.drop_next_handle()?;
13894                    }
13895                    *self = Capability::__SourceBreaking { unknown_ordinal: ordinal };
13896                }
13897            }
13898            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
13899                return Err(fidl::Error::InvalidNumBytesInEnvelope);
13900            }
13901            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13902                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13903            }
13904            Ok(())
13905        }
13906    }
13907
13908    impl fidl::encoding::ResourceTypeMarker for ConnectorRouterRouteResponse {
13909        type Borrowed<'a> = &'a mut Self;
13910        fn take_or_borrow<'a>(
13911            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13912        ) -> Self::Borrowed<'a> {
13913            value
13914        }
13915    }
13916
13917    unsafe impl fidl::encoding::TypeMarker for ConnectorRouterRouteResponse {
13918        type Owned = Self;
13919
13920        #[inline(always)]
13921        fn inline_align(_context: fidl::encoding::Context) -> usize {
13922            8
13923        }
13924
13925        #[inline(always)]
13926        fn inline_size(_context: fidl::encoding::Context) -> usize {
13927            16
13928        }
13929    }
13930
13931    unsafe impl
13932        fidl::encoding::Encode<
13933            ConnectorRouterRouteResponse,
13934            fidl::encoding::DefaultFuchsiaResourceDialect,
13935        > for &mut ConnectorRouterRouteResponse
13936    {
13937        #[inline]
13938        unsafe fn encode(
13939            self,
13940            encoder: &mut fidl::encoding::Encoder<
13941                '_,
13942                fidl::encoding::DefaultFuchsiaResourceDialect,
13943            >,
13944            offset: usize,
13945            _depth: fidl::encoding::Depth,
13946        ) -> fidl::Result<()> {
13947            encoder.debug_check_bounds::<ConnectorRouterRouteResponse>(offset);
13948            encoder.write_num::<u64>(self.ordinal(), offset);
13949            match self {
13950                ConnectorRouterRouteResponse::Connector(ref mut val) => {
13951                    fidl::encoding::encode_in_envelope::<
13952                        Connector,
13953                        fidl::encoding::DefaultFuchsiaResourceDialect,
13954                    >(
13955                        <Connector as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
13956                        encoder,
13957                        offset + 8,
13958                        _depth,
13959                    )
13960                }
13961                ConnectorRouterRouteResponse::Unavailable(ref val) => {
13962                    fidl::encoding::encode_in_envelope::<
13963                        Unit,
13964                        fidl::encoding::DefaultFuchsiaResourceDialect,
13965                    >(
13966                        <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
13967                        encoder,
13968                        offset + 8,
13969                        _depth,
13970                    )
13971                }
13972            }
13973        }
13974    }
13975
13976    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13977        for ConnectorRouterRouteResponse
13978    {
13979        #[inline(always)]
13980        fn new_empty() -> Self {
13981            Self::Connector(fidl::new_empty!(
13982                Connector,
13983                fidl::encoding::DefaultFuchsiaResourceDialect
13984            ))
13985        }
13986
13987        #[inline]
13988        unsafe fn decode(
13989            &mut self,
13990            decoder: &mut fidl::encoding::Decoder<
13991                '_,
13992                fidl::encoding::DefaultFuchsiaResourceDialect,
13993            >,
13994            offset: usize,
13995            mut depth: fidl::encoding::Depth,
13996        ) -> fidl::Result<()> {
13997            decoder.debug_check_bounds::<Self>(offset);
13998            #[allow(unused_variables)]
13999            let next_out_of_line = decoder.next_out_of_line();
14000            let handles_before = decoder.remaining_handles();
14001            let (ordinal, inlined, num_bytes, num_handles) =
14002                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
14003
14004            let member_inline_size = match ordinal {
14005                1 => <Connector as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14006                2 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14007                _ => return Err(fidl::Error::UnknownUnionTag),
14008            };
14009
14010            if inlined != (member_inline_size <= 4) {
14011                return Err(fidl::Error::InvalidInlineBitInEnvelope);
14012            }
14013            let _inner_offset;
14014            if inlined {
14015                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
14016                _inner_offset = offset + 8;
14017            } else {
14018                depth.increment()?;
14019                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14020            }
14021            match ordinal {
14022                1 => {
14023                    #[allow(irrefutable_let_patterns)]
14024                    if let ConnectorRouterRouteResponse::Connector(_) = self {
14025                        // Do nothing, read the value into the object
14026                    } else {
14027                        // Initialize `self` to the right variant
14028                        *self = ConnectorRouterRouteResponse::Connector(fidl::new_empty!(
14029                            Connector,
14030                            fidl::encoding::DefaultFuchsiaResourceDialect
14031                        ));
14032                    }
14033                    #[allow(irrefutable_let_patterns)]
14034                    if let ConnectorRouterRouteResponse::Connector(ref mut val) = self {
14035                        fidl::decode!(
14036                            Connector,
14037                            fidl::encoding::DefaultFuchsiaResourceDialect,
14038                            val,
14039                            decoder,
14040                            _inner_offset,
14041                            depth
14042                        )?;
14043                    } else {
14044                        unreachable!()
14045                    }
14046                }
14047                2 => {
14048                    #[allow(irrefutable_let_patterns)]
14049                    if let ConnectorRouterRouteResponse::Unavailable(_) = self {
14050                        // Do nothing, read the value into the object
14051                    } else {
14052                        // Initialize `self` to the right variant
14053                        *self = ConnectorRouterRouteResponse::Unavailable(fidl::new_empty!(
14054                            Unit,
14055                            fidl::encoding::DefaultFuchsiaResourceDialect
14056                        ));
14057                    }
14058                    #[allow(irrefutable_let_patterns)]
14059                    if let ConnectorRouterRouteResponse::Unavailable(ref mut val) = self {
14060                        fidl::decode!(
14061                            Unit,
14062                            fidl::encoding::DefaultFuchsiaResourceDialect,
14063                            val,
14064                            decoder,
14065                            _inner_offset,
14066                            depth
14067                        )?;
14068                    } else {
14069                        unreachable!()
14070                    }
14071                }
14072                ordinal => panic!("unexpected ordinal {:?}", ordinal),
14073            }
14074            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
14075                return Err(fidl::Error::InvalidNumBytesInEnvelope);
14076            }
14077            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14078                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14079            }
14080            Ok(())
14081        }
14082    }
14083
14084    impl fidl::encoding::ResourceTypeMarker for DataRouterRouteResponse {
14085        type Borrowed<'a> = &'a mut Self;
14086        fn take_or_borrow<'a>(
14087            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14088        ) -> Self::Borrowed<'a> {
14089            value
14090        }
14091    }
14092
14093    unsafe impl fidl::encoding::TypeMarker for DataRouterRouteResponse {
14094        type Owned = Self;
14095
14096        #[inline(always)]
14097        fn inline_align(_context: fidl::encoding::Context) -> usize {
14098            8
14099        }
14100
14101        #[inline(always)]
14102        fn inline_size(_context: fidl::encoding::Context) -> usize {
14103            16
14104        }
14105    }
14106
14107    unsafe impl
14108        fidl::encoding::Encode<
14109            DataRouterRouteResponse,
14110            fidl::encoding::DefaultFuchsiaResourceDialect,
14111        > for &mut DataRouterRouteResponse
14112    {
14113        #[inline]
14114        unsafe fn encode(
14115            self,
14116            encoder: &mut fidl::encoding::Encoder<
14117                '_,
14118                fidl::encoding::DefaultFuchsiaResourceDialect,
14119            >,
14120            offset: usize,
14121            _depth: fidl::encoding::Depth,
14122        ) -> fidl::Result<()> {
14123            encoder.debug_check_bounds::<DataRouterRouteResponse>(offset);
14124            encoder.write_num::<u64>(self.ordinal(), offset);
14125            match self {
14126                DataRouterRouteResponse::Data(ref val) => fidl::encoding::encode_in_envelope::<
14127                    Data,
14128                    fidl::encoding::DefaultFuchsiaResourceDialect,
14129                >(
14130                    <Data as fidl::encoding::ValueTypeMarker>::borrow(val),
14131                    encoder,
14132                    offset + 8,
14133                    _depth,
14134                ),
14135                DataRouterRouteResponse::Unavailable(ref val) => {
14136                    fidl::encoding::encode_in_envelope::<
14137                        Unit,
14138                        fidl::encoding::DefaultFuchsiaResourceDialect,
14139                    >(
14140                        <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
14141                        encoder,
14142                        offset + 8,
14143                        _depth,
14144                    )
14145                }
14146            }
14147        }
14148    }
14149
14150    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14151        for DataRouterRouteResponse
14152    {
14153        #[inline(always)]
14154        fn new_empty() -> Self {
14155            Self::Data(fidl::new_empty!(Data, fidl::encoding::DefaultFuchsiaResourceDialect))
14156        }
14157
14158        #[inline]
14159        unsafe fn decode(
14160            &mut self,
14161            decoder: &mut fidl::encoding::Decoder<
14162                '_,
14163                fidl::encoding::DefaultFuchsiaResourceDialect,
14164            >,
14165            offset: usize,
14166            mut depth: fidl::encoding::Depth,
14167        ) -> fidl::Result<()> {
14168            decoder.debug_check_bounds::<Self>(offset);
14169            #[allow(unused_variables)]
14170            let next_out_of_line = decoder.next_out_of_line();
14171            let handles_before = decoder.remaining_handles();
14172            let (ordinal, inlined, num_bytes, num_handles) =
14173                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
14174
14175            let member_inline_size = match ordinal {
14176                1 => <Data as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14177                2 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14178                _ => return Err(fidl::Error::UnknownUnionTag),
14179            };
14180
14181            if inlined != (member_inline_size <= 4) {
14182                return Err(fidl::Error::InvalidInlineBitInEnvelope);
14183            }
14184            let _inner_offset;
14185            if inlined {
14186                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
14187                _inner_offset = offset + 8;
14188            } else {
14189                depth.increment()?;
14190                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14191            }
14192            match ordinal {
14193                1 => {
14194                    #[allow(irrefutable_let_patterns)]
14195                    if let DataRouterRouteResponse::Data(_) = self {
14196                        // Do nothing, read the value into the object
14197                    } else {
14198                        // Initialize `self` to the right variant
14199                        *self = DataRouterRouteResponse::Data(fidl::new_empty!(
14200                            Data,
14201                            fidl::encoding::DefaultFuchsiaResourceDialect
14202                        ));
14203                    }
14204                    #[allow(irrefutable_let_patterns)]
14205                    if let DataRouterRouteResponse::Data(ref mut val) = self {
14206                        fidl::decode!(
14207                            Data,
14208                            fidl::encoding::DefaultFuchsiaResourceDialect,
14209                            val,
14210                            decoder,
14211                            _inner_offset,
14212                            depth
14213                        )?;
14214                    } else {
14215                        unreachable!()
14216                    }
14217                }
14218                2 => {
14219                    #[allow(irrefutable_let_patterns)]
14220                    if let DataRouterRouteResponse::Unavailable(_) = self {
14221                        // Do nothing, read the value into the object
14222                    } else {
14223                        // Initialize `self` to the right variant
14224                        *self = DataRouterRouteResponse::Unavailable(fidl::new_empty!(
14225                            Unit,
14226                            fidl::encoding::DefaultFuchsiaResourceDialect
14227                        ));
14228                    }
14229                    #[allow(irrefutable_let_patterns)]
14230                    if let DataRouterRouteResponse::Unavailable(ref mut val) = self {
14231                        fidl::decode!(
14232                            Unit,
14233                            fidl::encoding::DefaultFuchsiaResourceDialect,
14234                            val,
14235                            decoder,
14236                            _inner_offset,
14237                            depth
14238                        )?;
14239                    } else {
14240                        unreachable!()
14241                    }
14242                }
14243                ordinal => panic!("unexpected ordinal {:?}", ordinal),
14244            }
14245            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
14246                return Err(fidl::Error::InvalidNumBytesInEnvelope);
14247            }
14248            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14249                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14250            }
14251            Ok(())
14252        }
14253    }
14254
14255    impl fidl::encoding::ResourceTypeMarker for DictionaryRouterRouteResponse {
14256        type Borrowed<'a> = &'a mut Self;
14257        fn take_or_borrow<'a>(
14258            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14259        ) -> Self::Borrowed<'a> {
14260            value
14261        }
14262    }
14263
14264    unsafe impl fidl::encoding::TypeMarker for DictionaryRouterRouteResponse {
14265        type Owned = Self;
14266
14267        #[inline(always)]
14268        fn inline_align(_context: fidl::encoding::Context) -> usize {
14269            8
14270        }
14271
14272        #[inline(always)]
14273        fn inline_size(_context: fidl::encoding::Context) -> usize {
14274            16
14275        }
14276    }
14277
14278    unsafe impl
14279        fidl::encoding::Encode<
14280            DictionaryRouterRouteResponse,
14281            fidl::encoding::DefaultFuchsiaResourceDialect,
14282        > for &mut DictionaryRouterRouteResponse
14283    {
14284        #[inline]
14285        unsafe fn encode(
14286            self,
14287            encoder: &mut fidl::encoding::Encoder<
14288                '_,
14289                fidl::encoding::DefaultFuchsiaResourceDialect,
14290            >,
14291            offset: usize,
14292            _depth: fidl::encoding::Depth,
14293        ) -> fidl::Result<()> {
14294            encoder.debug_check_bounds::<DictionaryRouterRouteResponse>(offset);
14295            encoder.write_num::<u64>(self.ordinal(), offset);
14296            match self {
14297                DictionaryRouterRouteResponse::Dictionary(ref mut val) => {
14298                    fidl::encoding::encode_in_envelope::<
14299                        DictionaryRef,
14300                        fidl::encoding::DefaultFuchsiaResourceDialect,
14301                    >(
14302                        <DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
14303                        encoder,
14304                        offset + 8,
14305                        _depth,
14306                    )
14307                }
14308                DictionaryRouterRouteResponse::Unavailable(ref val) => {
14309                    fidl::encoding::encode_in_envelope::<
14310                        Unit,
14311                        fidl::encoding::DefaultFuchsiaResourceDialect,
14312                    >(
14313                        <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
14314                        encoder,
14315                        offset + 8,
14316                        _depth,
14317                    )
14318                }
14319            }
14320        }
14321    }
14322
14323    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14324        for DictionaryRouterRouteResponse
14325    {
14326        #[inline(always)]
14327        fn new_empty() -> Self {
14328            Self::Dictionary(fidl::new_empty!(
14329                DictionaryRef,
14330                fidl::encoding::DefaultFuchsiaResourceDialect
14331            ))
14332        }
14333
14334        #[inline]
14335        unsafe fn decode(
14336            &mut self,
14337            decoder: &mut fidl::encoding::Decoder<
14338                '_,
14339                fidl::encoding::DefaultFuchsiaResourceDialect,
14340            >,
14341            offset: usize,
14342            mut depth: fidl::encoding::Depth,
14343        ) -> fidl::Result<()> {
14344            decoder.debug_check_bounds::<Self>(offset);
14345            #[allow(unused_variables)]
14346            let next_out_of_line = decoder.next_out_of_line();
14347            let handles_before = decoder.remaining_handles();
14348            let (ordinal, inlined, num_bytes, num_handles) =
14349                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
14350
14351            let member_inline_size = match ordinal {
14352                1 => <DictionaryRef as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14353                2 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14354                _ => return Err(fidl::Error::UnknownUnionTag),
14355            };
14356
14357            if inlined != (member_inline_size <= 4) {
14358                return Err(fidl::Error::InvalidInlineBitInEnvelope);
14359            }
14360            let _inner_offset;
14361            if inlined {
14362                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
14363                _inner_offset = offset + 8;
14364            } else {
14365                depth.increment()?;
14366                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14367            }
14368            match ordinal {
14369                1 => {
14370                    #[allow(irrefutable_let_patterns)]
14371                    if let DictionaryRouterRouteResponse::Dictionary(_) = self {
14372                        // Do nothing, read the value into the object
14373                    } else {
14374                        // Initialize `self` to the right variant
14375                        *self = DictionaryRouterRouteResponse::Dictionary(fidl::new_empty!(
14376                            DictionaryRef,
14377                            fidl::encoding::DefaultFuchsiaResourceDialect
14378                        ));
14379                    }
14380                    #[allow(irrefutable_let_patterns)]
14381                    if let DictionaryRouterRouteResponse::Dictionary(ref mut val) = self {
14382                        fidl::decode!(
14383                            DictionaryRef,
14384                            fidl::encoding::DefaultFuchsiaResourceDialect,
14385                            val,
14386                            decoder,
14387                            _inner_offset,
14388                            depth
14389                        )?;
14390                    } else {
14391                        unreachable!()
14392                    }
14393                }
14394                2 => {
14395                    #[allow(irrefutable_let_patterns)]
14396                    if let DictionaryRouterRouteResponse::Unavailable(_) = self {
14397                        // Do nothing, read the value into the object
14398                    } else {
14399                        // Initialize `self` to the right variant
14400                        *self = DictionaryRouterRouteResponse::Unavailable(fidl::new_empty!(
14401                            Unit,
14402                            fidl::encoding::DefaultFuchsiaResourceDialect
14403                        ));
14404                    }
14405                    #[allow(irrefutable_let_patterns)]
14406                    if let DictionaryRouterRouteResponse::Unavailable(ref mut val) = self {
14407                        fidl::decode!(
14408                            Unit,
14409                            fidl::encoding::DefaultFuchsiaResourceDialect,
14410                            val,
14411                            decoder,
14412                            _inner_offset,
14413                            depth
14414                        )?;
14415                    } else {
14416                        unreachable!()
14417                    }
14418                }
14419                ordinal => panic!("unexpected ordinal {:?}", ordinal),
14420            }
14421            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
14422                return Err(fidl::Error::InvalidNumBytesInEnvelope);
14423            }
14424            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14425                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14426            }
14427            Ok(())
14428        }
14429    }
14430
14431    impl fidl::encoding::ResourceTypeMarker for DirConnectorRouterRouteResponse {
14432        type Borrowed<'a> = &'a mut Self;
14433        fn take_or_borrow<'a>(
14434            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14435        ) -> Self::Borrowed<'a> {
14436            value
14437        }
14438    }
14439
14440    unsafe impl fidl::encoding::TypeMarker for DirConnectorRouterRouteResponse {
14441        type Owned = Self;
14442
14443        #[inline(always)]
14444        fn inline_align(_context: fidl::encoding::Context) -> usize {
14445            8
14446        }
14447
14448        #[inline(always)]
14449        fn inline_size(_context: fidl::encoding::Context) -> usize {
14450            16
14451        }
14452    }
14453
14454    unsafe impl
14455        fidl::encoding::Encode<
14456            DirConnectorRouterRouteResponse,
14457            fidl::encoding::DefaultFuchsiaResourceDialect,
14458        > for &mut DirConnectorRouterRouteResponse
14459    {
14460        #[inline]
14461        unsafe fn encode(
14462            self,
14463            encoder: &mut fidl::encoding::Encoder<
14464                '_,
14465                fidl::encoding::DefaultFuchsiaResourceDialect,
14466            >,
14467            offset: usize,
14468            _depth: fidl::encoding::Depth,
14469        ) -> fidl::Result<()> {
14470            encoder.debug_check_bounds::<DirConnectorRouterRouteResponse>(offset);
14471            encoder.write_num::<u64>(self.ordinal(), offset);
14472            match self {
14473                DirConnectorRouterRouteResponse::DirConnector(ref mut val) => {
14474                    fidl::encoding::encode_in_envelope::<
14475                        DirConnector,
14476                        fidl::encoding::DefaultFuchsiaResourceDialect,
14477                    >(
14478                        <DirConnector as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
14479                        encoder,
14480                        offset + 8,
14481                        _depth,
14482                    )
14483                }
14484                DirConnectorRouterRouteResponse::Unavailable(ref val) => {
14485                    fidl::encoding::encode_in_envelope::<
14486                        Unit,
14487                        fidl::encoding::DefaultFuchsiaResourceDialect,
14488                    >(
14489                        <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
14490                        encoder,
14491                        offset + 8,
14492                        _depth,
14493                    )
14494                }
14495            }
14496        }
14497    }
14498
14499    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14500        for DirConnectorRouterRouteResponse
14501    {
14502        #[inline(always)]
14503        fn new_empty() -> Self {
14504            Self::DirConnector(fidl::new_empty!(
14505                DirConnector,
14506                fidl::encoding::DefaultFuchsiaResourceDialect
14507            ))
14508        }
14509
14510        #[inline]
14511        unsafe fn decode(
14512            &mut self,
14513            decoder: &mut fidl::encoding::Decoder<
14514                '_,
14515                fidl::encoding::DefaultFuchsiaResourceDialect,
14516            >,
14517            offset: usize,
14518            mut depth: fidl::encoding::Depth,
14519        ) -> fidl::Result<()> {
14520            decoder.debug_check_bounds::<Self>(offset);
14521            #[allow(unused_variables)]
14522            let next_out_of_line = decoder.next_out_of_line();
14523            let handles_before = decoder.remaining_handles();
14524            let (ordinal, inlined, num_bytes, num_handles) =
14525                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
14526
14527            let member_inline_size = match ordinal {
14528                1 => <DirConnector as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14529                2 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14530                _ => return Err(fidl::Error::UnknownUnionTag),
14531            };
14532
14533            if inlined != (member_inline_size <= 4) {
14534                return Err(fidl::Error::InvalidInlineBitInEnvelope);
14535            }
14536            let _inner_offset;
14537            if inlined {
14538                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
14539                _inner_offset = offset + 8;
14540            } else {
14541                depth.increment()?;
14542                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14543            }
14544            match ordinal {
14545                1 => {
14546                    #[allow(irrefutable_let_patterns)]
14547                    if let DirConnectorRouterRouteResponse::DirConnector(_) = self {
14548                        // Do nothing, read the value into the object
14549                    } else {
14550                        // Initialize `self` to the right variant
14551                        *self = DirConnectorRouterRouteResponse::DirConnector(fidl::new_empty!(
14552                            DirConnector,
14553                            fidl::encoding::DefaultFuchsiaResourceDialect
14554                        ));
14555                    }
14556                    #[allow(irrefutable_let_patterns)]
14557                    if let DirConnectorRouterRouteResponse::DirConnector(ref mut val) = self {
14558                        fidl::decode!(
14559                            DirConnector,
14560                            fidl::encoding::DefaultFuchsiaResourceDialect,
14561                            val,
14562                            decoder,
14563                            _inner_offset,
14564                            depth
14565                        )?;
14566                    } else {
14567                        unreachable!()
14568                    }
14569                }
14570                2 => {
14571                    #[allow(irrefutable_let_patterns)]
14572                    if let DirConnectorRouterRouteResponse::Unavailable(_) = self {
14573                        // Do nothing, read the value into the object
14574                    } else {
14575                        // Initialize `self` to the right variant
14576                        *self = DirConnectorRouterRouteResponse::Unavailable(fidl::new_empty!(
14577                            Unit,
14578                            fidl::encoding::DefaultFuchsiaResourceDialect
14579                        ));
14580                    }
14581                    #[allow(irrefutable_let_patterns)]
14582                    if let DirConnectorRouterRouteResponse::Unavailable(ref mut val) = self {
14583                        fidl::decode!(
14584                            Unit,
14585                            fidl::encoding::DefaultFuchsiaResourceDialect,
14586                            val,
14587                            decoder,
14588                            _inner_offset,
14589                            depth
14590                        )?;
14591                    } else {
14592                        unreachable!()
14593                    }
14594                }
14595                ordinal => panic!("unexpected ordinal {:?}", ordinal),
14596            }
14597            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
14598                return Err(fidl::Error::InvalidNumBytesInEnvelope);
14599            }
14600            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14601                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14602            }
14603            Ok(())
14604        }
14605    }
14606
14607    impl fidl::encoding::ResourceTypeMarker for DirEntryRouterRouteResponse {
14608        type Borrowed<'a> = &'a mut Self;
14609        fn take_or_borrow<'a>(
14610            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14611        ) -> Self::Borrowed<'a> {
14612            value
14613        }
14614    }
14615
14616    unsafe impl fidl::encoding::TypeMarker for DirEntryRouterRouteResponse {
14617        type Owned = Self;
14618
14619        #[inline(always)]
14620        fn inline_align(_context: fidl::encoding::Context) -> usize {
14621            8
14622        }
14623
14624        #[inline(always)]
14625        fn inline_size(_context: fidl::encoding::Context) -> usize {
14626            16
14627        }
14628    }
14629
14630    unsafe impl
14631        fidl::encoding::Encode<
14632            DirEntryRouterRouteResponse,
14633            fidl::encoding::DefaultFuchsiaResourceDialect,
14634        > for &mut DirEntryRouterRouteResponse
14635    {
14636        #[inline]
14637        unsafe fn encode(
14638            self,
14639            encoder: &mut fidl::encoding::Encoder<
14640                '_,
14641                fidl::encoding::DefaultFuchsiaResourceDialect,
14642            >,
14643            offset: usize,
14644            _depth: fidl::encoding::Depth,
14645        ) -> fidl::Result<()> {
14646            encoder.debug_check_bounds::<DirEntryRouterRouteResponse>(offset);
14647            encoder.write_num::<u64>(self.ordinal(), offset);
14648            match self {
14649                DirEntryRouterRouteResponse::DirEntry(ref mut val) => {
14650                    fidl::encoding::encode_in_envelope::<
14651                        DirEntry,
14652                        fidl::encoding::DefaultFuchsiaResourceDialect,
14653                    >(
14654                        <DirEntry as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
14655                        encoder,
14656                        offset + 8,
14657                        _depth,
14658                    )
14659                }
14660                DirEntryRouterRouteResponse::Unavailable(ref val) => {
14661                    fidl::encoding::encode_in_envelope::<
14662                        Unit,
14663                        fidl::encoding::DefaultFuchsiaResourceDialect,
14664                    >(
14665                        <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
14666                        encoder,
14667                        offset + 8,
14668                        _depth,
14669                    )
14670                }
14671            }
14672        }
14673    }
14674
14675    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14676        for DirEntryRouterRouteResponse
14677    {
14678        #[inline(always)]
14679        fn new_empty() -> Self {
14680            Self::DirEntry(fidl::new_empty!(
14681                DirEntry,
14682                fidl::encoding::DefaultFuchsiaResourceDialect
14683            ))
14684        }
14685
14686        #[inline]
14687        unsafe fn decode(
14688            &mut self,
14689            decoder: &mut fidl::encoding::Decoder<
14690                '_,
14691                fidl::encoding::DefaultFuchsiaResourceDialect,
14692            >,
14693            offset: usize,
14694            mut depth: fidl::encoding::Depth,
14695        ) -> fidl::Result<()> {
14696            decoder.debug_check_bounds::<Self>(offset);
14697            #[allow(unused_variables)]
14698            let next_out_of_line = decoder.next_out_of_line();
14699            let handles_before = decoder.remaining_handles();
14700            let (ordinal, inlined, num_bytes, num_handles) =
14701                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
14702
14703            let member_inline_size = match ordinal {
14704                1 => <DirEntry as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14705                2 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14706                _ => return Err(fidl::Error::UnknownUnionTag),
14707            };
14708
14709            if inlined != (member_inline_size <= 4) {
14710                return Err(fidl::Error::InvalidInlineBitInEnvelope);
14711            }
14712            let _inner_offset;
14713            if inlined {
14714                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
14715                _inner_offset = offset + 8;
14716            } else {
14717                depth.increment()?;
14718                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14719            }
14720            match ordinal {
14721                1 => {
14722                    #[allow(irrefutable_let_patterns)]
14723                    if let DirEntryRouterRouteResponse::DirEntry(_) = self {
14724                        // Do nothing, read the value into the object
14725                    } else {
14726                        // Initialize `self` to the right variant
14727                        *self = DirEntryRouterRouteResponse::DirEntry(fidl::new_empty!(
14728                            DirEntry,
14729                            fidl::encoding::DefaultFuchsiaResourceDialect
14730                        ));
14731                    }
14732                    #[allow(irrefutable_let_patterns)]
14733                    if let DirEntryRouterRouteResponse::DirEntry(ref mut val) = self {
14734                        fidl::decode!(
14735                            DirEntry,
14736                            fidl::encoding::DefaultFuchsiaResourceDialect,
14737                            val,
14738                            decoder,
14739                            _inner_offset,
14740                            depth
14741                        )?;
14742                    } else {
14743                        unreachable!()
14744                    }
14745                }
14746                2 => {
14747                    #[allow(irrefutable_let_patterns)]
14748                    if let DirEntryRouterRouteResponse::Unavailable(_) = self {
14749                        // Do nothing, read the value into the object
14750                    } else {
14751                        // Initialize `self` to the right variant
14752                        *self = DirEntryRouterRouteResponse::Unavailable(fidl::new_empty!(
14753                            Unit,
14754                            fidl::encoding::DefaultFuchsiaResourceDialect
14755                        ));
14756                    }
14757                    #[allow(irrefutable_let_patterns)]
14758                    if let DirEntryRouterRouteResponse::Unavailable(ref mut val) = self {
14759                        fidl::decode!(
14760                            Unit,
14761                            fidl::encoding::DefaultFuchsiaResourceDialect,
14762                            val,
14763                            decoder,
14764                            _inner_offset,
14765                            depth
14766                        )?;
14767                    } else {
14768                        unreachable!()
14769                    }
14770                }
14771                ordinal => panic!("unexpected ordinal {:?}", ordinal),
14772            }
14773            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
14774                return Err(fidl::Error::InvalidNumBytesInEnvelope);
14775            }
14776            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14777                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14778            }
14779            Ok(())
14780        }
14781    }
14782
14783    impl fidl::encoding::ResourceTypeMarker for DirectoryRouterRouteResponse {
14784        type Borrowed<'a> = &'a mut Self;
14785        fn take_or_borrow<'a>(
14786            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14787        ) -> Self::Borrowed<'a> {
14788            value
14789        }
14790    }
14791
14792    unsafe impl fidl::encoding::TypeMarker for DirectoryRouterRouteResponse {
14793        type Owned = Self;
14794
14795        #[inline(always)]
14796        fn inline_align(_context: fidl::encoding::Context) -> usize {
14797            8
14798        }
14799
14800        #[inline(always)]
14801        fn inline_size(_context: fidl::encoding::Context) -> usize {
14802            16
14803        }
14804    }
14805
14806    unsafe impl
14807        fidl::encoding::Encode<
14808            DirectoryRouterRouteResponse,
14809            fidl::encoding::DefaultFuchsiaResourceDialect,
14810        > for &mut DirectoryRouterRouteResponse
14811    {
14812        #[inline]
14813        unsafe fn encode(
14814            self,
14815            encoder: &mut fidl::encoding::Encoder<
14816                '_,
14817                fidl::encoding::DefaultFuchsiaResourceDialect,
14818            >,
14819            offset: usize,
14820            _depth: fidl::encoding::Depth,
14821        ) -> fidl::Result<()> {
14822            encoder.debug_check_bounds::<DirectoryRouterRouteResponse>(offset);
14823            encoder.write_num::<u64>(self.ordinal(), offset);
14824            match self {
14825                DirectoryRouterRouteResponse::Directory(ref mut val) => {
14826                    fidl::encoding::encode_in_envelope::<
14827                        fidl::encoding::Endpoint<
14828                            fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
14829                        >,
14830                        fidl::encoding::DefaultFuchsiaResourceDialect,
14831                    >(
14832                        <fidl::encoding::Endpoint<
14833                            fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
14834                        > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
14835                            val
14836                        ),
14837                        encoder,
14838                        offset + 8,
14839                        _depth,
14840                    )
14841                }
14842                DirectoryRouterRouteResponse::Unavailable(ref val) => {
14843                    fidl::encoding::encode_in_envelope::<
14844                        Unit,
14845                        fidl::encoding::DefaultFuchsiaResourceDialect,
14846                    >(
14847                        <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
14848                        encoder,
14849                        offset + 8,
14850                        _depth,
14851                    )
14852                }
14853            }
14854        }
14855    }
14856
14857    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14858        for DirectoryRouterRouteResponse
14859    {
14860        #[inline(always)]
14861        fn new_empty() -> Self {
14862            Self::Directory(fidl::new_empty!(
14863                fidl::encoding::Endpoint<
14864                    fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
14865                >,
14866                fidl::encoding::DefaultFuchsiaResourceDialect
14867            ))
14868        }
14869
14870        #[inline]
14871        unsafe fn decode(
14872            &mut self,
14873            decoder: &mut fidl::encoding::Decoder<
14874                '_,
14875                fidl::encoding::DefaultFuchsiaResourceDialect,
14876            >,
14877            offset: usize,
14878            mut depth: fidl::encoding::Depth,
14879        ) -> fidl::Result<()> {
14880            decoder.debug_check_bounds::<Self>(offset);
14881            #[allow(unused_variables)]
14882            let next_out_of_line = decoder.next_out_of_line();
14883            let handles_before = decoder.remaining_handles();
14884            let (ordinal, inlined, num_bytes, num_handles) =
14885                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
14886
14887            let member_inline_size = match ordinal {
14888                1 => <fidl::encoding::Endpoint<
14889                    fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
14890                > as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14891                2 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14892                _ => return Err(fidl::Error::UnknownUnionTag),
14893            };
14894
14895            if inlined != (member_inline_size <= 4) {
14896                return Err(fidl::Error::InvalidInlineBitInEnvelope);
14897            }
14898            let _inner_offset;
14899            if inlined {
14900                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
14901                _inner_offset = offset + 8;
14902            } else {
14903                depth.increment()?;
14904                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14905            }
14906            match ordinal {
14907                1 => {
14908                    #[allow(irrefutable_let_patterns)]
14909                    if let DirectoryRouterRouteResponse::Directory(_) = self {
14910                        // Do nothing, read the value into the object
14911                    } else {
14912                        // Initialize `self` to the right variant
14913                        *self = DirectoryRouterRouteResponse::Directory(fidl::new_empty!(
14914                            fidl::encoding::Endpoint<
14915                                fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
14916                            >,
14917                            fidl::encoding::DefaultFuchsiaResourceDialect
14918                        ));
14919                    }
14920                    #[allow(irrefutable_let_patterns)]
14921                    if let DirectoryRouterRouteResponse::Directory(ref mut val) = self {
14922                        fidl::decode!(
14923                            fidl::encoding::Endpoint<
14924                                fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
14925                            >,
14926                            fidl::encoding::DefaultFuchsiaResourceDialect,
14927                            val,
14928                            decoder,
14929                            _inner_offset,
14930                            depth
14931                        )?;
14932                    } else {
14933                        unreachable!()
14934                    }
14935                }
14936                2 => {
14937                    #[allow(irrefutable_let_patterns)]
14938                    if let DirectoryRouterRouteResponse::Unavailable(_) = self {
14939                        // Do nothing, read the value into the object
14940                    } else {
14941                        // Initialize `self` to the right variant
14942                        *self = DirectoryRouterRouteResponse::Unavailable(fidl::new_empty!(
14943                            Unit,
14944                            fidl::encoding::DefaultFuchsiaResourceDialect
14945                        ));
14946                    }
14947                    #[allow(irrefutable_let_patterns)]
14948                    if let DirectoryRouterRouteResponse::Unavailable(ref mut val) = self {
14949                        fidl::decode!(
14950                            Unit,
14951                            fidl::encoding::DefaultFuchsiaResourceDialect,
14952                            val,
14953                            decoder,
14954                            _inner_offset,
14955                            depth
14956                        )?;
14957                    } else {
14958                        unreachable!()
14959                    }
14960                }
14961                ordinal => panic!("unexpected ordinal {:?}", ordinal),
14962            }
14963            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
14964                return Err(fidl::Error::InvalidNumBytesInEnvelope);
14965            }
14966            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14967                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14968            }
14969            Ok(())
14970        }
14971    }
14972}