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#[cfg(target_os = "fuchsia")]
1147impl fidl::endpoints::FromClient for CapabilityStoreSynchronousProxy {
1148    type Protocol = CapabilityStoreMarker;
1149
1150    fn from_client(value: fidl::endpoints::ClientEnd<CapabilityStoreMarker>) -> Self {
1151        Self::new(value.into_channel())
1152    }
1153}
1154
1155#[derive(Debug, Clone)]
1156pub struct CapabilityStoreProxy {
1157    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1158}
1159
1160impl fidl::endpoints::Proxy for CapabilityStoreProxy {
1161    type Protocol = CapabilityStoreMarker;
1162
1163    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1164        Self::new(inner)
1165    }
1166
1167    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1168        self.client.into_channel().map_err(|client| Self { client })
1169    }
1170
1171    fn as_channel(&self) -> &::fidl::AsyncChannel {
1172        self.client.as_channel()
1173    }
1174}
1175
1176impl CapabilityStoreProxy {
1177    /// Create a new Proxy for fuchsia.component.sandbox/CapabilityStore.
1178    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1179        let protocol_name = <CapabilityStoreMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1180        Self { client: fidl::client::Client::new(channel, protocol_name) }
1181    }
1182
1183    /// Get a Stream of events from the remote end of the protocol.
1184    ///
1185    /// # Panics
1186    ///
1187    /// Panics if the event stream was already taken.
1188    pub fn take_event_stream(&self) -> CapabilityStoreEventStream {
1189        CapabilityStoreEventStream { event_receiver: self.client.take_event_receiver() }
1190    }
1191
1192    /// Duplicates the capability with `id` to `dest_id`.
1193    ///
1194    /// Errors:
1195    ///
1196    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1197    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
1198    /// - `NOT_DUPLICATABLE` if `id` could not be duplicated.
1199    pub fn r#duplicate(
1200        &self,
1201        mut id: u64,
1202        mut dest_id: u64,
1203    ) -> fidl::client::QueryResponseFut<
1204        CapabilityStoreDuplicateResult,
1205        fidl::encoding::DefaultFuchsiaResourceDialect,
1206    > {
1207        CapabilityStoreProxyInterface::r#duplicate(self, id, dest_id)
1208    }
1209
1210    /// Drops the capability with `id` from this [`CapabilityStore`].
1211    ///
1212    /// Errors:
1213    ///
1214    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1215    pub fn r#drop(
1216        &self,
1217        mut id: u64,
1218    ) -> fidl::client::QueryResponseFut<
1219        CapabilityStoreDropResult,
1220        fidl::encoding::DefaultFuchsiaResourceDialect,
1221    > {
1222        CapabilityStoreProxyInterface::r#drop(self, id)
1223    }
1224
1225    /// Exports the capability with the client-assigned identifier `id` to
1226    /// `capability`. This operation removes the capability from the store. If
1227    /// this is not desired, [Duplicate] the capability first.
1228    ///
1229    /// Errors:
1230    ///
1231    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1232    pub fn r#export(
1233        &self,
1234        mut id: u64,
1235    ) -> fidl::client::QueryResponseFut<
1236        CapabilityStoreExportResult,
1237        fidl::encoding::DefaultFuchsiaResourceDialect,
1238    > {
1239        CapabilityStoreProxyInterface::r#export(self, id)
1240    }
1241
1242    /// Imports `capability` into this store with the client-assigned `id`.
1243    ///
1244    /// Errors:
1245    ///
1246    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
1247    /// - `BAD_CAPABILITY` if `capability` was not a valid [Capability].
1248    pub fn r#import(
1249        &self,
1250        mut id: u64,
1251        mut capability: Capability,
1252    ) -> fidl::client::QueryResponseFut<
1253        CapabilityStoreImportResult,
1254        fidl::encoding::DefaultFuchsiaResourceDialect,
1255    > {
1256        CapabilityStoreProxyInterface::r#import(self, id, capability)
1257    }
1258
1259    /// Creates a [Connector] from a [Receiver]. Incoming connections to the [Connector] will be
1260    /// dispatched to this [Receiver].
1261    ///
1262    /// Errors:
1263    ///
1264    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
1265    pub fn r#connector_create(
1266        &self,
1267        mut id: u64,
1268        mut receiver: fidl::endpoints::ClientEnd<ReceiverMarker>,
1269    ) -> fidl::client::QueryResponseFut<
1270        CapabilityStoreConnectorCreateResult,
1271        fidl::encoding::DefaultFuchsiaResourceDialect,
1272    > {
1273        CapabilityStoreProxyInterface::r#connector_create(self, id, receiver)
1274    }
1275
1276    /// Open a connection from the provided [Connector] capability that will be dispatched to
1277    /// the [Receiver] on the other end.
1278    ///
1279    /// If there is an error, it will be reported as a zx.Status epitaph on `server_end`.
1280    ///
1281    /// Errors:
1282    ///
1283    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1284    /// - `WRONG_TYPE` if `id` was not a connector capability.
1285    pub fn r#connector_open(
1286        &self,
1287        mut id: u64,
1288        mut server_end: fidl::Channel,
1289    ) -> fidl::client::QueryResponseFut<
1290        CapabilityStoreConnectorOpenResult,
1291        fidl::encoding::DefaultFuchsiaResourceDialect,
1292    > {
1293        CapabilityStoreProxyInterface::r#connector_open(self, id, server_end)
1294    }
1295
1296    /// Creates a [DirConnector] from a [DirReceiver]. Incoming connections to the [DirConnector]
1297    /// will be dispatched to this [DirReceiver].
1298    ///
1299    /// Errors:
1300    ///
1301    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
1302    pub fn r#dir_connector_create(
1303        &self,
1304        mut id: u64,
1305        mut receiver: fidl::endpoints::ClientEnd<DirReceiverMarker>,
1306    ) -> fidl::client::QueryResponseFut<
1307        CapabilityStoreDirConnectorCreateResult,
1308        fidl::encoding::DefaultFuchsiaResourceDialect,
1309    > {
1310        CapabilityStoreProxyInterface::r#dir_connector_create(self, id, receiver)
1311    }
1312
1313    /// Open a connection from the provided [DirConnector] capability that will be dispatched to
1314    /// the [DirReceiver] on the other end.
1315    ///
1316    /// This method does not take `Open`/`Open3` parameters such as `flags` or `path`.
1317    /// Clients that wish to specify these can get an initial connection from this method
1318    /// and call `fuchsia.io/Directory.Open` on it. See the [DirReceiver] documentation for
1319    /// more information about the expectations of the server side.
1320    ///
1321    /// If there was an error making the connection, it will be reported as a zx.Status
1322    /// epitaph on `server_end`.
1323    ///
1324    /// Errors:
1325    ///
1326    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1327    /// - `WRONG_TYPE` if `id` was not a connector capability.
1328    pub fn r#dir_connector_open(
1329        &self,
1330        mut id: u64,
1331        mut server_end: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
1332    ) -> fidl::client::QueryResponseFut<
1333        CapabilityStoreDirConnectorOpenResult,
1334        fidl::encoding::DefaultFuchsiaResourceDialect,
1335    > {
1336        CapabilityStoreProxyInterface::r#dir_connector_open(self, id, server_end)
1337    }
1338
1339    /// Creates a new empty dictionary in this [`CapabilityStore`] with client-assigned `id`.
1340    ///
1341    /// Errors:
1342    ///
1343    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
1344    pub fn r#dictionary_create(
1345        &self,
1346        mut id: u64,
1347    ) -> fidl::client::QueryResponseFut<
1348        CapabilityStoreDictionaryCreateResult,
1349        fidl::encoding::DefaultFuchsiaResourceDialect,
1350    > {
1351        CapabilityStoreProxyInterface::r#dictionary_create(self, id)
1352    }
1353
1354    /// Imports a dictionary in the form of a channel.
1355    ///
1356    /// This is a legacy API to support backward compatibility with APIs that take a [Dictionary]
1357    /// channel.
1358    ///
1359    /// Errors:
1360    ///
1361    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
1362    /// - `BAD_CAPABILITY` if `client_end` was not a valid dictionary channel.
1363    pub fn r#dictionary_legacy_import(
1364        &self,
1365        mut id: u64,
1366        mut client_end: fidl::Channel,
1367    ) -> fidl::client::QueryResponseFut<
1368        CapabilityStoreDictionaryLegacyImportResult,
1369        fidl::encoding::DefaultFuchsiaResourceDialect,
1370    > {
1371        CapabilityStoreProxyInterface::r#dictionary_legacy_import(self, id, client_end)
1372    }
1373
1374    /// Binds a channel to the dictionary with `id`. The channel can
1375    /// be re-imported into a [CapabilityStore] with [DictionaryImportLegacy].
1376    ///
1377    /// This is a legacy API to support backward compatibility with APIs that take a [Dictionary]
1378    /// channel.
1379    ///
1380    /// Errors:
1381    ///
1382    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1383    pub fn r#dictionary_legacy_export(
1384        &self,
1385        mut id: u64,
1386        mut server_end: fidl::Channel,
1387    ) -> fidl::client::QueryResponseFut<
1388        CapabilityStoreDictionaryLegacyExportResult,
1389        fidl::encoding::DefaultFuchsiaResourceDialect,
1390    > {
1391        CapabilityStoreProxyInterface::r#dictionary_legacy_export(self, id, server_end)
1392    }
1393
1394    /// Inserts `item` into the dictionary with `id`. `item.value` is moved into the dictionary and
1395    /// its id is released if this call succeeds.
1396    ///
1397    /// Errors:
1398    ///
1399    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1400    /// - `WRONG_TYPE` if `id` was not a dictionary.
1401    /// - `INVALID_KEY` if `item.key` was invalid.
1402    /// - `ITEM_ALREADY_EXISTS` if the dictionary already contains an item with `item.key`.
1403    pub fn r#dictionary_insert(
1404        &self,
1405        mut id: u64,
1406        mut item: &DictionaryItem,
1407    ) -> fidl::client::QueryResponseFut<
1408        CapabilityStoreDictionaryInsertResult,
1409        fidl::encoding::DefaultFuchsiaResourceDialect,
1410    > {
1411        CapabilityStoreProxyInterface::r#dictionary_insert(self, id, item)
1412    }
1413
1414    /// Get a duplicate of a capability from the dictionary with `id`, which is
1415    /// loaded into `dest_id`.
1416    ///
1417    /// Errors:
1418    ///
1419    /// - `ID_NOT_FOUND` if `id` was not a recognized capability id in this store.
1420    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
1421    /// - `WRONG_TYPE` if `id` was not a dictionary.
1422    /// - `INVALID_KEY` if `item.key` was invalid.
1423    /// - `ITEM_NOT_FOUND` if the dictionary does not contain `key`.
1424    /// - `NOT_DUPLICATABLE` if the capability could not be duplicated.
1425    pub fn r#dictionary_get(
1426        &self,
1427        mut id: u64,
1428        mut key: &str,
1429        mut dest_id: u64,
1430    ) -> fidl::client::QueryResponseFut<
1431        CapabilityStoreDictionaryGetResult,
1432        fidl::encoding::DefaultFuchsiaResourceDialect,
1433    > {
1434        CapabilityStoreProxyInterface::r#dictionary_get(self, id, key, dest_id)
1435    }
1436
1437    /// Removes a key from the dictionary with `id`. If `dest_id` is present, loads the value
1438    /// into it, otherwise discards the value.
1439    ///
1440    /// Errors:
1441    ///
1442    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1443    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
1444    /// - `WRONG_TYPE` if `id` was not a dictionary.
1445    /// - `INVALID_KEY` if `key` was invalid.
1446    /// - `ITEM_NOT_FOUND` if the dictionary does not contain the key.
1447    pub fn r#dictionary_remove(
1448        &self,
1449        mut id: u64,
1450        mut key: &str,
1451        mut dest_id: Option<&WrappedCapabilityId>,
1452    ) -> fidl::client::QueryResponseFut<
1453        CapabilityStoreDictionaryRemoveResult,
1454        fidl::encoding::DefaultFuchsiaResourceDialect,
1455    > {
1456        CapabilityStoreProxyInterface::r#dictionary_remove(self, id, key, dest_id)
1457    }
1458
1459    /// Create a new dictionary that contains a duplicate of all the entries in
1460    /// the dictionary with `id`, assigning `dest_id` to the new dictionary.
1461    /// The runtime of this method is linear in the number of top-level entries
1462    /// in the dictionary.
1463    ///
1464    /// For example, if the dictionary contains nested dictionaries, the newly
1465    /// created dictionary will contain references to those same nested
1466    /// dictionaries because the entries are duplicated rather than deep-copied.
1467    ///
1468    /// Errors:
1469    ///
1470    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1471    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
1472    /// - `WRONG_TYPE` if `id` was not a dictionary.
1473    /// - `NOT_DUPLICATABLE` if one of the capabilities in `id` could not be duplicated.
1474    pub fn r#dictionary_copy(
1475        &self,
1476        mut id: u64,
1477        mut dest_id: u64,
1478    ) -> fidl::client::QueryResponseFut<
1479        CapabilityStoreDictionaryCopyResult,
1480        fidl::encoding::DefaultFuchsiaResourceDialect,
1481    > {
1482        CapabilityStoreProxyInterface::r#dictionary_copy(self, id, dest_id)
1483    }
1484
1485    /// Enumerates the keys in the dictionary with `id`.
1486    ///
1487    /// Errors:
1488    ///
1489    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1490    /// - `WRONG_TYPE` if `id` was not a dictionary.
1491    pub fn r#dictionary_keys(
1492        &self,
1493        mut id: u64,
1494        mut iterator: fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>,
1495    ) -> fidl::client::QueryResponseFut<
1496        CapabilityStoreDictionaryKeysResult,
1497        fidl::encoding::DefaultFuchsiaResourceDialect,
1498    > {
1499        CapabilityStoreProxyInterface::r#dictionary_keys(self, id, iterator)
1500    }
1501
1502    /// Enumerates the items (keys and values) in the dictionary with `id`.
1503    ///
1504    /// Creates a duplicate of each value (capability). If a value could not be duplicated,
1505    /// the value will be null.
1506    ///
1507    /// Errors:
1508    ///
1509    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1510    /// - `WRONG_TYPE` if `id` was not a dictionary.
1511    pub fn r#dictionary_enumerate(
1512        &self,
1513        mut id: u64,
1514        mut iterator: fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
1515    ) -> fidl::client::QueryResponseFut<
1516        CapabilityStoreDictionaryEnumerateResult,
1517        fidl::encoding::DefaultFuchsiaResourceDialect,
1518    > {
1519        CapabilityStoreProxyInterface::r#dictionary_enumerate(self, id, iterator)
1520    }
1521
1522    /// Removes all the entries in this dictionary, returning them in `contents` if provided.
1523    /// If `contents` is not provided, all the items are discarded without enumerating them.
1524    ///
1525    /// Errors:
1526    ///
1527    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1528    /// - `WRONG_TYPE` if `id` was not a dictionary.
1529    pub fn r#dictionary_drain(
1530        &self,
1531        mut id: u64,
1532        mut iterator: Option<fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>>,
1533    ) -> fidl::client::QueryResponseFut<
1534        CapabilityStoreDictionaryDrainResult,
1535        fidl::encoding::DefaultFuchsiaResourceDialect,
1536    > {
1537        CapabilityStoreProxyInterface::r#dictionary_drain(self, id, iterator)
1538    }
1539}
1540
1541impl CapabilityStoreProxyInterface for CapabilityStoreProxy {
1542    type DuplicateResponseFut = fidl::client::QueryResponseFut<
1543        CapabilityStoreDuplicateResult,
1544        fidl::encoding::DefaultFuchsiaResourceDialect,
1545    >;
1546    fn r#duplicate(&self, mut id: u64, mut dest_id: u64) -> Self::DuplicateResponseFut {
1547        fn _decode(
1548            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1549        ) -> Result<CapabilityStoreDuplicateResult, fidl::Error> {
1550            let _response = fidl::client::decode_transaction_body::<
1551                fidl::encoding::FlexibleResultType<
1552                    fidl::encoding::EmptyStruct,
1553                    CapabilityStoreError,
1554                >,
1555                fidl::encoding::DefaultFuchsiaResourceDialect,
1556                0x5d5d35d9c20a2184,
1557            >(_buf?)?
1558            .into_result::<CapabilityStoreMarker>("duplicate")?;
1559            Ok(_response.map(|x| x))
1560        }
1561        self.client.send_query_and_decode::<
1562            CapabilityStoreDuplicateRequest,
1563            CapabilityStoreDuplicateResult,
1564        >(
1565            (id, dest_id,),
1566            0x5d5d35d9c20a2184,
1567            fidl::encoding::DynamicFlags::FLEXIBLE,
1568            _decode,
1569        )
1570    }
1571
1572    type DropResponseFut = fidl::client::QueryResponseFut<
1573        CapabilityStoreDropResult,
1574        fidl::encoding::DefaultFuchsiaResourceDialect,
1575    >;
1576    fn r#drop(&self, mut id: u64) -> Self::DropResponseFut {
1577        fn _decode(
1578            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1579        ) -> Result<CapabilityStoreDropResult, fidl::Error> {
1580            let _response = fidl::client::decode_transaction_body::<
1581                fidl::encoding::FlexibleResultType<
1582                    fidl::encoding::EmptyStruct,
1583                    CapabilityStoreError,
1584                >,
1585                fidl::encoding::DefaultFuchsiaResourceDialect,
1586                0xa745c0990fc2559,
1587            >(_buf?)?
1588            .into_result::<CapabilityStoreMarker>("drop")?;
1589            Ok(_response.map(|x| x))
1590        }
1591        self.client.send_query_and_decode::<CapabilityStoreDropRequest, CapabilityStoreDropResult>(
1592            (id,),
1593            0xa745c0990fc2559,
1594            fidl::encoding::DynamicFlags::FLEXIBLE,
1595            _decode,
1596        )
1597    }
1598
1599    type ExportResponseFut = fidl::client::QueryResponseFut<
1600        CapabilityStoreExportResult,
1601        fidl::encoding::DefaultFuchsiaResourceDialect,
1602    >;
1603    fn r#export(&self, mut id: u64) -> Self::ExportResponseFut {
1604        fn _decode(
1605            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1606        ) -> Result<CapabilityStoreExportResult, fidl::Error> {
1607            let _response = fidl::client::decode_transaction_body::<
1608                fidl::encoding::FlexibleResultType<
1609                    CapabilityStoreExportResponse,
1610                    CapabilityStoreError,
1611                >,
1612                fidl::encoding::DefaultFuchsiaResourceDialect,
1613                0x3237a8f4748faff,
1614            >(_buf?)?
1615            .into_result::<CapabilityStoreMarker>("export")?;
1616            Ok(_response.map(|x| x.capability))
1617        }
1618        self.client
1619            .send_query_and_decode::<CapabilityStoreExportRequest, CapabilityStoreExportResult>(
1620                (id,),
1621                0x3237a8f4748faff,
1622                fidl::encoding::DynamicFlags::FLEXIBLE,
1623                _decode,
1624            )
1625    }
1626
1627    type ImportResponseFut = fidl::client::QueryResponseFut<
1628        CapabilityStoreImportResult,
1629        fidl::encoding::DefaultFuchsiaResourceDialect,
1630    >;
1631    fn r#import(&self, mut id: u64, mut capability: Capability) -> Self::ImportResponseFut {
1632        fn _decode(
1633            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1634        ) -> Result<CapabilityStoreImportResult, fidl::Error> {
1635            let _response = fidl::client::decode_transaction_body::<
1636                fidl::encoding::FlexibleResultType<
1637                    fidl::encoding::EmptyStruct,
1638                    CapabilityStoreError,
1639                >,
1640                fidl::encoding::DefaultFuchsiaResourceDialect,
1641                0x1f96157a29f4539b,
1642            >(_buf?)?
1643            .into_result::<CapabilityStoreMarker>("import")?;
1644            Ok(_response.map(|x| x))
1645        }
1646        self.client
1647            .send_query_and_decode::<CapabilityStoreImportRequest, CapabilityStoreImportResult>(
1648                (id, &mut capability),
1649                0x1f96157a29f4539b,
1650                fidl::encoding::DynamicFlags::FLEXIBLE,
1651                _decode,
1652            )
1653    }
1654
1655    type ConnectorCreateResponseFut = fidl::client::QueryResponseFut<
1656        CapabilityStoreConnectorCreateResult,
1657        fidl::encoding::DefaultFuchsiaResourceDialect,
1658    >;
1659    fn r#connector_create(
1660        &self,
1661        mut id: u64,
1662        mut receiver: fidl::endpoints::ClientEnd<ReceiverMarker>,
1663    ) -> Self::ConnectorCreateResponseFut {
1664        fn _decode(
1665            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1666        ) -> Result<CapabilityStoreConnectorCreateResult, fidl::Error> {
1667            let _response = fidl::client::decode_transaction_body::<
1668                fidl::encoding::FlexibleResultType<
1669                    fidl::encoding::EmptyStruct,
1670                    CapabilityStoreError,
1671                >,
1672                fidl::encoding::DefaultFuchsiaResourceDialect,
1673                0x29592c5d63e91c25,
1674            >(_buf?)?
1675            .into_result::<CapabilityStoreMarker>("connector_create")?;
1676            Ok(_response.map(|x| x))
1677        }
1678        self.client.send_query_and_decode::<
1679            CapabilityStoreConnectorCreateRequest,
1680            CapabilityStoreConnectorCreateResult,
1681        >(
1682            (id, receiver,),
1683            0x29592c5d63e91c25,
1684            fidl::encoding::DynamicFlags::FLEXIBLE,
1685            _decode,
1686        )
1687    }
1688
1689    type ConnectorOpenResponseFut = fidl::client::QueryResponseFut<
1690        CapabilityStoreConnectorOpenResult,
1691        fidl::encoding::DefaultFuchsiaResourceDialect,
1692    >;
1693    fn r#connector_open(
1694        &self,
1695        mut id: u64,
1696        mut server_end: fidl::Channel,
1697    ) -> Self::ConnectorOpenResponseFut {
1698        fn _decode(
1699            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1700        ) -> Result<CapabilityStoreConnectorOpenResult, fidl::Error> {
1701            let _response = fidl::client::decode_transaction_body::<
1702                fidl::encoding::FlexibleResultType<
1703                    fidl::encoding::EmptyStruct,
1704                    CapabilityStoreError,
1705                >,
1706                fidl::encoding::DefaultFuchsiaResourceDialect,
1707                0x537e69ab40563b9f,
1708            >(_buf?)?
1709            .into_result::<CapabilityStoreMarker>("connector_open")?;
1710            Ok(_response.map(|x| x))
1711        }
1712        self.client.send_query_and_decode::<
1713            CapabilityStoreConnectorOpenRequest,
1714            CapabilityStoreConnectorOpenResult,
1715        >(
1716            (id, server_end,),
1717            0x537e69ab40563b9f,
1718            fidl::encoding::DynamicFlags::FLEXIBLE,
1719            _decode,
1720        )
1721    }
1722
1723    type DirConnectorCreateResponseFut = fidl::client::QueryResponseFut<
1724        CapabilityStoreDirConnectorCreateResult,
1725        fidl::encoding::DefaultFuchsiaResourceDialect,
1726    >;
1727    fn r#dir_connector_create(
1728        &self,
1729        mut id: u64,
1730        mut receiver: fidl::endpoints::ClientEnd<DirReceiverMarker>,
1731    ) -> Self::DirConnectorCreateResponseFut {
1732        fn _decode(
1733            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1734        ) -> Result<CapabilityStoreDirConnectorCreateResult, fidl::Error> {
1735            let _response = fidl::client::decode_transaction_body::<
1736                fidl::encoding::FlexibleResultType<
1737                    fidl::encoding::EmptyStruct,
1738                    CapabilityStoreError,
1739                >,
1740                fidl::encoding::DefaultFuchsiaResourceDialect,
1741                0x186138a11ccf19bb,
1742            >(_buf?)?
1743            .into_result::<CapabilityStoreMarker>("dir_connector_create")?;
1744            Ok(_response.map(|x| x))
1745        }
1746        self.client.send_query_and_decode::<
1747            CapabilityStoreDirConnectorCreateRequest,
1748            CapabilityStoreDirConnectorCreateResult,
1749        >(
1750            (id, receiver,),
1751            0x186138a11ccf19bb,
1752            fidl::encoding::DynamicFlags::FLEXIBLE,
1753            _decode,
1754        )
1755    }
1756
1757    type DirConnectorOpenResponseFut = fidl::client::QueryResponseFut<
1758        CapabilityStoreDirConnectorOpenResult,
1759        fidl::encoding::DefaultFuchsiaResourceDialect,
1760    >;
1761    fn r#dir_connector_open(
1762        &self,
1763        mut id: u64,
1764        mut server_end: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
1765    ) -> Self::DirConnectorOpenResponseFut {
1766        fn _decode(
1767            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1768        ) -> Result<CapabilityStoreDirConnectorOpenResult, fidl::Error> {
1769            let _response = fidl::client::decode_transaction_body::<
1770                fidl::encoding::FlexibleResultType<
1771                    fidl::encoding::EmptyStruct,
1772                    CapabilityStoreError,
1773                >,
1774                fidl::encoding::DefaultFuchsiaResourceDialect,
1775                0x5650d3d6a3a13901,
1776            >(_buf?)?
1777            .into_result::<CapabilityStoreMarker>("dir_connector_open")?;
1778            Ok(_response.map(|x| x))
1779        }
1780        self.client.send_query_and_decode::<
1781            CapabilityStoreDirConnectorOpenRequest,
1782            CapabilityStoreDirConnectorOpenResult,
1783        >(
1784            (id, server_end,),
1785            0x5650d3d6a3a13901,
1786            fidl::encoding::DynamicFlags::FLEXIBLE,
1787            _decode,
1788        )
1789    }
1790
1791    type DictionaryCreateResponseFut = fidl::client::QueryResponseFut<
1792        CapabilityStoreDictionaryCreateResult,
1793        fidl::encoding::DefaultFuchsiaResourceDialect,
1794    >;
1795    fn r#dictionary_create(&self, mut id: u64) -> Self::DictionaryCreateResponseFut {
1796        fn _decode(
1797            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1798        ) -> Result<CapabilityStoreDictionaryCreateResult, fidl::Error> {
1799            let _response = fidl::client::decode_transaction_body::<
1800                fidl::encoding::FlexibleResultType<
1801                    fidl::encoding::EmptyStruct,
1802                    CapabilityStoreError,
1803                >,
1804                fidl::encoding::DefaultFuchsiaResourceDialect,
1805                0x6997c8dfc63de093,
1806            >(_buf?)?
1807            .into_result::<CapabilityStoreMarker>("dictionary_create")?;
1808            Ok(_response.map(|x| x))
1809        }
1810        self.client.send_query_and_decode::<
1811            CapabilityStoreDictionaryCreateRequest,
1812            CapabilityStoreDictionaryCreateResult,
1813        >(
1814            (id,),
1815            0x6997c8dfc63de093,
1816            fidl::encoding::DynamicFlags::FLEXIBLE,
1817            _decode,
1818        )
1819    }
1820
1821    type DictionaryLegacyImportResponseFut = fidl::client::QueryResponseFut<
1822        CapabilityStoreDictionaryLegacyImportResult,
1823        fidl::encoding::DefaultFuchsiaResourceDialect,
1824    >;
1825    fn r#dictionary_legacy_import(
1826        &self,
1827        mut id: u64,
1828        mut client_end: fidl::Channel,
1829    ) -> Self::DictionaryLegacyImportResponseFut {
1830        fn _decode(
1831            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1832        ) -> Result<CapabilityStoreDictionaryLegacyImportResult, fidl::Error> {
1833            let _response = fidl::client::decode_transaction_body::<
1834                fidl::encoding::FlexibleResultType<
1835                    fidl::encoding::EmptyStruct,
1836                    CapabilityStoreError,
1837                >,
1838                fidl::encoding::DefaultFuchsiaResourceDialect,
1839                0x72fd686c37b6025f,
1840            >(_buf?)?
1841            .into_result::<CapabilityStoreMarker>("dictionary_legacy_import")?;
1842            Ok(_response.map(|x| x))
1843        }
1844        self.client.send_query_and_decode::<
1845            CapabilityStoreDictionaryLegacyImportRequest,
1846            CapabilityStoreDictionaryLegacyImportResult,
1847        >(
1848            (id, client_end,),
1849            0x72fd686c37b6025f,
1850            fidl::encoding::DynamicFlags::FLEXIBLE,
1851            _decode,
1852        )
1853    }
1854
1855    type DictionaryLegacyExportResponseFut = fidl::client::QueryResponseFut<
1856        CapabilityStoreDictionaryLegacyExportResult,
1857        fidl::encoding::DefaultFuchsiaResourceDialect,
1858    >;
1859    fn r#dictionary_legacy_export(
1860        &self,
1861        mut id: u64,
1862        mut server_end: fidl::Channel,
1863    ) -> Self::DictionaryLegacyExportResponseFut {
1864        fn _decode(
1865            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1866        ) -> Result<CapabilityStoreDictionaryLegacyExportResult, fidl::Error> {
1867            let _response = fidl::client::decode_transaction_body::<
1868                fidl::encoding::FlexibleResultType<
1869                    fidl::encoding::EmptyStruct,
1870                    CapabilityStoreError,
1871                >,
1872                fidl::encoding::DefaultFuchsiaResourceDialect,
1873                0x407e15cc4bde5dcd,
1874            >(_buf?)?
1875            .into_result::<CapabilityStoreMarker>("dictionary_legacy_export")?;
1876            Ok(_response.map(|x| x))
1877        }
1878        self.client.send_query_and_decode::<
1879            CapabilityStoreDictionaryLegacyExportRequest,
1880            CapabilityStoreDictionaryLegacyExportResult,
1881        >(
1882            (id, server_end,),
1883            0x407e15cc4bde5dcd,
1884            fidl::encoding::DynamicFlags::FLEXIBLE,
1885            _decode,
1886        )
1887    }
1888
1889    type DictionaryInsertResponseFut = fidl::client::QueryResponseFut<
1890        CapabilityStoreDictionaryInsertResult,
1891        fidl::encoding::DefaultFuchsiaResourceDialect,
1892    >;
1893    fn r#dictionary_insert(
1894        &self,
1895        mut id: u64,
1896        mut item: &DictionaryItem,
1897    ) -> Self::DictionaryInsertResponseFut {
1898        fn _decode(
1899            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1900        ) -> Result<CapabilityStoreDictionaryInsertResult, fidl::Error> {
1901            let _response = fidl::client::decode_transaction_body::<
1902                fidl::encoding::FlexibleResultType<
1903                    fidl::encoding::EmptyStruct,
1904                    CapabilityStoreError,
1905                >,
1906                fidl::encoding::DefaultFuchsiaResourceDialect,
1907                0x7702183689d44c27,
1908            >(_buf?)?
1909            .into_result::<CapabilityStoreMarker>("dictionary_insert")?;
1910            Ok(_response.map(|x| x))
1911        }
1912        self.client.send_query_and_decode::<
1913            CapabilityStoreDictionaryInsertRequest,
1914            CapabilityStoreDictionaryInsertResult,
1915        >(
1916            (id, item,),
1917            0x7702183689d44c27,
1918            fidl::encoding::DynamicFlags::FLEXIBLE,
1919            _decode,
1920        )
1921    }
1922
1923    type DictionaryGetResponseFut = fidl::client::QueryResponseFut<
1924        CapabilityStoreDictionaryGetResult,
1925        fidl::encoding::DefaultFuchsiaResourceDialect,
1926    >;
1927    fn r#dictionary_get(
1928        &self,
1929        mut id: u64,
1930        mut key: &str,
1931        mut dest_id: u64,
1932    ) -> Self::DictionaryGetResponseFut {
1933        fn _decode(
1934            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1935        ) -> Result<CapabilityStoreDictionaryGetResult, fidl::Error> {
1936            let _response = fidl::client::decode_transaction_body::<
1937                fidl::encoding::FlexibleResultType<
1938                    fidl::encoding::EmptyStruct,
1939                    CapabilityStoreError,
1940                >,
1941                fidl::encoding::DefaultFuchsiaResourceDialect,
1942                0x4d9e27538284add2,
1943            >(_buf?)?
1944            .into_result::<CapabilityStoreMarker>("dictionary_get")?;
1945            Ok(_response.map(|x| x))
1946        }
1947        self.client.send_query_and_decode::<
1948            CapabilityStoreDictionaryGetRequest,
1949            CapabilityStoreDictionaryGetResult,
1950        >(
1951            (id, key, dest_id,),
1952            0x4d9e27538284add2,
1953            fidl::encoding::DynamicFlags::FLEXIBLE,
1954            _decode,
1955        )
1956    }
1957
1958    type DictionaryRemoveResponseFut = fidl::client::QueryResponseFut<
1959        CapabilityStoreDictionaryRemoveResult,
1960        fidl::encoding::DefaultFuchsiaResourceDialect,
1961    >;
1962    fn r#dictionary_remove(
1963        &self,
1964        mut id: u64,
1965        mut key: &str,
1966        mut dest_id: Option<&WrappedCapabilityId>,
1967    ) -> Self::DictionaryRemoveResponseFut {
1968        fn _decode(
1969            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1970        ) -> Result<CapabilityStoreDictionaryRemoveResult, fidl::Error> {
1971            let _response = fidl::client::decode_transaction_body::<
1972                fidl::encoding::FlexibleResultType<
1973                    fidl::encoding::EmptyStruct,
1974                    CapabilityStoreError,
1975                >,
1976                fidl::encoding::DefaultFuchsiaResourceDialect,
1977                0x4c5c025ab05d4f3,
1978            >(_buf?)?
1979            .into_result::<CapabilityStoreMarker>("dictionary_remove")?;
1980            Ok(_response.map(|x| x))
1981        }
1982        self.client.send_query_and_decode::<
1983            CapabilityStoreDictionaryRemoveRequest,
1984            CapabilityStoreDictionaryRemoveResult,
1985        >(
1986            (id, key, dest_id,),
1987            0x4c5c025ab05d4f3,
1988            fidl::encoding::DynamicFlags::FLEXIBLE,
1989            _decode,
1990        )
1991    }
1992
1993    type DictionaryCopyResponseFut = fidl::client::QueryResponseFut<
1994        CapabilityStoreDictionaryCopyResult,
1995        fidl::encoding::DefaultFuchsiaResourceDialect,
1996    >;
1997    fn r#dictionary_copy(&self, mut id: u64, mut dest_id: u64) -> Self::DictionaryCopyResponseFut {
1998        fn _decode(
1999            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2000        ) -> Result<CapabilityStoreDictionaryCopyResult, fidl::Error> {
2001            let _response = fidl::client::decode_transaction_body::<
2002                fidl::encoding::FlexibleResultType<
2003                    fidl::encoding::EmptyStruct,
2004                    CapabilityStoreError,
2005                >,
2006                fidl::encoding::DefaultFuchsiaResourceDialect,
2007                0x3733ecdf4ea1b44f,
2008            >(_buf?)?
2009            .into_result::<CapabilityStoreMarker>("dictionary_copy")?;
2010            Ok(_response.map(|x| x))
2011        }
2012        self.client.send_query_and_decode::<
2013            CapabilityStoreDictionaryCopyRequest,
2014            CapabilityStoreDictionaryCopyResult,
2015        >(
2016            (id, dest_id,),
2017            0x3733ecdf4ea1b44f,
2018            fidl::encoding::DynamicFlags::FLEXIBLE,
2019            _decode,
2020        )
2021    }
2022
2023    type DictionaryKeysResponseFut = fidl::client::QueryResponseFut<
2024        CapabilityStoreDictionaryKeysResult,
2025        fidl::encoding::DefaultFuchsiaResourceDialect,
2026    >;
2027    fn r#dictionary_keys(
2028        &self,
2029        mut id: u64,
2030        mut iterator: fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>,
2031    ) -> Self::DictionaryKeysResponseFut {
2032        fn _decode(
2033            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2034        ) -> Result<CapabilityStoreDictionaryKeysResult, fidl::Error> {
2035            let _response = fidl::client::decode_transaction_body::<
2036                fidl::encoding::FlexibleResultType<
2037                    fidl::encoding::EmptyStruct,
2038                    CapabilityStoreError,
2039                >,
2040                fidl::encoding::DefaultFuchsiaResourceDialect,
2041                0x84b05577ceaec9e,
2042            >(_buf?)?
2043            .into_result::<CapabilityStoreMarker>("dictionary_keys")?;
2044            Ok(_response.map(|x| x))
2045        }
2046        self.client.send_query_and_decode::<
2047            CapabilityStoreDictionaryKeysRequest,
2048            CapabilityStoreDictionaryKeysResult,
2049        >(
2050            (id, iterator,),
2051            0x84b05577ceaec9e,
2052            fidl::encoding::DynamicFlags::FLEXIBLE,
2053            _decode,
2054        )
2055    }
2056
2057    type DictionaryEnumerateResponseFut = fidl::client::QueryResponseFut<
2058        CapabilityStoreDictionaryEnumerateResult,
2059        fidl::encoding::DefaultFuchsiaResourceDialect,
2060    >;
2061    fn r#dictionary_enumerate(
2062        &self,
2063        mut id: u64,
2064        mut iterator: fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
2065    ) -> Self::DictionaryEnumerateResponseFut {
2066        fn _decode(
2067            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2068        ) -> Result<CapabilityStoreDictionaryEnumerateResult, fidl::Error> {
2069            let _response = fidl::client::decode_transaction_body::<
2070                fidl::encoding::FlexibleResultType<
2071                    fidl::encoding::EmptyStruct,
2072                    CapabilityStoreError,
2073                >,
2074                fidl::encoding::DefaultFuchsiaResourceDialect,
2075                0xd6279b6ced04641,
2076            >(_buf?)?
2077            .into_result::<CapabilityStoreMarker>("dictionary_enumerate")?;
2078            Ok(_response.map(|x| x))
2079        }
2080        self.client.send_query_and_decode::<
2081            CapabilityStoreDictionaryEnumerateRequest,
2082            CapabilityStoreDictionaryEnumerateResult,
2083        >(
2084            (id, iterator,),
2085            0xd6279b6ced04641,
2086            fidl::encoding::DynamicFlags::FLEXIBLE,
2087            _decode,
2088        )
2089    }
2090
2091    type DictionaryDrainResponseFut = fidl::client::QueryResponseFut<
2092        CapabilityStoreDictionaryDrainResult,
2093        fidl::encoding::DefaultFuchsiaResourceDialect,
2094    >;
2095    fn r#dictionary_drain(
2096        &self,
2097        mut id: u64,
2098        mut iterator: Option<fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>>,
2099    ) -> Self::DictionaryDrainResponseFut {
2100        fn _decode(
2101            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2102        ) -> Result<CapabilityStoreDictionaryDrainResult, fidl::Error> {
2103            let _response = fidl::client::decode_transaction_body::<
2104                fidl::encoding::FlexibleResultType<
2105                    fidl::encoding::EmptyStruct,
2106                    CapabilityStoreError,
2107                >,
2108                fidl::encoding::DefaultFuchsiaResourceDialect,
2109                0x28a3a3f84d928cd8,
2110            >(_buf?)?
2111            .into_result::<CapabilityStoreMarker>("dictionary_drain")?;
2112            Ok(_response.map(|x| x))
2113        }
2114        self.client.send_query_and_decode::<
2115            CapabilityStoreDictionaryDrainRequest,
2116            CapabilityStoreDictionaryDrainResult,
2117        >(
2118            (id, iterator,),
2119            0x28a3a3f84d928cd8,
2120            fidl::encoding::DynamicFlags::FLEXIBLE,
2121            _decode,
2122        )
2123    }
2124}
2125
2126pub struct CapabilityStoreEventStream {
2127    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2128}
2129
2130impl std::marker::Unpin for CapabilityStoreEventStream {}
2131
2132impl futures::stream::FusedStream for CapabilityStoreEventStream {
2133    fn is_terminated(&self) -> bool {
2134        self.event_receiver.is_terminated()
2135    }
2136}
2137
2138impl futures::Stream for CapabilityStoreEventStream {
2139    type Item = Result<CapabilityStoreEvent, fidl::Error>;
2140
2141    fn poll_next(
2142        mut self: std::pin::Pin<&mut Self>,
2143        cx: &mut std::task::Context<'_>,
2144    ) -> std::task::Poll<Option<Self::Item>> {
2145        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2146            &mut self.event_receiver,
2147            cx
2148        )?) {
2149            Some(buf) => std::task::Poll::Ready(Some(CapabilityStoreEvent::decode(buf))),
2150            None => std::task::Poll::Ready(None),
2151        }
2152    }
2153}
2154
2155#[derive(Debug)]
2156pub enum CapabilityStoreEvent {
2157    #[non_exhaustive]
2158    _UnknownEvent {
2159        /// Ordinal of the event that was sent.
2160        ordinal: u64,
2161    },
2162}
2163
2164impl CapabilityStoreEvent {
2165    /// Decodes a message buffer as a [`CapabilityStoreEvent`].
2166    fn decode(
2167        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2168    ) -> Result<CapabilityStoreEvent, fidl::Error> {
2169        let (bytes, _handles) = buf.split_mut();
2170        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2171        debug_assert_eq!(tx_header.tx_id, 0);
2172        match tx_header.ordinal {
2173            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2174                Ok(CapabilityStoreEvent::_UnknownEvent { ordinal: tx_header.ordinal })
2175            }
2176            _ => Err(fidl::Error::UnknownOrdinal {
2177                ordinal: tx_header.ordinal,
2178                protocol_name:
2179                    <CapabilityStoreMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2180            }),
2181        }
2182    }
2183}
2184
2185/// A Stream of incoming requests for fuchsia.component.sandbox/CapabilityStore.
2186pub struct CapabilityStoreRequestStream {
2187    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2188    is_terminated: bool,
2189}
2190
2191impl std::marker::Unpin for CapabilityStoreRequestStream {}
2192
2193impl futures::stream::FusedStream for CapabilityStoreRequestStream {
2194    fn is_terminated(&self) -> bool {
2195        self.is_terminated
2196    }
2197}
2198
2199impl fidl::endpoints::RequestStream for CapabilityStoreRequestStream {
2200    type Protocol = CapabilityStoreMarker;
2201    type ControlHandle = CapabilityStoreControlHandle;
2202
2203    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2204        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2205    }
2206
2207    fn control_handle(&self) -> Self::ControlHandle {
2208        CapabilityStoreControlHandle { inner: self.inner.clone() }
2209    }
2210
2211    fn into_inner(
2212        self,
2213    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2214    {
2215        (self.inner, self.is_terminated)
2216    }
2217
2218    fn from_inner(
2219        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2220        is_terminated: bool,
2221    ) -> Self {
2222        Self { inner, is_terminated }
2223    }
2224}
2225
2226impl futures::Stream for CapabilityStoreRequestStream {
2227    type Item = Result<CapabilityStoreRequest, fidl::Error>;
2228
2229    fn poll_next(
2230        mut self: std::pin::Pin<&mut Self>,
2231        cx: &mut std::task::Context<'_>,
2232    ) -> std::task::Poll<Option<Self::Item>> {
2233        let this = &mut *self;
2234        if this.inner.check_shutdown(cx) {
2235            this.is_terminated = true;
2236            return std::task::Poll::Ready(None);
2237        }
2238        if this.is_terminated {
2239            panic!("polled CapabilityStoreRequestStream after completion");
2240        }
2241        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2242            |bytes, handles| {
2243                match this.inner.channel().read_etc(cx, bytes, handles) {
2244                    std::task::Poll::Ready(Ok(())) => {}
2245                    std::task::Poll::Pending => return std::task::Poll::Pending,
2246                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2247                        this.is_terminated = true;
2248                        return std::task::Poll::Ready(None);
2249                    }
2250                    std::task::Poll::Ready(Err(e)) => {
2251                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2252                            e.into(),
2253                        ))))
2254                    }
2255                }
2256
2257                // A message has been received from the channel
2258                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2259
2260                std::task::Poll::Ready(Some(match header.ordinal {
2261                    0x5d5d35d9c20a2184 => {
2262                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2263                        let mut req = fidl::new_empty!(
2264                            CapabilityStoreDuplicateRequest,
2265                            fidl::encoding::DefaultFuchsiaResourceDialect
2266                        );
2267                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDuplicateRequest>(&header, _body_bytes, handles, &mut req)?;
2268                        let control_handle =
2269                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2270                        Ok(CapabilityStoreRequest::Duplicate {
2271                            id: req.id,
2272                            dest_id: req.dest_id,
2273
2274                            responder: CapabilityStoreDuplicateResponder {
2275                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2276                                tx_id: header.tx_id,
2277                            },
2278                        })
2279                    }
2280                    0xa745c0990fc2559 => {
2281                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2282                        let mut req = fidl::new_empty!(
2283                            CapabilityStoreDropRequest,
2284                            fidl::encoding::DefaultFuchsiaResourceDialect
2285                        );
2286                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDropRequest>(&header, _body_bytes, handles, &mut req)?;
2287                        let control_handle =
2288                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2289                        Ok(CapabilityStoreRequest::Drop {
2290                            id: req.id,
2291
2292                            responder: CapabilityStoreDropResponder {
2293                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2294                                tx_id: header.tx_id,
2295                            },
2296                        })
2297                    }
2298                    0x3237a8f4748faff => {
2299                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2300                        let mut req = fidl::new_empty!(
2301                            CapabilityStoreExportRequest,
2302                            fidl::encoding::DefaultFuchsiaResourceDialect
2303                        );
2304                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreExportRequest>(&header, _body_bytes, handles, &mut req)?;
2305                        let control_handle =
2306                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2307                        Ok(CapabilityStoreRequest::Export {
2308                            id: req.id,
2309
2310                            responder: CapabilityStoreExportResponder {
2311                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2312                                tx_id: header.tx_id,
2313                            },
2314                        })
2315                    }
2316                    0x1f96157a29f4539b => {
2317                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2318                        let mut req = fidl::new_empty!(
2319                            CapabilityStoreImportRequest,
2320                            fidl::encoding::DefaultFuchsiaResourceDialect
2321                        );
2322                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreImportRequest>(&header, _body_bytes, handles, &mut req)?;
2323                        let control_handle =
2324                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2325                        Ok(CapabilityStoreRequest::Import {
2326                            id: req.id,
2327                            capability: req.capability,
2328
2329                            responder: CapabilityStoreImportResponder {
2330                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2331                                tx_id: header.tx_id,
2332                            },
2333                        })
2334                    }
2335                    0x29592c5d63e91c25 => {
2336                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2337                        let mut req = fidl::new_empty!(
2338                            CapabilityStoreConnectorCreateRequest,
2339                            fidl::encoding::DefaultFuchsiaResourceDialect
2340                        );
2341                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreConnectorCreateRequest>(&header, _body_bytes, handles, &mut req)?;
2342                        let control_handle =
2343                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2344                        Ok(CapabilityStoreRequest::ConnectorCreate {
2345                            id: req.id,
2346                            receiver: req.receiver,
2347
2348                            responder: CapabilityStoreConnectorCreateResponder {
2349                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2350                                tx_id: header.tx_id,
2351                            },
2352                        })
2353                    }
2354                    0x537e69ab40563b9f => {
2355                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2356                        let mut req = fidl::new_empty!(
2357                            CapabilityStoreConnectorOpenRequest,
2358                            fidl::encoding::DefaultFuchsiaResourceDialect
2359                        );
2360                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreConnectorOpenRequest>(&header, _body_bytes, handles, &mut req)?;
2361                        let control_handle =
2362                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2363                        Ok(CapabilityStoreRequest::ConnectorOpen {
2364                            id: req.id,
2365                            server_end: req.server_end,
2366
2367                            responder: CapabilityStoreConnectorOpenResponder {
2368                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2369                                tx_id: header.tx_id,
2370                            },
2371                        })
2372                    }
2373                    0x186138a11ccf19bb => {
2374                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2375                        let mut req = fidl::new_empty!(
2376                            CapabilityStoreDirConnectorCreateRequest,
2377                            fidl::encoding::DefaultFuchsiaResourceDialect
2378                        );
2379                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDirConnectorCreateRequest>(&header, _body_bytes, handles, &mut req)?;
2380                        let control_handle =
2381                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2382                        Ok(CapabilityStoreRequest::DirConnectorCreate {
2383                            id: req.id,
2384                            receiver: req.receiver,
2385
2386                            responder: CapabilityStoreDirConnectorCreateResponder {
2387                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2388                                tx_id: header.tx_id,
2389                            },
2390                        })
2391                    }
2392                    0x5650d3d6a3a13901 => {
2393                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2394                        let mut req = fidl::new_empty!(
2395                            CapabilityStoreDirConnectorOpenRequest,
2396                            fidl::encoding::DefaultFuchsiaResourceDialect
2397                        );
2398                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDirConnectorOpenRequest>(&header, _body_bytes, handles, &mut req)?;
2399                        let control_handle =
2400                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2401                        Ok(CapabilityStoreRequest::DirConnectorOpen {
2402                            id: req.id,
2403                            server_end: req.server_end,
2404
2405                            responder: CapabilityStoreDirConnectorOpenResponder {
2406                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2407                                tx_id: header.tx_id,
2408                            },
2409                        })
2410                    }
2411                    0x6997c8dfc63de093 => {
2412                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2413                        let mut req = fidl::new_empty!(
2414                            CapabilityStoreDictionaryCreateRequest,
2415                            fidl::encoding::DefaultFuchsiaResourceDialect
2416                        );
2417                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryCreateRequest>(&header, _body_bytes, handles, &mut req)?;
2418                        let control_handle =
2419                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2420                        Ok(CapabilityStoreRequest::DictionaryCreate {
2421                            id: req.id,
2422
2423                            responder: CapabilityStoreDictionaryCreateResponder {
2424                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2425                                tx_id: header.tx_id,
2426                            },
2427                        })
2428                    }
2429                    0x72fd686c37b6025f => {
2430                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2431                        let mut req = fidl::new_empty!(
2432                            CapabilityStoreDictionaryLegacyImportRequest,
2433                            fidl::encoding::DefaultFuchsiaResourceDialect
2434                        );
2435                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryLegacyImportRequest>(&header, _body_bytes, handles, &mut req)?;
2436                        let control_handle =
2437                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2438                        Ok(CapabilityStoreRequest::DictionaryLegacyImport {
2439                            id: req.id,
2440                            client_end: req.client_end,
2441
2442                            responder: CapabilityStoreDictionaryLegacyImportResponder {
2443                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2444                                tx_id: header.tx_id,
2445                            },
2446                        })
2447                    }
2448                    0x407e15cc4bde5dcd => {
2449                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2450                        let mut req = fidl::new_empty!(
2451                            CapabilityStoreDictionaryLegacyExportRequest,
2452                            fidl::encoding::DefaultFuchsiaResourceDialect
2453                        );
2454                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryLegacyExportRequest>(&header, _body_bytes, handles, &mut req)?;
2455                        let control_handle =
2456                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2457                        Ok(CapabilityStoreRequest::DictionaryLegacyExport {
2458                            id: req.id,
2459                            server_end: req.server_end,
2460
2461                            responder: CapabilityStoreDictionaryLegacyExportResponder {
2462                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2463                                tx_id: header.tx_id,
2464                            },
2465                        })
2466                    }
2467                    0x7702183689d44c27 => {
2468                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2469                        let mut req = fidl::new_empty!(
2470                            CapabilityStoreDictionaryInsertRequest,
2471                            fidl::encoding::DefaultFuchsiaResourceDialect
2472                        );
2473                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryInsertRequest>(&header, _body_bytes, handles, &mut req)?;
2474                        let control_handle =
2475                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2476                        Ok(CapabilityStoreRequest::DictionaryInsert {
2477                            id: req.id,
2478                            item: req.item,
2479
2480                            responder: CapabilityStoreDictionaryInsertResponder {
2481                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2482                                tx_id: header.tx_id,
2483                            },
2484                        })
2485                    }
2486                    0x4d9e27538284add2 => {
2487                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2488                        let mut req = fidl::new_empty!(
2489                            CapabilityStoreDictionaryGetRequest,
2490                            fidl::encoding::DefaultFuchsiaResourceDialect
2491                        );
2492                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryGetRequest>(&header, _body_bytes, handles, &mut req)?;
2493                        let control_handle =
2494                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2495                        Ok(CapabilityStoreRequest::DictionaryGet {
2496                            id: req.id,
2497                            key: req.key,
2498                            dest_id: req.dest_id,
2499
2500                            responder: CapabilityStoreDictionaryGetResponder {
2501                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2502                                tx_id: header.tx_id,
2503                            },
2504                        })
2505                    }
2506                    0x4c5c025ab05d4f3 => {
2507                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2508                        let mut req = fidl::new_empty!(
2509                            CapabilityStoreDictionaryRemoveRequest,
2510                            fidl::encoding::DefaultFuchsiaResourceDialect
2511                        );
2512                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryRemoveRequest>(&header, _body_bytes, handles, &mut req)?;
2513                        let control_handle =
2514                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2515                        Ok(CapabilityStoreRequest::DictionaryRemove {
2516                            id: req.id,
2517                            key: req.key,
2518                            dest_id: req.dest_id,
2519
2520                            responder: CapabilityStoreDictionaryRemoveResponder {
2521                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2522                                tx_id: header.tx_id,
2523                            },
2524                        })
2525                    }
2526                    0x3733ecdf4ea1b44f => {
2527                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2528                        let mut req = fidl::new_empty!(
2529                            CapabilityStoreDictionaryCopyRequest,
2530                            fidl::encoding::DefaultFuchsiaResourceDialect
2531                        );
2532                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryCopyRequest>(&header, _body_bytes, handles, &mut req)?;
2533                        let control_handle =
2534                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2535                        Ok(CapabilityStoreRequest::DictionaryCopy {
2536                            id: req.id,
2537                            dest_id: req.dest_id,
2538
2539                            responder: CapabilityStoreDictionaryCopyResponder {
2540                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2541                                tx_id: header.tx_id,
2542                            },
2543                        })
2544                    }
2545                    0x84b05577ceaec9e => {
2546                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2547                        let mut req = fidl::new_empty!(
2548                            CapabilityStoreDictionaryKeysRequest,
2549                            fidl::encoding::DefaultFuchsiaResourceDialect
2550                        );
2551                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryKeysRequest>(&header, _body_bytes, handles, &mut req)?;
2552                        let control_handle =
2553                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2554                        Ok(CapabilityStoreRequest::DictionaryKeys {
2555                            id: req.id,
2556                            iterator: req.iterator,
2557
2558                            responder: CapabilityStoreDictionaryKeysResponder {
2559                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2560                                tx_id: header.tx_id,
2561                            },
2562                        })
2563                    }
2564                    0xd6279b6ced04641 => {
2565                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2566                        let mut req = fidl::new_empty!(
2567                            CapabilityStoreDictionaryEnumerateRequest,
2568                            fidl::encoding::DefaultFuchsiaResourceDialect
2569                        );
2570                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryEnumerateRequest>(&header, _body_bytes, handles, &mut req)?;
2571                        let control_handle =
2572                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2573                        Ok(CapabilityStoreRequest::DictionaryEnumerate {
2574                            id: req.id,
2575                            iterator: req.iterator,
2576
2577                            responder: CapabilityStoreDictionaryEnumerateResponder {
2578                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2579                                tx_id: header.tx_id,
2580                            },
2581                        })
2582                    }
2583                    0x28a3a3f84d928cd8 => {
2584                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2585                        let mut req = fidl::new_empty!(
2586                            CapabilityStoreDictionaryDrainRequest,
2587                            fidl::encoding::DefaultFuchsiaResourceDialect
2588                        );
2589                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryDrainRequest>(&header, _body_bytes, handles, &mut req)?;
2590                        let control_handle =
2591                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2592                        Ok(CapabilityStoreRequest::DictionaryDrain {
2593                            id: req.id,
2594                            iterator: req.iterator,
2595
2596                            responder: CapabilityStoreDictionaryDrainResponder {
2597                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2598                                tx_id: header.tx_id,
2599                            },
2600                        })
2601                    }
2602                    _ if header.tx_id == 0
2603                        && header
2604                            .dynamic_flags()
2605                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2606                    {
2607                        Ok(CapabilityStoreRequest::_UnknownMethod {
2608                            ordinal: header.ordinal,
2609                            control_handle: CapabilityStoreControlHandle {
2610                                inner: this.inner.clone(),
2611                            },
2612                            method_type: fidl::MethodType::OneWay,
2613                        })
2614                    }
2615                    _ if header
2616                        .dynamic_flags()
2617                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2618                    {
2619                        this.inner.send_framework_err(
2620                            fidl::encoding::FrameworkErr::UnknownMethod,
2621                            header.tx_id,
2622                            header.ordinal,
2623                            header.dynamic_flags(),
2624                            (bytes, handles),
2625                        )?;
2626                        Ok(CapabilityStoreRequest::_UnknownMethod {
2627                            ordinal: header.ordinal,
2628                            control_handle: CapabilityStoreControlHandle {
2629                                inner: this.inner.clone(),
2630                            },
2631                            method_type: fidl::MethodType::TwoWay,
2632                        })
2633                    }
2634                    _ => Err(fidl::Error::UnknownOrdinal {
2635                        ordinal: header.ordinal,
2636                        protocol_name:
2637                            <CapabilityStoreMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2638                    }),
2639                }))
2640            },
2641        )
2642    }
2643}
2644
2645/// Protocol that represents the concept of a "capability store", a repository
2646/// for [Capability]s that are held by the component framework runtime.
2647///
2648/// [CapabilityStore] serves as the main bridge between the component runtime and clients
2649/// that enables them to operate on and exchange [Capability]s. A [CapabilityStore] instance
2650/// contains a set of [Capability]s, each of which has a [CapabilityId] assigned by the client.
2651///
2652/// Normally, a program would not exchange a [CapabilityStore] or [CapabilityId] with other
2653/// programs -- a [CapabilityStore] connection and its enclosed capabilities are intended to
2654/// be "local" to a program. Instead, if a program wishes to exchange a [Capability] with other
2655/// programs, it should [Export] the [Capability] out of the store, send the [Capability] to the
2656/// target program, which can then [Import] the capability into its own store.
2657///
2658/// [CapabilityStore] is also used to manage capability lifetimes. The lifetime of a capability is
2659/// scoped to the [CapabilityStore] in which it resides; i.e. to drop the [CapabilityStore]
2660/// connections to release the capabilities instead it. In addition, [CapabilityStore] supports a
2661/// [Drop] API to drop an individual [Capability] reference. (Note that it is possible for a
2662/// some capabilities, like [DictionaryRef], to have multiple references, in which case all of
2663/// the references must be dropped for the underlying resource to be released.)
2664///
2665/// A note about semantics: the [CapabilityStore] APIs do not return [CapabilityId]s, because
2666/// [CapabilityId]s are assigned by the client. Instead, when a method would semantically return
2667/// a capability, this is expressed by taking the destination [CapabilityId] as an output parameter.
2668#[derive(Debug)]
2669pub enum CapabilityStoreRequest {
2670    /// Duplicates the capability with `id` to `dest_id`.
2671    ///
2672    /// Errors:
2673    ///
2674    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2675    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
2676    /// - `NOT_DUPLICATABLE` if `id` could not be duplicated.
2677    Duplicate { id: u64, dest_id: u64, responder: CapabilityStoreDuplicateResponder },
2678    /// Drops the capability with `id` from this [`CapabilityStore`].
2679    ///
2680    /// Errors:
2681    ///
2682    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2683    Drop { id: u64, responder: CapabilityStoreDropResponder },
2684    /// Exports the capability with the client-assigned identifier `id` to
2685    /// `capability`. This operation removes the capability from the store. If
2686    /// this is not desired, [Duplicate] the capability first.
2687    ///
2688    /// Errors:
2689    ///
2690    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2691    Export { id: u64, responder: CapabilityStoreExportResponder },
2692    /// Imports `capability` into this store with the client-assigned `id`.
2693    ///
2694    /// Errors:
2695    ///
2696    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
2697    /// - `BAD_CAPABILITY` if `capability` was not a valid [Capability].
2698    Import { id: u64, capability: Capability, responder: CapabilityStoreImportResponder },
2699    /// Creates a [Connector] from a [Receiver]. Incoming connections to the [Connector] will be
2700    /// dispatched to this [Receiver].
2701    ///
2702    /// Errors:
2703    ///
2704    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
2705    ConnectorCreate {
2706        id: u64,
2707        receiver: fidl::endpoints::ClientEnd<ReceiverMarker>,
2708        responder: CapabilityStoreConnectorCreateResponder,
2709    },
2710    /// Open a connection from the provided [Connector] capability that will be dispatched to
2711    /// the [Receiver] on the other end.
2712    ///
2713    /// If there is an error, it will be reported as a zx.Status epitaph on `server_end`.
2714    ///
2715    /// Errors:
2716    ///
2717    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2718    /// - `WRONG_TYPE` if `id` was not a connector capability.
2719    ConnectorOpen {
2720        id: u64,
2721        server_end: fidl::Channel,
2722        responder: CapabilityStoreConnectorOpenResponder,
2723    },
2724    /// Creates a [DirConnector] from a [DirReceiver]. Incoming connections to the [DirConnector]
2725    /// will be dispatched to this [DirReceiver].
2726    ///
2727    /// Errors:
2728    ///
2729    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
2730    DirConnectorCreate {
2731        id: u64,
2732        receiver: fidl::endpoints::ClientEnd<DirReceiverMarker>,
2733        responder: CapabilityStoreDirConnectorCreateResponder,
2734    },
2735    /// Open a connection from the provided [DirConnector] capability that will be dispatched to
2736    /// the [DirReceiver] on the other end.
2737    ///
2738    /// This method does not take `Open`/`Open3` parameters such as `flags` or `path`.
2739    /// Clients that wish to specify these can get an initial connection from this method
2740    /// and call `fuchsia.io/Directory.Open` on it. See the [DirReceiver] documentation for
2741    /// more information about the expectations of the server side.
2742    ///
2743    /// If there was an error making the connection, it will be reported as a zx.Status
2744    /// epitaph on `server_end`.
2745    ///
2746    /// Errors:
2747    ///
2748    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2749    /// - `WRONG_TYPE` if `id` was not a connector capability.
2750    DirConnectorOpen {
2751        id: u64,
2752        server_end: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
2753        responder: CapabilityStoreDirConnectorOpenResponder,
2754    },
2755    /// Creates a new empty dictionary in this [`CapabilityStore`] with client-assigned `id`.
2756    ///
2757    /// Errors:
2758    ///
2759    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
2760    DictionaryCreate { id: u64, responder: CapabilityStoreDictionaryCreateResponder },
2761    /// Imports a dictionary in the form of a channel.
2762    ///
2763    /// This is a legacy API to support backward compatibility with APIs that take a [Dictionary]
2764    /// channel.
2765    ///
2766    /// Errors:
2767    ///
2768    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
2769    /// - `BAD_CAPABILITY` if `client_end` was not a valid dictionary channel.
2770    DictionaryLegacyImport {
2771        id: u64,
2772        client_end: fidl::Channel,
2773        responder: CapabilityStoreDictionaryLegacyImportResponder,
2774    },
2775    /// Binds a channel to the dictionary with `id`. The channel can
2776    /// be re-imported into a [CapabilityStore] with [DictionaryImportLegacy].
2777    ///
2778    /// This is a legacy API to support backward compatibility with APIs that take a [Dictionary]
2779    /// channel.
2780    ///
2781    /// Errors:
2782    ///
2783    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2784    DictionaryLegacyExport {
2785        id: u64,
2786        server_end: fidl::Channel,
2787        responder: CapabilityStoreDictionaryLegacyExportResponder,
2788    },
2789    /// Inserts `item` into the dictionary with `id`. `item.value` is moved into the dictionary and
2790    /// its id is released if this call succeeds.
2791    ///
2792    /// Errors:
2793    ///
2794    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2795    /// - `WRONG_TYPE` if `id` was not a dictionary.
2796    /// - `INVALID_KEY` if `item.key` was invalid.
2797    /// - `ITEM_ALREADY_EXISTS` if the dictionary already contains an item with `item.key`.
2798    DictionaryInsert {
2799        id: u64,
2800        item: DictionaryItem,
2801        responder: CapabilityStoreDictionaryInsertResponder,
2802    },
2803    /// Get a duplicate of a capability from the dictionary with `id`, which is
2804    /// loaded into `dest_id`.
2805    ///
2806    /// Errors:
2807    ///
2808    /// - `ID_NOT_FOUND` if `id` was not a recognized capability id in this store.
2809    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
2810    /// - `WRONG_TYPE` if `id` was not a dictionary.
2811    /// - `INVALID_KEY` if `item.key` was invalid.
2812    /// - `ITEM_NOT_FOUND` if the dictionary does not contain `key`.
2813    /// - `NOT_DUPLICATABLE` if the capability could not be duplicated.
2814    DictionaryGet {
2815        id: u64,
2816        key: String,
2817        dest_id: u64,
2818        responder: CapabilityStoreDictionaryGetResponder,
2819    },
2820    /// Removes a key from the dictionary with `id`. If `dest_id` is present, loads the value
2821    /// into it, otherwise discards the value.
2822    ///
2823    /// Errors:
2824    ///
2825    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2826    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
2827    /// - `WRONG_TYPE` if `id` was not a dictionary.
2828    /// - `INVALID_KEY` if `key` was invalid.
2829    /// - `ITEM_NOT_FOUND` if the dictionary does not contain the key.
2830    DictionaryRemove {
2831        id: u64,
2832        key: String,
2833        dest_id: Option<Box<WrappedCapabilityId>>,
2834        responder: CapabilityStoreDictionaryRemoveResponder,
2835    },
2836    /// Create a new dictionary that contains a duplicate of all the entries in
2837    /// the dictionary with `id`, assigning `dest_id` to the new dictionary.
2838    /// The runtime of this method is linear in the number of top-level entries
2839    /// in the dictionary.
2840    ///
2841    /// For example, if the dictionary contains nested dictionaries, the newly
2842    /// created dictionary will contain references to those same nested
2843    /// dictionaries because the entries are duplicated rather than deep-copied.
2844    ///
2845    /// Errors:
2846    ///
2847    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2848    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
2849    /// - `WRONG_TYPE` if `id` was not a dictionary.
2850    /// - `NOT_DUPLICATABLE` if one of the capabilities in `id` could not be duplicated.
2851    DictionaryCopy { id: u64, dest_id: u64, responder: CapabilityStoreDictionaryCopyResponder },
2852    /// Enumerates the keys in the dictionary with `id`.
2853    ///
2854    /// Errors:
2855    ///
2856    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2857    /// - `WRONG_TYPE` if `id` was not a dictionary.
2858    DictionaryKeys {
2859        id: u64,
2860        iterator: fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>,
2861        responder: CapabilityStoreDictionaryKeysResponder,
2862    },
2863    /// Enumerates the items (keys and values) in the dictionary with `id`.
2864    ///
2865    /// Creates a duplicate of each value (capability). If a value could not be duplicated,
2866    /// the value will be null.
2867    ///
2868    /// Errors:
2869    ///
2870    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2871    /// - `WRONG_TYPE` if `id` was not a dictionary.
2872    DictionaryEnumerate {
2873        id: u64,
2874        iterator: fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
2875        responder: CapabilityStoreDictionaryEnumerateResponder,
2876    },
2877    /// Removes all the entries in this dictionary, returning them in `contents` if provided.
2878    /// If `contents` is not provided, all the items are discarded without enumerating them.
2879    ///
2880    /// Errors:
2881    ///
2882    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2883    /// - `WRONG_TYPE` if `id` was not a dictionary.
2884    DictionaryDrain {
2885        id: u64,
2886        iterator: Option<fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>>,
2887        responder: CapabilityStoreDictionaryDrainResponder,
2888    },
2889    /// An interaction was received which does not match any known method.
2890    #[non_exhaustive]
2891    _UnknownMethod {
2892        /// Ordinal of the method that was called.
2893        ordinal: u64,
2894        control_handle: CapabilityStoreControlHandle,
2895        method_type: fidl::MethodType,
2896    },
2897}
2898
2899impl CapabilityStoreRequest {
2900    #[allow(irrefutable_let_patterns)]
2901    pub fn into_duplicate(self) -> Option<(u64, u64, CapabilityStoreDuplicateResponder)> {
2902        if let CapabilityStoreRequest::Duplicate { id, dest_id, responder } = self {
2903            Some((id, dest_id, responder))
2904        } else {
2905            None
2906        }
2907    }
2908
2909    #[allow(irrefutable_let_patterns)]
2910    pub fn into_drop(self) -> Option<(u64, CapabilityStoreDropResponder)> {
2911        if let CapabilityStoreRequest::Drop { id, responder } = self {
2912            Some((id, responder))
2913        } else {
2914            None
2915        }
2916    }
2917
2918    #[allow(irrefutable_let_patterns)]
2919    pub fn into_export(self) -> Option<(u64, CapabilityStoreExportResponder)> {
2920        if let CapabilityStoreRequest::Export { id, responder } = self {
2921            Some((id, responder))
2922        } else {
2923            None
2924        }
2925    }
2926
2927    #[allow(irrefutable_let_patterns)]
2928    pub fn into_import(self) -> Option<(u64, Capability, CapabilityStoreImportResponder)> {
2929        if let CapabilityStoreRequest::Import { id, capability, responder } = self {
2930            Some((id, capability, responder))
2931        } else {
2932            None
2933        }
2934    }
2935
2936    #[allow(irrefutable_let_patterns)]
2937    pub fn into_connector_create(
2938        self,
2939    ) -> Option<(
2940        u64,
2941        fidl::endpoints::ClientEnd<ReceiverMarker>,
2942        CapabilityStoreConnectorCreateResponder,
2943    )> {
2944        if let CapabilityStoreRequest::ConnectorCreate { id, receiver, responder } = self {
2945            Some((id, receiver, responder))
2946        } else {
2947            None
2948        }
2949    }
2950
2951    #[allow(irrefutable_let_patterns)]
2952    pub fn into_connector_open(
2953        self,
2954    ) -> Option<(u64, fidl::Channel, CapabilityStoreConnectorOpenResponder)> {
2955        if let CapabilityStoreRequest::ConnectorOpen { id, server_end, responder } = self {
2956            Some((id, server_end, responder))
2957        } else {
2958            None
2959        }
2960    }
2961
2962    #[allow(irrefutable_let_patterns)]
2963    pub fn into_dir_connector_create(
2964        self,
2965    ) -> Option<(
2966        u64,
2967        fidl::endpoints::ClientEnd<DirReceiverMarker>,
2968        CapabilityStoreDirConnectorCreateResponder,
2969    )> {
2970        if let CapabilityStoreRequest::DirConnectorCreate { id, receiver, responder } = self {
2971            Some((id, receiver, responder))
2972        } else {
2973            None
2974        }
2975    }
2976
2977    #[allow(irrefutable_let_patterns)]
2978    pub fn into_dir_connector_open(
2979        self,
2980    ) -> Option<(
2981        u64,
2982        fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
2983        CapabilityStoreDirConnectorOpenResponder,
2984    )> {
2985        if let CapabilityStoreRequest::DirConnectorOpen { id, server_end, responder } = self {
2986            Some((id, server_end, responder))
2987        } else {
2988            None
2989        }
2990    }
2991
2992    #[allow(irrefutable_let_patterns)]
2993    pub fn into_dictionary_create(self) -> Option<(u64, CapabilityStoreDictionaryCreateResponder)> {
2994        if let CapabilityStoreRequest::DictionaryCreate { id, responder } = self {
2995            Some((id, responder))
2996        } else {
2997            None
2998        }
2999    }
3000
3001    #[allow(irrefutable_let_patterns)]
3002    pub fn into_dictionary_legacy_import(
3003        self,
3004    ) -> Option<(u64, fidl::Channel, CapabilityStoreDictionaryLegacyImportResponder)> {
3005        if let CapabilityStoreRequest::DictionaryLegacyImport { id, client_end, responder } = self {
3006            Some((id, client_end, responder))
3007        } else {
3008            None
3009        }
3010    }
3011
3012    #[allow(irrefutable_let_patterns)]
3013    pub fn into_dictionary_legacy_export(
3014        self,
3015    ) -> Option<(u64, fidl::Channel, CapabilityStoreDictionaryLegacyExportResponder)> {
3016        if let CapabilityStoreRequest::DictionaryLegacyExport { id, server_end, responder } = self {
3017            Some((id, server_end, responder))
3018        } else {
3019            None
3020        }
3021    }
3022
3023    #[allow(irrefutable_let_patterns)]
3024    pub fn into_dictionary_insert(
3025        self,
3026    ) -> Option<(u64, DictionaryItem, CapabilityStoreDictionaryInsertResponder)> {
3027        if let CapabilityStoreRequest::DictionaryInsert { id, item, responder } = self {
3028            Some((id, item, responder))
3029        } else {
3030            None
3031        }
3032    }
3033
3034    #[allow(irrefutable_let_patterns)]
3035    pub fn into_dictionary_get(
3036        self,
3037    ) -> Option<(u64, String, u64, CapabilityStoreDictionaryGetResponder)> {
3038        if let CapabilityStoreRequest::DictionaryGet { id, key, dest_id, responder } = self {
3039            Some((id, key, dest_id, responder))
3040        } else {
3041            None
3042        }
3043    }
3044
3045    #[allow(irrefutable_let_patterns)]
3046    pub fn into_dictionary_remove(
3047        self,
3048    ) -> Option<(
3049        u64,
3050        String,
3051        Option<Box<WrappedCapabilityId>>,
3052        CapabilityStoreDictionaryRemoveResponder,
3053    )> {
3054        if let CapabilityStoreRequest::DictionaryRemove { id, key, dest_id, responder } = self {
3055            Some((id, key, dest_id, responder))
3056        } else {
3057            None
3058        }
3059    }
3060
3061    #[allow(irrefutable_let_patterns)]
3062    pub fn into_dictionary_copy(
3063        self,
3064    ) -> Option<(u64, u64, CapabilityStoreDictionaryCopyResponder)> {
3065        if let CapabilityStoreRequest::DictionaryCopy { id, dest_id, responder } = self {
3066            Some((id, dest_id, responder))
3067        } else {
3068            None
3069        }
3070    }
3071
3072    #[allow(irrefutable_let_patterns)]
3073    pub fn into_dictionary_keys(
3074        self,
3075    ) -> Option<(
3076        u64,
3077        fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>,
3078        CapabilityStoreDictionaryKeysResponder,
3079    )> {
3080        if let CapabilityStoreRequest::DictionaryKeys { id, iterator, responder } = self {
3081            Some((id, iterator, responder))
3082        } else {
3083            None
3084        }
3085    }
3086
3087    #[allow(irrefutable_let_patterns)]
3088    pub fn into_dictionary_enumerate(
3089        self,
3090    ) -> Option<(
3091        u64,
3092        fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
3093        CapabilityStoreDictionaryEnumerateResponder,
3094    )> {
3095        if let CapabilityStoreRequest::DictionaryEnumerate { id, iterator, responder } = self {
3096            Some((id, iterator, responder))
3097        } else {
3098            None
3099        }
3100    }
3101
3102    #[allow(irrefutable_let_patterns)]
3103    pub fn into_dictionary_drain(
3104        self,
3105    ) -> Option<(
3106        u64,
3107        Option<fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>>,
3108        CapabilityStoreDictionaryDrainResponder,
3109    )> {
3110        if let CapabilityStoreRequest::DictionaryDrain { id, iterator, responder } = self {
3111            Some((id, iterator, responder))
3112        } else {
3113            None
3114        }
3115    }
3116
3117    /// Name of the method defined in FIDL
3118    pub fn method_name(&self) -> &'static str {
3119        match *self {
3120            CapabilityStoreRequest::Duplicate { .. } => "duplicate",
3121            CapabilityStoreRequest::Drop { .. } => "drop",
3122            CapabilityStoreRequest::Export { .. } => "export",
3123            CapabilityStoreRequest::Import { .. } => "import",
3124            CapabilityStoreRequest::ConnectorCreate { .. } => "connector_create",
3125            CapabilityStoreRequest::ConnectorOpen { .. } => "connector_open",
3126            CapabilityStoreRequest::DirConnectorCreate { .. } => "dir_connector_create",
3127            CapabilityStoreRequest::DirConnectorOpen { .. } => "dir_connector_open",
3128            CapabilityStoreRequest::DictionaryCreate { .. } => "dictionary_create",
3129            CapabilityStoreRequest::DictionaryLegacyImport { .. } => "dictionary_legacy_import",
3130            CapabilityStoreRequest::DictionaryLegacyExport { .. } => "dictionary_legacy_export",
3131            CapabilityStoreRequest::DictionaryInsert { .. } => "dictionary_insert",
3132            CapabilityStoreRequest::DictionaryGet { .. } => "dictionary_get",
3133            CapabilityStoreRequest::DictionaryRemove { .. } => "dictionary_remove",
3134            CapabilityStoreRequest::DictionaryCopy { .. } => "dictionary_copy",
3135            CapabilityStoreRequest::DictionaryKeys { .. } => "dictionary_keys",
3136            CapabilityStoreRequest::DictionaryEnumerate { .. } => "dictionary_enumerate",
3137            CapabilityStoreRequest::DictionaryDrain { .. } => "dictionary_drain",
3138            CapabilityStoreRequest::_UnknownMethod {
3139                method_type: fidl::MethodType::OneWay,
3140                ..
3141            } => "unknown one-way method",
3142            CapabilityStoreRequest::_UnknownMethod {
3143                method_type: fidl::MethodType::TwoWay,
3144                ..
3145            } => "unknown two-way method",
3146        }
3147    }
3148}
3149
3150#[derive(Debug, Clone)]
3151pub struct CapabilityStoreControlHandle {
3152    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3153}
3154
3155impl fidl::endpoints::ControlHandle for CapabilityStoreControlHandle {
3156    fn shutdown(&self) {
3157        self.inner.shutdown()
3158    }
3159    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3160        self.inner.shutdown_with_epitaph(status)
3161    }
3162
3163    fn is_closed(&self) -> bool {
3164        self.inner.channel().is_closed()
3165    }
3166    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3167        self.inner.channel().on_closed()
3168    }
3169
3170    #[cfg(target_os = "fuchsia")]
3171    fn signal_peer(
3172        &self,
3173        clear_mask: zx::Signals,
3174        set_mask: zx::Signals,
3175    ) -> Result<(), zx_status::Status> {
3176        use fidl::Peered;
3177        self.inner.channel().signal_peer(clear_mask, set_mask)
3178    }
3179}
3180
3181impl CapabilityStoreControlHandle {}
3182
3183#[must_use = "FIDL methods require a response to be sent"]
3184#[derive(Debug)]
3185pub struct CapabilityStoreDuplicateResponder {
3186    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3187    tx_id: u32,
3188}
3189
3190/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3191/// if the responder is dropped without sending a response, so that the client
3192/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3193impl std::ops::Drop for CapabilityStoreDuplicateResponder {
3194    fn drop(&mut self) {
3195        self.control_handle.shutdown();
3196        // Safety: drops once, never accessed again
3197        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3198    }
3199}
3200
3201impl fidl::endpoints::Responder for CapabilityStoreDuplicateResponder {
3202    type ControlHandle = CapabilityStoreControlHandle;
3203
3204    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3205        &self.control_handle
3206    }
3207
3208    fn drop_without_shutdown(mut self) {
3209        // Safety: drops once, never accessed again due to mem::forget
3210        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3211        // Prevent Drop from running (which would shut down the channel)
3212        std::mem::forget(self);
3213    }
3214}
3215
3216impl CapabilityStoreDuplicateResponder {
3217    /// Sends a response to the FIDL transaction.
3218    ///
3219    /// Sets the channel to shutdown if an error occurs.
3220    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3221        let _result = self.send_raw(result);
3222        if _result.is_err() {
3223            self.control_handle.shutdown();
3224        }
3225        self.drop_without_shutdown();
3226        _result
3227    }
3228
3229    /// Similar to "send" but does not shutdown the channel if an error occurs.
3230    pub fn send_no_shutdown_on_err(
3231        self,
3232        mut result: Result<(), CapabilityStoreError>,
3233    ) -> Result<(), fidl::Error> {
3234        let _result = self.send_raw(result);
3235        self.drop_without_shutdown();
3236        _result
3237    }
3238
3239    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3240        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3241            fidl::encoding::EmptyStruct,
3242            CapabilityStoreError,
3243        >>(
3244            fidl::encoding::FlexibleResult::new(result),
3245            self.tx_id,
3246            0x5d5d35d9c20a2184,
3247            fidl::encoding::DynamicFlags::FLEXIBLE,
3248        )
3249    }
3250}
3251
3252#[must_use = "FIDL methods require a response to be sent"]
3253#[derive(Debug)]
3254pub struct CapabilityStoreDropResponder {
3255    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3256    tx_id: u32,
3257}
3258
3259/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3260/// if the responder is dropped without sending a response, so that the client
3261/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3262impl std::ops::Drop for CapabilityStoreDropResponder {
3263    fn drop(&mut self) {
3264        self.control_handle.shutdown();
3265        // Safety: drops once, never accessed again
3266        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3267    }
3268}
3269
3270impl fidl::endpoints::Responder for CapabilityStoreDropResponder {
3271    type ControlHandle = CapabilityStoreControlHandle;
3272
3273    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3274        &self.control_handle
3275    }
3276
3277    fn drop_without_shutdown(mut self) {
3278        // Safety: drops once, never accessed again due to mem::forget
3279        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3280        // Prevent Drop from running (which would shut down the channel)
3281        std::mem::forget(self);
3282    }
3283}
3284
3285impl CapabilityStoreDropResponder {
3286    /// Sends a response to the FIDL transaction.
3287    ///
3288    /// Sets the channel to shutdown if an error occurs.
3289    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3290        let _result = self.send_raw(result);
3291        if _result.is_err() {
3292            self.control_handle.shutdown();
3293        }
3294        self.drop_without_shutdown();
3295        _result
3296    }
3297
3298    /// Similar to "send" but does not shutdown the channel if an error occurs.
3299    pub fn send_no_shutdown_on_err(
3300        self,
3301        mut result: Result<(), CapabilityStoreError>,
3302    ) -> Result<(), fidl::Error> {
3303        let _result = self.send_raw(result);
3304        self.drop_without_shutdown();
3305        _result
3306    }
3307
3308    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3309        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3310            fidl::encoding::EmptyStruct,
3311            CapabilityStoreError,
3312        >>(
3313            fidl::encoding::FlexibleResult::new(result),
3314            self.tx_id,
3315            0xa745c0990fc2559,
3316            fidl::encoding::DynamicFlags::FLEXIBLE,
3317        )
3318    }
3319}
3320
3321#[must_use = "FIDL methods require a response to be sent"]
3322#[derive(Debug)]
3323pub struct CapabilityStoreExportResponder {
3324    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3325    tx_id: u32,
3326}
3327
3328/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3329/// if the responder is dropped without sending a response, so that the client
3330/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3331impl std::ops::Drop for CapabilityStoreExportResponder {
3332    fn drop(&mut self) {
3333        self.control_handle.shutdown();
3334        // Safety: drops once, never accessed again
3335        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3336    }
3337}
3338
3339impl fidl::endpoints::Responder for CapabilityStoreExportResponder {
3340    type ControlHandle = CapabilityStoreControlHandle;
3341
3342    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3343        &self.control_handle
3344    }
3345
3346    fn drop_without_shutdown(mut self) {
3347        // Safety: drops once, never accessed again due to mem::forget
3348        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3349        // Prevent Drop from running (which would shut down the channel)
3350        std::mem::forget(self);
3351    }
3352}
3353
3354impl CapabilityStoreExportResponder {
3355    /// Sends a response to the FIDL transaction.
3356    ///
3357    /// Sets the channel to shutdown if an error occurs.
3358    pub fn send(
3359        self,
3360        mut result: Result<Capability, CapabilityStoreError>,
3361    ) -> Result<(), fidl::Error> {
3362        let _result = self.send_raw(result);
3363        if _result.is_err() {
3364            self.control_handle.shutdown();
3365        }
3366        self.drop_without_shutdown();
3367        _result
3368    }
3369
3370    /// Similar to "send" but does not shutdown the channel if an error occurs.
3371    pub fn send_no_shutdown_on_err(
3372        self,
3373        mut result: Result<Capability, CapabilityStoreError>,
3374    ) -> Result<(), fidl::Error> {
3375        let _result = self.send_raw(result);
3376        self.drop_without_shutdown();
3377        _result
3378    }
3379
3380    fn send_raw(
3381        &self,
3382        mut result: Result<Capability, CapabilityStoreError>,
3383    ) -> Result<(), fidl::Error> {
3384        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3385            CapabilityStoreExportResponse,
3386            CapabilityStoreError,
3387        >>(
3388            fidl::encoding::FlexibleResult::new(
3389                result.as_mut().map_err(|e| *e).map(|capability| (capability,)),
3390            ),
3391            self.tx_id,
3392            0x3237a8f4748faff,
3393            fidl::encoding::DynamicFlags::FLEXIBLE,
3394        )
3395    }
3396}
3397
3398#[must_use = "FIDL methods require a response to be sent"]
3399#[derive(Debug)]
3400pub struct CapabilityStoreImportResponder {
3401    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3402    tx_id: u32,
3403}
3404
3405/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3406/// if the responder is dropped without sending a response, so that the client
3407/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3408impl std::ops::Drop for CapabilityStoreImportResponder {
3409    fn drop(&mut self) {
3410        self.control_handle.shutdown();
3411        // Safety: drops once, never accessed again
3412        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3413    }
3414}
3415
3416impl fidl::endpoints::Responder for CapabilityStoreImportResponder {
3417    type ControlHandle = CapabilityStoreControlHandle;
3418
3419    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3420        &self.control_handle
3421    }
3422
3423    fn drop_without_shutdown(mut self) {
3424        // Safety: drops once, never accessed again due to mem::forget
3425        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3426        // Prevent Drop from running (which would shut down the channel)
3427        std::mem::forget(self);
3428    }
3429}
3430
3431impl CapabilityStoreImportResponder {
3432    /// Sends a response to the FIDL transaction.
3433    ///
3434    /// Sets the channel to shutdown if an error occurs.
3435    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3436        let _result = self.send_raw(result);
3437        if _result.is_err() {
3438            self.control_handle.shutdown();
3439        }
3440        self.drop_without_shutdown();
3441        _result
3442    }
3443
3444    /// Similar to "send" but does not shutdown the channel if an error occurs.
3445    pub fn send_no_shutdown_on_err(
3446        self,
3447        mut result: Result<(), CapabilityStoreError>,
3448    ) -> Result<(), fidl::Error> {
3449        let _result = self.send_raw(result);
3450        self.drop_without_shutdown();
3451        _result
3452    }
3453
3454    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3455        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3456            fidl::encoding::EmptyStruct,
3457            CapabilityStoreError,
3458        >>(
3459            fidl::encoding::FlexibleResult::new(result),
3460            self.tx_id,
3461            0x1f96157a29f4539b,
3462            fidl::encoding::DynamicFlags::FLEXIBLE,
3463        )
3464    }
3465}
3466
3467#[must_use = "FIDL methods require a response to be sent"]
3468#[derive(Debug)]
3469pub struct CapabilityStoreConnectorCreateResponder {
3470    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3471    tx_id: u32,
3472}
3473
3474/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3475/// if the responder is dropped without sending a response, so that the client
3476/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3477impl std::ops::Drop for CapabilityStoreConnectorCreateResponder {
3478    fn drop(&mut self) {
3479        self.control_handle.shutdown();
3480        // Safety: drops once, never accessed again
3481        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3482    }
3483}
3484
3485impl fidl::endpoints::Responder for CapabilityStoreConnectorCreateResponder {
3486    type ControlHandle = CapabilityStoreControlHandle;
3487
3488    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3489        &self.control_handle
3490    }
3491
3492    fn drop_without_shutdown(mut self) {
3493        // Safety: drops once, never accessed again due to mem::forget
3494        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3495        // Prevent Drop from running (which would shut down the channel)
3496        std::mem::forget(self);
3497    }
3498}
3499
3500impl CapabilityStoreConnectorCreateResponder {
3501    /// Sends a response to the FIDL transaction.
3502    ///
3503    /// Sets the channel to shutdown if an error occurs.
3504    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3505        let _result = self.send_raw(result);
3506        if _result.is_err() {
3507            self.control_handle.shutdown();
3508        }
3509        self.drop_without_shutdown();
3510        _result
3511    }
3512
3513    /// Similar to "send" but does not shutdown the channel if an error occurs.
3514    pub fn send_no_shutdown_on_err(
3515        self,
3516        mut result: Result<(), CapabilityStoreError>,
3517    ) -> Result<(), fidl::Error> {
3518        let _result = self.send_raw(result);
3519        self.drop_without_shutdown();
3520        _result
3521    }
3522
3523    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3524        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3525            fidl::encoding::EmptyStruct,
3526            CapabilityStoreError,
3527        >>(
3528            fidl::encoding::FlexibleResult::new(result),
3529            self.tx_id,
3530            0x29592c5d63e91c25,
3531            fidl::encoding::DynamicFlags::FLEXIBLE,
3532        )
3533    }
3534}
3535
3536#[must_use = "FIDL methods require a response to be sent"]
3537#[derive(Debug)]
3538pub struct CapabilityStoreConnectorOpenResponder {
3539    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3540    tx_id: u32,
3541}
3542
3543/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3544/// if the responder is dropped without sending a response, so that the client
3545/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3546impl std::ops::Drop for CapabilityStoreConnectorOpenResponder {
3547    fn drop(&mut self) {
3548        self.control_handle.shutdown();
3549        // Safety: drops once, never accessed again
3550        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3551    }
3552}
3553
3554impl fidl::endpoints::Responder for CapabilityStoreConnectorOpenResponder {
3555    type ControlHandle = CapabilityStoreControlHandle;
3556
3557    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3558        &self.control_handle
3559    }
3560
3561    fn drop_without_shutdown(mut self) {
3562        // Safety: drops once, never accessed again due to mem::forget
3563        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3564        // Prevent Drop from running (which would shut down the channel)
3565        std::mem::forget(self);
3566    }
3567}
3568
3569impl CapabilityStoreConnectorOpenResponder {
3570    /// Sends a response to the FIDL transaction.
3571    ///
3572    /// Sets the channel to shutdown if an error occurs.
3573    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3574        let _result = self.send_raw(result);
3575        if _result.is_err() {
3576            self.control_handle.shutdown();
3577        }
3578        self.drop_without_shutdown();
3579        _result
3580    }
3581
3582    /// Similar to "send" but does not shutdown the channel if an error occurs.
3583    pub fn send_no_shutdown_on_err(
3584        self,
3585        mut result: Result<(), CapabilityStoreError>,
3586    ) -> Result<(), fidl::Error> {
3587        let _result = self.send_raw(result);
3588        self.drop_without_shutdown();
3589        _result
3590    }
3591
3592    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3593        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3594            fidl::encoding::EmptyStruct,
3595            CapabilityStoreError,
3596        >>(
3597            fidl::encoding::FlexibleResult::new(result),
3598            self.tx_id,
3599            0x537e69ab40563b9f,
3600            fidl::encoding::DynamicFlags::FLEXIBLE,
3601        )
3602    }
3603}
3604
3605#[must_use = "FIDL methods require a response to be sent"]
3606#[derive(Debug)]
3607pub struct CapabilityStoreDirConnectorCreateResponder {
3608    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3609    tx_id: u32,
3610}
3611
3612/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3613/// if the responder is dropped without sending a response, so that the client
3614/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3615impl std::ops::Drop for CapabilityStoreDirConnectorCreateResponder {
3616    fn drop(&mut self) {
3617        self.control_handle.shutdown();
3618        // Safety: drops once, never accessed again
3619        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3620    }
3621}
3622
3623impl fidl::endpoints::Responder for CapabilityStoreDirConnectorCreateResponder {
3624    type ControlHandle = CapabilityStoreControlHandle;
3625
3626    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3627        &self.control_handle
3628    }
3629
3630    fn drop_without_shutdown(mut self) {
3631        // Safety: drops once, never accessed again due to mem::forget
3632        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3633        // Prevent Drop from running (which would shut down the channel)
3634        std::mem::forget(self);
3635    }
3636}
3637
3638impl CapabilityStoreDirConnectorCreateResponder {
3639    /// Sends a response to the FIDL transaction.
3640    ///
3641    /// Sets the channel to shutdown if an error occurs.
3642    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3643        let _result = self.send_raw(result);
3644        if _result.is_err() {
3645            self.control_handle.shutdown();
3646        }
3647        self.drop_without_shutdown();
3648        _result
3649    }
3650
3651    /// Similar to "send" but does not shutdown the channel if an error occurs.
3652    pub fn send_no_shutdown_on_err(
3653        self,
3654        mut result: Result<(), CapabilityStoreError>,
3655    ) -> Result<(), fidl::Error> {
3656        let _result = self.send_raw(result);
3657        self.drop_without_shutdown();
3658        _result
3659    }
3660
3661    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3662        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3663            fidl::encoding::EmptyStruct,
3664            CapabilityStoreError,
3665        >>(
3666            fidl::encoding::FlexibleResult::new(result),
3667            self.tx_id,
3668            0x186138a11ccf19bb,
3669            fidl::encoding::DynamicFlags::FLEXIBLE,
3670        )
3671    }
3672}
3673
3674#[must_use = "FIDL methods require a response to be sent"]
3675#[derive(Debug)]
3676pub struct CapabilityStoreDirConnectorOpenResponder {
3677    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3678    tx_id: u32,
3679}
3680
3681/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3682/// if the responder is dropped without sending a response, so that the client
3683/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3684impl std::ops::Drop for CapabilityStoreDirConnectorOpenResponder {
3685    fn drop(&mut self) {
3686        self.control_handle.shutdown();
3687        // Safety: drops once, never accessed again
3688        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3689    }
3690}
3691
3692impl fidl::endpoints::Responder for CapabilityStoreDirConnectorOpenResponder {
3693    type ControlHandle = CapabilityStoreControlHandle;
3694
3695    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3696        &self.control_handle
3697    }
3698
3699    fn drop_without_shutdown(mut self) {
3700        // Safety: drops once, never accessed again due to mem::forget
3701        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3702        // Prevent Drop from running (which would shut down the channel)
3703        std::mem::forget(self);
3704    }
3705}
3706
3707impl CapabilityStoreDirConnectorOpenResponder {
3708    /// Sends a response to the FIDL transaction.
3709    ///
3710    /// Sets the channel to shutdown if an error occurs.
3711    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3712        let _result = self.send_raw(result);
3713        if _result.is_err() {
3714            self.control_handle.shutdown();
3715        }
3716        self.drop_without_shutdown();
3717        _result
3718    }
3719
3720    /// Similar to "send" but does not shutdown the channel if an error occurs.
3721    pub fn send_no_shutdown_on_err(
3722        self,
3723        mut result: Result<(), CapabilityStoreError>,
3724    ) -> Result<(), fidl::Error> {
3725        let _result = self.send_raw(result);
3726        self.drop_without_shutdown();
3727        _result
3728    }
3729
3730    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3731        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3732            fidl::encoding::EmptyStruct,
3733            CapabilityStoreError,
3734        >>(
3735            fidl::encoding::FlexibleResult::new(result),
3736            self.tx_id,
3737            0x5650d3d6a3a13901,
3738            fidl::encoding::DynamicFlags::FLEXIBLE,
3739        )
3740    }
3741}
3742
3743#[must_use = "FIDL methods require a response to be sent"]
3744#[derive(Debug)]
3745pub struct CapabilityStoreDictionaryCreateResponder {
3746    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3747    tx_id: u32,
3748}
3749
3750/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3751/// if the responder is dropped without sending a response, so that the client
3752/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3753impl std::ops::Drop for CapabilityStoreDictionaryCreateResponder {
3754    fn drop(&mut self) {
3755        self.control_handle.shutdown();
3756        // Safety: drops once, never accessed again
3757        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3758    }
3759}
3760
3761impl fidl::endpoints::Responder for CapabilityStoreDictionaryCreateResponder {
3762    type ControlHandle = CapabilityStoreControlHandle;
3763
3764    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3765        &self.control_handle
3766    }
3767
3768    fn drop_without_shutdown(mut self) {
3769        // Safety: drops once, never accessed again due to mem::forget
3770        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3771        // Prevent Drop from running (which would shut down the channel)
3772        std::mem::forget(self);
3773    }
3774}
3775
3776impl CapabilityStoreDictionaryCreateResponder {
3777    /// Sends a response to the FIDL transaction.
3778    ///
3779    /// Sets the channel to shutdown if an error occurs.
3780    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3781        let _result = self.send_raw(result);
3782        if _result.is_err() {
3783            self.control_handle.shutdown();
3784        }
3785        self.drop_without_shutdown();
3786        _result
3787    }
3788
3789    /// Similar to "send" but does not shutdown the channel if an error occurs.
3790    pub fn send_no_shutdown_on_err(
3791        self,
3792        mut result: Result<(), CapabilityStoreError>,
3793    ) -> Result<(), fidl::Error> {
3794        let _result = self.send_raw(result);
3795        self.drop_without_shutdown();
3796        _result
3797    }
3798
3799    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3800        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3801            fidl::encoding::EmptyStruct,
3802            CapabilityStoreError,
3803        >>(
3804            fidl::encoding::FlexibleResult::new(result),
3805            self.tx_id,
3806            0x6997c8dfc63de093,
3807            fidl::encoding::DynamicFlags::FLEXIBLE,
3808        )
3809    }
3810}
3811
3812#[must_use = "FIDL methods require a response to be sent"]
3813#[derive(Debug)]
3814pub struct CapabilityStoreDictionaryLegacyImportResponder {
3815    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3816    tx_id: u32,
3817}
3818
3819/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3820/// if the responder is dropped without sending a response, so that the client
3821/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3822impl std::ops::Drop for CapabilityStoreDictionaryLegacyImportResponder {
3823    fn drop(&mut self) {
3824        self.control_handle.shutdown();
3825        // Safety: drops once, never accessed again
3826        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3827    }
3828}
3829
3830impl fidl::endpoints::Responder for CapabilityStoreDictionaryLegacyImportResponder {
3831    type ControlHandle = CapabilityStoreControlHandle;
3832
3833    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3834        &self.control_handle
3835    }
3836
3837    fn drop_without_shutdown(mut self) {
3838        // Safety: drops once, never accessed again due to mem::forget
3839        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3840        // Prevent Drop from running (which would shut down the channel)
3841        std::mem::forget(self);
3842    }
3843}
3844
3845impl CapabilityStoreDictionaryLegacyImportResponder {
3846    /// Sends a response to the FIDL transaction.
3847    ///
3848    /// Sets the channel to shutdown if an error occurs.
3849    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3850        let _result = self.send_raw(result);
3851        if _result.is_err() {
3852            self.control_handle.shutdown();
3853        }
3854        self.drop_without_shutdown();
3855        _result
3856    }
3857
3858    /// Similar to "send" but does not shutdown the channel if an error occurs.
3859    pub fn send_no_shutdown_on_err(
3860        self,
3861        mut result: Result<(), CapabilityStoreError>,
3862    ) -> Result<(), fidl::Error> {
3863        let _result = self.send_raw(result);
3864        self.drop_without_shutdown();
3865        _result
3866    }
3867
3868    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3869        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3870            fidl::encoding::EmptyStruct,
3871            CapabilityStoreError,
3872        >>(
3873            fidl::encoding::FlexibleResult::new(result),
3874            self.tx_id,
3875            0x72fd686c37b6025f,
3876            fidl::encoding::DynamicFlags::FLEXIBLE,
3877        )
3878    }
3879}
3880
3881#[must_use = "FIDL methods require a response to be sent"]
3882#[derive(Debug)]
3883pub struct CapabilityStoreDictionaryLegacyExportResponder {
3884    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3885    tx_id: u32,
3886}
3887
3888/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3889/// if the responder is dropped without sending a response, so that the client
3890/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3891impl std::ops::Drop for CapabilityStoreDictionaryLegacyExportResponder {
3892    fn drop(&mut self) {
3893        self.control_handle.shutdown();
3894        // Safety: drops once, never accessed again
3895        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3896    }
3897}
3898
3899impl fidl::endpoints::Responder for CapabilityStoreDictionaryLegacyExportResponder {
3900    type ControlHandle = CapabilityStoreControlHandle;
3901
3902    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3903        &self.control_handle
3904    }
3905
3906    fn drop_without_shutdown(mut self) {
3907        // Safety: drops once, never accessed again due to mem::forget
3908        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3909        // Prevent Drop from running (which would shut down the channel)
3910        std::mem::forget(self);
3911    }
3912}
3913
3914impl CapabilityStoreDictionaryLegacyExportResponder {
3915    /// Sends a response to the FIDL transaction.
3916    ///
3917    /// Sets the channel to shutdown if an error occurs.
3918    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3919        let _result = self.send_raw(result);
3920        if _result.is_err() {
3921            self.control_handle.shutdown();
3922        }
3923        self.drop_without_shutdown();
3924        _result
3925    }
3926
3927    /// Similar to "send" but does not shutdown the channel if an error occurs.
3928    pub fn send_no_shutdown_on_err(
3929        self,
3930        mut result: Result<(), CapabilityStoreError>,
3931    ) -> Result<(), fidl::Error> {
3932        let _result = self.send_raw(result);
3933        self.drop_without_shutdown();
3934        _result
3935    }
3936
3937    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3938        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3939            fidl::encoding::EmptyStruct,
3940            CapabilityStoreError,
3941        >>(
3942            fidl::encoding::FlexibleResult::new(result),
3943            self.tx_id,
3944            0x407e15cc4bde5dcd,
3945            fidl::encoding::DynamicFlags::FLEXIBLE,
3946        )
3947    }
3948}
3949
3950#[must_use = "FIDL methods require a response to be sent"]
3951#[derive(Debug)]
3952pub struct CapabilityStoreDictionaryInsertResponder {
3953    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3954    tx_id: u32,
3955}
3956
3957/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3958/// if the responder is dropped without sending a response, so that the client
3959/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3960impl std::ops::Drop for CapabilityStoreDictionaryInsertResponder {
3961    fn drop(&mut self) {
3962        self.control_handle.shutdown();
3963        // Safety: drops once, never accessed again
3964        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3965    }
3966}
3967
3968impl fidl::endpoints::Responder for CapabilityStoreDictionaryInsertResponder {
3969    type ControlHandle = CapabilityStoreControlHandle;
3970
3971    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3972        &self.control_handle
3973    }
3974
3975    fn drop_without_shutdown(mut self) {
3976        // Safety: drops once, never accessed again due to mem::forget
3977        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3978        // Prevent Drop from running (which would shut down the channel)
3979        std::mem::forget(self);
3980    }
3981}
3982
3983impl CapabilityStoreDictionaryInsertResponder {
3984    /// Sends a response to the FIDL transaction.
3985    ///
3986    /// Sets the channel to shutdown if an error occurs.
3987    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3988        let _result = self.send_raw(result);
3989        if _result.is_err() {
3990            self.control_handle.shutdown();
3991        }
3992        self.drop_without_shutdown();
3993        _result
3994    }
3995
3996    /// Similar to "send" but does not shutdown the channel if an error occurs.
3997    pub fn send_no_shutdown_on_err(
3998        self,
3999        mut result: Result<(), CapabilityStoreError>,
4000    ) -> Result<(), fidl::Error> {
4001        let _result = self.send_raw(result);
4002        self.drop_without_shutdown();
4003        _result
4004    }
4005
4006    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4007        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4008            fidl::encoding::EmptyStruct,
4009            CapabilityStoreError,
4010        >>(
4011            fidl::encoding::FlexibleResult::new(result),
4012            self.tx_id,
4013            0x7702183689d44c27,
4014            fidl::encoding::DynamicFlags::FLEXIBLE,
4015        )
4016    }
4017}
4018
4019#[must_use = "FIDL methods require a response to be sent"]
4020#[derive(Debug)]
4021pub struct CapabilityStoreDictionaryGetResponder {
4022    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
4023    tx_id: u32,
4024}
4025
4026/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
4027/// if the responder is dropped without sending a response, so that the client
4028/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4029impl std::ops::Drop for CapabilityStoreDictionaryGetResponder {
4030    fn drop(&mut self) {
4031        self.control_handle.shutdown();
4032        // Safety: drops once, never accessed again
4033        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4034    }
4035}
4036
4037impl fidl::endpoints::Responder for CapabilityStoreDictionaryGetResponder {
4038    type ControlHandle = CapabilityStoreControlHandle;
4039
4040    fn control_handle(&self) -> &CapabilityStoreControlHandle {
4041        &self.control_handle
4042    }
4043
4044    fn drop_without_shutdown(mut self) {
4045        // Safety: drops once, never accessed again due to mem::forget
4046        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4047        // Prevent Drop from running (which would shut down the channel)
4048        std::mem::forget(self);
4049    }
4050}
4051
4052impl CapabilityStoreDictionaryGetResponder {
4053    /// Sends a response to the FIDL transaction.
4054    ///
4055    /// Sets the channel to shutdown if an error occurs.
4056    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4057        let _result = self.send_raw(result);
4058        if _result.is_err() {
4059            self.control_handle.shutdown();
4060        }
4061        self.drop_without_shutdown();
4062        _result
4063    }
4064
4065    /// Similar to "send" but does not shutdown the channel if an error occurs.
4066    pub fn send_no_shutdown_on_err(
4067        self,
4068        mut result: Result<(), CapabilityStoreError>,
4069    ) -> Result<(), fidl::Error> {
4070        let _result = self.send_raw(result);
4071        self.drop_without_shutdown();
4072        _result
4073    }
4074
4075    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4076        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4077            fidl::encoding::EmptyStruct,
4078            CapabilityStoreError,
4079        >>(
4080            fidl::encoding::FlexibleResult::new(result),
4081            self.tx_id,
4082            0x4d9e27538284add2,
4083            fidl::encoding::DynamicFlags::FLEXIBLE,
4084        )
4085    }
4086}
4087
4088#[must_use = "FIDL methods require a response to be sent"]
4089#[derive(Debug)]
4090pub struct CapabilityStoreDictionaryRemoveResponder {
4091    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
4092    tx_id: u32,
4093}
4094
4095/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
4096/// if the responder is dropped without sending a response, so that the client
4097/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4098impl std::ops::Drop for CapabilityStoreDictionaryRemoveResponder {
4099    fn drop(&mut self) {
4100        self.control_handle.shutdown();
4101        // Safety: drops once, never accessed again
4102        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4103    }
4104}
4105
4106impl fidl::endpoints::Responder for CapabilityStoreDictionaryRemoveResponder {
4107    type ControlHandle = CapabilityStoreControlHandle;
4108
4109    fn control_handle(&self) -> &CapabilityStoreControlHandle {
4110        &self.control_handle
4111    }
4112
4113    fn drop_without_shutdown(mut self) {
4114        // Safety: drops once, never accessed again due to mem::forget
4115        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4116        // Prevent Drop from running (which would shut down the channel)
4117        std::mem::forget(self);
4118    }
4119}
4120
4121impl CapabilityStoreDictionaryRemoveResponder {
4122    /// Sends a response to the FIDL transaction.
4123    ///
4124    /// Sets the channel to shutdown if an error occurs.
4125    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4126        let _result = self.send_raw(result);
4127        if _result.is_err() {
4128            self.control_handle.shutdown();
4129        }
4130        self.drop_without_shutdown();
4131        _result
4132    }
4133
4134    /// Similar to "send" but does not shutdown the channel if an error occurs.
4135    pub fn send_no_shutdown_on_err(
4136        self,
4137        mut result: Result<(), CapabilityStoreError>,
4138    ) -> Result<(), fidl::Error> {
4139        let _result = self.send_raw(result);
4140        self.drop_without_shutdown();
4141        _result
4142    }
4143
4144    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4145        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4146            fidl::encoding::EmptyStruct,
4147            CapabilityStoreError,
4148        >>(
4149            fidl::encoding::FlexibleResult::new(result),
4150            self.tx_id,
4151            0x4c5c025ab05d4f3,
4152            fidl::encoding::DynamicFlags::FLEXIBLE,
4153        )
4154    }
4155}
4156
4157#[must_use = "FIDL methods require a response to be sent"]
4158#[derive(Debug)]
4159pub struct CapabilityStoreDictionaryCopyResponder {
4160    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
4161    tx_id: u32,
4162}
4163
4164/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
4165/// if the responder is dropped without sending a response, so that the client
4166/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4167impl std::ops::Drop for CapabilityStoreDictionaryCopyResponder {
4168    fn drop(&mut self) {
4169        self.control_handle.shutdown();
4170        // Safety: drops once, never accessed again
4171        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4172    }
4173}
4174
4175impl fidl::endpoints::Responder for CapabilityStoreDictionaryCopyResponder {
4176    type ControlHandle = CapabilityStoreControlHandle;
4177
4178    fn control_handle(&self) -> &CapabilityStoreControlHandle {
4179        &self.control_handle
4180    }
4181
4182    fn drop_without_shutdown(mut self) {
4183        // Safety: drops once, never accessed again due to mem::forget
4184        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4185        // Prevent Drop from running (which would shut down the channel)
4186        std::mem::forget(self);
4187    }
4188}
4189
4190impl CapabilityStoreDictionaryCopyResponder {
4191    /// Sends a response to the FIDL transaction.
4192    ///
4193    /// Sets the channel to shutdown if an error occurs.
4194    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4195        let _result = self.send_raw(result);
4196        if _result.is_err() {
4197            self.control_handle.shutdown();
4198        }
4199        self.drop_without_shutdown();
4200        _result
4201    }
4202
4203    /// Similar to "send" but does not shutdown the channel if an error occurs.
4204    pub fn send_no_shutdown_on_err(
4205        self,
4206        mut result: Result<(), CapabilityStoreError>,
4207    ) -> Result<(), fidl::Error> {
4208        let _result = self.send_raw(result);
4209        self.drop_without_shutdown();
4210        _result
4211    }
4212
4213    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4214        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4215            fidl::encoding::EmptyStruct,
4216            CapabilityStoreError,
4217        >>(
4218            fidl::encoding::FlexibleResult::new(result),
4219            self.tx_id,
4220            0x3733ecdf4ea1b44f,
4221            fidl::encoding::DynamicFlags::FLEXIBLE,
4222        )
4223    }
4224}
4225
4226#[must_use = "FIDL methods require a response to be sent"]
4227#[derive(Debug)]
4228pub struct CapabilityStoreDictionaryKeysResponder {
4229    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
4230    tx_id: u32,
4231}
4232
4233/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
4234/// if the responder is dropped without sending a response, so that the client
4235/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4236impl std::ops::Drop for CapabilityStoreDictionaryKeysResponder {
4237    fn drop(&mut self) {
4238        self.control_handle.shutdown();
4239        // Safety: drops once, never accessed again
4240        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4241    }
4242}
4243
4244impl fidl::endpoints::Responder for CapabilityStoreDictionaryKeysResponder {
4245    type ControlHandle = CapabilityStoreControlHandle;
4246
4247    fn control_handle(&self) -> &CapabilityStoreControlHandle {
4248        &self.control_handle
4249    }
4250
4251    fn drop_without_shutdown(mut self) {
4252        // Safety: drops once, never accessed again due to mem::forget
4253        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4254        // Prevent Drop from running (which would shut down the channel)
4255        std::mem::forget(self);
4256    }
4257}
4258
4259impl CapabilityStoreDictionaryKeysResponder {
4260    /// Sends a response to the FIDL transaction.
4261    ///
4262    /// Sets the channel to shutdown if an error occurs.
4263    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4264        let _result = self.send_raw(result);
4265        if _result.is_err() {
4266            self.control_handle.shutdown();
4267        }
4268        self.drop_without_shutdown();
4269        _result
4270    }
4271
4272    /// Similar to "send" but does not shutdown the channel if an error occurs.
4273    pub fn send_no_shutdown_on_err(
4274        self,
4275        mut result: Result<(), CapabilityStoreError>,
4276    ) -> Result<(), fidl::Error> {
4277        let _result = self.send_raw(result);
4278        self.drop_without_shutdown();
4279        _result
4280    }
4281
4282    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4283        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4284            fidl::encoding::EmptyStruct,
4285            CapabilityStoreError,
4286        >>(
4287            fidl::encoding::FlexibleResult::new(result),
4288            self.tx_id,
4289            0x84b05577ceaec9e,
4290            fidl::encoding::DynamicFlags::FLEXIBLE,
4291        )
4292    }
4293}
4294
4295#[must_use = "FIDL methods require a response to be sent"]
4296#[derive(Debug)]
4297pub struct CapabilityStoreDictionaryEnumerateResponder {
4298    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
4299    tx_id: u32,
4300}
4301
4302/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
4303/// if the responder is dropped without sending a response, so that the client
4304/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4305impl std::ops::Drop for CapabilityStoreDictionaryEnumerateResponder {
4306    fn drop(&mut self) {
4307        self.control_handle.shutdown();
4308        // Safety: drops once, never accessed again
4309        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4310    }
4311}
4312
4313impl fidl::endpoints::Responder for CapabilityStoreDictionaryEnumerateResponder {
4314    type ControlHandle = CapabilityStoreControlHandle;
4315
4316    fn control_handle(&self) -> &CapabilityStoreControlHandle {
4317        &self.control_handle
4318    }
4319
4320    fn drop_without_shutdown(mut self) {
4321        // Safety: drops once, never accessed again due to mem::forget
4322        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4323        // Prevent Drop from running (which would shut down the channel)
4324        std::mem::forget(self);
4325    }
4326}
4327
4328impl CapabilityStoreDictionaryEnumerateResponder {
4329    /// Sends a response to the FIDL transaction.
4330    ///
4331    /// Sets the channel to shutdown if an error occurs.
4332    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4333        let _result = self.send_raw(result);
4334        if _result.is_err() {
4335            self.control_handle.shutdown();
4336        }
4337        self.drop_without_shutdown();
4338        _result
4339    }
4340
4341    /// Similar to "send" but does not shutdown the channel if an error occurs.
4342    pub fn send_no_shutdown_on_err(
4343        self,
4344        mut result: Result<(), CapabilityStoreError>,
4345    ) -> Result<(), fidl::Error> {
4346        let _result = self.send_raw(result);
4347        self.drop_without_shutdown();
4348        _result
4349    }
4350
4351    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4352        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4353            fidl::encoding::EmptyStruct,
4354            CapabilityStoreError,
4355        >>(
4356            fidl::encoding::FlexibleResult::new(result),
4357            self.tx_id,
4358            0xd6279b6ced04641,
4359            fidl::encoding::DynamicFlags::FLEXIBLE,
4360        )
4361    }
4362}
4363
4364#[must_use = "FIDL methods require a response to be sent"]
4365#[derive(Debug)]
4366pub struct CapabilityStoreDictionaryDrainResponder {
4367    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
4368    tx_id: u32,
4369}
4370
4371/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
4372/// if the responder is dropped without sending a response, so that the client
4373/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4374impl std::ops::Drop for CapabilityStoreDictionaryDrainResponder {
4375    fn drop(&mut self) {
4376        self.control_handle.shutdown();
4377        // Safety: drops once, never accessed again
4378        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4379    }
4380}
4381
4382impl fidl::endpoints::Responder for CapabilityStoreDictionaryDrainResponder {
4383    type ControlHandle = CapabilityStoreControlHandle;
4384
4385    fn control_handle(&self) -> &CapabilityStoreControlHandle {
4386        &self.control_handle
4387    }
4388
4389    fn drop_without_shutdown(mut self) {
4390        // Safety: drops once, never accessed again due to mem::forget
4391        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4392        // Prevent Drop from running (which would shut down the channel)
4393        std::mem::forget(self);
4394    }
4395}
4396
4397impl CapabilityStoreDictionaryDrainResponder {
4398    /// Sends a response to the FIDL transaction.
4399    ///
4400    /// Sets the channel to shutdown if an error occurs.
4401    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4402        let _result = self.send_raw(result);
4403        if _result.is_err() {
4404            self.control_handle.shutdown();
4405        }
4406        self.drop_without_shutdown();
4407        _result
4408    }
4409
4410    /// Similar to "send" but does not shutdown the channel if an error occurs.
4411    pub fn send_no_shutdown_on_err(
4412        self,
4413        mut result: Result<(), CapabilityStoreError>,
4414    ) -> Result<(), fidl::Error> {
4415        let _result = self.send_raw(result);
4416        self.drop_without_shutdown();
4417        _result
4418    }
4419
4420    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4421        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4422            fidl::encoding::EmptyStruct,
4423            CapabilityStoreError,
4424        >>(
4425            fidl::encoding::FlexibleResult::new(result),
4426            self.tx_id,
4427            0x28a3a3f84d928cd8,
4428            fidl::encoding::DynamicFlags::FLEXIBLE,
4429        )
4430    }
4431}
4432
4433#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4434pub struct ConnectorRouterMarker;
4435
4436impl fidl::endpoints::ProtocolMarker for ConnectorRouterMarker {
4437    type Proxy = ConnectorRouterProxy;
4438    type RequestStream = ConnectorRouterRequestStream;
4439    #[cfg(target_os = "fuchsia")]
4440    type SynchronousProxy = ConnectorRouterSynchronousProxy;
4441
4442    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.ConnectorRouter";
4443}
4444impl fidl::endpoints::DiscoverableProtocolMarker for ConnectorRouterMarker {}
4445pub type ConnectorRouterRouteResult = Result<ConnectorRouterRouteResponse, RouterError>;
4446
4447pub trait ConnectorRouterProxyInterface: Send + Sync {
4448    type RouteResponseFut: std::future::Future<Output = Result<ConnectorRouterRouteResult, fidl::Error>>
4449        + Send;
4450    fn r#route(&self, payload: RouteRequest) -> Self::RouteResponseFut;
4451}
4452#[derive(Debug)]
4453#[cfg(target_os = "fuchsia")]
4454pub struct ConnectorRouterSynchronousProxy {
4455    client: fidl::client::sync::Client,
4456}
4457
4458#[cfg(target_os = "fuchsia")]
4459impl fidl::endpoints::SynchronousProxy for ConnectorRouterSynchronousProxy {
4460    type Proxy = ConnectorRouterProxy;
4461    type Protocol = ConnectorRouterMarker;
4462
4463    fn from_channel(inner: fidl::Channel) -> Self {
4464        Self::new(inner)
4465    }
4466
4467    fn into_channel(self) -> fidl::Channel {
4468        self.client.into_channel()
4469    }
4470
4471    fn as_channel(&self) -> &fidl::Channel {
4472        self.client.as_channel()
4473    }
4474}
4475
4476#[cfg(target_os = "fuchsia")]
4477impl ConnectorRouterSynchronousProxy {
4478    pub fn new(channel: fidl::Channel) -> Self {
4479        let protocol_name = <ConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4480        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
4481    }
4482
4483    pub fn into_channel(self) -> fidl::Channel {
4484        self.client.into_channel()
4485    }
4486
4487    /// Waits until an event arrives and returns it. It is safe for other
4488    /// threads to make concurrent requests while waiting for an event.
4489    pub fn wait_for_event(
4490        &self,
4491        deadline: zx::MonotonicInstant,
4492    ) -> Result<ConnectorRouterEvent, fidl::Error> {
4493        ConnectorRouterEvent::decode(self.client.wait_for_event(deadline)?)
4494    }
4495
4496    pub fn r#route(
4497        &self,
4498        mut payload: RouteRequest,
4499        ___deadline: zx::MonotonicInstant,
4500    ) -> Result<ConnectorRouterRouteResult, fidl::Error> {
4501        let _response = self.client.send_query::<
4502            RouteRequest,
4503            fidl::encoding::FlexibleResultType<ConnectorRouterRouteResponse, RouterError>,
4504        >(
4505            &mut payload,
4506            0x74dbb8bc13730766,
4507            fidl::encoding::DynamicFlags::FLEXIBLE,
4508            ___deadline,
4509        )?
4510        .into_result::<ConnectorRouterMarker>("route")?;
4511        Ok(_response.map(|x| x))
4512    }
4513}
4514
4515#[cfg(target_os = "fuchsia")]
4516impl From<ConnectorRouterSynchronousProxy> for zx::Handle {
4517    fn from(value: ConnectorRouterSynchronousProxy) -> Self {
4518        value.into_channel().into()
4519    }
4520}
4521
4522#[cfg(target_os = "fuchsia")]
4523impl From<fidl::Channel> for ConnectorRouterSynchronousProxy {
4524    fn from(value: fidl::Channel) -> Self {
4525        Self::new(value)
4526    }
4527}
4528
4529#[cfg(target_os = "fuchsia")]
4530impl fidl::endpoints::FromClient for ConnectorRouterSynchronousProxy {
4531    type Protocol = ConnectorRouterMarker;
4532
4533    fn from_client(value: fidl::endpoints::ClientEnd<ConnectorRouterMarker>) -> Self {
4534        Self::new(value.into_channel())
4535    }
4536}
4537
4538#[derive(Debug, Clone)]
4539pub struct ConnectorRouterProxy {
4540    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
4541}
4542
4543impl fidl::endpoints::Proxy for ConnectorRouterProxy {
4544    type Protocol = ConnectorRouterMarker;
4545
4546    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
4547        Self::new(inner)
4548    }
4549
4550    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
4551        self.client.into_channel().map_err(|client| Self { client })
4552    }
4553
4554    fn as_channel(&self) -> &::fidl::AsyncChannel {
4555        self.client.as_channel()
4556    }
4557}
4558
4559impl ConnectorRouterProxy {
4560    /// Create a new Proxy for fuchsia.component.sandbox/ConnectorRouter.
4561    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
4562        let protocol_name = <ConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4563        Self { client: fidl::client::Client::new(channel, protocol_name) }
4564    }
4565
4566    /// Get a Stream of events from the remote end of the protocol.
4567    ///
4568    /// # Panics
4569    ///
4570    /// Panics if the event stream was already taken.
4571    pub fn take_event_stream(&self) -> ConnectorRouterEventStream {
4572        ConnectorRouterEventStream { event_receiver: self.client.take_event_receiver() }
4573    }
4574
4575    pub fn r#route(
4576        &self,
4577        mut payload: RouteRequest,
4578    ) -> fidl::client::QueryResponseFut<
4579        ConnectorRouterRouteResult,
4580        fidl::encoding::DefaultFuchsiaResourceDialect,
4581    > {
4582        ConnectorRouterProxyInterface::r#route(self, payload)
4583    }
4584}
4585
4586impl ConnectorRouterProxyInterface for ConnectorRouterProxy {
4587    type RouteResponseFut = fidl::client::QueryResponseFut<
4588        ConnectorRouterRouteResult,
4589        fidl::encoding::DefaultFuchsiaResourceDialect,
4590    >;
4591    fn r#route(&self, mut payload: RouteRequest) -> Self::RouteResponseFut {
4592        fn _decode(
4593            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4594        ) -> Result<ConnectorRouterRouteResult, fidl::Error> {
4595            let _response = fidl::client::decode_transaction_body::<
4596                fidl::encoding::FlexibleResultType<ConnectorRouterRouteResponse, RouterError>,
4597                fidl::encoding::DefaultFuchsiaResourceDialect,
4598                0x74dbb8bc13730766,
4599            >(_buf?)?
4600            .into_result::<ConnectorRouterMarker>("route")?;
4601            Ok(_response.map(|x| x))
4602        }
4603        self.client.send_query_and_decode::<RouteRequest, ConnectorRouterRouteResult>(
4604            &mut payload,
4605            0x74dbb8bc13730766,
4606            fidl::encoding::DynamicFlags::FLEXIBLE,
4607            _decode,
4608        )
4609    }
4610}
4611
4612pub struct ConnectorRouterEventStream {
4613    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
4614}
4615
4616impl std::marker::Unpin for ConnectorRouterEventStream {}
4617
4618impl futures::stream::FusedStream for ConnectorRouterEventStream {
4619    fn is_terminated(&self) -> bool {
4620        self.event_receiver.is_terminated()
4621    }
4622}
4623
4624impl futures::Stream for ConnectorRouterEventStream {
4625    type Item = Result<ConnectorRouterEvent, fidl::Error>;
4626
4627    fn poll_next(
4628        mut self: std::pin::Pin<&mut Self>,
4629        cx: &mut std::task::Context<'_>,
4630    ) -> std::task::Poll<Option<Self::Item>> {
4631        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4632            &mut self.event_receiver,
4633            cx
4634        )?) {
4635            Some(buf) => std::task::Poll::Ready(Some(ConnectorRouterEvent::decode(buf))),
4636            None => std::task::Poll::Ready(None),
4637        }
4638    }
4639}
4640
4641#[derive(Debug)]
4642pub enum ConnectorRouterEvent {
4643    #[non_exhaustive]
4644    _UnknownEvent {
4645        /// Ordinal of the event that was sent.
4646        ordinal: u64,
4647    },
4648}
4649
4650impl ConnectorRouterEvent {
4651    /// Decodes a message buffer as a [`ConnectorRouterEvent`].
4652    fn decode(
4653        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4654    ) -> Result<ConnectorRouterEvent, fidl::Error> {
4655        let (bytes, _handles) = buf.split_mut();
4656        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4657        debug_assert_eq!(tx_header.tx_id, 0);
4658        match tx_header.ordinal {
4659            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4660                Ok(ConnectorRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
4661            }
4662            _ => Err(fidl::Error::UnknownOrdinal {
4663                ordinal: tx_header.ordinal,
4664                protocol_name:
4665                    <ConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4666            }),
4667        }
4668    }
4669}
4670
4671/// A Stream of incoming requests for fuchsia.component.sandbox/ConnectorRouter.
4672pub struct ConnectorRouterRequestStream {
4673    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4674    is_terminated: bool,
4675}
4676
4677impl std::marker::Unpin for ConnectorRouterRequestStream {}
4678
4679impl futures::stream::FusedStream for ConnectorRouterRequestStream {
4680    fn is_terminated(&self) -> bool {
4681        self.is_terminated
4682    }
4683}
4684
4685impl fidl::endpoints::RequestStream for ConnectorRouterRequestStream {
4686    type Protocol = ConnectorRouterMarker;
4687    type ControlHandle = ConnectorRouterControlHandle;
4688
4689    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
4690        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4691    }
4692
4693    fn control_handle(&self) -> Self::ControlHandle {
4694        ConnectorRouterControlHandle { inner: self.inner.clone() }
4695    }
4696
4697    fn into_inner(
4698        self,
4699    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
4700    {
4701        (self.inner, self.is_terminated)
4702    }
4703
4704    fn from_inner(
4705        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4706        is_terminated: bool,
4707    ) -> Self {
4708        Self { inner, is_terminated }
4709    }
4710}
4711
4712impl futures::Stream for ConnectorRouterRequestStream {
4713    type Item = Result<ConnectorRouterRequest, fidl::Error>;
4714
4715    fn poll_next(
4716        mut self: std::pin::Pin<&mut Self>,
4717        cx: &mut std::task::Context<'_>,
4718    ) -> std::task::Poll<Option<Self::Item>> {
4719        let this = &mut *self;
4720        if this.inner.check_shutdown(cx) {
4721            this.is_terminated = true;
4722            return std::task::Poll::Ready(None);
4723        }
4724        if this.is_terminated {
4725            panic!("polled ConnectorRouterRequestStream after completion");
4726        }
4727        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4728            |bytes, handles| {
4729                match this.inner.channel().read_etc(cx, bytes, handles) {
4730                    std::task::Poll::Ready(Ok(())) => {}
4731                    std::task::Poll::Pending => return std::task::Poll::Pending,
4732                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4733                        this.is_terminated = true;
4734                        return std::task::Poll::Ready(None);
4735                    }
4736                    std::task::Poll::Ready(Err(e)) => {
4737                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4738                            e.into(),
4739                        ))))
4740                    }
4741                }
4742
4743                // A message has been received from the channel
4744                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4745
4746                std::task::Poll::Ready(Some(match header.ordinal {
4747                    0x74dbb8bc13730766 => {
4748                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4749                        let mut req = fidl::new_empty!(
4750                            RouteRequest,
4751                            fidl::encoding::DefaultFuchsiaResourceDialect
4752                        );
4753                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RouteRequest>(&header, _body_bytes, handles, &mut req)?;
4754                        let control_handle =
4755                            ConnectorRouterControlHandle { inner: this.inner.clone() };
4756                        Ok(ConnectorRouterRequest::Route {
4757                            payload: req,
4758                            responder: ConnectorRouterRouteResponder {
4759                                control_handle: std::mem::ManuallyDrop::new(control_handle),
4760                                tx_id: header.tx_id,
4761                            },
4762                        })
4763                    }
4764                    _ if header.tx_id == 0
4765                        && header
4766                            .dynamic_flags()
4767                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
4768                    {
4769                        Ok(ConnectorRouterRequest::_UnknownMethod {
4770                            ordinal: header.ordinal,
4771                            control_handle: ConnectorRouterControlHandle {
4772                                inner: this.inner.clone(),
4773                            },
4774                            method_type: fidl::MethodType::OneWay,
4775                        })
4776                    }
4777                    _ if header
4778                        .dynamic_flags()
4779                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
4780                    {
4781                        this.inner.send_framework_err(
4782                            fidl::encoding::FrameworkErr::UnknownMethod,
4783                            header.tx_id,
4784                            header.ordinal,
4785                            header.dynamic_flags(),
4786                            (bytes, handles),
4787                        )?;
4788                        Ok(ConnectorRouterRequest::_UnknownMethod {
4789                            ordinal: header.ordinal,
4790                            control_handle: ConnectorRouterControlHandle {
4791                                inner: this.inner.clone(),
4792                            },
4793                            method_type: fidl::MethodType::TwoWay,
4794                        })
4795                    }
4796                    _ => Err(fidl::Error::UnknownOrdinal {
4797                        ordinal: header.ordinal,
4798                        protocol_name:
4799                            <ConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4800                    }),
4801                }))
4802            },
4803        )
4804    }
4805}
4806
4807#[derive(Debug)]
4808pub enum ConnectorRouterRequest {
4809    Route {
4810        payload: RouteRequest,
4811        responder: ConnectorRouterRouteResponder,
4812    },
4813    /// An interaction was received which does not match any known method.
4814    #[non_exhaustive]
4815    _UnknownMethod {
4816        /// Ordinal of the method that was called.
4817        ordinal: u64,
4818        control_handle: ConnectorRouterControlHandle,
4819        method_type: fidl::MethodType,
4820    },
4821}
4822
4823impl ConnectorRouterRequest {
4824    #[allow(irrefutable_let_patterns)]
4825    pub fn into_route(self) -> Option<(RouteRequest, ConnectorRouterRouteResponder)> {
4826        if let ConnectorRouterRequest::Route { payload, responder } = self {
4827            Some((payload, responder))
4828        } else {
4829            None
4830        }
4831    }
4832
4833    /// Name of the method defined in FIDL
4834    pub fn method_name(&self) -> &'static str {
4835        match *self {
4836            ConnectorRouterRequest::Route { .. } => "route",
4837            ConnectorRouterRequest::_UnknownMethod {
4838                method_type: fidl::MethodType::OneWay,
4839                ..
4840            } => "unknown one-way method",
4841            ConnectorRouterRequest::_UnknownMethod {
4842                method_type: fidl::MethodType::TwoWay,
4843                ..
4844            } => "unknown two-way method",
4845        }
4846    }
4847}
4848
4849#[derive(Debug, Clone)]
4850pub struct ConnectorRouterControlHandle {
4851    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4852}
4853
4854impl fidl::endpoints::ControlHandle for ConnectorRouterControlHandle {
4855    fn shutdown(&self) {
4856        self.inner.shutdown()
4857    }
4858    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
4859        self.inner.shutdown_with_epitaph(status)
4860    }
4861
4862    fn is_closed(&self) -> bool {
4863        self.inner.channel().is_closed()
4864    }
4865    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4866        self.inner.channel().on_closed()
4867    }
4868
4869    #[cfg(target_os = "fuchsia")]
4870    fn signal_peer(
4871        &self,
4872        clear_mask: zx::Signals,
4873        set_mask: zx::Signals,
4874    ) -> Result<(), zx_status::Status> {
4875        use fidl::Peered;
4876        self.inner.channel().signal_peer(clear_mask, set_mask)
4877    }
4878}
4879
4880impl ConnectorRouterControlHandle {}
4881
4882#[must_use = "FIDL methods require a response to be sent"]
4883#[derive(Debug)]
4884pub struct ConnectorRouterRouteResponder {
4885    control_handle: std::mem::ManuallyDrop<ConnectorRouterControlHandle>,
4886    tx_id: u32,
4887}
4888
4889/// Set the the channel to be shutdown (see [`ConnectorRouterControlHandle::shutdown`])
4890/// if the responder is dropped without sending a response, so that the client
4891/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4892impl std::ops::Drop for ConnectorRouterRouteResponder {
4893    fn drop(&mut self) {
4894        self.control_handle.shutdown();
4895        // Safety: drops once, never accessed again
4896        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4897    }
4898}
4899
4900impl fidl::endpoints::Responder for ConnectorRouterRouteResponder {
4901    type ControlHandle = ConnectorRouterControlHandle;
4902
4903    fn control_handle(&self) -> &ConnectorRouterControlHandle {
4904        &self.control_handle
4905    }
4906
4907    fn drop_without_shutdown(mut self) {
4908        // Safety: drops once, never accessed again due to mem::forget
4909        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4910        // Prevent Drop from running (which would shut down the channel)
4911        std::mem::forget(self);
4912    }
4913}
4914
4915impl ConnectorRouterRouteResponder {
4916    /// Sends a response to the FIDL transaction.
4917    ///
4918    /// Sets the channel to shutdown if an error occurs.
4919    pub fn send(
4920        self,
4921        mut result: Result<ConnectorRouterRouteResponse, RouterError>,
4922    ) -> Result<(), fidl::Error> {
4923        let _result = self.send_raw(result);
4924        if _result.is_err() {
4925            self.control_handle.shutdown();
4926        }
4927        self.drop_without_shutdown();
4928        _result
4929    }
4930
4931    /// Similar to "send" but does not shutdown the channel if an error occurs.
4932    pub fn send_no_shutdown_on_err(
4933        self,
4934        mut result: Result<ConnectorRouterRouteResponse, RouterError>,
4935    ) -> Result<(), fidl::Error> {
4936        let _result = self.send_raw(result);
4937        self.drop_without_shutdown();
4938        _result
4939    }
4940
4941    fn send_raw(
4942        &self,
4943        mut result: Result<ConnectorRouterRouteResponse, RouterError>,
4944    ) -> Result<(), fidl::Error> {
4945        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4946            ConnectorRouterRouteResponse,
4947            RouterError,
4948        >>(
4949            fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
4950            self.tx_id,
4951            0x74dbb8bc13730766,
4952            fidl::encoding::DynamicFlags::FLEXIBLE,
4953        )
4954    }
4955}
4956
4957#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4958pub struct DataRouterMarker;
4959
4960impl fidl::endpoints::ProtocolMarker for DataRouterMarker {
4961    type Proxy = DataRouterProxy;
4962    type RequestStream = DataRouterRequestStream;
4963    #[cfg(target_os = "fuchsia")]
4964    type SynchronousProxy = DataRouterSynchronousProxy;
4965
4966    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.DataRouter";
4967}
4968impl fidl::endpoints::DiscoverableProtocolMarker for DataRouterMarker {}
4969pub type DataRouterRouteResult = Result<DataRouterRouteResponse, RouterError>;
4970
4971pub trait DataRouterProxyInterface: Send + Sync {
4972    type RouteResponseFut: std::future::Future<Output = Result<DataRouterRouteResult, fidl::Error>>
4973        + Send;
4974    fn r#route(&self, payload: RouteRequest) -> Self::RouteResponseFut;
4975}
4976#[derive(Debug)]
4977#[cfg(target_os = "fuchsia")]
4978pub struct DataRouterSynchronousProxy {
4979    client: fidl::client::sync::Client,
4980}
4981
4982#[cfg(target_os = "fuchsia")]
4983impl fidl::endpoints::SynchronousProxy for DataRouterSynchronousProxy {
4984    type Proxy = DataRouterProxy;
4985    type Protocol = DataRouterMarker;
4986
4987    fn from_channel(inner: fidl::Channel) -> Self {
4988        Self::new(inner)
4989    }
4990
4991    fn into_channel(self) -> fidl::Channel {
4992        self.client.into_channel()
4993    }
4994
4995    fn as_channel(&self) -> &fidl::Channel {
4996        self.client.as_channel()
4997    }
4998}
4999
5000#[cfg(target_os = "fuchsia")]
5001impl DataRouterSynchronousProxy {
5002    pub fn new(channel: fidl::Channel) -> Self {
5003        let protocol_name = <DataRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5004        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
5005    }
5006
5007    pub fn into_channel(self) -> fidl::Channel {
5008        self.client.into_channel()
5009    }
5010
5011    /// Waits until an event arrives and returns it. It is safe for other
5012    /// threads to make concurrent requests while waiting for an event.
5013    pub fn wait_for_event(
5014        &self,
5015        deadline: zx::MonotonicInstant,
5016    ) -> Result<DataRouterEvent, fidl::Error> {
5017        DataRouterEvent::decode(self.client.wait_for_event(deadline)?)
5018    }
5019
5020    pub fn r#route(
5021        &self,
5022        mut payload: RouteRequest,
5023        ___deadline: zx::MonotonicInstant,
5024    ) -> Result<DataRouterRouteResult, fidl::Error> {
5025        let _response = self.client.send_query::<
5026            RouteRequest,
5027            fidl::encoding::FlexibleResultType<DataRouterRouteResponse, RouterError>,
5028        >(
5029            &mut payload,
5030            0x2e87dc44dfc53804,
5031            fidl::encoding::DynamicFlags::FLEXIBLE,
5032            ___deadline,
5033        )?
5034        .into_result::<DataRouterMarker>("route")?;
5035        Ok(_response.map(|x| x))
5036    }
5037}
5038
5039#[cfg(target_os = "fuchsia")]
5040impl From<DataRouterSynchronousProxy> for zx::Handle {
5041    fn from(value: DataRouterSynchronousProxy) -> Self {
5042        value.into_channel().into()
5043    }
5044}
5045
5046#[cfg(target_os = "fuchsia")]
5047impl From<fidl::Channel> for DataRouterSynchronousProxy {
5048    fn from(value: fidl::Channel) -> Self {
5049        Self::new(value)
5050    }
5051}
5052
5053#[cfg(target_os = "fuchsia")]
5054impl fidl::endpoints::FromClient for DataRouterSynchronousProxy {
5055    type Protocol = DataRouterMarker;
5056
5057    fn from_client(value: fidl::endpoints::ClientEnd<DataRouterMarker>) -> Self {
5058        Self::new(value.into_channel())
5059    }
5060}
5061
5062#[derive(Debug, Clone)]
5063pub struct DataRouterProxy {
5064    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
5065}
5066
5067impl fidl::endpoints::Proxy for DataRouterProxy {
5068    type Protocol = DataRouterMarker;
5069
5070    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
5071        Self::new(inner)
5072    }
5073
5074    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
5075        self.client.into_channel().map_err(|client| Self { client })
5076    }
5077
5078    fn as_channel(&self) -> &::fidl::AsyncChannel {
5079        self.client.as_channel()
5080    }
5081}
5082
5083impl DataRouterProxy {
5084    /// Create a new Proxy for fuchsia.component.sandbox/DataRouter.
5085    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5086        let protocol_name = <DataRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5087        Self { client: fidl::client::Client::new(channel, protocol_name) }
5088    }
5089
5090    /// Get a Stream of events from the remote end of the protocol.
5091    ///
5092    /// # Panics
5093    ///
5094    /// Panics if the event stream was already taken.
5095    pub fn take_event_stream(&self) -> DataRouterEventStream {
5096        DataRouterEventStream { event_receiver: self.client.take_event_receiver() }
5097    }
5098
5099    pub fn r#route(
5100        &self,
5101        mut payload: RouteRequest,
5102    ) -> fidl::client::QueryResponseFut<
5103        DataRouterRouteResult,
5104        fidl::encoding::DefaultFuchsiaResourceDialect,
5105    > {
5106        DataRouterProxyInterface::r#route(self, payload)
5107    }
5108}
5109
5110impl DataRouterProxyInterface for DataRouterProxy {
5111    type RouteResponseFut = fidl::client::QueryResponseFut<
5112        DataRouterRouteResult,
5113        fidl::encoding::DefaultFuchsiaResourceDialect,
5114    >;
5115    fn r#route(&self, mut payload: RouteRequest) -> Self::RouteResponseFut {
5116        fn _decode(
5117            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5118        ) -> Result<DataRouterRouteResult, fidl::Error> {
5119            let _response = fidl::client::decode_transaction_body::<
5120                fidl::encoding::FlexibleResultType<DataRouterRouteResponse, RouterError>,
5121                fidl::encoding::DefaultFuchsiaResourceDialect,
5122                0x2e87dc44dfc53804,
5123            >(_buf?)?
5124            .into_result::<DataRouterMarker>("route")?;
5125            Ok(_response.map(|x| x))
5126        }
5127        self.client.send_query_and_decode::<RouteRequest, DataRouterRouteResult>(
5128            &mut payload,
5129            0x2e87dc44dfc53804,
5130            fidl::encoding::DynamicFlags::FLEXIBLE,
5131            _decode,
5132        )
5133    }
5134}
5135
5136pub struct DataRouterEventStream {
5137    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
5138}
5139
5140impl std::marker::Unpin for DataRouterEventStream {}
5141
5142impl futures::stream::FusedStream for DataRouterEventStream {
5143    fn is_terminated(&self) -> bool {
5144        self.event_receiver.is_terminated()
5145    }
5146}
5147
5148impl futures::Stream for DataRouterEventStream {
5149    type Item = Result<DataRouterEvent, fidl::Error>;
5150
5151    fn poll_next(
5152        mut self: std::pin::Pin<&mut Self>,
5153        cx: &mut std::task::Context<'_>,
5154    ) -> std::task::Poll<Option<Self::Item>> {
5155        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5156            &mut self.event_receiver,
5157            cx
5158        )?) {
5159            Some(buf) => std::task::Poll::Ready(Some(DataRouterEvent::decode(buf))),
5160            None => std::task::Poll::Ready(None),
5161        }
5162    }
5163}
5164
5165#[derive(Debug)]
5166pub enum DataRouterEvent {
5167    #[non_exhaustive]
5168    _UnknownEvent {
5169        /// Ordinal of the event that was sent.
5170        ordinal: u64,
5171    },
5172}
5173
5174impl DataRouterEvent {
5175    /// Decodes a message buffer as a [`DataRouterEvent`].
5176    fn decode(
5177        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5178    ) -> Result<DataRouterEvent, fidl::Error> {
5179        let (bytes, _handles) = buf.split_mut();
5180        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5181        debug_assert_eq!(tx_header.tx_id, 0);
5182        match tx_header.ordinal {
5183            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
5184                Ok(DataRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
5185            }
5186            _ => Err(fidl::Error::UnknownOrdinal {
5187                ordinal: tx_header.ordinal,
5188                protocol_name: <DataRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5189            }),
5190        }
5191    }
5192}
5193
5194/// A Stream of incoming requests for fuchsia.component.sandbox/DataRouter.
5195pub struct DataRouterRequestStream {
5196    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5197    is_terminated: bool,
5198}
5199
5200impl std::marker::Unpin for DataRouterRequestStream {}
5201
5202impl futures::stream::FusedStream for DataRouterRequestStream {
5203    fn is_terminated(&self) -> bool {
5204        self.is_terminated
5205    }
5206}
5207
5208impl fidl::endpoints::RequestStream for DataRouterRequestStream {
5209    type Protocol = DataRouterMarker;
5210    type ControlHandle = DataRouterControlHandle;
5211
5212    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5213        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5214    }
5215
5216    fn control_handle(&self) -> Self::ControlHandle {
5217        DataRouterControlHandle { inner: self.inner.clone() }
5218    }
5219
5220    fn into_inner(
5221        self,
5222    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5223    {
5224        (self.inner, self.is_terminated)
5225    }
5226
5227    fn from_inner(
5228        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5229        is_terminated: bool,
5230    ) -> Self {
5231        Self { inner, is_terminated }
5232    }
5233}
5234
5235impl futures::Stream for DataRouterRequestStream {
5236    type Item = Result<DataRouterRequest, fidl::Error>;
5237
5238    fn poll_next(
5239        mut self: std::pin::Pin<&mut Self>,
5240        cx: &mut std::task::Context<'_>,
5241    ) -> std::task::Poll<Option<Self::Item>> {
5242        let this = &mut *self;
5243        if this.inner.check_shutdown(cx) {
5244            this.is_terminated = true;
5245            return std::task::Poll::Ready(None);
5246        }
5247        if this.is_terminated {
5248            panic!("polled DataRouterRequestStream after completion");
5249        }
5250        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
5251            |bytes, handles| {
5252                match this.inner.channel().read_etc(cx, bytes, handles) {
5253                    std::task::Poll::Ready(Ok(())) => {}
5254                    std::task::Poll::Pending => return std::task::Poll::Pending,
5255                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
5256                        this.is_terminated = true;
5257                        return std::task::Poll::Ready(None);
5258                    }
5259                    std::task::Poll::Ready(Err(e)) => {
5260                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5261                            e.into(),
5262                        ))))
5263                    }
5264                }
5265
5266                // A message has been received from the channel
5267                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5268
5269                std::task::Poll::Ready(Some(match header.ordinal {
5270                    0x2e87dc44dfc53804 => {
5271                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5272                        let mut req = fidl::new_empty!(
5273                            RouteRequest,
5274                            fidl::encoding::DefaultFuchsiaResourceDialect
5275                        );
5276                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RouteRequest>(&header, _body_bytes, handles, &mut req)?;
5277                        let control_handle = DataRouterControlHandle { inner: this.inner.clone() };
5278                        Ok(DataRouterRequest::Route {
5279                            payload: req,
5280                            responder: DataRouterRouteResponder {
5281                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5282                                tx_id: header.tx_id,
5283                            },
5284                        })
5285                    }
5286                    _ if header.tx_id == 0
5287                        && header
5288                            .dynamic_flags()
5289                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5290                    {
5291                        Ok(DataRouterRequest::_UnknownMethod {
5292                            ordinal: header.ordinal,
5293                            control_handle: DataRouterControlHandle { inner: this.inner.clone() },
5294                            method_type: fidl::MethodType::OneWay,
5295                        })
5296                    }
5297                    _ if header
5298                        .dynamic_flags()
5299                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5300                    {
5301                        this.inner.send_framework_err(
5302                            fidl::encoding::FrameworkErr::UnknownMethod,
5303                            header.tx_id,
5304                            header.ordinal,
5305                            header.dynamic_flags(),
5306                            (bytes, handles),
5307                        )?;
5308                        Ok(DataRouterRequest::_UnknownMethod {
5309                            ordinal: header.ordinal,
5310                            control_handle: DataRouterControlHandle { inner: this.inner.clone() },
5311                            method_type: fidl::MethodType::TwoWay,
5312                        })
5313                    }
5314                    _ => Err(fidl::Error::UnknownOrdinal {
5315                        ordinal: header.ordinal,
5316                        protocol_name:
5317                            <DataRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5318                    }),
5319                }))
5320            },
5321        )
5322    }
5323}
5324
5325#[derive(Debug)]
5326pub enum DataRouterRequest {
5327    Route {
5328        payload: RouteRequest,
5329        responder: DataRouterRouteResponder,
5330    },
5331    /// An interaction was received which does not match any known method.
5332    #[non_exhaustive]
5333    _UnknownMethod {
5334        /// Ordinal of the method that was called.
5335        ordinal: u64,
5336        control_handle: DataRouterControlHandle,
5337        method_type: fidl::MethodType,
5338    },
5339}
5340
5341impl DataRouterRequest {
5342    #[allow(irrefutable_let_patterns)]
5343    pub fn into_route(self) -> Option<(RouteRequest, DataRouterRouteResponder)> {
5344        if let DataRouterRequest::Route { payload, responder } = self {
5345            Some((payload, responder))
5346        } else {
5347            None
5348        }
5349    }
5350
5351    /// Name of the method defined in FIDL
5352    pub fn method_name(&self) -> &'static str {
5353        match *self {
5354            DataRouterRequest::Route { .. } => "route",
5355            DataRouterRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
5356                "unknown one-way method"
5357            }
5358            DataRouterRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
5359                "unknown two-way method"
5360            }
5361        }
5362    }
5363}
5364
5365#[derive(Debug, Clone)]
5366pub struct DataRouterControlHandle {
5367    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5368}
5369
5370impl fidl::endpoints::ControlHandle for DataRouterControlHandle {
5371    fn shutdown(&self) {
5372        self.inner.shutdown()
5373    }
5374    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
5375        self.inner.shutdown_with_epitaph(status)
5376    }
5377
5378    fn is_closed(&self) -> bool {
5379        self.inner.channel().is_closed()
5380    }
5381    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
5382        self.inner.channel().on_closed()
5383    }
5384
5385    #[cfg(target_os = "fuchsia")]
5386    fn signal_peer(
5387        &self,
5388        clear_mask: zx::Signals,
5389        set_mask: zx::Signals,
5390    ) -> Result<(), zx_status::Status> {
5391        use fidl::Peered;
5392        self.inner.channel().signal_peer(clear_mask, set_mask)
5393    }
5394}
5395
5396impl DataRouterControlHandle {}
5397
5398#[must_use = "FIDL methods require a response to be sent"]
5399#[derive(Debug)]
5400pub struct DataRouterRouteResponder {
5401    control_handle: std::mem::ManuallyDrop<DataRouterControlHandle>,
5402    tx_id: u32,
5403}
5404
5405/// Set the the channel to be shutdown (see [`DataRouterControlHandle::shutdown`])
5406/// if the responder is dropped without sending a response, so that the client
5407/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5408impl std::ops::Drop for DataRouterRouteResponder {
5409    fn drop(&mut self) {
5410        self.control_handle.shutdown();
5411        // Safety: drops once, never accessed again
5412        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5413    }
5414}
5415
5416impl fidl::endpoints::Responder for DataRouterRouteResponder {
5417    type ControlHandle = DataRouterControlHandle;
5418
5419    fn control_handle(&self) -> &DataRouterControlHandle {
5420        &self.control_handle
5421    }
5422
5423    fn drop_without_shutdown(mut self) {
5424        // Safety: drops once, never accessed again due to mem::forget
5425        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5426        // Prevent Drop from running (which would shut down the channel)
5427        std::mem::forget(self);
5428    }
5429}
5430
5431impl DataRouterRouteResponder {
5432    /// Sends a response to the FIDL transaction.
5433    ///
5434    /// Sets the channel to shutdown if an error occurs.
5435    pub fn send(
5436        self,
5437        mut result: Result<DataRouterRouteResponse, RouterError>,
5438    ) -> Result<(), fidl::Error> {
5439        let _result = self.send_raw(result);
5440        if _result.is_err() {
5441            self.control_handle.shutdown();
5442        }
5443        self.drop_without_shutdown();
5444        _result
5445    }
5446
5447    /// Similar to "send" but does not shutdown the channel if an error occurs.
5448    pub fn send_no_shutdown_on_err(
5449        self,
5450        mut result: Result<DataRouterRouteResponse, RouterError>,
5451    ) -> Result<(), fidl::Error> {
5452        let _result = self.send_raw(result);
5453        self.drop_without_shutdown();
5454        _result
5455    }
5456
5457    fn send_raw(
5458        &self,
5459        mut result: Result<DataRouterRouteResponse, RouterError>,
5460    ) -> Result<(), fidl::Error> {
5461        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
5462            DataRouterRouteResponse,
5463            RouterError,
5464        >>(
5465            fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
5466            self.tx_id,
5467            0x2e87dc44dfc53804,
5468            fidl::encoding::DynamicFlags::FLEXIBLE,
5469        )
5470    }
5471}
5472
5473#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5474pub struct DictionaryMarker;
5475
5476impl fidl::endpoints::ProtocolMarker for DictionaryMarker {
5477    type Proxy = DictionaryProxy;
5478    type RequestStream = DictionaryRequestStream;
5479    #[cfg(target_os = "fuchsia")]
5480    type SynchronousProxy = DictionarySynchronousProxy;
5481
5482    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.Dictionary";
5483}
5484impl fidl::endpoints::DiscoverableProtocolMarker for DictionaryMarker {}
5485
5486pub trait DictionaryProxyInterface: Send + Sync {}
5487#[derive(Debug)]
5488#[cfg(target_os = "fuchsia")]
5489pub struct DictionarySynchronousProxy {
5490    client: fidl::client::sync::Client,
5491}
5492
5493#[cfg(target_os = "fuchsia")]
5494impl fidl::endpoints::SynchronousProxy for DictionarySynchronousProxy {
5495    type Proxy = DictionaryProxy;
5496    type Protocol = DictionaryMarker;
5497
5498    fn from_channel(inner: fidl::Channel) -> Self {
5499        Self::new(inner)
5500    }
5501
5502    fn into_channel(self) -> fidl::Channel {
5503        self.client.into_channel()
5504    }
5505
5506    fn as_channel(&self) -> &fidl::Channel {
5507        self.client.as_channel()
5508    }
5509}
5510
5511#[cfg(target_os = "fuchsia")]
5512impl DictionarySynchronousProxy {
5513    pub fn new(channel: fidl::Channel) -> Self {
5514        let protocol_name = <DictionaryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5515        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
5516    }
5517
5518    pub fn into_channel(self) -> fidl::Channel {
5519        self.client.into_channel()
5520    }
5521
5522    /// Waits until an event arrives and returns it. It is safe for other
5523    /// threads to make concurrent requests while waiting for an event.
5524    pub fn wait_for_event(
5525        &self,
5526        deadline: zx::MonotonicInstant,
5527    ) -> Result<DictionaryEvent, fidl::Error> {
5528        DictionaryEvent::decode(self.client.wait_for_event(deadline)?)
5529    }
5530}
5531
5532#[cfg(target_os = "fuchsia")]
5533impl From<DictionarySynchronousProxy> for zx::Handle {
5534    fn from(value: DictionarySynchronousProxy) -> Self {
5535        value.into_channel().into()
5536    }
5537}
5538
5539#[cfg(target_os = "fuchsia")]
5540impl From<fidl::Channel> for DictionarySynchronousProxy {
5541    fn from(value: fidl::Channel) -> Self {
5542        Self::new(value)
5543    }
5544}
5545
5546#[cfg(target_os = "fuchsia")]
5547impl fidl::endpoints::FromClient for DictionarySynchronousProxy {
5548    type Protocol = DictionaryMarker;
5549
5550    fn from_client(value: fidl::endpoints::ClientEnd<DictionaryMarker>) -> Self {
5551        Self::new(value.into_channel())
5552    }
5553}
5554
5555#[derive(Debug, Clone)]
5556pub struct DictionaryProxy {
5557    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
5558}
5559
5560impl fidl::endpoints::Proxy for DictionaryProxy {
5561    type Protocol = DictionaryMarker;
5562
5563    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
5564        Self::new(inner)
5565    }
5566
5567    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
5568        self.client.into_channel().map_err(|client| Self { client })
5569    }
5570
5571    fn as_channel(&self) -> &::fidl::AsyncChannel {
5572        self.client.as_channel()
5573    }
5574}
5575
5576impl DictionaryProxy {
5577    /// Create a new Proxy for fuchsia.component.sandbox/Dictionary.
5578    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5579        let protocol_name = <DictionaryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5580        Self { client: fidl::client::Client::new(channel, protocol_name) }
5581    }
5582
5583    /// Get a Stream of events from the remote end of the protocol.
5584    ///
5585    /// # Panics
5586    ///
5587    /// Panics if the event stream was already taken.
5588    pub fn take_event_stream(&self) -> DictionaryEventStream {
5589        DictionaryEventStream { event_receiver: self.client.take_event_receiver() }
5590    }
5591}
5592
5593impl DictionaryProxyInterface for DictionaryProxy {}
5594
5595pub struct DictionaryEventStream {
5596    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
5597}
5598
5599impl std::marker::Unpin for DictionaryEventStream {}
5600
5601impl futures::stream::FusedStream for DictionaryEventStream {
5602    fn is_terminated(&self) -> bool {
5603        self.event_receiver.is_terminated()
5604    }
5605}
5606
5607impl futures::Stream for DictionaryEventStream {
5608    type Item = Result<DictionaryEvent, fidl::Error>;
5609
5610    fn poll_next(
5611        mut self: std::pin::Pin<&mut Self>,
5612        cx: &mut std::task::Context<'_>,
5613    ) -> std::task::Poll<Option<Self::Item>> {
5614        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5615            &mut self.event_receiver,
5616            cx
5617        )?) {
5618            Some(buf) => std::task::Poll::Ready(Some(DictionaryEvent::decode(buf))),
5619            None => std::task::Poll::Ready(None),
5620        }
5621    }
5622}
5623
5624#[derive(Debug)]
5625pub enum DictionaryEvent {
5626    #[non_exhaustive]
5627    _UnknownEvent {
5628        /// Ordinal of the event that was sent.
5629        ordinal: u64,
5630    },
5631}
5632
5633impl DictionaryEvent {
5634    /// Decodes a message buffer as a [`DictionaryEvent`].
5635    fn decode(
5636        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5637    ) -> Result<DictionaryEvent, fidl::Error> {
5638        let (bytes, _handles) = buf.split_mut();
5639        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5640        debug_assert_eq!(tx_header.tx_id, 0);
5641        match tx_header.ordinal {
5642            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
5643                Ok(DictionaryEvent::_UnknownEvent { ordinal: tx_header.ordinal })
5644            }
5645            _ => Err(fidl::Error::UnknownOrdinal {
5646                ordinal: tx_header.ordinal,
5647                protocol_name: <DictionaryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5648            }),
5649        }
5650    }
5651}
5652
5653/// A Stream of incoming requests for fuchsia.component.sandbox/Dictionary.
5654pub struct DictionaryRequestStream {
5655    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5656    is_terminated: bool,
5657}
5658
5659impl std::marker::Unpin for DictionaryRequestStream {}
5660
5661impl futures::stream::FusedStream for DictionaryRequestStream {
5662    fn is_terminated(&self) -> bool {
5663        self.is_terminated
5664    }
5665}
5666
5667impl fidl::endpoints::RequestStream for DictionaryRequestStream {
5668    type Protocol = DictionaryMarker;
5669    type ControlHandle = DictionaryControlHandle;
5670
5671    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5672        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5673    }
5674
5675    fn control_handle(&self) -> Self::ControlHandle {
5676        DictionaryControlHandle { inner: self.inner.clone() }
5677    }
5678
5679    fn into_inner(
5680        self,
5681    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5682    {
5683        (self.inner, self.is_terminated)
5684    }
5685
5686    fn from_inner(
5687        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5688        is_terminated: bool,
5689    ) -> Self {
5690        Self { inner, is_terminated }
5691    }
5692}
5693
5694impl futures::Stream for DictionaryRequestStream {
5695    type Item = Result<DictionaryRequest, fidl::Error>;
5696
5697    fn poll_next(
5698        mut self: std::pin::Pin<&mut Self>,
5699        cx: &mut std::task::Context<'_>,
5700    ) -> std::task::Poll<Option<Self::Item>> {
5701        let this = &mut *self;
5702        if this.inner.check_shutdown(cx) {
5703            this.is_terminated = true;
5704            return std::task::Poll::Ready(None);
5705        }
5706        if this.is_terminated {
5707            panic!("polled DictionaryRequestStream after completion");
5708        }
5709        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
5710            |bytes, handles| {
5711                match this.inner.channel().read_etc(cx, bytes, handles) {
5712                    std::task::Poll::Ready(Ok(())) => {}
5713                    std::task::Poll::Pending => return std::task::Poll::Pending,
5714                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
5715                        this.is_terminated = true;
5716                        return std::task::Poll::Ready(None);
5717                    }
5718                    std::task::Poll::Ready(Err(e)) => {
5719                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5720                            e.into(),
5721                        ))))
5722                    }
5723                }
5724
5725                // A message has been received from the channel
5726                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5727
5728                std::task::Poll::Ready(Some(match header.ordinal {
5729                    _ if header.tx_id == 0
5730                        && header
5731                            .dynamic_flags()
5732                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5733                    {
5734                        Ok(DictionaryRequest::_UnknownMethod {
5735                            ordinal: header.ordinal,
5736                            control_handle: DictionaryControlHandle { inner: this.inner.clone() },
5737                            method_type: fidl::MethodType::OneWay,
5738                        })
5739                    }
5740                    _ if header
5741                        .dynamic_flags()
5742                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5743                    {
5744                        this.inner.send_framework_err(
5745                            fidl::encoding::FrameworkErr::UnknownMethod,
5746                            header.tx_id,
5747                            header.ordinal,
5748                            header.dynamic_flags(),
5749                            (bytes, handles),
5750                        )?;
5751                        Ok(DictionaryRequest::_UnknownMethod {
5752                            ordinal: header.ordinal,
5753                            control_handle: DictionaryControlHandle { inner: this.inner.clone() },
5754                            method_type: fidl::MethodType::TwoWay,
5755                        })
5756                    }
5757                    _ => Err(fidl::Error::UnknownOrdinal {
5758                        ordinal: header.ordinal,
5759                        protocol_name:
5760                            <DictionaryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5761                    }),
5762                }))
5763            },
5764        )
5765    }
5766}
5767
5768#[derive(Debug)]
5769pub enum DictionaryRequest {
5770    /// An interaction was received which does not match any known method.
5771    #[non_exhaustive]
5772    _UnknownMethod {
5773        /// Ordinal of the method that was called.
5774        ordinal: u64,
5775        control_handle: DictionaryControlHandle,
5776        method_type: fidl::MethodType,
5777    },
5778}
5779
5780impl DictionaryRequest {
5781    /// Name of the method defined in FIDL
5782    pub fn method_name(&self) -> &'static str {
5783        match *self {
5784            DictionaryRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
5785                "unknown one-way method"
5786            }
5787            DictionaryRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
5788                "unknown two-way method"
5789            }
5790        }
5791    }
5792}
5793
5794#[derive(Debug, Clone)]
5795pub struct DictionaryControlHandle {
5796    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5797}
5798
5799impl fidl::endpoints::ControlHandle for DictionaryControlHandle {
5800    fn shutdown(&self) {
5801        self.inner.shutdown()
5802    }
5803    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
5804        self.inner.shutdown_with_epitaph(status)
5805    }
5806
5807    fn is_closed(&self) -> bool {
5808        self.inner.channel().is_closed()
5809    }
5810    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
5811        self.inner.channel().on_closed()
5812    }
5813
5814    #[cfg(target_os = "fuchsia")]
5815    fn signal_peer(
5816        &self,
5817        clear_mask: zx::Signals,
5818        set_mask: zx::Signals,
5819    ) -> Result<(), zx_status::Status> {
5820        use fidl::Peered;
5821        self.inner.channel().signal_peer(clear_mask, set_mask)
5822    }
5823}
5824
5825impl DictionaryControlHandle {}
5826
5827#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5828pub struct DictionaryDrainIteratorMarker;
5829
5830impl fidl::endpoints::ProtocolMarker for DictionaryDrainIteratorMarker {
5831    type Proxy = DictionaryDrainIteratorProxy;
5832    type RequestStream = DictionaryDrainIteratorRequestStream;
5833    #[cfg(target_os = "fuchsia")]
5834    type SynchronousProxy = DictionaryDrainIteratorSynchronousProxy;
5835
5836    const DEBUG_NAME: &'static str = "(anonymous) DictionaryDrainIterator";
5837}
5838pub type DictionaryDrainIteratorGetNextResult =
5839    Result<(Vec<DictionaryItem>, u64), CapabilityStoreError>;
5840
5841pub trait DictionaryDrainIteratorProxyInterface: Send + Sync {
5842    type GetNextResponseFut: std::future::Future<Output = Result<DictionaryDrainIteratorGetNextResult, fidl::Error>>
5843        + Send;
5844    fn r#get_next(&self, start_id: u64, limit: u32) -> Self::GetNextResponseFut;
5845}
5846#[derive(Debug)]
5847#[cfg(target_os = "fuchsia")]
5848pub struct DictionaryDrainIteratorSynchronousProxy {
5849    client: fidl::client::sync::Client,
5850}
5851
5852#[cfg(target_os = "fuchsia")]
5853impl fidl::endpoints::SynchronousProxy for DictionaryDrainIteratorSynchronousProxy {
5854    type Proxy = DictionaryDrainIteratorProxy;
5855    type Protocol = DictionaryDrainIteratorMarker;
5856
5857    fn from_channel(inner: fidl::Channel) -> Self {
5858        Self::new(inner)
5859    }
5860
5861    fn into_channel(self) -> fidl::Channel {
5862        self.client.into_channel()
5863    }
5864
5865    fn as_channel(&self) -> &fidl::Channel {
5866        self.client.as_channel()
5867    }
5868}
5869
5870#[cfg(target_os = "fuchsia")]
5871impl DictionaryDrainIteratorSynchronousProxy {
5872    pub fn new(channel: fidl::Channel) -> Self {
5873        let protocol_name =
5874            <DictionaryDrainIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5875        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
5876    }
5877
5878    pub fn into_channel(self) -> fidl::Channel {
5879        self.client.into_channel()
5880    }
5881
5882    /// Waits until an event arrives and returns it. It is safe for other
5883    /// threads to make concurrent requests while waiting for an event.
5884    pub fn wait_for_event(
5885        &self,
5886        deadline: zx::MonotonicInstant,
5887    ) -> Result<DictionaryDrainIteratorEvent, fidl::Error> {
5888        DictionaryDrainIteratorEvent::decode(self.client.wait_for_event(deadline)?)
5889    }
5890
5891    /// Returns the next batch of results for a [Dictionary.Drain] call, returning up to
5892    /// `limit` results. `limit` can be at most [MAX_DICTIONARY_ITERATOR_CHUNK].
5893    ///
5894    /// Each returned capability will be assigned a monotonically increasing [CapabilityId] starting
5895    /// from `start_id`.
5896    ///
5897    /// In addition to the `items`, returns `end_id`, which is one more than the highest id reserved
5898    /// by [GetNext]. `end_id` can be used as the `start_id` for the next call to [GetNext].
5899    ///
5900    /// If [GetNext] returns an error, the server will also close the channel.
5901    ///
5902    /// Errors:
5903    ///
5904    /// - `ID_ALREADY_EXISTS` if some id in the range `[start_id, limit)` already exists in this
5905    ///   store.
5906    /// - `INVALID_ARGS` if `limit` was `0` or greater than `MAX_DICTIONARY_ITERATOR_CHUNK`.
5907    pub fn r#get_next(
5908        &self,
5909        mut start_id: u64,
5910        mut limit: u32,
5911        ___deadline: zx::MonotonicInstant,
5912    ) -> Result<DictionaryDrainIteratorGetNextResult, fidl::Error> {
5913        let _response = self
5914            .client
5915            .send_query::<DictionaryDrainIteratorGetNextRequest, fidl::encoding::FlexibleResultType<
5916                DictionaryDrainIteratorGetNextResponse,
5917                CapabilityStoreError,
5918            >>(
5919                (start_id, limit),
5920                0x4f8082ca1ee26061,
5921                fidl::encoding::DynamicFlags::FLEXIBLE,
5922                ___deadline,
5923            )?
5924            .into_result::<DictionaryDrainIteratorMarker>("get_next")?;
5925        Ok(_response.map(|x| (x.items, x.end_id)))
5926    }
5927}
5928
5929#[cfg(target_os = "fuchsia")]
5930impl From<DictionaryDrainIteratorSynchronousProxy> for zx::Handle {
5931    fn from(value: DictionaryDrainIteratorSynchronousProxy) -> Self {
5932        value.into_channel().into()
5933    }
5934}
5935
5936#[cfg(target_os = "fuchsia")]
5937impl From<fidl::Channel> for DictionaryDrainIteratorSynchronousProxy {
5938    fn from(value: fidl::Channel) -> Self {
5939        Self::new(value)
5940    }
5941}
5942
5943#[cfg(target_os = "fuchsia")]
5944impl fidl::endpoints::FromClient for DictionaryDrainIteratorSynchronousProxy {
5945    type Protocol = DictionaryDrainIteratorMarker;
5946
5947    fn from_client(value: fidl::endpoints::ClientEnd<DictionaryDrainIteratorMarker>) -> Self {
5948        Self::new(value.into_channel())
5949    }
5950}
5951
5952#[derive(Debug, Clone)]
5953pub struct DictionaryDrainIteratorProxy {
5954    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
5955}
5956
5957impl fidl::endpoints::Proxy for DictionaryDrainIteratorProxy {
5958    type Protocol = DictionaryDrainIteratorMarker;
5959
5960    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
5961        Self::new(inner)
5962    }
5963
5964    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
5965        self.client.into_channel().map_err(|client| Self { client })
5966    }
5967
5968    fn as_channel(&self) -> &::fidl::AsyncChannel {
5969        self.client.as_channel()
5970    }
5971}
5972
5973impl DictionaryDrainIteratorProxy {
5974    /// Create a new Proxy for fuchsia.component.sandbox/DictionaryDrainIterator.
5975    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5976        let protocol_name =
5977            <DictionaryDrainIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5978        Self { client: fidl::client::Client::new(channel, protocol_name) }
5979    }
5980
5981    /// Get a Stream of events from the remote end of the protocol.
5982    ///
5983    /// # Panics
5984    ///
5985    /// Panics if the event stream was already taken.
5986    pub fn take_event_stream(&self) -> DictionaryDrainIteratorEventStream {
5987        DictionaryDrainIteratorEventStream { event_receiver: self.client.take_event_receiver() }
5988    }
5989
5990    /// Returns the next batch of results for a [Dictionary.Drain] call, returning up to
5991    /// `limit` results. `limit` can be at most [MAX_DICTIONARY_ITERATOR_CHUNK].
5992    ///
5993    /// Each returned capability will be assigned a monotonically increasing [CapabilityId] starting
5994    /// from `start_id`.
5995    ///
5996    /// In addition to the `items`, returns `end_id`, which is one more than the highest id reserved
5997    /// by [GetNext]. `end_id` can be used as the `start_id` for the next call to [GetNext].
5998    ///
5999    /// If [GetNext] returns an error, the server will also close the channel.
6000    ///
6001    /// Errors:
6002    ///
6003    /// - `ID_ALREADY_EXISTS` if some id in the range `[start_id, limit)` already exists in this
6004    ///   store.
6005    /// - `INVALID_ARGS` if `limit` was `0` or greater than `MAX_DICTIONARY_ITERATOR_CHUNK`.
6006    pub fn r#get_next(
6007        &self,
6008        mut start_id: u64,
6009        mut limit: u32,
6010    ) -> fidl::client::QueryResponseFut<
6011        DictionaryDrainIteratorGetNextResult,
6012        fidl::encoding::DefaultFuchsiaResourceDialect,
6013    > {
6014        DictionaryDrainIteratorProxyInterface::r#get_next(self, start_id, limit)
6015    }
6016}
6017
6018impl DictionaryDrainIteratorProxyInterface for DictionaryDrainIteratorProxy {
6019    type GetNextResponseFut = fidl::client::QueryResponseFut<
6020        DictionaryDrainIteratorGetNextResult,
6021        fidl::encoding::DefaultFuchsiaResourceDialect,
6022    >;
6023    fn r#get_next(&self, mut start_id: u64, mut limit: u32) -> Self::GetNextResponseFut {
6024        fn _decode(
6025            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6026        ) -> Result<DictionaryDrainIteratorGetNextResult, fidl::Error> {
6027            let _response = fidl::client::decode_transaction_body::<
6028                fidl::encoding::FlexibleResultType<
6029                    DictionaryDrainIteratorGetNextResponse,
6030                    CapabilityStoreError,
6031                >,
6032                fidl::encoding::DefaultFuchsiaResourceDialect,
6033                0x4f8082ca1ee26061,
6034            >(_buf?)?
6035            .into_result::<DictionaryDrainIteratorMarker>("get_next")?;
6036            Ok(_response.map(|x| (x.items, x.end_id)))
6037        }
6038        self.client.send_query_and_decode::<
6039            DictionaryDrainIteratorGetNextRequest,
6040            DictionaryDrainIteratorGetNextResult,
6041        >(
6042            (start_id, limit,),
6043            0x4f8082ca1ee26061,
6044            fidl::encoding::DynamicFlags::FLEXIBLE,
6045            _decode,
6046        )
6047    }
6048}
6049
6050pub struct DictionaryDrainIteratorEventStream {
6051    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6052}
6053
6054impl std::marker::Unpin for DictionaryDrainIteratorEventStream {}
6055
6056impl futures::stream::FusedStream for DictionaryDrainIteratorEventStream {
6057    fn is_terminated(&self) -> bool {
6058        self.event_receiver.is_terminated()
6059    }
6060}
6061
6062impl futures::Stream for DictionaryDrainIteratorEventStream {
6063    type Item = Result<DictionaryDrainIteratorEvent, fidl::Error>;
6064
6065    fn poll_next(
6066        mut self: std::pin::Pin<&mut Self>,
6067        cx: &mut std::task::Context<'_>,
6068    ) -> std::task::Poll<Option<Self::Item>> {
6069        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6070            &mut self.event_receiver,
6071            cx
6072        )?) {
6073            Some(buf) => std::task::Poll::Ready(Some(DictionaryDrainIteratorEvent::decode(buf))),
6074            None => std::task::Poll::Ready(None),
6075        }
6076    }
6077}
6078
6079#[derive(Debug)]
6080pub enum DictionaryDrainIteratorEvent {
6081    #[non_exhaustive]
6082    _UnknownEvent {
6083        /// Ordinal of the event that was sent.
6084        ordinal: u64,
6085    },
6086}
6087
6088impl DictionaryDrainIteratorEvent {
6089    /// Decodes a message buffer as a [`DictionaryDrainIteratorEvent`].
6090    fn decode(
6091        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6092    ) -> Result<DictionaryDrainIteratorEvent, fidl::Error> {
6093        let (bytes, _handles) = buf.split_mut();
6094        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6095        debug_assert_eq!(tx_header.tx_id, 0);
6096        match tx_header.ordinal {
6097            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6098                Ok(DictionaryDrainIteratorEvent::_UnknownEvent { ordinal: tx_header.ordinal })
6099            }
6100            _ => Err(fidl::Error::UnknownOrdinal {
6101                ordinal: tx_header.ordinal,
6102                protocol_name:
6103                    <DictionaryDrainIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6104            }),
6105        }
6106    }
6107}
6108
6109/// A Stream of incoming requests for fuchsia.component.sandbox/DictionaryDrainIterator.
6110pub struct DictionaryDrainIteratorRequestStream {
6111    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6112    is_terminated: bool,
6113}
6114
6115impl std::marker::Unpin for DictionaryDrainIteratorRequestStream {}
6116
6117impl futures::stream::FusedStream for DictionaryDrainIteratorRequestStream {
6118    fn is_terminated(&self) -> bool {
6119        self.is_terminated
6120    }
6121}
6122
6123impl fidl::endpoints::RequestStream for DictionaryDrainIteratorRequestStream {
6124    type Protocol = DictionaryDrainIteratorMarker;
6125    type ControlHandle = DictionaryDrainIteratorControlHandle;
6126
6127    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6128        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6129    }
6130
6131    fn control_handle(&self) -> Self::ControlHandle {
6132        DictionaryDrainIteratorControlHandle { inner: self.inner.clone() }
6133    }
6134
6135    fn into_inner(
6136        self,
6137    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6138    {
6139        (self.inner, self.is_terminated)
6140    }
6141
6142    fn from_inner(
6143        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6144        is_terminated: bool,
6145    ) -> Self {
6146        Self { inner, is_terminated }
6147    }
6148}
6149
6150impl futures::Stream for DictionaryDrainIteratorRequestStream {
6151    type Item = Result<DictionaryDrainIteratorRequest, fidl::Error>;
6152
6153    fn poll_next(
6154        mut self: std::pin::Pin<&mut Self>,
6155        cx: &mut std::task::Context<'_>,
6156    ) -> std::task::Poll<Option<Self::Item>> {
6157        let this = &mut *self;
6158        if this.inner.check_shutdown(cx) {
6159            this.is_terminated = true;
6160            return std::task::Poll::Ready(None);
6161        }
6162        if this.is_terminated {
6163            panic!("polled DictionaryDrainIteratorRequestStream after completion");
6164        }
6165        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
6166            |bytes, handles| {
6167                match this.inner.channel().read_etc(cx, bytes, handles) {
6168                    std::task::Poll::Ready(Ok(())) => {}
6169                    std::task::Poll::Pending => return std::task::Poll::Pending,
6170                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
6171                        this.is_terminated = true;
6172                        return std::task::Poll::Ready(None);
6173                    }
6174                    std::task::Poll::Ready(Err(e)) => {
6175                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6176                            e.into(),
6177                        ))))
6178                    }
6179                }
6180
6181                // A message has been received from the channel
6182                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6183
6184                std::task::Poll::Ready(Some(match header.ordinal {
6185                0x4f8082ca1ee26061 => {
6186                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6187                    let mut req = fidl::new_empty!(DictionaryDrainIteratorGetNextRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
6188                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DictionaryDrainIteratorGetNextRequest>(&header, _body_bytes, handles, &mut req)?;
6189                    let control_handle = DictionaryDrainIteratorControlHandle {
6190                        inner: this.inner.clone(),
6191                    };
6192                    Ok(DictionaryDrainIteratorRequest::GetNext {start_id: req.start_id,
6193limit: req.limit,
6194
6195                        responder: DictionaryDrainIteratorGetNextResponder {
6196                            control_handle: std::mem::ManuallyDrop::new(control_handle),
6197                            tx_id: header.tx_id,
6198                        },
6199                    })
6200                }
6201                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6202                    Ok(DictionaryDrainIteratorRequest::_UnknownMethod {
6203                        ordinal: header.ordinal,
6204                        control_handle: DictionaryDrainIteratorControlHandle { inner: this.inner.clone() },
6205                        method_type: fidl::MethodType::OneWay,
6206                    })
6207                }
6208                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6209                    this.inner.send_framework_err(
6210                        fidl::encoding::FrameworkErr::UnknownMethod,
6211                        header.tx_id,
6212                        header.ordinal,
6213                        header.dynamic_flags(),
6214                        (bytes, handles),
6215                    )?;
6216                    Ok(DictionaryDrainIteratorRequest::_UnknownMethod {
6217                        ordinal: header.ordinal,
6218                        control_handle: DictionaryDrainIteratorControlHandle { inner: this.inner.clone() },
6219                        method_type: fidl::MethodType::TwoWay,
6220                    })
6221                }
6222                _ => Err(fidl::Error::UnknownOrdinal {
6223                    ordinal: header.ordinal,
6224                    protocol_name: <DictionaryDrainIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6225                }),
6226            }))
6227            },
6228        )
6229    }
6230}
6231
6232#[derive(Debug)]
6233pub enum DictionaryDrainIteratorRequest {
6234    /// Returns the next batch of results for a [Dictionary.Drain] call, returning up to
6235    /// `limit` results. `limit` can be at most [MAX_DICTIONARY_ITERATOR_CHUNK].
6236    ///
6237    /// Each returned capability will be assigned a monotonically increasing [CapabilityId] starting
6238    /// from `start_id`.
6239    ///
6240    /// In addition to the `items`, returns `end_id`, which is one more than the highest id reserved
6241    /// by [GetNext]. `end_id` can be used as the `start_id` for the next call to [GetNext].
6242    ///
6243    /// If [GetNext] returns an error, the server will also close the channel.
6244    ///
6245    /// Errors:
6246    ///
6247    /// - `ID_ALREADY_EXISTS` if some id in the range `[start_id, limit)` already exists in this
6248    ///   store.
6249    /// - `INVALID_ARGS` if `limit` was `0` or greater than `MAX_DICTIONARY_ITERATOR_CHUNK`.
6250    GetNext { start_id: u64, limit: u32, responder: DictionaryDrainIteratorGetNextResponder },
6251    /// An interaction was received which does not match any known method.
6252    #[non_exhaustive]
6253    _UnknownMethod {
6254        /// Ordinal of the method that was called.
6255        ordinal: u64,
6256        control_handle: DictionaryDrainIteratorControlHandle,
6257        method_type: fidl::MethodType,
6258    },
6259}
6260
6261impl DictionaryDrainIteratorRequest {
6262    #[allow(irrefutable_let_patterns)]
6263    pub fn into_get_next(self) -> Option<(u64, u32, DictionaryDrainIteratorGetNextResponder)> {
6264        if let DictionaryDrainIteratorRequest::GetNext { start_id, limit, responder } = self {
6265            Some((start_id, limit, responder))
6266        } else {
6267            None
6268        }
6269    }
6270
6271    /// Name of the method defined in FIDL
6272    pub fn method_name(&self) -> &'static str {
6273        match *self {
6274            DictionaryDrainIteratorRequest::GetNext { .. } => "get_next",
6275            DictionaryDrainIteratorRequest::_UnknownMethod {
6276                method_type: fidl::MethodType::OneWay,
6277                ..
6278            } => "unknown one-way method",
6279            DictionaryDrainIteratorRequest::_UnknownMethod {
6280                method_type: fidl::MethodType::TwoWay,
6281                ..
6282            } => "unknown two-way method",
6283        }
6284    }
6285}
6286
6287#[derive(Debug, Clone)]
6288pub struct DictionaryDrainIteratorControlHandle {
6289    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6290}
6291
6292impl fidl::endpoints::ControlHandle for DictionaryDrainIteratorControlHandle {
6293    fn shutdown(&self) {
6294        self.inner.shutdown()
6295    }
6296    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
6297        self.inner.shutdown_with_epitaph(status)
6298    }
6299
6300    fn is_closed(&self) -> bool {
6301        self.inner.channel().is_closed()
6302    }
6303    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6304        self.inner.channel().on_closed()
6305    }
6306
6307    #[cfg(target_os = "fuchsia")]
6308    fn signal_peer(
6309        &self,
6310        clear_mask: zx::Signals,
6311        set_mask: zx::Signals,
6312    ) -> Result<(), zx_status::Status> {
6313        use fidl::Peered;
6314        self.inner.channel().signal_peer(clear_mask, set_mask)
6315    }
6316}
6317
6318impl DictionaryDrainIteratorControlHandle {}
6319
6320#[must_use = "FIDL methods require a response to be sent"]
6321#[derive(Debug)]
6322pub struct DictionaryDrainIteratorGetNextResponder {
6323    control_handle: std::mem::ManuallyDrop<DictionaryDrainIteratorControlHandle>,
6324    tx_id: u32,
6325}
6326
6327/// Set the the channel to be shutdown (see [`DictionaryDrainIteratorControlHandle::shutdown`])
6328/// if the responder is dropped without sending a response, so that the client
6329/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6330impl std::ops::Drop for DictionaryDrainIteratorGetNextResponder {
6331    fn drop(&mut self) {
6332        self.control_handle.shutdown();
6333        // Safety: drops once, never accessed again
6334        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6335    }
6336}
6337
6338impl fidl::endpoints::Responder for DictionaryDrainIteratorGetNextResponder {
6339    type ControlHandle = DictionaryDrainIteratorControlHandle;
6340
6341    fn control_handle(&self) -> &DictionaryDrainIteratorControlHandle {
6342        &self.control_handle
6343    }
6344
6345    fn drop_without_shutdown(mut self) {
6346        // Safety: drops once, never accessed again due to mem::forget
6347        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6348        // Prevent Drop from running (which would shut down the channel)
6349        std::mem::forget(self);
6350    }
6351}
6352
6353impl DictionaryDrainIteratorGetNextResponder {
6354    /// Sends a response to the FIDL transaction.
6355    ///
6356    /// Sets the channel to shutdown if an error occurs.
6357    pub fn send(
6358        self,
6359        mut result: Result<(&[DictionaryItem], u64), CapabilityStoreError>,
6360    ) -> Result<(), fidl::Error> {
6361        let _result = self.send_raw(result);
6362        if _result.is_err() {
6363            self.control_handle.shutdown();
6364        }
6365        self.drop_without_shutdown();
6366        _result
6367    }
6368
6369    /// Similar to "send" but does not shutdown the channel if an error occurs.
6370    pub fn send_no_shutdown_on_err(
6371        self,
6372        mut result: Result<(&[DictionaryItem], u64), CapabilityStoreError>,
6373    ) -> Result<(), fidl::Error> {
6374        let _result = self.send_raw(result);
6375        self.drop_without_shutdown();
6376        _result
6377    }
6378
6379    fn send_raw(
6380        &self,
6381        mut result: Result<(&[DictionaryItem], u64), CapabilityStoreError>,
6382    ) -> Result<(), fidl::Error> {
6383        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
6384            DictionaryDrainIteratorGetNextResponse,
6385            CapabilityStoreError,
6386        >>(
6387            fidl::encoding::FlexibleResult::new(result),
6388            self.tx_id,
6389            0x4f8082ca1ee26061,
6390            fidl::encoding::DynamicFlags::FLEXIBLE,
6391        )
6392    }
6393}
6394
6395#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6396pub struct DictionaryEnumerateIteratorMarker;
6397
6398impl fidl::endpoints::ProtocolMarker for DictionaryEnumerateIteratorMarker {
6399    type Proxy = DictionaryEnumerateIteratorProxy;
6400    type RequestStream = DictionaryEnumerateIteratorRequestStream;
6401    #[cfg(target_os = "fuchsia")]
6402    type SynchronousProxy = DictionaryEnumerateIteratorSynchronousProxy;
6403
6404    const DEBUG_NAME: &'static str = "(anonymous) DictionaryEnumerateIterator";
6405}
6406pub type DictionaryEnumerateIteratorGetNextResult =
6407    Result<(Vec<DictionaryOptionalItem>, u64), CapabilityStoreError>;
6408
6409pub trait DictionaryEnumerateIteratorProxyInterface: Send + Sync {
6410    type GetNextResponseFut: std::future::Future<Output = Result<DictionaryEnumerateIteratorGetNextResult, fidl::Error>>
6411        + Send;
6412    fn r#get_next(&self, start_id: u64, limit: u32) -> Self::GetNextResponseFut;
6413}
6414#[derive(Debug)]
6415#[cfg(target_os = "fuchsia")]
6416pub struct DictionaryEnumerateIteratorSynchronousProxy {
6417    client: fidl::client::sync::Client,
6418}
6419
6420#[cfg(target_os = "fuchsia")]
6421impl fidl::endpoints::SynchronousProxy for DictionaryEnumerateIteratorSynchronousProxy {
6422    type Proxy = DictionaryEnumerateIteratorProxy;
6423    type Protocol = DictionaryEnumerateIteratorMarker;
6424
6425    fn from_channel(inner: fidl::Channel) -> Self {
6426        Self::new(inner)
6427    }
6428
6429    fn into_channel(self) -> fidl::Channel {
6430        self.client.into_channel()
6431    }
6432
6433    fn as_channel(&self) -> &fidl::Channel {
6434        self.client.as_channel()
6435    }
6436}
6437
6438#[cfg(target_os = "fuchsia")]
6439impl DictionaryEnumerateIteratorSynchronousProxy {
6440    pub fn new(channel: fidl::Channel) -> Self {
6441        let protocol_name =
6442            <DictionaryEnumerateIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6443        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
6444    }
6445
6446    pub fn into_channel(self) -> fidl::Channel {
6447        self.client.into_channel()
6448    }
6449
6450    /// Waits until an event arrives and returns it. It is safe for other
6451    /// threads to make concurrent requests while waiting for an event.
6452    pub fn wait_for_event(
6453        &self,
6454        deadline: zx::MonotonicInstant,
6455    ) -> Result<DictionaryEnumerateIteratorEvent, fidl::Error> {
6456        DictionaryEnumerateIteratorEvent::decode(self.client.wait_for_event(deadline)?)
6457    }
6458
6459    /// Returns the next batch of results for a [Dictionary.Enumerate] call, returning up to
6460    /// `limit` results. `limit` can be at most [MAX_DICTIONARY_ITERATOR_CHUNK].
6461    ///
6462    /// The value of each of `items` is a duplicate of the original capability
6463    /// ([CapabilityStore.Duplicate]), unless it could not be duplicated, it which case it will
6464    /// be null.
6465    ///
6466    /// Each returned capability will be assigned a monotonically increasing [CapabilityId] starting
6467    /// from `start_id`.
6468    ///
6469    /// In addition to the `items`, returns `end_id`, which is one more than the highest id reserved
6470    /// by [GetNext]. `end_id` can be used as the `start_id` for the next call to [GetNext].
6471    ///
6472    /// If [GetNext] returns an error, the server will also close the channel.
6473    ///
6474    /// Errors:
6475    ///
6476    /// - `ID_ALREADY_EXISTS` if some id in the range `[start_id, limit)` already exists in this
6477    ///   store.
6478    /// - `INVALID_ARGS` if `limit` was `0` or greater than `MAX_DICTIONARY_ITERATOR_CHUNK`.
6479    pub fn r#get_next(
6480        &self,
6481        mut start_id: u64,
6482        mut limit: u32,
6483        ___deadline: zx::MonotonicInstant,
6484    ) -> Result<DictionaryEnumerateIteratorGetNextResult, fidl::Error> {
6485        let _response = self.client.send_query::<
6486            DictionaryEnumerateIteratorGetNextRequest,
6487            fidl::encoding::FlexibleResultType<DictionaryEnumerateIteratorGetNextResponse, CapabilityStoreError>,
6488        >(
6489            (start_id, limit,),
6490            0x14f8bc286512f5cf,
6491            fidl::encoding::DynamicFlags::FLEXIBLE,
6492            ___deadline,
6493        )?
6494        .into_result::<DictionaryEnumerateIteratorMarker>("get_next")?;
6495        Ok(_response.map(|x| (x.items, x.end_id)))
6496    }
6497}
6498
6499#[cfg(target_os = "fuchsia")]
6500impl From<DictionaryEnumerateIteratorSynchronousProxy> for zx::Handle {
6501    fn from(value: DictionaryEnumerateIteratorSynchronousProxy) -> Self {
6502        value.into_channel().into()
6503    }
6504}
6505
6506#[cfg(target_os = "fuchsia")]
6507impl From<fidl::Channel> for DictionaryEnumerateIteratorSynchronousProxy {
6508    fn from(value: fidl::Channel) -> Self {
6509        Self::new(value)
6510    }
6511}
6512
6513#[cfg(target_os = "fuchsia")]
6514impl fidl::endpoints::FromClient for DictionaryEnumerateIteratorSynchronousProxy {
6515    type Protocol = DictionaryEnumerateIteratorMarker;
6516
6517    fn from_client(value: fidl::endpoints::ClientEnd<DictionaryEnumerateIteratorMarker>) -> Self {
6518        Self::new(value.into_channel())
6519    }
6520}
6521
6522#[derive(Debug, Clone)]
6523pub struct DictionaryEnumerateIteratorProxy {
6524    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6525}
6526
6527impl fidl::endpoints::Proxy for DictionaryEnumerateIteratorProxy {
6528    type Protocol = DictionaryEnumerateIteratorMarker;
6529
6530    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6531        Self::new(inner)
6532    }
6533
6534    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6535        self.client.into_channel().map_err(|client| Self { client })
6536    }
6537
6538    fn as_channel(&self) -> &::fidl::AsyncChannel {
6539        self.client.as_channel()
6540    }
6541}
6542
6543impl DictionaryEnumerateIteratorProxy {
6544    /// Create a new Proxy for fuchsia.component.sandbox/DictionaryEnumerateIterator.
6545    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6546        let protocol_name =
6547            <DictionaryEnumerateIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6548        Self { client: fidl::client::Client::new(channel, protocol_name) }
6549    }
6550
6551    /// Get a Stream of events from the remote end of the protocol.
6552    ///
6553    /// # Panics
6554    ///
6555    /// Panics if the event stream was already taken.
6556    pub fn take_event_stream(&self) -> DictionaryEnumerateIteratorEventStream {
6557        DictionaryEnumerateIteratorEventStream { event_receiver: self.client.take_event_receiver() }
6558    }
6559
6560    /// Returns the next batch of results for a [Dictionary.Enumerate] call, returning up to
6561    /// `limit` results. `limit` can be at most [MAX_DICTIONARY_ITERATOR_CHUNK].
6562    ///
6563    /// The value of each of `items` is a duplicate of the original capability
6564    /// ([CapabilityStore.Duplicate]), unless it could not be duplicated, it which case it will
6565    /// be null.
6566    ///
6567    /// Each returned capability will be assigned a monotonically increasing [CapabilityId] starting
6568    /// from `start_id`.
6569    ///
6570    /// In addition to the `items`, returns `end_id`, which is one more than the highest id reserved
6571    /// by [GetNext]. `end_id` can be used as the `start_id` for the next call to [GetNext].
6572    ///
6573    /// If [GetNext] returns an error, the server will also close the channel.
6574    ///
6575    /// Errors:
6576    ///
6577    /// - `ID_ALREADY_EXISTS` if some id in the range `[start_id, limit)` already exists in this
6578    ///   store.
6579    /// - `INVALID_ARGS` if `limit` was `0` or greater than `MAX_DICTIONARY_ITERATOR_CHUNK`.
6580    pub fn r#get_next(
6581        &self,
6582        mut start_id: u64,
6583        mut limit: u32,
6584    ) -> fidl::client::QueryResponseFut<
6585        DictionaryEnumerateIteratorGetNextResult,
6586        fidl::encoding::DefaultFuchsiaResourceDialect,
6587    > {
6588        DictionaryEnumerateIteratorProxyInterface::r#get_next(self, start_id, limit)
6589    }
6590}
6591
6592impl DictionaryEnumerateIteratorProxyInterface for DictionaryEnumerateIteratorProxy {
6593    type GetNextResponseFut = fidl::client::QueryResponseFut<
6594        DictionaryEnumerateIteratorGetNextResult,
6595        fidl::encoding::DefaultFuchsiaResourceDialect,
6596    >;
6597    fn r#get_next(&self, mut start_id: u64, mut limit: u32) -> Self::GetNextResponseFut {
6598        fn _decode(
6599            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6600        ) -> Result<DictionaryEnumerateIteratorGetNextResult, fidl::Error> {
6601            let _response = fidl::client::decode_transaction_body::<
6602                fidl::encoding::FlexibleResultType<
6603                    DictionaryEnumerateIteratorGetNextResponse,
6604                    CapabilityStoreError,
6605                >,
6606                fidl::encoding::DefaultFuchsiaResourceDialect,
6607                0x14f8bc286512f5cf,
6608            >(_buf?)?
6609            .into_result::<DictionaryEnumerateIteratorMarker>("get_next")?;
6610            Ok(_response.map(|x| (x.items, x.end_id)))
6611        }
6612        self.client.send_query_and_decode::<
6613            DictionaryEnumerateIteratorGetNextRequest,
6614            DictionaryEnumerateIteratorGetNextResult,
6615        >(
6616            (start_id, limit,),
6617            0x14f8bc286512f5cf,
6618            fidl::encoding::DynamicFlags::FLEXIBLE,
6619            _decode,
6620        )
6621    }
6622}
6623
6624pub struct DictionaryEnumerateIteratorEventStream {
6625    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6626}
6627
6628impl std::marker::Unpin for DictionaryEnumerateIteratorEventStream {}
6629
6630impl futures::stream::FusedStream for DictionaryEnumerateIteratorEventStream {
6631    fn is_terminated(&self) -> bool {
6632        self.event_receiver.is_terminated()
6633    }
6634}
6635
6636impl futures::Stream for DictionaryEnumerateIteratorEventStream {
6637    type Item = Result<DictionaryEnumerateIteratorEvent, fidl::Error>;
6638
6639    fn poll_next(
6640        mut self: std::pin::Pin<&mut Self>,
6641        cx: &mut std::task::Context<'_>,
6642    ) -> std::task::Poll<Option<Self::Item>> {
6643        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6644            &mut self.event_receiver,
6645            cx
6646        )?) {
6647            Some(buf) => {
6648                std::task::Poll::Ready(Some(DictionaryEnumerateIteratorEvent::decode(buf)))
6649            }
6650            None => std::task::Poll::Ready(None),
6651        }
6652    }
6653}
6654
6655#[derive(Debug)]
6656pub enum DictionaryEnumerateIteratorEvent {
6657    #[non_exhaustive]
6658    _UnknownEvent {
6659        /// Ordinal of the event that was sent.
6660        ordinal: u64,
6661    },
6662}
6663
6664impl DictionaryEnumerateIteratorEvent {
6665    /// Decodes a message buffer as a [`DictionaryEnumerateIteratorEvent`].
6666    fn decode(
6667        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6668    ) -> Result<DictionaryEnumerateIteratorEvent, fidl::Error> {
6669        let (bytes, _handles) = buf.split_mut();
6670        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6671        debug_assert_eq!(tx_header.tx_id, 0);
6672        match tx_header.ordinal {
6673            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6674                Ok(DictionaryEnumerateIteratorEvent::_UnknownEvent {
6675                    ordinal: tx_header.ordinal,
6676                })
6677            }
6678            _ => Err(fidl::Error::UnknownOrdinal {
6679                ordinal: tx_header.ordinal,
6680                protocol_name: <DictionaryEnumerateIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6681            })
6682        }
6683    }
6684}
6685
6686/// A Stream of incoming requests for fuchsia.component.sandbox/DictionaryEnumerateIterator.
6687pub struct DictionaryEnumerateIteratorRequestStream {
6688    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6689    is_terminated: bool,
6690}
6691
6692impl std::marker::Unpin for DictionaryEnumerateIteratorRequestStream {}
6693
6694impl futures::stream::FusedStream for DictionaryEnumerateIteratorRequestStream {
6695    fn is_terminated(&self) -> bool {
6696        self.is_terminated
6697    }
6698}
6699
6700impl fidl::endpoints::RequestStream for DictionaryEnumerateIteratorRequestStream {
6701    type Protocol = DictionaryEnumerateIteratorMarker;
6702    type ControlHandle = DictionaryEnumerateIteratorControlHandle;
6703
6704    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6705        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6706    }
6707
6708    fn control_handle(&self) -> Self::ControlHandle {
6709        DictionaryEnumerateIteratorControlHandle { inner: self.inner.clone() }
6710    }
6711
6712    fn into_inner(
6713        self,
6714    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6715    {
6716        (self.inner, self.is_terminated)
6717    }
6718
6719    fn from_inner(
6720        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6721        is_terminated: bool,
6722    ) -> Self {
6723        Self { inner, is_terminated }
6724    }
6725}
6726
6727impl futures::Stream for DictionaryEnumerateIteratorRequestStream {
6728    type Item = Result<DictionaryEnumerateIteratorRequest, fidl::Error>;
6729
6730    fn poll_next(
6731        mut self: std::pin::Pin<&mut Self>,
6732        cx: &mut std::task::Context<'_>,
6733    ) -> std::task::Poll<Option<Self::Item>> {
6734        let this = &mut *self;
6735        if this.inner.check_shutdown(cx) {
6736            this.is_terminated = true;
6737            return std::task::Poll::Ready(None);
6738        }
6739        if this.is_terminated {
6740            panic!("polled DictionaryEnumerateIteratorRequestStream after completion");
6741        }
6742        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
6743            |bytes, handles| {
6744                match this.inner.channel().read_etc(cx, bytes, handles) {
6745                    std::task::Poll::Ready(Ok(())) => {}
6746                    std::task::Poll::Pending => return std::task::Poll::Pending,
6747                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
6748                        this.is_terminated = true;
6749                        return std::task::Poll::Ready(None);
6750                    }
6751                    std::task::Poll::Ready(Err(e)) => {
6752                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6753                            e.into(),
6754                        ))))
6755                    }
6756                }
6757
6758                // A message has been received from the channel
6759                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6760
6761                std::task::Poll::Ready(Some(match header.ordinal {
6762                0x14f8bc286512f5cf => {
6763                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6764                    let mut req = fidl::new_empty!(DictionaryEnumerateIteratorGetNextRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
6765                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DictionaryEnumerateIteratorGetNextRequest>(&header, _body_bytes, handles, &mut req)?;
6766                    let control_handle = DictionaryEnumerateIteratorControlHandle {
6767                        inner: this.inner.clone(),
6768                    };
6769                    Ok(DictionaryEnumerateIteratorRequest::GetNext {start_id: req.start_id,
6770limit: req.limit,
6771
6772                        responder: DictionaryEnumerateIteratorGetNextResponder {
6773                            control_handle: std::mem::ManuallyDrop::new(control_handle),
6774                            tx_id: header.tx_id,
6775                        },
6776                    })
6777                }
6778                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6779                    Ok(DictionaryEnumerateIteratorRequest::_UnknownMethod {
6780                        ordinal: header.ordinal,
6781                        control_handle: DictionaryEnumerateIteratorControlHandle { inner: this.inner.clone() },
6782                        method_type: fidl::MethodType::OneWay,
6783                    })
6784                }
6785                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6786                    this.inner.send_framework_err(
6787                        fidl::encoding::FrameworkErr::UnknownMethod,
6788                        header.tx_id,
6789                        header.ordinal,
6790                        header.dynamic_flags(),
6791                        (bytes, handles),
6792                    )?;
6793                    Ok(DictionaryEnumerateIteratorRequest::_UnknownMethod {
6794                        ordinal: header.ordinal,
6795                        control_handle: DictionaryEnumerateIteratorControlHandle { inner: this.inner.clone() },
6796                        method_type: fidl::MethodType::TwoWay,
6797                    })
6798                }
6799                _ => Err(fidl::Error::UnknownOrdinal {
6800                    ordinal: header.ordinal,
6801                    protocol_name: <DictionaryEnumerateIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6802                }),
6803            }))
6804            },
6805        )
6806    }
6807}
6808
6809#[derive(Debug)]
6810pub enum DictionaryEnumerateIteratorRequest {
6811    /// Returns the next batch of results for a [Dictionary.Enumerate] call, returning up to
6812    /// `limit` results. `limit` can be at most [MAX_DICTIONARY_ITERATOR_CHUNK].
6813    ///
6814    /// The value of each of `items` is a duplicate of the original capability
6815    /// ([CapabilityStore.Duplicate]), unless it could not be duplicated, it which case it will
6816    /// be null.
6817    ///
6818    /// Each returned capability will be assigned a monotonically increasing [CapabilityId] starting
6819    /// from `start_id`.
6820    ///
6821    /// In addition to the `items`, returns `end_id`, which is one more than the highest id reserved
6822    /// by [GetNext]. `end_id` can be used as the `start_id` for the next call to [GetNext].
6823    ///
6824    /// If [GetNext] returns an error, the server will also close the channel.
6825    ///
6826    /// Errors:
6827    ///
6828    /// - `ID_ALREADY_EXISTS` if some id in the range `[start_id, limit)` already exists in this
6829    ///   store.
6830    /// - `INVALID_ARGS` if `limit` was `0` or greater than `MAX_DICTIONARY_ITERATOR_CHUNK`.
6831    GetNext { start_id: u64, limit: u32, responder: DictionaryEnumerateIteratorGetNextResponder },
6832    /// An interaction was received which does not match any known method.
6833    #[non_exhaustive]
6834    _UnknownMethod {
6835        /// Ordinal of the method that was called.
6836        ordinal: u64,
6837        control_handle: DictionaryEnumerateIteratorControlHandle,
6838        method_type: fidl::MethodType,
6839    },
6840}
6841
6842impl DictionaryEnumerateIteratorRequest {
6843    #[allow(irrefutable_let_patterns)]
6844    pub fn into_get_next(self) -> Option<(u64, u32, DictionaryEnumerateIteratorGetNextResponder)> {
6845        if let DictionaryEnumerateIteratorRequest::GetNext { start_id, limit, responder } = self {
6846            Some((start_id, limit, responder))
6847        } else {
6848            None
6849        }
6850    }
6851
6852    /// Name of the method defined in FIDL
6853    pub fn method_name(&self) -> &'static str {
6854        match *self {
6855            DictionaryEnumerateIteratorRequest::GetNext { .. } => "get_next",
6856            DictionaryEnumerateIteratorRequest::_UnknownMethod {
6857                method_type: fidl::MethodType::OneWay,
6858                ..
6859            } => "unknown one-way method",
6860            DictionaryEnumerateIteratorRequest::_UnknownMethod {
6861                method_type: fidl::MethodType::TwoWay,
6862                ..
6863            } => "unknown two-way method",
6864        }
6865    }
6866}
6867
6868#[derive(Debug, Clone)]
6869pub struct DictionaryEnumerateIteratorControlHandle {
6870    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6871}
6872
6873impl fidl::endpoints::ControlHandle for DictionaryEnumerateIteratorControlHandle {
6874    fn shutdown(&self) {
6875        self.inner.shutdown()
6876    }
6877    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
6878        self.inner.shutdown_with_epitaph(status)
6879    }
6880
6881    fn is_closed(&self) -> bool {
6882        self.inner.channel().is_closed()
6883    }
6884    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6885        self.inner.channel().on_closed()
6886    }
6887
6888    #[cfg(target_os = "fuchsia")]
6889    fn signal_peer(
6890        &self,
6891        clear_mask: zx::Signals,
6892        set_mask: zx::Signals,
6893    ) -> Result<(), zx_status::Status> {
6894        use fidl::Peered;
6895        self.inner.channel().signal_peer(clear_mask, set_mask)
6896    }
6897}
6898
6899impl DictionaryEnumerateIteratorControlHandle {}
6900
6901#[must_use = "FIDL methods require a response to be sent"]
6902#[derive(Debug)]
6903pub struct DictionaryEnumerateIteratorGetNextResponder {
6904    control_handle: std::mem::ManuallyDrop<DictionaryEnumerateIteratorControlHandle>,
6905    tx_id: u32,
6906}
6907
6908/// Set the the channel to be shutdown (see [`DictionaryEnumerateIteratorControlHandle::shutdown`])
6909/// if the responder is dropped without sending a response, so that the client
6910/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6911impl std::ops::Drop for DictionaryEnumerateIteratorGetNextResponder {
6912    fn drop(&mut self) {
6913        self.control_handle.shutdown();
6914        // Safety: drops once, never accessed again
6915        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6916    }
6917}
6918
6919impl fidl::endpoints::Responder for DictionaryEnumerateIteratorGetNextResponder {
6920    type ControlHandle = DictionaryEnumerateIteratorControlHandle;
6921
6922    fn control_handle(&self) -> &DictionaryEnumerateIteratorControlHandle {
6923        &self.control_handle
6924    }
6925
6926    fn drop_without_shutdown(mut self) {
6927        // Safety: drops once, never accessed again due to mem::forget
6928        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6929        // Prevent Drop from running (which would shut down the channel)
6930        std::mem::forget(self);
6931    }
6932}
6933
6934impl DictionaryEnumerateIteratorGetNextResponder {
6935    /// Sends a response to the FIDL transaction.
6936    ///
6937    /// Sets the channel to shutdown if an error occurs.
6938    pub fn send(
6939        self,
6940        mut result: Result<(Vec<DictionaryOptionalItem>, u64), CapabilityStoreError>,
6941    ) -> Result<(), fidl::Error> {
6942        let _result = self.send_raw(result);
6943        if _result.is_err() {
6944            self.control_handle.shutdown();
6945        }
6946        self.drop_without_shutdown();
6947        _result
6948    }
6949
6950    /// Similar to "send" but does not shutdown the channel if an error occurs.
6951    pub fn send_no_shutdown_on_err(
6952        self,
6953        mut result: Result<(Vec<DictionaryOptionalItem>, u64), CapabilityStoreError>,
6954    ) -> Result<(), fidl::Error> {
6955        let _result = self.send_raw(result);
6956        self.drop_without_shutdown();
6957        _result
6958    }
6959
6960    fn send_raw(
6961        &self,
6962        mut result: Result<(Vec<DictionaryOptionalItem>, u64), CapabilityStoreError>,
6963    ) -> Result<(), fidl::Error> {
6964        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
6965            DictionaryEnumerateIteratorGetNextResponse,
6966            CapabilityStoreError,
6967        >>(
6968            fidl::encoding::FlexibleResult::new(
6969                result
6970                    .as_mut()
6971                    .map_err(|e| *e)
6972                    .map(|(items, end_id)| (items.as_mut_slice(), *end_id)),
6973            ),
6974            self.tx_id,
6975            0x14f8bc286512f5cf,
6976            fidl::encoding::DynamicFlags::FLEXIBLE,
6977        )
6978    }
6979}
6980
6981#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6982pub struct DictionaryKeysIteratorMarker;
6983
6984impl fidl::endpoints::ProtocolMarker for DictionaryKeysIteratorMarker {
6985    type Proxy = DictionaryKeysIteratorProxy;
6986    type RequestStream = DictionaryKeysIteratorRequestStream;
6987    #[cfg(target_os = "fuchsia")]
6988    type SynchronousProxy = DictionaryKeysIteratorSynchronousProxy;
6989
6990    const DEBUG_NAME: &'static str = "(anonymous) DictionaryKeysIterator";
6991}
6992
6993pub trait DictionaryKeysIteratorProxyInterface: Send + Sync {
6994    type GetNextResponseFut: std::future::Future<Output = Result<Vec<String>, fidl::Error>> + Send;
6995    fn r#get_next(&self) -> Self::GetNextResponseFut;
6996}
6997#[derive(Debug)]
6998#[cfg(target_os = "fuchsia")]
6999pub struct DictionaryKeysIteratorSynchronousProxy {
7000    client: fidl::client::sync::Client,
7001}
7002
7003#[cfg(target_os = "fuchsia")]
7004impl fidl::endpoints::SynchronousProxy for DictionaryKeysIteratorSynchronousProxy {
7005    type Proxy = DictionaryKeysIteratorProxy;
7006    type Protocol = DictionaryKeysIteratorMarker;
7007
7008    fn from_channel(inner: fidl::Channel) -> Self {
7009        Self::new(inner)
7010    }
7011
7012    fn into_channel(self) -> fidl::Channel {
7013        self.client.into_channel()
7014    }
7015
7016    fn as_channel(&self) -> &fidl::Channel {
7017        self.client.as_channel()
7018    }
7019}
7020
7021#[cfg(target_os = "fuchsia")]
7022impl DictionaryKeysIteratorSynchronousProxy {
7023    pub fn new(channel: fidl::Channel) -> Self {
7024        let protocol_name =
7025            <DictionaryKeysIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7026        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
7027    }
7028
7029    pub fn into_channel(self) -> fidl::Channel {
7030        self.client.into_channel()
7031    }
7032
7033    /// Waits until an event arrives and returns it. It is safe for other
7034    /// threads to make concurrent requests while waiting for an event.
7035    pub fn wait_for_event(
7036        &self,
7037        deadline: zx::MonotonicInstant,
7038    ) -> Result<DictionaryKeysIteratorEvent, fidl::Error> {
7039        DictionaryKeysIteratorEvent::decode(self.client.wait_for_event(deadline)?)
7040    }
7041
7042    pub fn r#get_next(
7043        &self,
7044        ___deadline: zx::MonotonicInstant,
7045    ) -> Result<Vec<String>, fidl::Error> {
7046        let _response = self.client.send_query::<
7047            fidl::encoding::EmptyPayload,
7048            fidl::encoding::FlexibleType<DictionaryKeysIteratorGetNextResponse>,
7049        >(
7050            (),
7051            0x453828cbacca7d53,
7052            fidl::encoding::DynamicFlags::FLEXIBLE,
7053            ___deadline,
7054        )?
7055        .into_result::<DictionaryKeysIteratorMarker>("get_next")?;
7056        Ok(_response.keys)
7057    }
7058}
7059
7060#[cfg(target_os = "fuchsia")]
7061impl From<DictionaryKeysIteratorSynchronousProxy> for zx::Handle {
7062    fn from(value: DictionaryKeysIteratorSynchronousProxy) -> Self {
7063        value.into_channel().into()
7064    }
7065}
7066
7067#[cfg(target_os = "fuchsia")]
7068impl From<fidl::Channel> for DictionaryKeysIteratorSynchronousProxy {
7069    fn from(value: fidl::Channel) -> Self {
7070        Self::new(value)
7071    }
7072}
7073
7074#[cfg(target_os = "fuchsia")]
7075impl fidl::endpoints::FromClient for DictionaryKeysIteratorSynchronousProxy {
7076    type Protocol = DictionaryKeysIteratorMarker;
7077
7078    fn from_client(value: fidl::endpoints::ClientEnd<DictionaryKeysIteratorMarker>) -> Self {
7079        Self::new(value.into_channel())
7080    }
7081}
7082
7083#[derive(Debug, Clone)]
7084pub struct DictionaryKeysIteratorProxy {
7085    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
7086}
7087
7088impl fidl::endpoints::Proxy for DictionaryKeysIteratorProxy {
7089    type Protocol = DictionaryKeysIteratorMarker;
7090
7091    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
7092        Self::new(inner)
7093    }
7094
7095    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
7096        self.client.into_channel().map_err(|client| Self { client })
7097    }
7098
7099    fn as_channel(&self) -> &::fidl::AsyncChannel {
7100        self.client.as_channel()
7101    }
7102}
7103
7104impl DictionaryKeysIteratorProxy {
7105    /// Create a new Proxy for fuchsia.component.sandbox/DictionaryKeysIterator.
7106    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
7107        let protocol_name =
7108            <DictionaryKeysIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7109        Self { client: fidl::client::Client::new(channel, protocol_name) }
7110    }
7111
7112    /// Get a Stream of events from the remote end of the protocol.
7113    ///
7114    /// # Panics
7115    ///
7116    /// Panics if the event stream was already taken.
7117    pub fn take_event_stream(&self) -> DictionaryKeysIteratorEventStream {
7118        DictionaryKeysIteratorEventStream { event_receiver: self.client.take_event_receiver() }
7119    }
7120
7121    pub fn r#get_next(
7122        &self,
7123    ) -> fidl::client::QueryResponseFut<Vec<String>, fidl::encoding::DefaultFuchsiaResourceDialect>
7124    {
7125        DictionaryKeysIteratorProxyInterface::r#get_next(self)
7126    }
7127}
7128
7129impl DictionaryKeysIteratorProxyInterface for DictionaryKeysIteratorProxy {
7130    type GetNextResponseFut =
7131        fidl::client::QueryResponseFut<Vec<String>, fidl::encoding::DefaultFuchsiaResourceDialect>;
7132    fn r#get_next(&self) -> Self::GetNextResponseFut {
7133        fn _decode(
7134            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7135        ) -> Result<Vec<String>, fidl::Error> {
7136            let _response = fidl::client::decode_transaction_body::<
7137                fidl::encoding::FlexibleType<DictionaryKeysIteratorGetNextResponse>,
7138                fidl::encoding::DefaultFuchsiaResourceDialect,
7139                0x453828cbacca7d53,
7140            >(_buf?)?
7141            .into_result::<DictionaryKeysIteratorMarker>("get_next")?;
7142            Ok(_response.keys)
7143        }
7144        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<String>>(
7145            (),
7146            0x453828cbacca7d53,
7147            fidl::encoding::DynamicFlags::FLEXIBLE,
7148            _decode,
7149        )
7150    }
7151}
7152
7153pub struct DictionaryKeysIteratorEventStream {
7154    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
7155}
7156
7157impl std::marker::Unpin for DictionaryKeysIteratorEventStream {}
7158
7159impl futures::stream::FusedStream for DictionaryKeysIteratorEventStream {
7160    fn is_terminated(&self) -> bool {
7161        self.event_receiver.is_terminated()
7162    }
7163}
7164
7165impl futures::Stream for DictionaryKeysIteratorEventStream {
7166    type Item = Result<DictionaryKeysIteratorEvent, fidl::Error>;
7167
7168    fn poll_next(
7169        mut self: std::pin::Pin<&mut Self>,
7170        cx: &mut std::task::Context<'_>,
7171    ) -> std::task::Poll<Option<Self::Item>> {
7172        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7173            &mut self.event_receiver,
7174            cx
7175        )?) {
7176            Some(buf) => std::task::Poll::Ready(Some(DictionaryKeysIteratorEvent::decode(buf))),
7177            None => std::task::Poll::Ready(None),
7178        }
7179    }
7180}
7181
7182#[derive(Debug)]
7183pub enum DictionaryKeysIteratorEvent {
7184    #[non_exhaustive]
7185    _UnknownEvent {
7186        /// Ordinal of the event that was sent.
7187        ordinal: u64,
7188    },
7189}
7190
7191impl DictionaryKeysIteratorEvent {
7192    /// Decodes a message buffer as a [`DictionaryKeysIteratorEvent`].
7193    fn decode(
7194        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7195    ) -> Result<DictionaryKeysIteratorEvent, fidl::Error> {
7196        let (bytes, _handles) = buf.split_mut();
7197        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7198        debug_assert_eq!(tx_header.tx_id, 0);
7199        match tx_header.ordinal {
7200            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7201                Ok(DictionaryKeysIteratorEvent::_UnknownEvent { ordinal: tx_header.ordinal })
7202            }
7203            _ => Err(fidl::Error::UnknownOrdinal {
7204                ordinal: tx_header.ordinal,
7205                protocol_name:
7206                    <DictionaryKeysIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7207            }),
7208        }
7209    }
7210}
7211
7212/// A Stream of incoming requests for fuchsia.component.sandbox/DictionaryKeysIterator.
7213pub struct DictionaryKeysIteratorRequestStream {
7214    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7215    is_terminated: bool,
7216}
7217
7218impl std::marker::Unpin for DictionaryKeysIteratorRequestStream {}
7219
7220impl futures::stream::FusedStream for DictionaryKeysIteratorRequestStream {
7221    fn is_terminated(&self) -> bool {
7222        self.is_terminated
7223    }
7224}
7225
7226impl fidl::endpoints::RequestStream for DictionaryKeysIteratorRequestStream {
7227    type Protocol = DictionaryKeysIteratorMarker;
7228    type ControlHandle = DictionaryKeysIteratorControlHandle;
7229
7230    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
7231        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7232    }
7233
7234    fn control_handle(&self) -> Self::ControlHandle {
7235        DictionaryKeysIteratorControlHandle { inner: self.inner.clone() }
7236    }
7237
7238    fn into_inner(
7239        self,
7240    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
7241    {
7242        (self.inner, self.is_terminated)
7243    }
7244
7245    fn from_inner(
7246        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7247        is_terminated: bool,
7248    ) -> Self {
7249        Self { inner, is_terminated }
7250    }
7251}
7252
7253impl futures::Stream for DictionaryKeysIteratorRequestStream {
7254    type Item = Result<DictionaryKeysIteratorRequest, fidl::Error>;
7255
7256    fn poll_next(
7257        mut self: std::pin::Pin<&mut Self>,
7258        cx: &mut std::task::Context<'_>,
7259    ) -> std::task::Poll<Option<Self::Item>> {
7260        let this = &mut *self;
7261        if this.inner.check_shutdown(cx) {
7262            this.is_terminated = true;
7263            return std::task::Poll::Ready(None);
7264        }
7265        if this.is_terminated {
7266            panic!("polled DictionaryKeysIteratorRequestStream after completion");
7267        }
7268        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
7269            |bytes, handles| {
7270                match this.inner.channel().read_etc(cx, bytes, handles) {
7271                    std::task::Poll::Ready(Ok(())) => {}
7272                    std::task::Poll::Pending => return std::task::Poll::Pending,
7273                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
7274                        this.is_terminated = true;
7275                        return std::task::Poll::Ready(None);
7276                    }
7277                    std::task::Poll::Ready(Err(e)) => {
7278                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7279                            e.into(),
7280                        ))))
7281                    }
7282                }
7283
7284                // A message has been received from the channel
7285                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7286
7287                std::task::Poll::Ready(Some(match header.ordinal {
7288                0x453828cbacca7d53 => {
7289                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7290                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
7291                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7292                    let control_handle = DictionaryKeysIteratorControlHandle {
7293                        inner: this.inner.clone(),
7294                    };
7295                    Ok(DictionaryKeysIteratorRequest::GetNext {
7296                        responder: DictionaryKeysIteratorGetNextResponder {
7297                            control_handle: std::mem::ManuallyDrop::new(control_handle),
7298                            tx_id: header.tx_id,
7299                        },
7300                    })
7301                }
7302                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7303                    Ok(DictionaryKeysIteratorRequest::_UnknownMethod {
7304                        ordinal: header.ordinal,
7305                        control_handle: DictionaryKeysIteratorControlHandle { inner: this.inner.clone() },
7306                        method_type: fidl::MethodType::OneWay,
7307                    })
7308                }
7309                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7310                    this.inner.send_framework_err(
7311                        fidl::encoding::FrameworkErr::UnknownMethod,
7312                        header.tx_id,
7313                        header.ordinal,
7314                        header.dynamic_flags(),
7315                        (bytes, handles),
7316                    )?;
7317                    Ok(DictionaryKeysIteratorRequest::_UnknownMethod {
7318                        ordinal: header.ordinal,
7319                        control_handle: DictionaryKeysIteratorControlHandle { inner: this.inner.clone() },
7320                        method_type: fidl::MethodType::TwoWay,
7321                    })
7322                }
7323                _ => Err(fidl::Error::UnknownOrdinal {
7324                    ordinal: header.ordinal,
7325                    protocol_name: <DictionaryKeysIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7326                }),
7327            }))
7328            },
7329        )
7330    }
7331}
7332
7333#[derive(Debug)]
7334pub enum DictionaryKeysIteratorRequest {
7335    GetNext {
7336        responder: DictionaryKeysIteratorGetNextResponder,
7337    },
7338    /// An interaction was received which does not match any known method.
7339    #[non_exhaustive]
7340    _UnknownMethod {
7341        /// Ordinal of the method that was called.
7342        ordinal: u64,
7343        control_handle: DictionaryKeysIteratorControlHandle,
7344        method_type: fidl::MethodType,
7345    },
7346}
7347
7348impl DictionaryKeysIteratorRequest {
7349    #[allow(irrefutable_let_patterns)]
7350    pub fn into_get_next(self) -> Option<(DictionaryKeysIteratorGetNextResponder)> {
7351        if let DictionaryKeysIteratorRequest::GetNext { responder } = self {
7352            Some((responder))
7353        } else {
7354            None
7355        }
7356    }
7357
7358    /// Name of the method defined in FIDL
7359    pub fn method_name(&self) -> &'static str {
7360        match *self {
7361            DictionaryKeysIteratorRequest::GetNext { .. } => "get_next",
7362            DictionaryKeysIteratorRequest::_UnknownMethod {
7363                method_type: fidl::MethodType::OneWay,
7364                ..
7365            } => "unknown one-way method",
7366            DictionaryKeysIteratorRequest::_UnknownMethod {
7367                method_type: fidl::MethodType::TwoWay,
7368                ..
7369            } => "unknown two-way method",
7370        }
7371    }
7372}
7373
7374#[derive(Debug, Clone)]
7375pub struct DictionaryKeysIteratorControlHandle {
7376    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7377}
7378
7379impl fidl::endpoints::ControlHandle for DictionaryKeysIteratorControlHandle {
7380    fn shutdown(&self) {
7381        self.inner.shutdown()
7382    }
7383    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
7384        self.inner.shutdown_with_epitaph(status)
7385    }
7386
7387    fn is_closed(&self) -> bool {
7388        self.inner.channel().is_closed()
7389    }
7390    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
7391        self.inner.channel().on_closed()
7392    }
7393
7394    #[cfg(target_os = "fuchsia")]
7395    fn signal_peer(
7396        &self,
7397        clear_mask: zx::Signals,
7398        set_mask: zx::Signals,
7399    ) -> Result<(), zx_status::Status> {
7400        use fidl::Peered;
7401        self.inner.channel().signal_peer(clear_mask, set_mask)
7402    }
7403}
7404
7405impl DictionaryKeysIteratorControlHandle {}
7406
7407#[must_use = "FIDL methods require a response to be sent"]
7408#[derive(Debug)]
7409pub struct DictionaryKeysIteratorGetNextResponder {
7410    control_handle: std::mem::ManuallyDrop<DictionaryKeysIteratorControlHandle>,
7411    tx_id: u32,
7412}
7413
7414/// Set the the channel to be shutdown (see [`DictionaryKeysIteratorControlHandle::shutdown`])
7415/// if the responder is dropped without sending a response, so that the client
7416/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7417impl std::ops::Drop for DictionaryKeysIteratorGetNextResponder {
7418    fn drop(&mut self) {
7419        self.control_handle.shutdown();
7420        // Safety: drops once, never accessed again
7421        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7422    }
7423}
7424
7425impl fidl::endpoints::Responder for DictionaryKeysIteratorGetNextResponder {
7426    type ControlHandle = DictionaryKeysIteratorControlHandle;
7427
7428    fn control_handle(&self) -> &DictionaryKeysIteratorControlHandle {
7429        &self.control_handle
7430    }
7431
7432    fn drop_without_shutdown(mut self) {
7433        // Safety: drops once, never accessed again due to mem::forget
7434        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7435        // Prevent Drop from running (which would shut down the channel)
7436        std::mem::forget(self);
7437    }
7438}
7439
7440impl DictionaryKeysIteratorGetNextResponder {
7441    /// Sends a response to the FIDL transaction.
7442    ///
7443    /// Sets the channel to shutdown if an error occurs.
7444    pub fn send(self, mut keys: &[String]) -> Result<(), fidl::Error> {
7445        let _result = self.send_raw(keys);
7446        if _result.is_err() {
7447            self.control_handle.shutdown();
7448        }
7449        self.drop_without_shutdown();
7450        _result
7451    }
7452
7453    /// Similar to "send" but does not shutdown the channel if an error occurs.
7454    pub fn send_no_shutdown_on_err(self, mut keys: &[String]) -> Result<(), fidl::Error> {
7455        let _result = self.send_raw(keys);
7456        self.drop_without_shutdown();
7457        _result
7458    }
7459
7460    fn send_raw(&self, mut keys: &[String]) -> Result<(), fidl::Error> {
7461        self.control_handle
7462            .inner
7463            .send::<fidl::encoding::FlexibleType<DictionaryKeysIteratorGetNextResponse>>(
7464                fidl::encoding::Flexible::new((keys,)),
7465                self.tx_id,
7466                0x453828cbacca7d53,
7467                fidl::encoding::DynamicFlags::FLEXIBLE,
7468            )
7469    }
7470}
7471
7472#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
7473pub struct DictionaryRouterMarker;
7474
7475impl fidl::endpoints::ProtocolMarker for DictionaryRouterMarker {
7476    type Proxy = DictionaryRouterProxy;
7477    type RequestStream = DictionaryRouterRequestStream;
7478    #[cfg(target_os = "fuchsia")]
7479    type SynchronousProxy = DictionaryRouterSynchronousProxy;
7480
7481    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.DictionaryRouter";
7482}
7483impl fidl::endpoints::DiscoverableProtocolMarker for DictionaryRouterMarker {}
7484pub type DictionaryRouterRouteResult = Result<DictionaryRouterRouteResponse, RouterError>;
7485
7486pub trait DictionaryRouterProxyInterface: Send + Sync {
7487    type RouteResponseFut: std::future::Future<Output = Result<DictionaryRouterRouteResult, fidl::Error>>
7488        + Send;
7489    fn r#route(&self, payload: RouteRequest) -> Self::RouteResponseFut;
7490}
7491#[derive(Debug)]
7492#[cfg(target_os = "fuchsia")]
7493pub struct DictionaryRouterSynchronousProxy {
7494    client: fidl::client::sync::Client,
7495}
7496
7497#[cfg(target_os = "fuchsia")]
7498impl fidl::endpoints::SynchronousProxy for DictionaryRouterSynchronousProxy {
7499    type Proxy = DictionaryRouterProxy;
7500    type Protocol = DictionaryRouterMarker;
7501
7502    fn from_channel(inner: fidl::Channel) -> Self {
7503        Self::new(inner)
7504    }
7505
7506    fn into_channel(self) -> fidl::Channel {
7507        self.client.into_channel()
7508    }
7509
7510    fn as_channel(&self) -> &fidl::Channel {
7511        self.client.as_channel()
7512    }
7513}
7514
7515#[cfg(target_os = "fuchsia")]
7516impl DictionaryRouterSynchronousProxy {
7517    pub fn new(channel: fidl::Channel) -> Self {
7518        let protocol_name = <DictionaryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7519        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
7520    }
7521
7522    pub fn into_channel(self) -> fidl::Channel {
7523        self.client.into_channel()
7524    }
7525
7526    /// Waits until an event arrives and returns it. It is safe for other
7527    /// threads to make concurrent requests while waiting for an event.
7528    pub fn wait_for_event(
7529        &self,
7530        deadline: zx::MonotonicInstant,
7531    ) -> Result<DictionaryRouterEvent, fidl::Error> {
7532        DictionaryRouterEvent::decode(self.client.wait_for_event(deadline)?)
7533    }
7534
7535    pub fn r#route(
7536        &self,
7537        mut payload: RouteRequest,
7538        ___deadline: zx::MonotonicInstant,
7539    ) -> Result<DictionaryRouterRouteResult, fidl::Error> {
7540        let _response = self.client.send_query::<
7541            RouteRequest,
7542            fidl::encoding::FlexibleResultType<DictionaryRouterRouteResponse, RouterError>,
7543        >(
7544            &mut payload,
7545            0x714c65bfe54bd79f,
7546            fidl::encoding::DynamicFlags::FLEXIBLE,
7547            ___deadline,
7548        )?
7549        .into_result::<DictionaryRouterMarker>("route")?;
7550        Ok(_response.map(|x| x))
7551    }
7552}
7553
7554#[cfg(target_os = "fuchsia")]
7555impl From<DictionaryRouterSynchronousProxy> for zx::Handle {
7556    fn from(value: DictionaryRouterSynchronousProxy) -> Self {
7557        value.into_channel().into()
7558    }
7559}
7560
7561#[cfg(target_os = "fuchsia")]
7562impl From<fidl::Channel> for DictionaryRouterSynchronousProxy {
7563    fn from(value: fidl::Channel) -> Self {
7564        Self::new(value)
7565    }
7566}
7567
7568#[cfg(target_os = "fuchsia")]
7569impl fidl::endpoints::FromClient for DictionaryRouterSynchronousProxy {
7570    type Protocol = DictionaryRouterMarker;
7571
7572    fn from_client(value: fidl::endpoints::ClientEnd<DictionaryRouterMarker>) -> Self {
7573        Self::new(value.into_channel())
7574    }
7575}
7576
7577#[derive(Debug, Clone)]
7578pub struct DictionaryRouterProxy {
7579    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
7580}
7581
7582impl fidl::endpoints::Proxy for DictionaryRouterProxy {
7583    type Protocol = DictionaryRouterMarker;
7584
7585    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
7586        Self::new(inner)
7587    }
7588
7589    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
7590        self.client.into_channel().map_err(|client| Self { client })
7591    }
7592
7593    fn as_channel(&self) -> &::fidl::AsyncChannel {
7594        self.client.as_channel()
7595    }
7596}
7597
7598impl DictionaryRouterProxy {
7599    /// Create a new Proxy for fuchsia.component.sandbox/DictionaryRouter.
7600    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
7601        let protocol_name = <DictionaryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7602        Self { client: fidl::client::Client::new(channel, protocol_name) }
7603    }
7604
7605    /// Get a Stream of events from the remote end of the protocol.
7606    ///
7607    /// # Panics
7608    ///
7609    /// Panics if the event stream was already taken.
7610    pub fn take_event_stream(&self) -> DictionaryRouterEventStream {
7611        DictionaryRouterEventStream { event_receiver: self.client.take_event_receiver() }
7612    }
7613
7614    pub fn r#route(
7615        &self,
7616        mut payload: RouteRequest,
7617    ) -> fidl::client::QueryResponseFut<
7618        DictionaryRouterRouteResult,
7619        fidl::encoding::DefaultFuchsiaResourceDialect,
7620    > {
7621        DictionaryRouterProxyInterface::r#route(self, payload)
7622    }
7623}
7624
7625impl DictionaryRouterProxyInterface for DictionaryRouterProxy {
7626    type RouteResponseFut = fidl::client::QueryResponseFut<
7627        DictionaryRouterRouteResult,
7628        fidl::encoding::DefaultFuchsiaResourceDialect,
7629    >;
7630    fn r#route(&self, mut payload: RouteRequest) -> Self::RouteResponseFut {
7631        fn _decode(
7632            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7633        ) -> Result<DictionaryRouterRouteResult, fidl::Error> {
7634            let _response = fidl::client::decode_transaction_body::<
7635                fidl::encoding::FlexibleResultType<DictionaryRouterRouteResponse, RouterError>,
7636                fidl::encoding::DefaultFuchsiaResourceDialect,
7637                0x714c65bfe54bd79f,
7638            >(_buf?)?
7639            .into_result::<DictionaryRouterMarker>("route")?;
7640            Ok(_response.map(|x| x))
7641        }
7642        self.client.send_query_and_decode::<RouteRequest, DictionaryRouterRouteResult>(
7643            &mut payload,
7644            0x714c65bfe54bd79f,
7645            fidl::encoding::DynamicFlags::FLEXIBLE,
7646            _decode,
7647        )
7648    }
7649}
7650
7651pub struct DictionaryRouterEventStream {
7652    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
7653}
7654
7655impl std::marker::Unpin for DictionaryRouterEventStream {}
7656
7657impl futures::stream::FusedStream for DictionaryRouterEventStream {
7658    fn is_terminated(&self) -> bool {
7659        self.event_receiver.is_terminated()
7660    }
7661}
7662
7663impl futures::Stream for DictionaryRouterEventStream {
7664    type Item = Result<DictionaryRouterEvent, fidl::Error>;
7665
7666    fn poll_next(
7667        mut self: std::pin::Pin<&mut Self>,
7668        cx: &mut std::task::Context<'_>,
7669    ) -> std::task::Poll<Option<Self::Item>> {
7670        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7671            &mut self.event_receiver,
7672            cx
7673        )?) {
7674            Some(buf) => std::task::Poll::Ready(Some(DictionaryRouterEvent::decode(buf))),
7675            None => std::task::Poll::Ready(None),
7676        }
7677    }
7678}
7679
7680#[derive(Debug)]
7681pub enum DictionaryRouterEvent {
7682    #[non_exhaustive]
7683    _UnknownEvent {
7684        /// Ordinal of the event that was sent.
7685        ordinal: u64,
7686    },
7687}
7688
7689impl DictionaryRouterEvent {
7690    /// Decodes a message buffer as a [`DictionaryRouterEvent`].
7691    fn decode(
7692        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7693    ) -> Result<DictionaryRouterEvent, fidl::Error> {
7694        let (bytes, _handles) = buf.split_mut();
7695        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7696        debug_assert_eq!(tx_header.tx_id, 0);
7697        match tx_header.ordinal {
7698            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7699                Ok(DictionaryRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
7700            }
7701            _ => Err(fidl::Error::UnknownOrdinal {
7702                ordinal: tx_header.ordinal,
7703                protocol_name:
7704                    <DictionaryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7705            }),
7706        }
7707    }
7708}
7709
7710/// A Stream of incoming requests for fuchsia.component.sandbox/DictionaryRouter.
7711pub struct DictionaryRouterRequestStream {
7712    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7713    is_terminated: bool,
7714}
7715
7716impl std::marker::Unpin for DictionaryRouterRequestStream {}
7717
7718impl futures::stream::FusedStream for DictionaryRouterRequestStream {
7719    fn is_terminated(&self) -> bool {
7720        self.is_terminated
7721    }
7722}
7723
7724impl fidl::endpoints::RequestStream for DictionaryRouterRequestStream {
7725    type Protocol = DictionaryRouterMarker;
7726    type ControlHandle = DictionaryRouterControlHandle;
7727
7728    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
7729        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7730    }
7731
7732    fn control_handle(&self) -> Self::ControlHandle {
7733        DictionaryRouterControlHandle { inner: self.inner.clone() }
7734    }
7735
7736    fn into_inner(
7737        self,
7738    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
7739    {
7740        (self.inner, self.is_terminated)
7741    }
7742
7743    fn from_inner(
7744        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7745        is_terminated: bool,
7746    ) -> Self {
7747        Self { inner, is_terminated }
7748    }
7749}
7750
7751impl futures::Stream for DictionaryRouterRequestStream {
7752    type Item = Result<DictionaryRouterRequest, fidl::Error>;
7753
7754    fn poll_next(
7755        mut self: std::pin::Pin<&mut Self>,
7756        cx: &mut std::task::Context<'_>,
7757    ) -> std::task::Poll<Option<Self::Item>> {
7758        let this = &mut *self;
7759        if this.inner.check_shutdown(cx) {
7760            this.is_terminated = true;
7761            return std::task::Poll::Ready(None);
7762        }
7763        if this.is_terminated {
7764            panic!("polled DictionaryRouterRequestStream after completion");
7765        }
7766        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
7767            |bytes, handles| {
7768                match this.inner.channel().read_etc(cx, bytes, handles) {
7769                    std::task::Poll::Ready(Ok(())) => {}
7770                    std::task::Poll::Pending => return std::task::Poll::Pending,
7771                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
7772                        this.is_terminated = true;
7773                        return std::task::Poll::Ready(None);
7774                    }
7775                    std::task::Poll::Ready(Err(e)) => {
7776                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7777                            e.into(),
7778                        ))))
7779                    }
7780                }
7781
7782                // A message has been received from the channel
7783                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7784
7785                std::task::Poll::Ready(Some(match header.ordinal {
7786                    0x714c65bfe54bd79f => {
7787                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7788                        let mut req = fidl::new_empty!(
7789                            RouteRequest,
7790                            fidl::encoding::DefaultFuchsiaResourceDialect
7791                        );
7792                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RouteRequest>(&header, _body_bytes, handles, &mut req)?;
7793                        let control_handle =
7794                            DictionaryRouterControlHandle { inner: this.inner.clone() };
7795                        Ok(DictionaryRouterRequest::Route {
7796                            payload: req,
7797                            responder: DictionaryRouterRouteResponder {
7798                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7799                                tx_id: header.tx_id,
7800                            },
7801                        })
7802                    }
7803                    _ if header.tx_id == 0
7804                        && header
7805                            .dynamic_flags()
7806                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
7807                    {
7808                        Ok(DictionaryRouterRequest::_UnknownMethod {
7809                            ordinal: header.ordinal,
7810                            control_handle: DictionaryRouterControlHandle {
7811                                inner: this.inner.clone(),
7812                            },
7813                            method_type: fidl::MethodType::OneWay,
7814                        })
7815                    }
7816                    _ if header
7817                        .dynamic_flags()
7818                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
7819                    {
7820                        this.inner.send_framework_err(
7821                            fidl::encoding::FrameworkErr::UnknownMethod,
7822                            header.tx_id,
7823                            header.ordinal,
7824                            header.dynamic_flags(),
7825                            (bytes, handles),
7826                        )?;
7827                        Ok(DictionaryRouterRequest::_UnknownMethod {
7828                            ordinal: header.ordinal,
7829                            control_handle: DictionaryRouterControlHandle {
7830                                inner: this.inner.clone(),
7831                            },
7832                            method_type: fidl::MethodType::TwoWay,
7833                        })
7834                    }
7835                    _ => Err(fidl::Error::UnknownOrdinal {
7836                        ordinal: header.ordinal,
7837                        protocol_name:
7838                            <DictionaryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7839                    }),
7840                }))
7841            },
7842        )
7843    }
7844}
7845
7846#[derive(Debug)]
7847pub enum DictionaryRouterRequest {
7848    Route {
7849        payload: RouteRequest,
7850        responder: DictionaryRouterRouteResponder,
7851    },
7852    /// An interaction was received which does not match any known method.
7853    #[non_exhaustive]
7854    _UnknownMethod {
7855        /// Ordinal of the method that was called.
7856        ordinal: u64,
7857        control_handle: DictionaryRouterControlHandle,
7858        method_type: fidl::MethodType,
7859    },
7860}
7861
7862impl DictionaryRouterRequest {
7863    #[allow(irrefutable_let_patterns)]
7864    pub fn into_route(self) -> Option<(RouteRequest, DictionaryRouterRouteResponder)> {
7865        if let DictionaryRouterRequest::Route { payload, responder } = self {
7866            Some((payload, responder))
7867        } else {
7868            None
7869        }
7870    }
7871
7872    /// Name of the method defined in FIDL
7873    pub fn method_name(&self) -> &'static str {
7874        match *self {
7875            DictionaryRouterRequest::Route { .. } => "route",
7876            DictionaryRouterRequest::_UnknownMethod {
7877                method_type: fidl::MethodType::OneWay,
7878                ..
7879            } => "unknown one-way method",
7880            DictionaryRouterRequest::_UnknownMethod {
7881                method_type: fidl::MethodType::TwoWay,
7882                ..
7883            } => "unknown two-way method",
7884        }
7885    }
7886}
7887
7888#[derive(Debug, Clone)]
7889pub struct DictionaryRouterControlHandle {
7890    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7891}
7892
7893impl fidl::endpoints::ControlHandle for DictionaryRouterControlHandle {
7894    fn shutdown(&self) {
7895        self.inner.shutdown()
7896    }
7897    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
7898        self.inner.shutdown_with_epitaph(status)
7899    }
7900
7901    fn is_closed(&self) -> bool {
7902        self.inner.channel().is_closed()
7903    }
7904    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
7905        self.inner.channel().on_closed()
7906    }
7907
7908    #[cfg(target_os = "fuchsia")]
7909    fn signal_peer(
7910        &self,
7911        clear_mask: zx::Signals,
7912        set_mask: zx::Signals,
7913    ) -> Result<(), zx_status::Status> {
7914        use fidl::Peered;
7915        self.inner.channel().signal_peer(clear_mask, set_mask)
7916    }
7917}
7918
7919impl DictionaryRouterControlHandle {}
7920
7921#[must_use = "FIDL methods require a response to be sent"]
7922#[derive(Debug)]
7923pub struct DictionaryRouterRouteResponder {
7924    control_handle: std::mem::ManuallyDrop<DictionaryRouterControlHandle>,
7925    tx_id: u32,
7926}
7927
7928/// Set the the channel to be shutdown (see [`DictionaryRouterControlHandle::shutdown`])
7929/// if the responder is dropped without sending a response, so that the client
7930/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7931impl std::ops::Drop for DictionaryRouterRouteResponder {
7932    fn drop(&mut self) {
7933        self.control_handle.shutdown();
7934        // Safety: drops once, never accessed again
7935        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7936    }
7937}
7938
7939impl fidl::endpoints::Responder for DictionaryRouterRouteResponder {
7940    type ControlHandle = DictionaryRouterControlHandle;
7941
7942    fn control_handle(&self) -> &DictionaryRouterControlHandle {
7943        &self.control_handle
7944    }
7945
7946    fn drop_without_shutdown(mut self) {
7947        // Safety: drops once, never accessed again due to mem::forget
7948        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7949        // Prevent Drop from running (which would shut down the channel)
7950        std::mem::forget(self);
7951    }
7952}
7953
7954impl DictionaryRouterRouteResponder {
7955    /// Sends a response to the FIDL transaction.
7956    ///
7957    /// Sets the channel to shutdown if an error occurs.
7958    pub fn send(
7959        self,
7960        mut result: Result<DictionaryRouterRouteResponse, RouterError>,
7961    ) -> Result<(), fidl::Error> {
7962        let _result = self.send_raw(result);
7963        if _result.is_err() {
7964            self.control_handle.shutdown();
7965        }
7966        self.drop_without_shutdown();
7967        _result
7968    }
7969
7970    /// Similar to "send" but does not shutdown the channel if an error occurs.
7971    pub fn send_no_shutdown_on_err(
7972        self,
7973        mut result: Result<DictionaryRouterRouteResponse, RouterError>,
7974    ) -> Result<(), fidl::Error> {
7975        let _result = self.send_raw(result);
7976        self.drop_without_shutdown();
7977        _result
7978    }
7979
7980    fn send_raw(
7981        &self,
7982        mut result: Result<DictionaryRouterRouteResponse, RouterError>,
7983    ) -> Result<(), fidl::Error> {
7984        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
7985            DictionaryRouterRouteResponse,
7986            RouterError,
7987        >>(
7988            fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
7989            self.tx_id,
7990            0x714c65bfe54bd79f,
7991            fidl::encoding::DynamicFlags::FLEXIBLE,
7992        )
7993    }
7994}
7995
7996#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
7997pub struct DirConnectorRouterMarker;
7998
7999impl fidl::endpoints::ProtocolMarker for DirConnectorRouterMarker {
8000    type Proxy = DirConnectorRouterProxy;
8001    type RequestStream = DirConnectorRouterRequestStream;
8002    #[cfg(target_os = "fuchsia")]
8003    type SynchronousProxy = DirConnectorRouterSynchronousProxy;
8004
8005    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.DirConnectorRouter";
8006}
8007impl fidl::endpoints::DiscoverableProtocolMarker for DirConnectorRouterMarker {}
8008pub type DirConnectorRouterRouteResult = Result<DirConnectorRouterRouteResponse, RouterError>;
8009
8010pub trait DirConnectorRouterProxyInterface: Send + Sync {
8011    type RouteResponseFut: std::future::Future<Output = Result<DirConnectorRouterRouteResult, fidl::Error>>
8012        + Send;
8013    fn r#route(&self, payload: RouteRequest) -> Self::RouteResponseFut;
8014}
8015#[derive(Debug)]
8016#[cfg(target_os = "fuchsia")]
8017pub struct DirConnectorRouterSynchronousProxy {
8018    client: fidl::client::sync::Client,
8019}
8020
8021#[cfg(target_os = "fuchsia")]
8022impl fidl::endpoints::SynchronousProxy for DirConnectorRouterSynchronousProxy {
8023    type Proxy = DirConnectorRouterProxy;
8024    type Protocol = DirConnectorRouterMarker;
8025
8026    fn from_channel(inner: fidl::Channel) -> Self {
8027        Self::new(inner)
8028    }
8029
8030    fn into_channel(self) -> fidl::Channel {
8031        self.client.into_channel()
8032    }
8033
8034    fn as_channel(&self) -> &fidl::Channel {
8035        self.client.as_channel()
8036    }
8037}
8038
8039#[cfg(target_os = "fuchsia")]
8040impl DirConnectorRouterSynchronousProxy {
8041    pub fn new(channel: fidl::Channel) -> Self {
8042        let protocol_name =
8043            <DirConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8044        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
8045    }
8046
8047    pub fn into_channel(self) -> fidl::Channel {
8048        self.client.into_channel()
8049    }
8050
8051    /// Waits until an event arrives and returns it. It is safe for other
8052    /// threads to make concurrent requests while waiting for an event.
8053    pub fn wait_for_event(
8054        &self,
8055        deadline: zx::MonotonicInstant,
8056    ) -> Result<DirConnectorRouterEvent, fidl::Error> {
8057        DirConnectorRouterEvent::decode(self.client.wait_for_event(deadline)?)
8058    }
8059
8060    pub fn r#route(
8061        &self,
8062        mut payload: RouteRequest,
8063        ___deadline: zx::MonotonicInstant,
8064    ) -> Result<DirConnectorRouterRouteResult, fidl::Error> {
8065        let _response = self.client.send_query::<
8066            RouteRequest,
8067            fidl::encoding::FlexibleResultType<DirConnectorRouterRouteResponse, RouterError>,
8068        >(
8069            &mut payload,
8070            0xd7e0f01da2c8e40,
8071            fidl::encoding::DynamicFlags::FLEXIBLE,
8072            ___deadline,
8073        )?
8074        .into_result::<DirConnectorRouterMarker>("route")?;
8075        Ok(_response.map(|x| x))
8076    }
8077}
8078
8079#[cfg(target_os = "fuchsia")]
8080impl From<DirConnectorRouterSynchronousProxy> for zx::Handle {
8081    fn from(value: DirConnectorRouterSynchronousProxy) -> Self {
8082        value.into_channel().into()
8083    }
8084}
8085
8086#[cfg(target_os = "fuchsia")]
8087impl From<fidl::Channel> for DirConnectorRouterSynchronousProxy {
8088    fn from(value: fidl::Channel) -> Self {
8089        Self::new(value)
8090    }
8091}
8092
8093#[cfg(target_os = "fuchsia")]
8094impl fidl::endpoints::FromClient for DirConnectorRouterSynchronousProxy {
8095    type Protocol = DirConnectorRouterMarker;
8096
8097    fn from_client(value: fidl::endpoints::ClientEnd<DirConnectorRouterMarker>) -> Self {
8098        Self::new(value.into_channel())
8099    }
8100}
8101
8102#[derive(Debug, Clone)]
8103pub struct DirConnectorRouterProxy {
8104    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
8105}
8106
8107impl fidl::endpoints::Proxy for DirConnectorRouterProxy {
8108    type Protocol = DirConnectorRouterMarker;
8109
8110    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
8111        Self::new(inner)
8112    }
8113
8114    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
8115        self.client.into_channel().map_err(|client| Self { client })
8116    }
8117
8118    fn as_channel(&self) -> &::fidl::AsyncChannel {
8119        self.client.as_channel()
8120    }
8121}
8122
8123impl DirConnectorRouterProxy {
8124    /// Create a new Proxy for fuchsia.component.sandbox/DirConnectorRouter.
8125    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
8126        let protocol_name =
8127            <DirConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8128        Self { client: fidl::client::Client::new(channel, protocol_name) }
8129    }
8130
8131    /// Get a Stream of events from the remote end of the protocol.
8132    ///
8133    /// # Panics
8134    ///
8135    /// Panics if the event stream was already taken.
8136    pub fn take_event_stream(&self) -> DirConnectorRouterEventStream {
8137        DirConnectorRouterEventStream { event_receiver: self.client.take_event_receiver() }
8138    }
8139
8140    pub fn r#route(
8141        &self,
8142        mut payload: RouteRequest,
8143    ) -> fidl::client::QueryResponseFut<
8144        DirConnectorRouterRouteResult,
8145        fidl::encoding::DefaultFuchsiaResourceDialect,
8146    > {
8147        DirConnectorRouterProxyInterface::r#route(self, payload)
8148    }
8149}
8150
8151impl DirConnectorRouterProxyInterface for DirConnectorRouterProxy {
8152    type RouteResponseFut = fidl::client::QueryResponseFut<
8153        DirConnectorRouterRouteResult,
8154        fidl::encoding::DefaultFuchsiaResourceDialect,
8155    >;
8156    fn r#route(&self, mut payload: RouteRequest) -> Self::RouteResponseFut {
8157        fn _decode(
8158            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8159        ) -> Result<DirConnectorRouterRouteResult, fidl::Error> {
8160            let _response = fidl::client::decode_transaction_body::<
8161                fidl::encoding::FlexibleResultType<DirConnectorRouterRouteResponse, RouterError>,
8162                fidl::encoding::DefaultFuchsiaResourceDialect,
8163                0xd7e0f01da2c8e40,
8164            >(_buf?)?
8165            .into_result::<DirConnectorRouterMarker>("route")?;
8166            Ok(_response.map(|x| x))
8167        }
8168        self.client.send_query_and_decode::<RouteRequest, DirConnectorRouterRouteResult>(
8169            &mut payload,
8170            0xd7e0f01da2c8e40,
8171            fidl::encoding::DynamicFlags::FLEXIBLE,
8172            _decode,
8173        )
8174    }
8175}
8176
8177pub struct DirConnectorRouterEventStream {
8178    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
8179}
8180
8181impl std::marker::Unpin for DirConnectorRouterEventStream {}
8182
8183impl futures::stream::FusedStream for DirConnectorRouterEventStream {
8184    fn is_terminated(&self) -> bool {
8185        self.event_receiver.is_terminated()
8186    }
8187}
8188
8189impl futures::Stream for DirConnectorRouterEventStream {
8190    type Item = Result<DirConnectorRouterEvent, fidl::Error>;
8191
8192    fn poll_next(
8193        mut self: std::pin::Pin<&mut Self>,
8194        cx: &mut std::task::Context<'_>,
8195    ) -> std::task::Poll<Option<Self::Item>> {
8196        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
8197            &mut self.event_receiver,
8198            cx
8199        )?) {
8200            Some(buf) => std::task::Poll::Ready(Some(DirConnectorRouterEvent::decode(buf))),
8201            None => std::task::Poll::Ready(None),
8202        }
8203    }
8204}
8205
8206#[derive(Debug)]
8207pub enum DirConnectorRouterEvent {
8208    #[non_exhaustive]
8209    _UnknownEvent {
8210        /// Ordinal of the event that was sent.
8211        ordinal: u64,
8212    },
8213}
8214
8215impl DirConnectorRouterEvent {
8216    /// Decodes a message buffer as a [`DirConnectorRouterEvent`].
8217    fn decode(
8218        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
8219    ) -> Result<DirConnectorRouterEvent, fidl::Error> {
8220        let (bytes, _handles) = buf.split_mut();
8221        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8222        debug_assert_eq!(tx_header.tx_id, 0);
8223        match tx_header.ordinal {
8224            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
8225                Ok(DirConnectorRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
8226            }
8227            _ => Err(fidl::Error::UnknownOrdinal {
8228                ordinal: tx_header.ordinal,
8229                protocol_name:
8230                    <DirConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8231            }),
8232        }
8233    }
8234}
8235
8236/// A Stream of incoming requests for fuchsia.component.sandbox/DirConnectorRouter.
8237pub struct DirConnectorRouterRequestStream {
8238    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8239    is_terminated: bool,
8240}
8241
8242impl std::marker::Unpin for DirConnectorRouterRequestStream {}
8243
8244impl futures::stream::FusedStream for DirConnectorRouterRequestStream {
8245    fn is_terminated(&self) -> bool {
8246        self.is_terminated
8247    }
8248}
8249
8250impl fidl::endpoints::RequestStream for DirConnectorRouterRequestStream {
8251    type Protocol = DirConnectorRouterMarker;
8252    type ControlHandle = DirConnectorRouterControlHandle;
8253
8254    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
8255        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
8256    }
8257
8258    fn control_handle(&self) -> Self::ControlHandle {
8259        DirConnectorRouterControlHandle { inner: self.inner.clone() }
8260    }
8261
8262    fn into_inner(
8263        self,
8264    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
8265    {
8266        (self.inner, self.is_terminated)
8267    }
8268
8269    fn from_inner(
8270        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8271        is_terminated: bool,
8272    ) -> Self {
8273        Self { inner, is_terminated }
8274    }
8275}
8276
8277impl futures::Stream for DirConnectorRouterRequestStream {
8278    type Item = Result<DirConnectorRouterRequest, fidl::Error>;
8279
8280    fn poll_next(
8281        mut self: std::pin::Pin<&mut Self>,
8282        cx: &mut std::task::Context<'_>,
8283    ) -> std::task::Poll<Option<Self::Item>> {
8284        let this = &mut *self;
8285        if this.inner.check_shutdown(cx) {
8286            this.is_terminated = true;
8287            return std::task::Poll::Ready(None);
8288        }
8289        if this.is_terminated {
8290            panic!("polled DirConnectorRouterRequestStream after completion");
8291        }
8292        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
8293            |bytes, handles| {
8294                match this.inner.channel().read_etc(cx, bytes, handles) {
8295                    std::task::Poll::Ready(Ok(())) => {}
8296                    std::task::Poll::Pending => return std::task::Poll::Pending,
8297                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
8298                        this.is_terminated = true;
8299                        return std::task::Poll::Ready(None);
8300                    }
8301                    std::task::Poll::Ready(Err(e)) => {
8302                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
8303                            e.into(),
8304                        ))))
8305                    }
8306                }
8307
8308                // A message has been received from the channel
8309                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8310
8311                std::task::Poll::Ready(Some(match header.ordinal {
8312                0xd7e0f01da2c8e40 => {
8313                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
8314                    let mut req = fidl::new_empty!(RouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
8315                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RouteRequest>(&header, _body_bytes, handles, &mut req)?;
8316                    let control_handle = DirConnectorRouterControlHandle {
8317                        inner: this.inner.clone(),
8318                    };
8319                    Ok(DirConnectorRouterRequest::Route {payload: req,
8320                        responder: DirConnectorRouterRouteResponder {
8321                            control_handle: std::mem::ManuallyDrop::new(control_handle),
8322                            tx_id: header.tx_id,
8323                        },
8324                    })
8325                }
8326                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
8327                    Ok(DirConnectorRouterRequest::_UnknownMethod {
8328                        ordinal: header.ordinal,
8329                        control_handle: DirConnectorRouterControlHandle { inner: this.inner.clone() },
8330                        method_type: fidl::MethodType::OneWay,
8331                    })
8332                }
8333                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
8334                    this.inner.send_framework_err(
8335                        fidl::encoding::FrameworkErr::UnknownMethod,
8336                        header.tx_id,
8337                        header.ordinal,
8338                        header.dynamic_flags(),
8339                        (bytes, handles),
8340                    )?;
8341                    Ok(DirConnectorRouterRequest::_UnknownMethod {
8342                        ordinal: header.ordinal,
8343                        control_handle: DirConnectorRouterControlHandle { inner: this.inner.clone() },
8344                        method_type: fidl::MethodType::TwoWay,
8345                    })
8346                }
8347                _ => Err(fidl::Error::UnknownOrdinal {
8348                    ordinal: header.ordinal,
8349                    protocol_name: <DirConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8350                }),
8351            }))
8352            },
8353        )
8354    }
8355}
8356
8357#[derive(Debug)]
8358pub enum DirConnectorRouterRequest {
8359    Route {
8360        payload: RouteRequest,
8361        responder: DirConnectorRouterRouteResponder,
8362    },
8363    /// An interaction was received which does not match any known method.
8364    #[non_exhaustive]
8365    _UnknownMethod {
8366        /// Ordinal of the method that was called.
8367        ordinal: u64,
8368        control_handle: DirConnectorRouterControlHandle,
8369        method_type: fidl::MethodType,
8370    },
8371}
8372
8373impl DirConnectorRouterRequest {
8374    #[allow(irrefutable_let_patterns)]
8375    pub fn into_route(self) -> Option<(RouteRequest, DirConnectorRouterRouteResponder)> {
8376        if let DirConnectorRouterRequest::Route { payload, responder } = self {
8377            Some((payload, responder))
8378        } else {
8379            None
8380        }
8381    }
8382
8383    /// Name of the method defined in FIDL
8384    pub fn method_name(&self) -> &'static str {
8385        match *self {
8386            DirConnectorRouterRequest::Route { .. } => "route",
8387            DirConnectorRouterRequest::_UnknownMethod {
8388                method_type: fidl::MethodType::OneWay,
8389                ..
8390            } => "unknown one-way method",
8391            DirConnectorRouterRequest::_UnknownMethod {
8392                method_type: fidl::MethodType::TwoWay,
8393                ..
8394            } => "unknown two-way method",
8395        }
8396    }
8397}
8398
8399#[derive(Debug, Clone)]
8400pub struct DirConnectorRouterControlHandle {
8401    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8402}
8403
8404impl fidl::endpoints::ControlHandle for DirConnectorRouterControlHandle {
8405    fn shutdown(&self) {
8406        self.inner.shutdown()
8407    }
8408    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
8409        self.inner.shutdown_with_epitaph(status)
8410    }
8411
8412    fn is_closed(&self) -> bool {
8413        self.inner.channel().is_closed()
8414    }
8415    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
8416        self.inner.channel().on_closed()
8417    }
8418
8419    #[cfg(target_os = "fuchsia")]
8420    fn signal_peer(
8421        &self,
8422        clear_mask: zx::Signals,
8423        set_mask: zx::Signals,
8424    ) -> Result<(), zx_status::Status> {
8425        use fidl::Peered;
8426        self.inner.channel().signal_peer(clear_mask, set_mask)
8427    }
8428}
8429
8430impl DirConnectorRouterControlHandle {}
8431
8432#[must_use = "FIDL methods require a response to be sent"]
8433#[derive(Debug)]
8434pub struct DirConnectorRouterRouteResponder {
8435    control_handle: std::mem::ManuallyDrop<DirConnectorRouterControlHandle>,
8436    tx_id: u32,
8437}
8438
8439/// Set the the channel to be shutdown (see [`DirConnectorRouterControlHandle::shutdown`])
8440/// if the responder is dropped without sending a response, so that the client
8441/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8442impl std::ops::Drop for DirConnectorRouterRouteResponder {
8443    fn drop(&mut self) {
8444        self.control_handle.shutdown();
8445        // Safety: drops once, never accessed again
8446        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8447    }
8448}
8449
8450impl fidl::endpoints::Responder for DirConnectorRouterRouteResponder {
8451    type ControlHandle = DirConnectorRouterControlHandle;
8452
8453    fn control_handle(&self) -> &DirConnectorRouterControlHandle {
8454        &self.control_handle
8455    }
8456
8457    fn drop_without_shutdown(mut self) {
8458        // Safety: drops once, never accessed again due to mem::forget
8459        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8460        // Prevent Drop from running (which would shut down the channel)
8461        std::mem::forget(self);
8462    }
8463}
8464
8465impl DirConnectorRouterRouteResponder {
8466    /// Sends a response to the FIDL transaction.
8467    ///
8468    /// Sets the channel to shutdown if an error occurs.
8469    pub fn send(
8470        self,
8471        mut result: Result<DirConnectorRouterRouteResponse, RouterError>,
8472    ) -> Result<(), fidl::Error> {
8473        let _result = self.send_raw(result);
8474        if _result.is_err() {
8475            self.control_handle.shutdown();
8476        }
8477        self.drop_without_shutdown();
8478        _result
8479    }
8480
8481    /// Similar to "send" but does not shutdown the channel if an error occurs.
8482    pub fn send_no_shutdown_on_err(
8483        self,
8484        mut result: Result<DirConnectorRouterRouteResponse, RouterError>,
8485    ) -> Result<(), fidl::Error> {
8486        let _result = self.send_raw(result);
8487        self.drop_without_shutdown();
8488        _result
8489    }
8490
8491    fn send_raw(
8492        &self,
8493        mut result: Result<DirConnectorRouterRouteResponse, RouterError>,
8494    ) -> Result<(), fidl::Error> {
8495        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
8496            DirConnectorRouterRouteResponse,
8497            RouterError,
8498        >>(
8499            fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
8500            self.tx_id,
8501            0xd7e0f01da2c8e40,
8502            fidl::encoding::DynamicFlags::FLEXIBLE,
8503        )
8504    }
8505}
8506
8507#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
8508pub struct DirEntryRouterMarker;
8509
8510impl fidl::endpoints::ProtocolMarker for DirEntryRouterMarker {
8511    type Proxy = DirEntryRouterProxy;
8512    type RequestStream = DirEntryRouterRequestStream;
8513    #[cfg(target_os = "fuchsia")]
8514    type SynchronousProxy = DirEntryRouterSynchronousProxy;
8515
8516    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.DirEntryRouter";
8517}
8518impl fidl::endpoints::DiscoverableProtocolMarker for DirEntryRouterMarker {}
8519pub type DirEntryRouterRouteResult = Result<DirEntryRouterRouteResponse, RouterError>;
8520
8521pub trait DirEntryRouterProxyInterface: Send + Sync {
8522    type RouteResponseFut: std::future::Future<Output = Result<DirEntryRouterRouteResult, fidl::Error>>
8523        + Send;
8524    fn r#route(&self, payload: RouteRequest) -> Self::RouteResponseFut;
8525}
8526#[derive(Debug)]
8527#[cfg(target_os = "fuchsia")]
8528pub struct DirEntryRouterSynchronousProxy {
8529    client: fidl::client::sync::Client,
8530}
8531
8532#[cfg(target_os = "fuchsia")]
8533impl fidl::endpoints::SynchronousProxy for DirEntryRouterSynchronousProxy {
8534    type Proxy = DirEntryRouterProxy;
8535    type Protocol = DirEntryRouterMarker;
8536
8537    fn from_channel(inner: fidl::Channel) -> Self {
8538        Self::new(inner)
8539    }
8540
8541    fn into_channel(self) -> fidl::Channel {
8542        self.client.into_channel()
8543    }
8544
8545    fn as_channel(&self) -> &fidl::Channel {
8546        self.client.as_channel()
8547    }
8548}
8549
8550#[cfg(target_os = "fuchsia")]
8551impl DirEntryRouterSynchronousProxy {
8552    pub fn new(channel: fidl::Channel) -> Self {
8553        let protocol_name = <DirEntryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8554        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
8555    }
8556
8557    pub fn into_channel(self) -> fidl::Channel {
8558        self.client.into_channel()
8559    }
8560
8561    /// Waits until an event arrives and returns it. It is safe for other
8562    /// threads to make concurrent requests while waiting for an event.
8563    pub fn wait_for_event(
8564        &self,
8565        deadline: zx::MonotonicInstant,
8566    ) -> Result<DirEntryRouterEvent, fidl::Error> {
8567        DirEntryRouterEvent::decode(self.client.wait_for_event(deadline)?)
8568    }
8569
8570    pub fn r#route(
8571        &self,
8572        mut payload: RouteRequest,
8573        ___deadline: zx::MonotonicInstant,
8574    ) -> Result<DirEntryRouterRouteResult, fidl::Error> {
8575        let _response = self.client.send_query::<
8576            RouteRequest,
8577            fidl::encoding::FlexibleResultType<DirEntryRouterRouteResponse, RouterError>,
8578        >(
8579            &mut payload,
8580            0x1ac694001c208bd2,
8581            fidl::encoding::DynamicFlags::FLEXIBLE,
8582            ___deadline,
8583        )?
8584        .into_result::<DirEntryRouterMarker>("route")?;
8585        Ok(_response.map(|x| x))
8586    }
8587}
8588
8589#[cfg(target_os = "fuchsia")]
8590impl From<DirEntryRouterSynchronousProxy> for zx::Handle {
8591    fn from(value: DirEntryRouterSynchronousProxy) -> Self {
8592        value.into_channel().into()
8593    }
8594}
8595
8596#[cfg(target_os = "fuchsia")]
8597impl From<fidl::Channel> for DirEntryRouterSynchronousProxy {
8598    fn from(value: fidl::Channel) -> Self {
8599        Self::new(value)
8600    }
8601}
8602
8603#[cfg(target_os = "fuchsia")]
8604impl fidl::endpoints::FromClient for DirEntryRouterSynchronousProxy {
8605    type Protocol = DirEntryRouterMarker;
8606
8607    fn from_client(value: fidl::endpoints::ClientEnd<DirEntryRouterMarker>) -> Self {
8608        Self::new(value.into_channel())
8609    }
8610}
8611
8612#[derive(Debug, Clone)]
8613pub struct DirEntryRouterProxy {
8614    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
8615}
8616
8617impl fidl::endpoints::Proxy for DirEntryRouterProxy {
8618    type Protocol = DirEntryRouterMarker;
8619
8620    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
8621        Self::new(inner)
8622    }
8623
8624    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
8625        self.client.into_channel().map_err(|client| Self { client })
8626    }
8627
8628    fn as_channel(&self) -> &::fidl::AsyncChannel {
8629        self.client.as_channel()
8630    }
8631}
8632
8633impl DirEntryRouterProxy {
8634    /// Create a new Proxy for fuchsia.component.sandbox/DirEntryRouter.
8635    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
8636        let protocol_name = <DirEntryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8637        Self { client: fidl::client::Client::new(channel, protocol_name) }
8638    }
8639
8640    /// Get a Stream of events from the remote end of the protocol.
8641    ///
8642    /// # Panics
8643    ///
8644    /// Panics if the event stream was already taken.
8645    pub fn take_event_stream(&self) -> DirEntryRouterEventStream {
8646        DirEntryRouterEventStream { event_receiver: self.client.take_event_receiver() }
8647    }
8648
8649    pub fn r#route(
8650        &self,
8651        mut payload: RouteRequest,
8652    ) -> fidl::client::QueryResponseFut<
8653        DirEntryRouterRouteResult,
8654        fidl::encoding::DefaultFuchsiaResourceDialect,
8655    > {
8656        DirEntryRouterProxyInterface::r#route(self, payload)
8657    }
8658}
8659
8660impl DirEntryRouterProxyInterface for DirEntryRouterProxy {
8661    type RouteResponseFut = fidl::client::QueryResponseFut<
8662        DirEntryRouterRouteResult,
8663        fidl::encoding::DefaultFuchsiaResourceDialect,
8664    >;
8665    fn r#route(&self, mut payload: RouteRequest) -> Self::RouteResponseFut {
8666        fn _decode(
8667            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8668        ) -> Result<DirEntryRouterRouteResult, fidl::Error> {
8669            let _response = fidl::client::decode_transaction_body::<
8670                fidl::encoding::FlexibleResultType<DirEntryRouterRouteResponse, RouterError>,
8671                fidl::encoding::DefaultFuchsiaResourceDialect,
8672                0x1ac694001c208bd2,
8673            >(_buf?)?
8674            .into_result::<DirEntryRouterMarker>("route")?;
8675            Ok(_response.map(|x| x))
8676        }
8677        self.client.send_query_and_decode::<RouteRequest, DirEntryRouterRouteResult>(
8678            &mut payload,
8679            0x1ac694001c208bd2,
8680            fidl::encoding::DynamicFlags::FLEXIBLE,
8681            _decode,
8682        )
8683    }
8684}
8685
8686pub struct DirEntryRouterEventStream {
8687    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
8688}
8689
8690impl std::marker::Unpin for DirEntryRouterEventStream {}
8691
8692impl futures::stream::FusedStream for DirEntryRouterEventStream {
8693    fn is_terminated(&self) -> bool {
8694        self.event_receiver.is_terminated()
8695    }
8696}
8697
8698impl futures::Stream for DirEntryRouterEventStream {
8699    type Item = Result<DirEntryRouterEvent, fidl::Error>;
8700
8701    fn poll_next(
8702        mut self: std::pin::Pin<&mut Self>,
8703        cx: &mut std::task::Context<'_>,
8704    ) -> std::task::Poll<Option<Self::Item>> {
8705        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
8706            &mut self.event_receiver,
8707            cx
8708        )?) {
8709            Some(buf) => std::task::Poll::Ready(Some(DirEntryRouterEvent::decode(buf))),
8710            None => std::task::Poll::Ready(None),
8711        }
8712    }
8713}
8714
8715#[derive(Debug)]
8716pub enum DirEntryRouterEvent {
8717    #[non_exhaustive]
8718    _UnknownEvent {
8719        /// Ordinal of the event that was sent.
8720        ordinal: u64,
8721    },
8722}
8723
8724impl DirEntryRouterEvent {
8725    /// Decodes a message buffer as a [`DirEntryRouterEvent`].
8726    fn decode(
8727        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
8728    ) -> Result<DirEntryRouterEvent, fidl::Error> {
8729        let (bytes, _handles) = buf.split_mut();
8730        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8731        debug_assert_eq!(tx_header.tx_id, 0);
8732        match tx_header.ordinal {
8733            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
8734                Ok(DirEntryRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
8735            }
8736            _ => Err(fidl::Error::UnknownOrdinal {
8737                ordinal: tx_header.ordinal,
8738                protocol_name:
8739                    <DirEntryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8740            }),
8741        }
8742    }
8743}
8744
8745/// A Stream of incoming requests for fuchsia.component.sandbox/DirEntryRouter.
8746pub struct DirEntryRouterRequestStream {
8747    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8748    is_terminated: bool,
8749}
8750
8751impl std::marker::Unpin for DirEntryRouterRequestStream {}
8752
8753impl futures::stream::FusedStream for DirEntryRouterRequestStream {
8754    fn is_terminated(&self) -> bool {
8755        self.is_terminated
8756    }
8757}
8758
8759impl fidl::endpoints::RequestStream for DirEntryRouterRequestStream {
8760    type Protocol = DirEntryRouterMarker;
8761    type ControlHandle = DirEntryRouterControlHandle;
8762
8763    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
8764        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
8765    }
8766
8767    fn control_handle(&self) -> Self::ControlHandle {
8768        DirEntryRouterControlHandle { inner: self.inner.clone() }
8769    }
8770
8771    fn into_inner(
8772        self,
8773    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
8774    {
8775        (self.inner, self.is_terminated)
8776    }
8777
8778    fn from_inner(
8779        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8780        is_terminated: bool,
8781    ) -> Self {
8782        Self { inner, is_terminated }
8783    }
8784}
8785
8786impl futures::Stream for DirEntryRouterRequestStream {
8787    type Item = Result<DirEntryRouterRequest, fidl::Error>;
8788
8789    fn poll_next(
8790        mut self: std::pin::Pin<&mut Self>,
8791        cx: &mut std::task::Context<'_>,
8792    ) -> std::task::Poll<Option<Self::Item>> {
8793        let this = &mut *self;
8794        if this.inner.check_shutdown(cx) {
8795            this.is_terminated = true;
8796            return std::task::Poll::Ready(None);
8797        }
8798        if this.is_terminated {
8799            panic!("polled DirEntryRouterRequestStream after completion");
8800        }
8801        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
8802            |bytes, handles| {
8803                match this.inner.channel().read_etc(cx, bytes, handles) {
8804                    std::task::Poll::Ready(Ok(())) => {}
8805                    std::task::Poll::Pending => return std::task::Poll::Pending,
8806                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
8807                        this.is_terminated = true;
8808                        return std::task::Poll::Ready(None);
8809                    }
8810                    std::task::Poll::Ready(Err(e)) => {
8811                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
8812                            e.into(),
8813                        ))))
8814                    }
8815                }
8816
8817                // A message has been received from the channel
8818                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8819
8820                std::task::Poll::Ready(Some(match header.ordinal {
8821                    0x1ac694001c208bd2 => {
8822                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
8823                        let mut req = fidl::new_empty!(
8824                            RouteRequest,
8825                            fidl::encoding::DefaultFuchsiaResourceDialect
8826                        );
8827                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RouteRequest>(&header, _body_bytes, handles, &mut req)?;
8828                        let control_handle =
8829                            DirEntryRouterControlHandle { inner: this.inner.clone() };
8830                        Ok(DirEntryRouterRequest::Route {
8831                            payload: req,
8832                            responder: DirEntryRouterRouteResponder {
8833                                control_handle: std::mem::ManuallyDrop::new(control_handle),
8834                                tx_id: header.tx_id,
8835                            },
8836                        })
8837                    }
8838                    _ if header.tx_id == 0
8839                        && header
8840                            .dynamic_flags()
8841                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
8842                    {
8843                        Ok(DirEntryRouterRequest::_UnknownMethod {
8844                            ordinal: header.ordinal,
8845                            control_handle: DirEntryRouterControlHandle {
8846                                inner: this.inner.clone(),
8847                            },
8848                            method_type: fidl::MethodType::OneWay,
8849                        })
8850                    }
8851                    _ if header
8852                        .dynamic_flags()
8853                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
8854                    {
8855                        this.inner.send_framework_err(
8856                            fidl::encoding::FrameworkErr::UnknownMethod,
8857                            header.tx_id,
8858                            header.ordinal,
8859                            header.dynamic_flags(),
8860                            (bytes, handles),
8861                        )?;
8862                        Ok(DirEntryRouterRequest::_UnknownMethod {
8863                            ordinal: header.ordinal,
8864                            control_handle: DirEntryRouterControlHandle {
8865                                inner: this.inner.clone(),
8866                            },
8867                            method_type: fidl::MethodType::TwoWay,
8868                        })
8869                    }
8870                    _ => Err(fidl::Error::UnknownOrdinal {
8871                        ordinal: header.ordinal,
8872                        protocol_name:
8873                            <DirEntryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8874                    }),
8875                }))
8876            },
8877        )
8878    }
8879}
8880
8881#[derive(Debug)]
8882pub enum DirEntryRouterRequest {
8883    Route {
8884        payload: RouteRequest,
8885        responder: DirEntryRouterRouteResponder,
8886    },
8887    /// An interaction was received which does not match any known method.
8888    #[non_exhaustive]
8889    _UnknownMethod {
8890        /// Ordinal of the method that was called.
8891        ordinal: u64,
8892        control_handle: DirEntryRouterControlHandle,
8893        method_type: fidl::MethodType,
8894    },
8895}
8896
8897impl DirEntryRouterRequest {
8898    #[allow(irrefutable_let_patterns)]
8899    pub fn into_route(self) -> Option<(RouteRequest, DirEntryRouterRouteResponder)> {
8900        if let DirEntryRouterRequest::Route { payload, responder } = self {
8901            Some((payload, responder))
8902        } else {
8903            None
8904        }
8905    }
8906
8907    /// Name of the method defined in FIDL
8908    pub fn method_name(&self) -> &'static str {
8909        match *self {
8910            DirEntryRouterRequest::Route { .. } => "route",
8911            DirEntryRouterRequest::_UnknownMethod {
8912                method_type: fidl::MethodType::OneWay, ..
8913            } => "unknown one-way method",
8914            DirEntryRouterRequest::_UnknownMethod {
8915                method_type: fidl::MethodType::TwoWay, ..
8916            } => "unknown two-way method",
8917        }
8918    }
8919}
8920
8921#[derive(Debug, Clone)]
8922pub struct DirEntryRouterControlHandle {
8923    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8924}
8925
8926impl fidl::endpoints::ControlHandle for DirEntryRouterControlHandle {
8927    fn shutdown(&self) {
8928        self.inner.shutdown()
8929    }
8930    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
8931        self.inner.shutdown_with_epitaph(status)
8932    }
8933
8934    fn is_closed(&self) -> bool {
8935        self.inner.channel().is_closed()
8936    }
8937    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
8938        self.inner.channel().on_closed()
8939    }
8940
8941    #[cfg(target_os = "fuchsia")]
8942    fn signal_peer(
8943        &self,
8944        clear_mask: zx::Signals,
8945        set_mask: zx::Signals,
8946    ) -> Result<(), zx_status::Status> {
8947        use fidl::Peered;
8948        self.inner.channel().signal_peer(clear_mask, set_mask)
8949    }
8950}
8951
8952impl DirEntryRouterControlHandle {}
8953
8954#[must_use = "FIDL methods require a response to be sent"]
8955#[derive(Debug)]
8956pub struct DirEntryRouterRouteResponder {
8957    control_handle: std::mem::ManuallyDrop<DirEntryRouterControlHandle>,
8958    tx_id: u32,
8959}
8960
8961/// Set the the channel to be shutdown (see [`DirEntryRouterControlHandle::shutdown`])
8962/// if the responder is dropped without sending a response, so that the client
8963/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8964impl std::ops::Drop for DirEntryRouterRouteResponder {
8965    fn drop(&mut self) {
8966        self.control_handle.shutdown();
8967        // Safety: drops once, never accessed again
8968        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8969    }
8970}
8971
8972impl fidl::endpoints::Responder for DirEntryRouterRouteResponder {
8973    type ControlHandle = DirEntryRouterControlHandle;
8974
8975    fn control_handle(&self) -> &DirEntryRouterControlHandle {
8976        &self.control_handle
8977    }
8978
8979    fn drop_without_shutdown(mut self) {
8980        // Safety: drops once, never accessed again due to mem::forget
8981        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8982        // Prevent Drop from running (which would shut down the channel)
8983        std::mem::forget(self);
8984    }
8985}
8986
8987impl DirEntryRouterRouteResponder {
8988    /// Sends a response to the FIDL transaction.
8989    ///
8990    /// Sets the channel to shutdown if an error occurs.
8991    pub fn send(
8992        self,
8993        mut result: Result<DirEntryRouterRouteResponse, RouterError>,
8994    ) -> Result<(), fidl::Error> {
8995        let _result = self.send_raw(result);
8996        if _result.is_err() {
8997            self.control_handle.shutdown();
8998        }
8999        self.drop_without_shutdown();
9000        _result
9001    }
9002
9003    /// Similar to "send" but does not shutdown the channel if an error occurs.
9004    pub fn send_no_shutdown_on_err(
9005        self,
9006        mut result: Result<DirEntryRouterRouteResponse, RouterError>,
9007    ) -> Result<(), fidl::Error> {
9008        let _result = self.send_raw(result);
9009        self.drop_without_shutdown();
9010        _result
9011    }
9012
9013    fn send_raw(
9014        &self,
9015        mut result: Result<DirEntryRouterRouteResponse, RouterError>,
9016    ) -> Result<(), fidl::Error> {
9017        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
9018            DirEntryRouterRouteResponse,
9019            RouterError,
9020        >>(
9021            fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
9022            self.tx_id,
9023            0x1ac694001c208bd2,
9024            fidl::encoding::DynamicFlags::FLEXIBLE,
9025        )
9026    }
9027}
9028
9029#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
9030pub struct DirReceiverMarker;
9031
9032impl fidl::endpoints::ProtocolMarker for DirReceiverMarker {
9033    type Proxy = DirReceiverProxy;
9034    type RequestStream = DirReceiverRequestStream;
9035    #[cfg(target_os = "fuchsia")]
9036    type SynchronousProxy = DirReceiverSynchronousProxy;
9037
9038    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.DirReceiver";
9039}
9040impl fidl::endpoints::DiscoverableProtocolMarker for DirReceiverMarker {}
9041
9042pub trait DirReceiverProxyInterface: Send + Sync {
9043    fn r#receive(
9044        &self,
9045        channel: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
9046    ) -> Result<(), fidl::Error>;
9047}
9048#[derive(Debug)]
9049#[cfg(target_os = "fuchsia")]
9050pub struct DirReceiverSynchronousProxy {
9051    client: fidl::client::sync::Client,
9052}
9053
9054#[cfg(target_os = "fuchsia")]
9055impl fidl::endpoints::SynchronousProxy for DirReceiverSynchronousProxy {
9056    type Proxy = DirReceiverProxy;
9057    type Protocol = DirReceiverMarker;
9058
9059    fn from_channel(inner: fidl::Channel) -> Self {
9060        Self::new(inner)
9061    }
9062
9063    fn into_channel(self) -> fidl::Channel {
9064        self.client.into_channel()
9065    }
9066
9067    fn as_channel(&self) -> &fidl::Channel {
9068        self.client.as_channel()
9069    }
9070}
9071
9072#[cfg(target_os = "fuchsia")]
9073impl DirReceiverSynchronousProxy {
9074    pub fn new(channel: fidl::Channel) -> Self {
9075        let protocol_name = <DirReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
9076        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
9077    }
9078
9079    pub fn into_channel(self) -> fidl::Channel {
9080        self.client.into_channel()
9081    }
9082
9083    /// Waits until an event arrives and returns it. It is safe for other
9084    /// threads to make concurrent requests while waiting for an event.
9085    pub fn wait_for_event(
9086        &self,
9087        deadline: zx::MonotonicInstant,
9088    ) -> Result<DirReceiverEvent, fidl::Error> {
9089        DirReceiverEvent::decode(self.client.wait_for_event(deadline)?)
9090    }
9091
9092    /// Sends a directory channel to this receiver.
9093    ///
9094    /// The server should implement this method by forwarding `channel` to a vfs instance
9095    /// of the language appropriate `vfs` library. To keep this interface decoupled from
9096    /// `fuchsia.io`, it deliberately omits `Open`/`Open3` parameters such as `flags` and
9097    /// `path`. If a client wishes to specify these, they can obtain an initial
9098    /// [fuchsia.io/Directory] channel first and then call `Open`/`Open3` on it.
9099    pub fn r#receive(
9100        &self,
9101        mut channel: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
9102    ) -> Result<(), fidl::Error> {
9103        self.client.send::<DirReceiverReceiveRequest>(
9104            (channel,),
9105            0xcdc3e9b89fe7bb4,
9106            fidl::encoding::DynamicFlags::FLEXIBLE,
9107        )
9108    }
9109}
9110
9111#[cfg(target_os = "fuchsia")]
9112impl From<DirReceiverSynchronousProxy> for zx::Handle {
9113    fn from(value: DirReceiverSynchronousProxy) -> Self {
9114        value.into_channel().into()
9115    }
9116}
9117
9118#[cfg(target_os = "fuchsia")]
9119impl From<fidl::Channel> for DirReceiverSynchronousProxy {
9120    fn from(value: fidl::Channel) -> Self {
9121        Self::new(value)
9122    }
9123}
9124
9125#[cfg(target_os = "fuchsia")]
9126impl fidl::endpoints::FromClient for DirReceiverSynchronousProxy {
9127    type Protocol = DirReceiverMarker;
9128
9129    fn from_client(value: fidl::endpoints::ClientEnd<DirReceiverMarker>) -> Self {
9130        Self::new(value.into_channel())
9131    }
9132}
9133
9134#[derive(Debug, Clone)]
9135pub struct DirReceiverProxy {
9136    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
9137}
9138
9139impl fidl::endpoints::Proxy for DirReceiverProxy {
9140    type Protocol = DirReceiverMarker;
9141
9142    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
9143        Self::new(inner)
9144    }
9145
9146    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
9147        self.client.into_channel().map_err(|client| Self { client })
9148    }
9149
9150    fn as_channel(&self) -> &::fidl::AsyncChannel {
9151        self.client.as_channel()
9152    }
9153}
9154
9155impl DirReceiverProxy {
9156    /// Create a new Proxy for fuchsia.component.sandbox/DirReceiver.
9157    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
9158        let protocol_name = <DirReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
9159        Self { client: fidl::client::Client::new(channel, protocol_name) }
9160    }
9161
9162    /// Get a Stream of events from the remote end of the protocol.
9163    ///
9164    /// # Panics
9165    ///
9166    /// Panics if the event stream was already taken.
9167    pub fn take_event_stream(&self) -> DirReceiverEventStream {
9168        DirReceiverEventStream { event_receiver: self.client.take_event_receiver() }
9169    }
9170
9171    /// Sends a directory channel to this receiver.
9172    ///
9173    /// The server should implement this method by forwarding `channel` to a vfs instance
9174    /// of the language appropriate `vfs` library. To keep this interface decoupled from
9175    /// `fuchsia.io`, it deliberately omits `Open`/`Open3` parameters such as `flags` and
9176    /// `path`. If a client wishes to specify these, they can obtain an initial
9177    /// [fuchsia.io/Directory] channel first and then call `Open`/`Open3` on it.
9178    pub fn r#receive(
9179        &self,
9180        mut channel: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
9181    ) -> Result<(), fidl::Error> {
9182        DirReceiverProxyInterface::r#receive(self, channel)
9183    }
9184}
9185
9186impl DirReceiverProxyInterface for DirReceiverProxy {
9187    fn r#receive(
9188        &self,
9189        mut channel: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
9190    ) -> Result<(), fidl::Error> {
9191        self.client.send::<DirReceiverReceiveRequest>(
9192            (channel,),
9193            0xcdc3e9b89fe7bb4,
9194            fidl::encoding::DynamicFlags::FLEXIBLE,
9195        )
9196    }
9197}
9198
9199pub struct DirReceiverEventStream {
9200    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
9201}
9202
9203impl std::marker::Unpin for DirReceiverEventStream {}
9204
9205impl futures::stream::FusedStream for DirReceiverEventStream {
9206    fn is_terminated(&self) -> bool {
9207        self.event_receiver.is_terminated()
9208    }
9209}
9210
9211impl futures::Stream for DirReceiverEventStream {
9212    type Item = Result<DirReceiverEvent, fidl::Error>;
9213
9214    fn poll_next(
9215        mut self: std::pin::Pin<&mut Self>,
9216        cx: &mut std::task::Context<'_>,
9217    ) -> std::task::Poll<Option<Self::Item>> {
9218        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
9219            &mut self.event_receiver,
9220            cx
9221        )?) {
9222            Some(buf) => std::task::Poll::Ready(Some(DirReceiverEvent::decode(buf))),
9223            None => std::task::Poll::Ready(None),
9224        }
9225    }
9226}
9227
9228#[derive(Debug)]
9229pub enum DirReceiverEvent {
9230    #[non_exhaustive]
9231    _UnknownEvent {
9232        /// Ordinal of the event that was sent.
9233        ordinal: u64,
9234    },
9235}
9236
9237impl DirReceiverEvent {
9238    /// Decodes a message buffer as a [`DirReceiverEvent`].
9239    fn decode(
9240        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
9241    ) -> Result<DirReceiverEvent, fidl::Error> {
9242        let (bytes, _handles) = buf.split_mut();
9243        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9244        debug_assert_eq!(tx_header.tx_id, 0);
9245        match tx_header.ordinal {
9246            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
9247                Ok(DirReceiverEvent::_UnknownEvent { ordinal: tx_header.ordinal })
9248            }
9249            _ => Err(fidl::Error::UnknownOrdinal {
9250                ordinal: tx_header.ordinal,
9251                protocol_name: <DirReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9252            }),
9253        }
9254    }
9255}
9256
9257/// A Stream of incoming requests for fuchsia.component.sandbox/DirReceiver.
9258pub struct DirReceiverRequestStream {
9259    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9260    is_terminated: bool,
9261}
9262
9263impl std::marker::Unpin for DirReceiverRequestStream {}
9264
9265impl futures::stream::FusedStream for DirReceiverRequestStream {
9266    fn is_terminated(&self) -> bool {
9267        self.is_terminated
9268    }
9269}
9270
9271impl fidl::endpoints::RequestStream for DirReceiverRequestStream {
9272    type Protocol = DirReceiverMarker;
9273    type ControlHandle = DirReceiverControlHandle;
9274
9275    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
9276        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
9277    }
9278
9279    fn control_handle(&self) -> Self::ControlHandle {
9280        DirReceiverControlHandle { inner: self.inner.clone() }
9281    }
9282
9283    fn into_inner(
9284        self,
9285    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
9286    {
9287        (self.inner, self.is_terminated)
9288    }
9289
9290    fn from_inner(
9291        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9292        is_terminated: bool,
9293    ) -> Self {
9294        Self { inner, is_terminated }
9295    }
9296}
9297
9298impl futures::Stream for DirReceiverRequestStream {
9299    type Item = Result<DirReceiverRequest, fidl::Error>;
9300
9301    fn poll_next(
9302        mut self: std::pin::Pin<&mut Self>,
9303        cx: &mut std::task::Context<'_>,
9304    ) -> std::task::Poll<Option<Self::Item>> {
9305        let this = &mut *self;
9306        if this.inner.check_shutdown(cx) {
9307            this.is_terminated = true;
9308            return std::task::Poll::Ready(None);
9309        }
9310        if this.is_terminated {
9311            panic!("polled DirReceiverRequestStream after completion");
9312        }
9313        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
9314            |bytes, handles| {
9315                match this.inner.channel().read_etc(cx, bytes, handles) {
9316                    std::task::Poll::Ready(Ok(())) => {}
9317                    std::task::Poll::Pending => return std::task::Poll::Pending,
9318                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
9319                        this.is_terminated = true;
9320                        return std::task::Poll::Ready(None);
9321                    }
9322                    std::task::Poll::Ready(Err(e)) => {
9323                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
9324                            e.into(),
9325                        ))))
9326                    }
9327                }
9328
9329                // A message has been received from the channel
9330                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9331
9332                std::task::Poll::Ready(Some(match header.ordinal {
9333                    0xcdc3e9b89fe7bb4 => {
9334                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
9335                        let mut req = fidl::new_empty!(
9336                            DirReceiverReceiveRequest,
9337                            fidl::encoding::DefaultFuchsiaResourceDialect
9338                        );
9339                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirReceiverReceiveRequest>(&header, _body_bytes, handles, &mut req)?;
9340                        let control_handle = DirReceiverControlHandle { inner: this.inner.clone() };
9341                        Ok(DirReceiverRequest::Receive { channel: req.channel, control_handle })
9342                    }
9343                    _ if header.tx_id == 0
9344                        && header
9345                            .dynamic_flags()
9346                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
9347                    {
9348                        Ok(DirReceiverRequest::_UnknownMethod {
9349                            ordinal: header.ordinal,
9350                            control_handle: DirReceiverControlHandle { inner: this.inner.clone() },
9351                            method_type: fidl::MethodType::OneWay,
9352                        })
9353                    }
9354                    _ if header
9355                        .dynamic_flags()
9356                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
9357                    {
9358                        this.inner.send_framework_err(
9359                            fidl::encoding::FrameworkErr::UnknownMethod,
9360                            header.tx_id,
9361                            header.ordinal,
9362                            header.dynamic_flags(),
9363                            (bytes, handles),
9364                        )?;
9365                        Ok(DirReceiverRequest::_UnknownMethod {
9366                            ordinal: header.ordinal,
9367                            control_handle: DirReceiverControlHandle { inner: this.inner.clone() },
9368                            method_type: fidl::MethodType::TwoWay,
9369                        })
9370                    }
9371                    _ => Err(fidl::Error::UnknownOrdinal {
9372                        ordinal: header.ordinal,
9373                        protocol_name:
9374                            <DirReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9375                    }),
9376                }))
9377            },
9378        )
9379    }
9380}
9381
9382/// A receiver is served by components and allows them to receive directory channels
9383/// framework.
9384#[derive(Debug)]
9385pub enum DirReceiverRequest {
9386    /// Sends a directory channel to this receiver.
9387    ///
9388    /// The server should implement this method by forwarding `channel` to a vfs instance
9389    /// of the language appropriate `vfs` library. To keep this interface decoupled from
9390    /// `fuchsia.io`, it deliberately omits `Open`/`Open3` parameters such as `flags` and
9391    /// `path`. If a client wishes to specify these, they can obtain an initial
9392    /// [fuchsia.io/Directory] channel first and then call `Open`/`Open3` on it.
9393    Receive {
9394        channel: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
9395        control_handle: DirReceiverControlHandle,
9396    },
9397    /// An interaction was received which does not match any known method.
9398    #[non_exhaustive]
9399    _UnknownMethod {
9400        /// Ordinal of the method that was called.
9401        ordinal: u64,
9402        control_handle: DirReceiverControlHandle,
9403        method_type: fidl::MethodType,
9404    },
9405}
9406
9407impl DirReceiverRequest {
9408    #[allow(irrefutable_let_patterns)]
9409    pub fn into_receive(
9410        self,
9411    ) -> Option<(
9412        fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
9413        DirReceiverControlHandle,
9414    )> {
9415        if let DirReceiverRequest::Receive { channel, control_handle } = self {
9416            Some((channel, control_handle))
9417        } else {
9418            None
9419        }
9420    }
9421
9422    /// Name of the method defined in FIDL
9423    pub fn method_name(&self) -> &'static str {
9424        match *self {
9425            DirReceiverRequest::Receive { .. } => "receive",
9426            DirReceiverRequest::_UnknownMethod {
9427                method_type: fidl::MethodType::OneWay, ..
9428            } => "unknown one-way method",
9429            DirReceiverRequest::_UnknownMethod {
9430                method_type: fidl::MethodType::TwoWay, ..
9431            } => "unknown two-way method",
9432        }
9433    }
9434}
9435
9436#[derive(Debug, Clone)]
9437pub struct DirReceiverControlHandle {
9438    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9439}
9440
9441impl fidl::endpoints::ControlHandle for DirReceiverControlHandle {
9442    fn shutdown(&self) {
9443        self.inner.shutdown()
9444    }
9445    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
9446        self.inner.shutdown_with_epitaph(status)
9447    }
9448
9449    fn is_closed(&self) -> bool {
9450        self.inner.channel().is_closed()
9451    }
9452    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
9453        self.inner.channel().on_closed()
9454    }
9455
9456    #[cfg(target_os = "fuchsia")]
9457    fn signal_peer(
9458        &self,
9459        clear_mask: zx::Signals,
9460        set_mask: zx::Signals,
9461    ) -> Result<(), zx_status::Status> {
9462        use fidl::Peered;
9463        self.inner.channel().signal_peer(clear_mask, set_mask)
9464    }
9465}
9466
9467impl DirReceiverControlHandle {}
9468
9469#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
9470pub struct DirectoryRouterMarker;
9471
9472impl fidl::endpoints::ProtocolMarker for DirectoryRouterMarker {
9473    type Proxy = DirectoryRouterProxy;
9474    type RequestStream = DirectoryRouterRequestStream;
9475    #[cfg(target_os = "fuchsia")]
9476    type SynchronousProxy = DirectoryRouterSynchronousProxy;
9477
9478    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.DirectoryRouter";
9479}
9480impl fidl::endpoints::DiscoverableProtocolMarker for DirectoryRouterMarker {}
9481pub type DirectoryRouterRouteResult = Result<DirectoryRouterRouteResponse, RouterError>;
9482
9483pub trait DirectoryRouterProxyInterface: Send + Sync {
9484    type RouteResponseFut: std::future::Future<Output = Result<DirectoryRouterRouteResult, fidl::Error>>
9485        + Send;
9486    fn r#route(&self, payload: RouteRequest) -> Self::RouteResponseFut;
9487}
9488#[derive(Debug)]
9489#[cfg(target_os = "fuchsia")]
9490pub struct DirectoryRouterSynchronousProxy {
9491    client: fidl::client::sync::Client,
9492}
9493
9494#[cfg(target_os = "fuchsia")]
9495impl fidl::endpoints::SynchronousProxy for DirectoryRouterSynchronousProxy {
9496    type Proxy = DirectoryRouterProxy;
9497    type Protocol = DirectoryRouterMarker;
9498
9499    fn from_channel(inner: fidl::Channel) -> Self {
9500        Self::new(inner)
9501    }
9502
9503    fn into_channel(self) -> fidl::Channel {
9504        self.client.into_channel()
9505    }
9506
9507    fn as_channel(&self) -> &fidl::Channel {
9508        self.client.as_channel()
9509    }
9510}
9511
9512#[cfg(target_os = "fuchsia")]
9513impl DirectoryRouterSynchronousProxy {
9514    pub fn new(channel: fidl::Channel) -> Self {
9515        let protocol_name = <DirectoryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
9516        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
9517    }
9518
9519    pub fn into_channel(self) -> fidl::Channel {
9520        self.client.into_channel()
9521    }
9522
9523    /// Waits until an event arrives and returns it. It is safe for other
9524    /// threads to make concurrent requests while waiting for an event.
9525    pub fn wait_for_event(
9526        &self,
9527        deadline: zx::MonotonicInstant,
9528    ) -> Result<DirectoryRouterEvent, fidl::Error> {
9529        DirectoryRouterEvent::decode(self.client.wait_for_event(deadline)?)
9530    }
9531
9532    pub fn r#route(
9533        &self,
9534        mut payload: RouteRequest,
9535        ___deadline: zx::MonotonicInstant,
9536    ) -> Result<DirectoryRouterRouteResult, fidl::Error> {
9537        let _response = self.client.send_query::<
9538            RouteRequest,
9539            fidl::encoding::FlexibleResultType<DirectoryRouterRouteResponse, RouterError>,
9540        >(
9541            &mut payload,
9542            0x683b6c6be21b0f21,
9543            fidl::encoding::DynamicFlags::FLEXIBLE,
9544            ___deadline,
9545        )?
9546        .into_result::<DirectoryRouterMarker>("route")?;
9547        Ok(_response.map(|x| x))
9548    }
9549}
9550
9551#[cfg(target_os = "fuchsia")]
9552impl From<DirectoryRouterSynchronousProxy> for zx::Handle {
9553    fn from(value: DirectoryRouterSynchronousProxy) -> Self {
9554        value.into_channel().into()
9555    }
9556}
9557
9558#[cfg(target_os = "fuchsia")]
9559impl From<fidl::Channel> for DirectoryRouterSynchronousProxy {
9560    fn from(value: fidl::Channel) -> Self {
9561        Self::new(value)
9562    }
9563}
9564
9565#[cfg(target_os = "fuchsia")]
9566impl fidl::endpoints::FromClient for DirectoryRouterSynchronousProxy {
9567    type Protocol = DirectoryRouterMarker;
9568
9569    fn from_client(value: fidl::endpoints::ClientEnd<DirectoryRouterMarker>) -> Self {
9570        Self::new(value.into_channel())
9571    }
9572}
9573
9574#[derive(Debug, Clone)]
9575pub struct DirectoryRouterProxy {
9576    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
9577}
9578
9579impl fidl::endpoints::Proxy for DirectoryRouterProxy {
9580    type Protocol = DirectoryRouterMarker;
9581
9582    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
9583        Self::new(inner)
9584    }
9585
9586    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
9587        self.client.into_channel().map_err(|client| Self { client })
9588    }
9589
9590    fn as_channel(&self) -> &::fidl::AsyncChannel {
9591        self.client.as_channel()
9592    }
9593}
9594
9595impl DirectoryRouterProxy {
9596    /// Create a new Proxy for fuchsia.component.sandbox/DirectoryRouter.
9597    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
9598        let protocol_name = <DirectoryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
9599        Self { client: fidl::client::Client::new(channel, protocol_name) }
9600    }
9601
9602    /// Get a Stream of events from the remote end of the protocol.
9603    ///
9604    /// # Panics
9605    ///
9606    /// Panics if the event stream was already taken.
9607    pub fn take_event_stream(&self) -> DirectoryRouterEventStream {
9608        DirectoryRouterEventStream { event_receiver: self.client.take_event_receiver() }
9609    }
9610
9611    pub fn r#route(
9612        &self,
9613        mut payload: RouteRequest,
9614    ) -> fidl::client::QueryResponseFut<
9615        DirectoryRouterRouteResult,
9616        fidl::encoding::DefaultFuchsiaResourceDialect,
9617    > {
9618        DirectoryRouterProxyInterface::r#route(self, payload)
9619    }
9620}
9621
9622impl DirectoryRouterProxyInterface for DirectoryRouterProxy {
9623    type RouteResponseFut = fidl::client::QueryResponseFut<
9624        DirectoryRouterRouteResult,
9625        fidl::encoding::DefaultFuchsiaResourceDialect,
9626    >;
9627    fn r#route(&self, mut payload: RouteRequest) -> Self::RouteResponseFut {
9628        fn _decode(
9629            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9630        ) -> Result<DirectoryRouterRouteResult, fidl::Error> {
9631            let _response = fidl::client::decode_transaction_body::<
9632                fidl::encoding::FlexibleResultType<DirectoryRouterRouteResponse, RouterError>,
9633                fidl::encoding::DefaultFuchsiaResourceDialect,
9634                0x683b6c6be21b0f21,
9635            >(_buf?)?
9636            .into_result::<DirectoryRouterMarker>("route")?;
9637            Ok(_response.map(|x| x))
9638        }
9639        self.client.send_query_and_decode::<RouteRequest, DirectoryRouterRouteResult>(
9640            &mut payload,
9641            0x683b6c6be21b0f21,
9642            fidl::encoding::DynamicFlags::FLEXIBLE,
9643            _decode,
9644        )
9645    }
9646}
9647
9648pub struct DirectoryRouterEventStream {
9649    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
9650}
9651
9652impl std::marker::Unpin for DirectoryRouterEventStream {}
9653
9654impl futures::stream::FusedStream for DirectoryRouterEventStream {
9655    fn is_terminated(&self) -> bool {
9656        self.event_receiver.is_terminated()
9657    }
9658}
9659
9660impl futures::Stream for DirectoryRouterEventStream {
9661    type Item = Result<DirectoryRouterEvent, fidl::Error>;
9662
9663    fn poll_next(
9664        mut self: std::pin::Pin<&mut Self>,
9665        cx: &mut std::task::Context<'_>,
9666    ) -> std::task::Poll<Option<Self::Item>> {
9667        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
9668            &mut self.event_receiver,
9669            cx
9670        )?) {
9671            Some(buf) => std::task::Poll::Ready(Some(DirectoryRouterEvent::decode(buf))),
9672            None => std::task::Poll::Ready(None),
9673        }
9674    }
9675}
9676
9677#[derive(Debug)]
9678pub enum DirectoryRouterEvent {
9679    #[non_exhaustive]
9680    _UnknownEvent {
9681        /// Ordinal of the event that was sent.
9682        ordinal: u64,
9683    },
9684}
9685
9686impl DirectoryRouterEvent {
9687    /// Decodes a message buffer as a [`DirectoryRouterEvent`].
9688    fn decode(
9689        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
9690    ) -> Result<DirectoryRouterEvent, fidl::Error> {
9691        let (bytes, _handles) = buf.split_mut();
9692        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9693        debug_assert_eq!(tx_header.tx_id, 0);
9694        match tx_header.ordinal {
9695            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
9696                Ok(DirectoryRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
9697            }
9698            _ => Err(fidl::Error::UnknownOrdinal {
9699                ordinal: tx_header.ordinal,
9700                protocol_name:
9701                    <DirectoryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9702            }),
9703        }
9704    }
9705}
9706
9707/// A Stream of incoming requests for fuchsia.component.sandbox/DirectoryRouter.
9708pub struct DirectoryRouterRequestStream {
9709    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9710    is_terminated: bool,
9711}
9712
9713impl std::marker::Unpin for DirectoryRouterRequestStream {}
9714
9715impl futures::stream::FusedStream for DirectoryRouterRequestStream {
9716    fn is_terminated(&self) -> bool {
9717        self.is_terminated
9718    }
9719}
9720
9721impl fidl::endpoints::RequestStream for DirectoryRouterRequestStream {
9722    type Protocol = DirectoryRouterMarker;
9723    type ControlHandle = DirectoryRouterControlHandle;
9724
9725    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
9726        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
9727    }
9728
9729    fn control_handle(&self) -> Self::ControlHandle {
9730        DirectoryRouterControlHandle { inner: self.inner.clone() }
9731    }
9732
9733    fn into_inner(
9734        self,
9735    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
9736    {
9737        (self.inner, self.is_terminated)
9738    }
9739
9740    fn from_inner(
9741        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9742        is_terminated: bool,
9743    ) -> Self {
9744        Self { inner, is_terminated }
9745    }
9746}
9747
9748impl futures::Stream for DirectoryRouterRequestStream {
9749    type Item = Result<DirectoryRouterRequest, fidl::Error>;
9750
9751    fn poll_next(
9752        mut self: std::pin::Pin<&mut Self>,
9753        cx: &mut std::task::Context<'_>,
9754    ) -> std::task::Poll<Option<Self::Item>> {
9755        let this = &mut *self;
9756        if this.inner.check_shutdown(cx) {
9757            this.is_terminated = true;
9758            return std::task::Poll::Ready(None);
9759        }
9760        if this.is_terminated {
9761            panic!("polled DirectoryRouterRequestStream after completion");
9762        }
9763        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
9764            |bytes, handles| {
9765                match this.inner.channel().read_etc(cx, bytes, handles) {
9766                    std::task::Poll::Ready(Ok(())) => {}
9767                    std::task::Poll::Pending => return std::task::Poll::Pending,
9768                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
9769                        this.is_terminated = true;
9770                        return std::task::Poll::Ready(None);
9771                    }
9772                    std::task::Poll::Ready(Err(e)) => {
9773                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
9774                            e.into(),
9775                        ))))
9776                    }
9777                }
9778
9779                // A message has been received from the channel
9780                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9781
9782                std::task::Poll::Ready(Some(match header.ordinal {
9783                    0x683b6c6be21b0f21 => {
9784                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9785                        let mut req = fidl::new_empty!(
9786                            RouteRequest,
9787                            fidl::encoding::DefaultFuchsiaResourceDialect
9788                        );
9789                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RouteRequest>(&header, _body_bytes, handles, &mut req)?;
9790                        let control_handle =
9791                            DirectoryRouterControlHandle { inner: this.inner.clone() };
9792                        Ok(DirectoryRouterRequest::Route {
9793                            payload: req,
9794                            responder: DirectoryRouterRouteResponder {
9795                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9796                                tx_id: header.tx_id,
9797                            },
9798                        })
9799                    }
9800                    _ if header.tx_id == 0
9801                        && header
9802                            .dynamic_flags()
9803                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
9804                    {
9805                        Ok(DirectoryRouterRequest::_UnknownMethod {
9806                            ordinal: header.ordinal,
9807                            control_handle: DirectoryRouterControlHandle {
9808                                inner: this.inner.clone(),
9809                            },
9810                            method_type: fidl::MethodType::OneWay,
9811                        })
9812                    }
9813                    _ if header
9814                        .dynamic_flags()
9815                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
9816                    {
9817                        this.inner.send_framework_err(
9818                            fidl::encoding::FrameworkErr::UnknownMethod,
9819                            header.tx_id,
9820                            header.ordinal,
9821                            header.dynamic_flags(),
9822                            (bytes, handles),
9823                        )?;
9824                        Ok(DirectoryRouterRequest::_UnknownMethod {
9825                            ordinal: header.ordinal,
9826                            control_handle: DirectoryRouterControlHandle {
9827                                inner: this.inner.clone(),
9828                            },
9829                            method_type: fidl::MethodType::TwoWay,
9830                        })
9831                    }
9832                    _ => Err(fidl::Error::UnknownOrdinal {
9833                        ordinal: header.ordinal,
9834                        protocol_name:
9835                            <DirectoryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9836                    }),
9837                }))
9838            },
9839        )
9840    }
9841}
9842
9843#[derive(Debug)]
9844pub enum DirectoryRouterRequest {
9845    Route {
9846        payload: RouteRequest,
9847        responder: DirectoryRouterRouteResponder,
9848    },
9849    /// An interaction was received which does not match any known method.
9850    #[non_exhaustive]
9851    _UnknownMethod {
9852        /// Ordinal of the method that was called.
9853        ordinal: u64,
9854        control_handle: DirectoryRouterControlHandle,
9855        method_type: fidl::MethodType,
9856    },
9857}
9858
9859impl DirectoryRouterRequest {
9860    #[allow(irrefutable_let_patterns)]
9861    pub fn into_route(self) -> Option<(RouteRequest, DirectoryRouterRouteResponder)> {
9862        if let DirectoryRouterRequest::Route { payload, responder } = self {
9863            Some((payload, responder))
9864        } else {
9865            None
9866        }
9867    }
9868
9869    /// Name of the method defined in FIDL
9870    pub fn method_name(&self) -> &'static str {
9871        match *self {
9872            DirectoryRouterRequest::Route { .. } => "route",
9873            DirectoryRouterRequest::_UnknownMethod {
9874                method_type: fidl::MethodType::OneWay,
9875                ..
9876            } => "unknown one-way method",
9877            DirectoryRouterRequest::_UnknownMethod {
9878                method_type: fidl::MethodType::TwoWay,
9879                ..
9880            } => "unknown two-way method",
9881        }
9882    }
9883}
9884
9885#[derive(Debug, Clone)]
9886pub struct DirectoryRouterControlHandle {
9887    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9888}
9889
9890impl fidl::endpoints::ControlHandle for DirectoryRouterControlHandle {
9891    fn shutdown(&self) {
9892        self.inner.shutdown()
9893    }
9894    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
9895        self.inner.shutdown_with_epitaph(status)
9896    }
9897
9898    fn is_closed(&self) -> bool {
9899        self.inner.channel().is_closed()
9900    }
9901    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
9902        self.inner.channel().on_closed()
9903    }
9904
9905    #[cfg(target_os = "fuchsia")]
9906    fn signal_peer(
9907        &self,
9908        clear_mask: zx::Signals,
9909        set_mask: zx::Signals,
9910    ) -> Result<(), zx_status::Status> {
9911        use fidl::Peered;
9912        self.inner.channel().signal_peer(clear_mask, set_mask)
9913    }
9914}
9915
9916impl DirectoryRouterControlHandle {}
9917
9918#[must_use = "FIDL methods require a response to be sent"]
9919#[derive(Debug)]
9920pub struct DirectoryRouterRouteResponder {
9921    control_handle: std::mem::ManuallyDrop<DirectoryRouterControlHandle>,
9922    tx_id: u32,
9923}
9924
9925/// Set the the channel to be shutdown (see [`DirectoryRouterControlHandle::shutdown`])
9926/// if the responder is dropped without sending a response, so that the client
9927/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9928impl std::ops::Drop for DirectoryRouterRouteResponder {
9929    fn drop(&mut self) {
9930        self.control_handle.shutdown();
9931        // Safety: drops once, never accessed again
9932        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9933    }
9934}
9935
9936impl fidl::endpoints::Responder for DirectoryRouterRouteResponder {
9937    type ControlHandle = DirectoryRouterControlHandle;
9938
9939    fn control_handle(&self) -> &DirectoryRouterControlHandle {
9940        &self.control_handle
9941    }
9942
9943    fn drop_without_shutdown(mut self) {
9944        // Safety: drops once, never accessed again due to mem::forget
9945        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9946        // Prevent Drop from running (which would shut down the channel)
9947        std::mem::forget(self);
9948    }
9949}
9950
9951impl DirectoryRouterRouteResponder {
9952    /// Sends a response to the FIDL transaction.
9953    ///
9954    /// Sets the channel to shutdown if an error occurs.
9955    pub fn send(
9956        self,
9957        mut result: Result<DirectoryRouterRouteResponse, RouterError>,
9958    ) -> Result<(), fidl::Error> {
9959        let _result = self.send_raw(result);
9960        if _result.is_err() {
9961            self.control_handle.shutdown();
9962        }
9963        self.drop_without_shutdown();
9964        _result
9965    }
9966
9967    /// Similar to "send" but does not shutdown the channel if an error occurs.
9968    pub fn send_no_shutdown_on_err(
9969        self,
9970        mut result: Result<DirectoryRouterRouteResponse, RouterError>,
9971    ) -> Result<(), fidl::Error> {
9972        let _result = self.send_raw(result);
9973        self.drop_without_shutdown();
9974        _result
9975    }
9976
9977    fn send_raw(
9978        &self,
9979        mut result: Result<DirectoryRouterRouteResponse, RouterError>,
9980    ) -> Result<(), fidl::Error> {
9981        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
9982            DirectoryRouterRouteResponse,
9983            RouterError,
9984        >>(
9985            fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
9986            self.tx_id,
9987            0x683b6c6be21b0f21,
9988            fidl::encoding::DynamicFlags::FLEXIBLE,
9989        )
9990    }
9991}
9992
9993#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
9994pub struct ReceiverMarker;
9995
9996impl fidl::endpoints::ProtocolMarker for ReceiverMarker {
9997    type Proxy = ReceiverProxy;
9998    type RequestStream = ReceiverRequestStream;
9999    #[cfg(target_os = "fuchsia")]
10000    type SynchronousProxy = ReceiverSynchronousProxy;
10001
10002    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.Receiver";
10003}
10004impl fidl::endpoints::DiscoverableProtocolMarker for ReceiverMarker {}
10005
10006pub trait ReceiverProxyInterface: Send + Sync {
10007    fn r#receive(&self, channel: fidl::Channel) -> Result<(), fidl::Error>;
10008}
10009#[derive(Debug)]
10010#[cfg(target_os = "fuchsia")]
10011pub struct ReceiverSynchronousProxy {
10012    client: fidl::client::sync::Client,
10013}
10014
10015#[cfg(target_os = "fuchsia")]
10016impl fidl::endpoints::SynchronousProxy for ReceiverSynchronousProxy {
10017    type Proxy = ReceiverProxy;
10018    type Protocol = ReceiverMarker;
10019
10020    fn from_channel(inner: fidl::Channel) -> Self {
10021        Self::new(inner)
10022    }
10023
10024    fn into_channel(self) -> fidl::Channel {
10025        self.client.into_channel()
10026    }
10027
10028    fn as_channel(&self) -> &fidl::Channel {
10029        self.client.as_channel()
10030    }
10031}
10032
10033#[cfg(target_os = "fuchsia")]
10034impl ReceiverSynchronousProxy {
10035    pub fn new(channel: fidl::Channel) -> Self {
10036        let protocol_name = <ReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
10037        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
10038    }
10039
10040    pub fn into_channel(self) -> fidl::Channel {
10041        self.client.into_channel()
10042    }
10043
10044    /// Waits until an event arrives and returns it. It is safe for other
10045    /// threads to make concurrent requests while waiting for an event.
10046    pub fn wait_for_event(
10047        &self,
10048        deadline: zx::MonotonicInstant,
10049    ) -> Result<ReceiverEvent, fidl::Error> {
10050        ReceiverEvent::decode(self.client.wait_for_event(deadline)?)
10051    }
10052
10053    /// Sends a channel to this receiver.
10054    pub fn r#receive(&self, mut channel: fidl::Channel) -> Result<(), fidl::Error> {
10055        self.client.send::<ProtocolPayload>(
10056            (channel,),
10057            0x4bae18ab7aa1a94,
10058            fidl::encoding::DynamicFlags::FLEXIBLE,
10059        )
10060    }
10061}
10062
10063#[cfg(target_os = "fuchsia")]
10064impl From<ReceiverSynchronousProxy> for zx::Handle {
10065    fn from(value: ReceiverSynchronousProxy) -> Self {
10066        value.into_channel().into()
10067    }
10068}
10069
10070#[cfg(target_os = "fuchsia")]
10071impl From<fidl::Channel> for ReceiverSynchronousProxy {
10072    fn from(value: fidl::Channel) -> Self {
10073        Self::new(value)
10074    }
10075}
10076
10077#[cfg(target_os = "fuchsia")]
10078impl fidl::endpoints::FromClient for ReceiverSynchronousProxy {
10079    type Protocol = ReceiverMarker;
10080
10081    fn from_client(value: fidl::endpoints::ClientEnd<ReceiverMarker>) -> Self {
10082        Self::new(value.into_channel())
10083    }
10084}
10085
10086#[derive(Debug, Clone)]
10087pub struct ReceiverProxy {
10088    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
10089}
10090
10091impl fidl::endpoints::Proxy for ReceiverProxy {
10092    type Protocol = ReceiverMarker;
10093
10094    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
10095        Self::new(inner)
10096    }
10097
10098    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
10099        self.client.into_channel().map_err(|client| Self { client })
10100    }
10101
10102    fn as_channel(&self) -> &::fidl::AsyncChannel {
10103        self.client.as_channel()
10104    }
10105}
10106
10107impl ReceiverProxy {
10108    /// Create a new Proxy for fuchsia.component.sandbox/Receiver.
10109    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
10110        let protocol_name = <ReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
10111        Self { client: fidl::client::Client::new(channel, protocol_name) }
10112    }
10113
10114    /// Get a Stream of events from the remote end of the protocol.
10115    ///
10116    /// # Panics
10117    ///
10118    /// Panics if the event stream was already taken.
10119    pub fn take_event_stream(&self) -> ReceiverEventStream {
10120        ReceiverEventStream { event_receiver: self.client.take_event_receiver() }
10121    }
10122
10123    /// Sends a channel to this receiver.
10124    pub fn r#receive(&self, mut channel: fidl::Channel) -> Result<(), fidl::Error> {
10125        ReceiverProxyInterface::r#receive(self, channel)
10126    }
10127}
10128
10129impl ReceiverProxyInterface for ReceiverProxy {
10130    fn r#receive(&self, mut channel: fidl::Channel) -> Result<(), fidl::Error> {
10131        self.client.send::<ProtocolPayload>(
10132            (channel,),
10133            0x4bae18ab7aa1a94,
10134            fidl::encoding::DynamicFlags::FLEXIBLE,
10135        )
10136    }
10137}
10138
10139pub struct ReceiverEventStream {
10140    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
10141}
10142
10143impl std::marker::Unpin for ReceiverEventStream {}
10144
10145impl futures::stream::FusedStream for ReceiverEventStream {
10146    fn is_terminated(&self) -> bool {
10147        self.event_receiver.is_terminated()
10148    }
10149}
10150
10151impl futures::Stream for ReceiverEventStream {
10152    type Item = Result<ReceiverEvent, fidl::Error>;
10153
10154    fn poll_next(
10155        mut self: std::pin::Pin<&mut Self>,
10156        cx: &mut std::task::Context<'_>,
10157    ) -> std::task::Poll<Option<Self::Item>> {
10158        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
10159            &mut self.event_receiver,
10160            cx
10161        )?) {
10162            Some(buf) => std::task::Poll::Ready(Some(ReceiverEvent::decode(buf))),
10163            None => std::task::Poll::Ready(None),
10164        }
10165    }
10166}
10167
10168#[derive(Debug)]
10169pub enum ReceiverEvent {
10170    #[non_exhaustive]
10171    _UnknownEvent {
10172        /// Ordinal of the event that was sent.
10173        ordinal: u64,
10174    },
10175}
10176
10177impl ReceiverEvent {
10178    /// Decodes a message buffer as a [`ReceiverEvent`].
10179    fn decode(
10180        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
10181    ) -> Result<ReceiverEvent, fidl::Error> {
10182        let (bytes, _handles) = buf.split_mut();
10183        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
10184        debug_assert_eq!(tx_header.tx_id, 0);
10185        match tx_header.ordinal {
10186            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
10187                Ok(ReceiverEvent::_UnknownEvent { ordinal: tx_header.ordinal })
10188            }
10189            _ => Err(fidl::Error::UnknownOrdinal {
10190                ordinal: tx_header.ordinal,
10191                protocol_name: <ReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
10192            }),
10193        }
10194    }
10195}
10196
10197/// A Stream of incoming requests for fuchsia.component.sandbox/Receiver.
10198pub struct ReceiverRequestStream {
10199    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10200    is_terminated: bool,
10201}
10202
10203impl std::marker::Unpin for ReceiverRequestStream {}
10204
10205impl futures::stream::FusedStream for ReceiverRequestStream {
10206    fn is_terminated(&self) -> bool {
10207        self.is_terminated
10208    }
10209}
10210
10211impl fidl::endpoints::RequestStream for ReceiverRequestStream {
10212    type Protocol = ReceiverMarker;
10213    type ControlHandle = ReceiverControlHandle;
10214
10215    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
10216        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
10217    }
10218
10219    fn control_handle(&self) -> Self::ControlHandle {
10220        ReceiverControlHandle { inner: self.inner.clone() }
10221    }
10222
10223    fn into_inner(
10224        self,
10225    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
10226    {
10227        (self.inner, self.is_terminated)
10228    }
10229
10230    fn from_inner(
10231        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10232        is_terminated: bool,
10233    ) -> Self {
10234        Self { inner, is_terminated }
10235    }
10236}
10237
10238impl futures::Stream for ReceiverRequestStream {
10239    type Item = Result<ReceiverRequest, fidl::Error>;
10240
10241    fn poll_next(
10242        mut self: std::pin::Pin<&mut Self>,
10243        cx: &mut std::task::Context<'_>,
10244    ) -> std::task::Poll<Option<Self::Item>> {
10245        let this = &mut *self;
10246        if this.inner.check_shutdown(cx) {
10247            this.is_terminated = true;
10248            return std::task::Poll::Ready(None);
10249        }
10250        if this.is_terminated {
10251            panic!("polled ReceiverRequestStream after completion");
10252        }
10253        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
10254            |bytes, handles| {
10255                match this.inner.channel().read_etc(cx, bytes, handles) {
10256                    std::task::Poll::Ready(Ok(())) => {}
10257                    std::task::Poll::Pending => return std::task::Poll::Pending,
10258                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
10259                        this.is_terminated = true;
10260                        return std::task::Poll::Ready(None);
10261                    }
10262                    std::task::Poll::Ready(Err(e)) => {
10263                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
10264                            e.into(),
10265                        ))))
10266                    }
10267                }
10268
10269                // A message has been received from the channel
10270                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
10271
10272                std::task::Poll::Ready(Some(match header.ordinal {
10273                    0x4bae18ab7aa1a94 => {
10274                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
10275                        let mut req = fidl::new_empty!(
10276                            ProtocolPayload,
10277                            fidl::encoding::DefaultFuchsiaResourceDialect
10278                        );
10279                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ProtocolPayload>(&header, _body_bytes, handles, &mut req)?;
10280                        let control_handle = ReceiverControlHandle { inner: this.inner.clone() };
10281                        Ok(ReceiverRequest::Receive { channel: req.channel, control_handle })
10282                    }
10283                    _ if header.tx_id == 0
10284                        && header
10285                            .dynamic_flags()
10286                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
10287                    {
10288                        Ok(ReceiverRequest::_UnknownMethod {
10289                            ordinal: header.ordinal,
10290                            control_handle: ReceiverControlHandle { inner: this.inner.clone() },
10291                            method_type: fidl::MethodType::OneWay,
10292                        })
10293                    }
10294                    _ if header
10295                        .dynamic_flags()
10296                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
10297                    {
10298                        this.inner.send_framework_err(
10299                            fidl::encoding::FrameworkErr::UnknownMethod,
10300                            header.tx_id,
10301                            header.ordinal,
10302                            header.dynamic_flags(),
10303                            (bytes, handles),
10304                        )?;
10305                        Ok(ReceiverRequest::_UnknownMethod {
10306                            ordinal: header.ordinal,
10307                            control_handle: ReceiverControlHandle { inner: this.inner.clone() },
10308                            method_type: fidl::MethodType::TwoWay,
10309                        })
10310                    }
10311                    _ => Err(fidl::Error::UnknownOrdinal {
10312                        ordinal: header.ordinal,
10313                        protocol_name:
10314                            <ReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
10315                    }),
10316                }))
10317            },
10318        )
10319    }
10320}
10321
10322/// A receiver is served by components and allows them to receive channels
10323/// from the framework.
10324#[derive(Debug)]
10325pub enum ReceiverRequest {
10326    /// Sends a channel to this receiver.
10327    Receive { channel: fidl::Channel, control_handle: ReceiverControlHandle },
10328    /// An interaction was received which does not match any known method.
10329    #[non_exhaustive]
10330    _UnknownMethod {
10331        /// Ordinal of the method that was called.
10332        ordinal: u64,
10333        control_handle: ReceiverControlHandle,
10334        method_type: fidl::MethodType,
10335    },
10336}
10337
10338impl ReceiverRequest {
10339    #[allow(irrefutable_let_patterns)]
10340    pub fn into_receive(self) -> Option<(fidl::Channel, ReceiverControlHandle)> {
10341        if let ReceiverRequest::Receive { channel, control_handle } = self {
10342            Some((channel, control_handle))
10343        } else {
10344            None
10345        }
10346    }
10347
10348    /// Name of the method defined in FIDL
10349    pub fn method_name(&self) -> &'static str {
10350        match *self {
10351            ReceiverRequest::Receive { .. } => "receive",
10352            ReceiverRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
10353                "unknown one-way method"
10354            }
10355            ReceiverRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
10356                "unknown two-way method"
10357            }
10358        }
10359    }
10360}
10361
10362#[derive(Debug, Clone)]
10363pub struct ReceiverControlHandle {
10364    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10365}
10366
10367impl fidl::endpoints::ControlHandle for ReceiverControlHandle {
10368    fn shutdown(&self) {
10369        self.inner.shutdown()
10370    }
10371    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
10372        self.inner.shutdown_with_epitaph(status)
10373    }
10374
10375    fn is_closed(&self) -> bool {
10376        self.inner.channel().is_closed()
10377    }
10378    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
10379        self.inner.channel().on_closed()
10380    }
10381
10382    #[cfg(target_os = "fuchsia")]
10383    fn signal_peer(
10384        &self,
10385        clear_mask: zx::Signals,
10386        set_mask: zx::Signals,
10387    ) -> Result<(), zx_status::Status> {
10388        use fidl::Peered;
10389        self.inner.channel().signal_peer(clear_mask, set_mask)
10390    }
10391}
10392
10393impl ReceiverControlHandle {}
10394
10395mod internal {
10396    use super::*;
10397
10398    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreConnectorCreateRequest {
10399        type Borrowed<'a> = &'a mut Self;
10400        fn take_or_borrow<'a>(
10401            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10402        ) -> Self::Borrowed<'a> {
10403            value
10404        }
10405    }
10406
10407    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreConnectorCreateRequest {
10408        type Owned = Self;
10409
10410        #[inline(always)]
10411        fn inline_align(_context: fidl::encoding::Context) -> usize {
10412            8
10413        }
10414
10415        #[inline(always)]
10416        fn inline_size(_context: fidl::encoding::Context) -> usize {
10417            16
10418        }
10419    }
10420
10421    unsafe impl
10422        fidl::encoding::Encode<
10423            CapabilityStoreConnectorCreateRequest,
10424            fidl::encoding::DefaultFuchsiaResourceDialect,
10425        > for &mut CapabilityStoreConnectorCreateRequest
10426    {
10427        #[inline]
10428        unsafe fn encode(
10429            self,
10430            encoder: &mut fidl::encoding::Encoder<
10431                '_,
10432                fidl::encoding::DefaultFuchsiaResourceDialect,
10433            >,
10434            offset: usize,
10435            _depth: fidl::encoding::Depth,
10436        ) -> fidl::Result<()> {
10437            encoder.debug_check_bounds::<CapabilityStoreConnectorCreateRequest>(offset);
10438            // Delegate to tuple encoding.
10439            fidl::encoding::Encode::<CapabilityStoreConnectorCreateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10440                (
10441                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
10442                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ReceiverMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.receiver),
10443                ),
10444                encoder, offset, _depth
10445            )
10446        }
10447    }
10448    unsafe impl<
10449            T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
10450            T1: fidl::encoding::Encode<
10451                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ReceiverMarker>>,
10452                fidl::encoding::DefaultFuchsiaResourceDialect,
10453            >,
10454        >
10455        fidl::encoding::Encode<
10456            CapabilityStoreConnectorCreateRequest,
10457            fidl::encoding::DefaultFuchsiaResourceDialect,
10458        > for (T0, T1)
10459    {
10460        #[inline]
10461        unsafe fn encode(
10462            self,
10463            encoder: &mut fidl::encoding::Encoder<
10464                '_,
10465                fidl::encoding::DefaultFuchsiaResourceDialect,
10466            >,
10467            offset: usize,
10468            depth: fidl::encoding::Depth,
10469        ) -> fidl::Result<()> {
10470            encoder.debug_check_bounds::<CapabilityStoreConnectorCreateRequest>(offset);
10471            // Zero out padding regions. There's no need to apply masks
10472            // because the unmasked parts will be overwritten by fields.
10473            unsafe {
10474                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
10475                (ptr as *mut u64).write_unaligned(0);
10476            }
10477            // Write the fields.
10478            self.0.encode(encoder, offset + 0, depth)?;
10479            self.1.encode(encoder, offset + 8, depth)?;
10480            Ok(())
10481        }
10482    }
10483
10484    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10485        for CapabilityStoreConnectorCreateRequest
10486    {
10487        #[inline(always)]
10488        fn new_empty() -> Self {
10489            Self {
10490                id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
10491                receiver: fidl::new_empty!(
10492                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ReceiverMarker>>,
10493                    fidl::encoding::DefaultFuchsiaResourceDialect
10494                ),
10495            }
10496        }
10497
10498        #[inline]
10499        unsafe fn decode(
10500            &mut self,
10501            decoder: &mut fidl::encoding::Decoder<
10502                '_,
10503                fidl::encoding::DefaultFuchsiaResourceDialect,
10504            >,
10505            offset: usize,
10506            _depth: fidl::encoding::Depth,
10507        ) -> fidl::Result<()> {
10508            decoder.debug_check_bounds::<Self>(offset);
10509            // Verify that padding bytes are zero.
10510            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
10511            let padval = unsafe { (ptr as *const u64).read_unaligned() };
10512            let mask = 0xffffffff00000000u64;
10513            let maskedval = padval & mask;
10514            if maskedval != 0 {
10515                return Err(fidl::Error::NonZeroPadding {
10516                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
10517                });
10518            }
10519            fidl::decode!(
10520                u64,
10521                fidl::encoding::DefaultFuchsiaResourceDialect,
10522                &mut self.id,
10523                decoder,
10524                offset + 0,
10525                _depth
10526            )?;
10527            fidl::decode!(
10528                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ReceiverMarker>>,
10529                fidl::encoding::DefaultFuchsiaResourceDialect,
10530                &mut self.receiver,
10531                decoder,
10532                offset + 8,
10533                _depth
10534            )?;
10535            Ok(())
10536        }
10537    }
10538
10539    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreConnectorOpenRequest {
10540        type Borrowed<'a> = &'a mut Self;
10541        fn take_or_borrow<'a>(
10542            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10543        ) -> Self::Borrowed<'a> {
10544            value
10545        }
10546    }
10547
10548    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreConnectorOpenRequest {
10549        type Owned = Self;
10550
10551        #[inline(always)]
10552        fn inline_align(_context: fidl::encoding::Context) -> usize {
10553            8
10554        }
10555
10556        #[inline(always)]
10557        fn inline_size(_context: fidl::encoding::Context) -> usize {
10558            16
10559        }
10560    }
10561
10562    unsafe impl
10563        fidl::encoding::Encode<
10564            CapabilityStoreConnectorOpenRequest,
10565            fidl::encoding::DefaultFuchsiaResourceDialect,
10566        > for &mut CapabilityStoreConnectorOpenRequest
10567    {
10568        #[inline]
10569        unsafe fn encode(
10570            self,
10571            encoder: &mut fidl::encoding::Encoder<
10572                '_,
10573                fidl::encoding::DefaultFuchsiaResourceDialect,
10574            >,
10575            offset: usize,
10576            _depth: fidl::encoding::Depth,
10577        ) -> fidl::Result<()> {
10578            encoder.debug_check_bounds::<CapabilityStoreConnectorOpenRequest>(offset);
10579            // Delegate to tuple encoding.
10580            fidl::encoding::Encode::<
10581                CapabilityStoreConnectorOpenRequest,
10582                fidl::encoding::DefaultFuchsiaResourceDialect,
10583            >::encode(
10584                (
10585                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
10586                    <fidl::encoding::HandleType<
10587                        fidl::Channel,
10588                        { fidl::ObjectType::CHANNEL.into_raw() },
10589                        2147483648,
10590                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10591                        &mut self.server_end
10592                    ),
10593                ),
10594                encoder,
10595                offset,
10596                _depth,
10597            )
10598        }
10599    }
10600    unsafe impl<
10601            T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
10602            T1: fidl::encoding::Encode<
10603                fidl::encoding::HandleType<
10604                    fidl::Channel,
10605                    { fidl::ObjectType::CHANNEL.into_raw() },
10606                    2147483648,
10607                >,
10608                fidl::encoding::DefaultFuchsiaResourceDialect,
10609            >,
10610        >
10611        fidl::encoding::Encode<
10612            CapabilityStoreConnectorOpenRequest,
10613            fidl::encoding::DefaultFuchsiaResourceDialect,
10614        > for (T0, T1)
10615    {
10616        #[inline]
10617        unsafe fn encode(
10618            self,
10619            encoder: &mut fidl::encoding::Encoder<
10620                '_,
10621                fidl::encoding::DefaultFuchsiaResourceDialect,
10622            >,
10623            offset: usize,
10624            depth: fidl::encoding::Depth,
10625        ) -> fidl::Result<()> {
10626            encoder.debug_check_bounds::<CapabilityStoreConnectorOpenRequest>(offset);
10627            // Zero out padding regions. There's no need to apply masks
10628            // because the unmasked parts will be overwritten by fields.
10629            unsafe {
10630                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
10631                (ptr as *mut u64).write_unaligned(0);
10632            }
10633            // Write the fields.
10634            self.0.encode(encoder, offset + 0, depth)?;
10635            self.1.encode(encoder, offset + 8, depth)?;
10636            Ok(())
10637        }
10638    }
10639
10640    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10641        for CapabilityStoreConnectorOpenRequest
10642    {
10643        #[inline(always)]
10644        fn new_empty() -> Self {
10645            Self {
10646                id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
10647                server_end: fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
10648            }
10649        }
10650
10651        #[inline]
10652        unsafe fn decode(
10653            &mut self,
10654            decoder: &mut fidl::encoding::Decoder<
10655                '_,
10656                fidl::encoding::DefaultFuchsiaResourceDialect,
10657            >,
10658            offset: usize,
10659            _depth: fidl::encoding::Depth,
10660        ) -> fidl::Result<()> {
10661            decoder.debug_check_bounds::<Self>(offset);
10662            // Verify that padding bytes are zero.
10663            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
10664            let padval = unsafe { (ptr as *const u64).read_unaligned() };
10665            let mask = 0xffffffff00000000u64;
10666            let maskedval = padval & mask;
10667            if maskedval != 0 {
10668                return Err(fidl::Error::NonZeroPadding {
10669                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
10670                });
10671            }
10672            fidl::decode!(
10673                u64,
10674                fidl::encoding::DefaultFuchsiaResourceDialect,
10675                &mut self.id,
10676                decoder,
10677                offset + 0,
10678                _depth
10679            )?;
10680            fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.server_end, decoder, offset + 8, _depth)?;
10681            Ok(())
10682        }
10683    }
10684
10685    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDictionaryDrainRequest {
10686        type Borrowed<'a> = &'a mut Self;
10687        fn take_or_borrow<'a>(
10688            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10689        ) -> Self::Borrowed<'a> {
10690            value
10691        }
10692    }
10693
10694    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDictionaryDrainRequest {
10695        type Owned = Self;
10696
10697        #[inline(always)]
10698        fn inline_align(_context: fidl::encoding::Context) -> usize {
10699            8
10700        }
10701
10702        #[inline(always)]
10703        fn inline_size(_context: fidl::encoding::Context) -> usize {
10704            16
10705        }
10706    }
10707
10708    unsafe impl
10709        fidl::encoding::Encode<
10710            CapabilityStoreDictionaryDrainRequest,
10711            fidl::encoding::DefaultFuchsiaResourceDialect,
10712        > for &mut CapabilityStoreDictionaryDrainRequest
10713    {
10714        #[inline]
10715        unsafe fn encode(
10716            self,
10717            encoder: &mut fidl::encoding::Encoder<
10718                '_,
10719                fidl::encoding::DefaultFuchsiaResourceDialect,
10720            >,
10721            offset: usize,
10722            _depth: fidl::encoding::Depth,
10723        ) -> fidl::Result<()> {
10724            encoder.debug_check_bounds::<CapabilityStoreDictionaryDrainRequest>(offset);
10725            // Delegate to tuple encoding.
10726            fidl::encoding::Encode::<
10727                CapabilityStoreDictionaryDrainRequest,
10728                fidl::encoding::DefaultFuchsiaResourceDialect,
10729            >::encode(
10730                (
10731                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
10732                    <fidl::encoding::Optional<
10733                        fidl::encoding::Endpoint<
10734                            fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>,
10735                        >,
10736                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10737                        &mut self.iterator
10738                    ),
10739                ),
10740                encoder,
10741                offset,
10742                _depth,
10743            )
10744        }
10745    }
10746    unsafe impl<
10747            T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
10748            T1: fidl::encoding::Encode<
10749                fidl::encoding::Optional<
10750                    fidl::encoding::Endpoint<
10751                        fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>,
10752                    >,
10753                >,
10754                fidl::encoding::DefaultFuchsiaResourceDialect,
10755            >,
10756        >
10757        fidl::encoding::Encode<
10758            CapabilityStoreDictionaryDrainRequest,
10759            fidl::encoding::DefaultFuchsiaResourceDialect,
10760        > for (T0, T1)
10761    {
10762        #[inline]
10763        unsafe fn encode(
10764            self,
10765            encoder: &mut fidl::encoding::Encoder<
10766                '_,
10767                fidl::encoding::DefaultFuchsiaResourceDialect,
10768            >,
10769            offset: usize,
10770            depth: fidl::encoding::Depth,
10771        ) -> fidl::Result<()> {
10772            encoder.debug_check_bounds::<CapabilityStoreDictionaryDrainRequest>(offset);
10773            // Zero out padding regions. There's no need to apply masks
10774            // because the unmasked parts will be overwritten by fields.
10775            unsafe {
10776                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
10777                (ptr as *mut u64).write_unaligned(0);
10778            }
10779            // Write the fields.
10780            self.0.encode(encoder, offset + 0, depth)?;
10781            self.1.encode(encoder, offset + 8, depth)?;
10782            Ok(())
10783        }
10784    }
10785
10786    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10787        for CapabilityStoreDictionaryDrainRequest
10788    {
10789        #[inline(always)]
10790        fn new_empty() -> Self {
10791            Self {
10792                id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
10793                iterator: fidl::new_empty!(
10794                    fidl::encoding::Optional<
10795                        fidl::encoding::Endpoint<
10796                            fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>,
10797                        >,
10798                    >,
10799                    fidl::encoding::DefaultFuchsiaResourceDialect
10800                ),
10801            }
10802        }
10803
10804        #[inline]
10805        unsafe fn decode(
10806            &mut self,
10807            decoder: &mut fidl::encoding::Decoder<
10808                '_,
10809                fidl::encoding::DefaultFuchsiaResourceDialect,
10810            >,
10811            offset: usize,
10812            _depth: fidl::encoding::Depth,
10813        ) -> fidl::Result<()> {
10814            decoder.debug_check_bounds::<Self>(offset);
10815            // Verify that padding bytes are zero.
10816            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
10817            let padval = unsafe { (ptr as *const u64).read_unaligned() };
10818            let mask = 0xffffffff00000000u64;
10819            let maskedval = padval & mask;
10820            if maskedval != 0 {
10821                return Err(fidl::Error::NonZeroPadding {
10822                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
10823                });
10824            }
10825            fidl::decode!(
10826                u64,
10827                fidl::encoding::DefaultFuchsiaResourceDialect,
10828                &mut self.id,
10829                decoder,
10830                offset + 0,
10831                _depth
10832            )?;
10833            fidl::decode!(
10834                fidl::encoding::Optional<
10835                    fidl::encoding::Endpoint<
10836                        fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>,
10837                    >,
10838                >,
10839                fidl::encoding::DefaultFuchsiaResourceDialect,
10840                &mut self.iterator,
10841                decoder,
10842                offset + 8,
10843                _depth
10844            )?;
10845            Ok(())
10846        }
10847    }
10848
10849    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDictionaryEnumerateRequest {
10850        type Borrowed<'a> = &'a mut Self;
10851        fn take_or_borrow<'a>(
10852            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10853        ) -> Self::Borrowed<'a> {
10854            value
10855        }
10856    }
10857
10858    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDictionaryEnumerateRequest {
10859        type Owned = Self;
10860
10861        #[inline(always)]
10862        fn inline_align(_context: fidl::encoding::Context) -> usize {
10863            8
10864        }
10865
10866        #[inline(always)]
10867        fn inline_size(_context: fidl::encoding::Context) -> usize {
10868            16
10869        }
10870    }
10871
10872    unsafe impl
10873        fidl::encoding::Encode<
10874            CapabilityStoreDictionaryEnumerateRequest,
10875            fidl::encoding::DefaultFuchsiaResourceDialect,
10876        > for &mut CapabilityStoreDictionaryEnumerateRequest
10877    {
10878        #[inline]
10879        unsafe fn encode(
10880            self,
10881            encoder: &mut fidl::encoding::Encoder<
10882                '_,
10883                fidl::encoding::DefaultFuchsiaResourceDialect,
10884            >,
10885            offset: usize,
10886            _depth: fidl::encoding::Depth,
10887        ) -> fidl::Result<()> {
10888            encoder.debug_check_bounds::<CapabilityStoreDictionaryEnumerateRequest>(offset);
10889            // Delegate to tuple encoding.
10890            fidl::encoding::Encode::<
10891                CapabilityStoreDictionaryEnumerateRequest,
10892                fidl::encoding::DefaultFuchsiaResourceDialect,
10893            >::encode(
10894                (
10895                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
10896                    <fidl::encoding::Endpoint<
10897                        fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
10898                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10899                        &mut self.iterator
10900                    ),
10901                ),
10902                encoder,
10903                offset,
10904                _depth,
10905            )
10906        }
10907    }
10908    unsafe impl<
10909            T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
10910            T1: fidl::encoding::Encode<
10911                fidl::encoding::Endpoint<
10912                    fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
10913                >,
10914                fidl::encoding::DefaultFuchsiaResourceDialect,
10915            >,
10916        >
10917        fidl::encoding::Encode<
10918            CapabilityStoreDictionaryEnumerateRequest,
10919            fidl::encoding::DefaultFuchsiaResourceDialect,
10920        > for (T0, T1)
10921    {
10922        #[inline]
10923        unsafe fn encode(
10924            self,
10925            encoder: &mut fidl::encoding::Encoder<
10926                '_,
10927                fidl::encoding::DefaultFuchsiaResourceDialect,
10928            >,
10929            offset: usize,
10930            depth: fidl::encoding::Depth,
10931        ) -> fidl::Result<()> {
10932            encoder.debug_check_bounds::<CapabilityStoreDictionaryEnumerateRequest>(offset);
10933            // Zero out padding regions. There's no need to apply masks
10934            // because the unmasked parts will be overwritten by fields.
10935            unsafe {
10936                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
10937                (ptr as *mut u64).write_unaligned(0);
10938            }
10939            // Write the fields.
10940            self.0.encode(encoder, offset + 0, depth)?;
10941            self.1.encode(encoder, offset + 8, depth)?;
10942            Ok(())
10943        }
10944    }
10945
10946    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10947        for CapabilityStoreDictionaryEnumerateRequest
10948    {
10949        #[inline(always)]
10950        fn new_empty() -> Self {
10951            Self {
10952                id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
10953                iterator: fidl::new_empty!(
10954                    fidl::encoding::Endpoint<
10955                        fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
10956                    >,
10957                    fidl::encoding::DefaultFuchsiaResourceDialect
10958                ),
10959            }
10960        }
10961
10962        #[inline]
10963        unsafe fn decode(
10964            &mut self,
10965            decoder: &mut fidl::encoding::Decoder<
10966                '_,
10967                fidl::encoding::DefaultFuchsiaResourceDialect,
10968            >,
10969            offset: usize,
10970            _depth: fidl::encoding::Depth,
10971        ) -> fidl::Result<()> {
10972            decoder.debug_check_bounds::<Self>(offset);
10973            // Verify that padding bytes are zero.
10974            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
10975            let padval = unsafe { (ptr as *const u64).read_unaligned() };
10976            let mask = 0xffffffff00000000u64;
10977            let maskedval = padval & mask;
10978            if maskedval != 0 {
10979                return Err(fidl::Error::NonZeroPadding {
10980                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
10981                });
10982            }
10983            fidl::decode!(
10984                u64,
10985                fidl::encoding::DefaultFuchsiaResourceDialect,
10986                &mut self.id,
10987                decoder,
10988                offset + 0,
10989                _depth
10990            )?;
10991            fidl::decode!(
10992                fidl::encoding::Endpoint<
10993                    fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
10994                >,
10995                fidl::encoding::DefaultFuchsiaResourceDialect,
10996                &mut self.iterator,
10997                decoder,
10998                offset + 8,
10999                _depth
11000            )?;
11001            Ok(())
11002        }
11003    }
11004
11005    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDictionaryKeysRequest {
11006        type Borrowed<'a> = &'a mut Self;
11007        fn take_or_borrow<'a>(
11008            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11009        ) -> Self::Borrowed<'a> {
11010            value
11011        }
11012    }
11013
11014    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDictionaryKeysRequest {
11015        type Owned = Self;
11016
11017        #[inline(always)]
11018        fn inline_align(_context: fidl::encoding::Context) -> usize {
11019            8
11020        }
11021
11022        #[inline(always)]
11023        fn inline_size(_context: fidl::encoding::Context) -> usize {
11024            16
11025        }
11026    }
11027
11028    unsafe impl
11029        fidl::encoding::Encode<
11030            CapabilityStoreDictionaryKeysRequest,
11031            fidl::encoding::DefaultFuchsiaResourceDialect,
11032        > for &mut CapabilityStoreDictionaryKeysRequest
11033    {
11034        #[inline]
11035        unsafe fn encode(
11036            self,
11037            encoder: &mut fidl::encoding::Encoder<
11038                '_,
11039                fidl::encoding::DefaultFuchsiaResourceDialect,
11040            >,
11041            offset: usize,
11042            _depth: fidl::encoding::Depth,
11043        ) -> fidl::Result<()> {
11044            encoder.debug_check_bounds::<CapabilityStoreDictionaryKeysRequest>(offset);
11045            // Delegate to tuple encoding.
11046            fidl::encoding::Encode::<
11047                CapabilityStoreDictionaryKeysRequest,
11048                fidl::encoding::DefaultFuchsiaResourceDialect,
11049            >::encode(
11050                (
11051                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
11052                    <fidl::encoding::Endpoint<
11053                        fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>,
11054                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11055                        &mut self.iterator
11056                    ),
11057                ),
11058                encoder,
11059                offset,
11060                _depth,
11061            )
11062        }
11063    }
11064    unsafe impl<
11065            T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
11066            T1: fidl::encoding::Encode<
11067                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>>,
11068                fidl::encoding::DefaultFuchsiaResourceDialect,
11069            >,
11070        >
11071        fidl::encoding::Encode<
11072            CapabilityStoreDictionaryKeysRequest,
11073            fidl::encoding::DefaultFuchsiaResourceDialect,
11074        > for (T0, T1)
11075    {
11076        #[inline]
11077        unsafe fn encode(
11078            self,
11079            encoder: &mut fidl::encoding::Encoder<
11080                '_,
11081                fidl::encoding::DefaultFuchsiaResourceDialect,
11082            >,
11083            offset: usize,
11084            depth: fidl::encoding::Depth,
11085        ) -> fidl::Result<()> {
11086            encoder.debug_check_bounds::<CapabilityStoreDictionaryKeysRequest>(offset);
11087            // Zero out padding regions. There's no need to apply masks
11088            // because the unmasked parts will be overwritten by fields.
11089            unsafe {
11090                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
11091                (ptr as *mut u64).write_unaligned(0);
11092            }
11093            // Write the fields.
11094            self.0.encode(encoder, offset + 0, depth)?;
11095            self.1.encode(encoder, offset + 8, depth)?;
11096            Ok(())
11097        }
11098    }
11099
11100    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11101        for CapabilityStoreDictionaryKeysRequest
11102    {
11103        #[inline(always)]
11104        fn new_empty() -> Self {
11105            Self {
11106                id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
11107                iterator: fidl::new_empty!(
11108                    fidl::encoding::Endpoint<
11109                        fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>,
11110                    >,
11111                    fidl::encoding::DefaultFuchsiaResourceDialect
11112                ),
11113            }
11114        }
11115
11116        #[inline]
11117        unsafe fn decode(
11118            &mut self,
11119            decoder: &mut fidl::encoding::Decoder<
11120                '_,
11121                fidl::encoding::DefaultFuchsiaResourceDialect,
11122            >,
11123            offset: usize,
11124            _depth: fidl::encoding::Depth,
11125        ) -> fidl::Result<()> {
11126            decoder.debug_check_bounds::<Self>(offset);
11127            // Verify that padding bytes are zero.
11128            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
11129            let padval = unsafe { (ptr as *const u64).read_unaligned() };
11130            let mask = 0xffffffff00000000u64;
11131            let maskedval = padval & mask;
11132            if maskedval != 0 {
11133                return Err(fidl::Error::NonZeroPadding {
11134                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
11135                });
11136            }
11137            fidl::decode!(
11138                u64,
11139                fidl::encoding::DefaultFuchsiaResourceDialect,
11140                &mut self.id,
11141                decoder,
11142                offset + 0,
11143                _depth
11144            )?;
11145            fidl::decode!(
11146                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>>,
11147                fidl::encoding::DefaultFuchsiaResourceDialect,
11148                &mut self.iterator,
11149                decoder,
11150                offset + 8,
11151                _depth
11152            )?;
11153            Ok(())
11154        }
11155    }
11156
11157    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDictionaryLegacyExportRequest {
11158        type Borrowed<'a> = &'a mut Self;
11159        fn take_or_borrow<'a>(
11160            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11161        ) -> Self::Borrowed<'a> {
11162            value
11163        }
11164    }
11165
11166    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDictionaryLegacyExportRequest {
11167        type Owned = Self;
11168
11169        #[inline(always)]
11170        fn inline_align(_context: fidl::encoding::Context) -> usize {
11171            8
11172        }
11173
11174        #[inline(always)]
11175        fn inline_size(_context: fidl::encoding::Context) -> usize {
11176            16
11177        }
11178    }
11179
11180    unsafe impl
11181        fidl::encoding::Encode<
11182            CapabilityStoreDictionaryLegacyExportRequest,
11183            fidl::encoding::DefaultFuchsiaResourceDialect,
11184        > for &mut CapabilityStoreDictionaryLegacyExportRequest
11185    {
11186        #[inline]
11187        unsafe fn encode(
11188            self,
11189            encoder: &mut fidl::encoding::Encoder<
11190                '_,
11191                fidl::encoding::DefaultFuchsiaResourceDialect,
11192            >,
11193            offset: usize,
11194            _depth: fidl::encoding::Depth,
11195        ) -> fidl::Result<()> {
11196            encoder.debug_check_bounds::<CapabilityStoreDictionaryLegacyExportRequest>(offset);
11197            // Delegate to tuple encoding.
11198            fidl::encoding::Encode::<
11199                CapabilityStoreDictionaryLegacyExportRequest,
11200                fidl::encoding::DefaultFuchsiaResourceDialect,
11201            >::encode(
11202                (
11203                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
11204                    <fidl::encoding::HandleType<
11205                        fidl::Channel,
11206                        { fidl::ObjectType::CHANNEL.into_raw() },
11207                        2147483648,
11208                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11209                        &mut self.server_end
11210                    ),
11211                ),
11212                encoder,
11213                offset,
11214                _depth,
11215            )
11216        }
11217    }
11218    unsafe impl<
11219            T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
11220            T1: fidl::encoding::Encode<
11221                fidl::encoding::HandleType<
11222                    fidl::Channel,
11223                    { fidl::ObjectType::CHANNEL.into_raw() },
11224                    2147483648,
11225                >,
11226                fidl::encoding::DefaultFuchsiaResourceDialect,
11227            >,
11228        >
11229        fidl::encoding::Encode<
11230            CapabilityStoreDictionaryLegacyExportRequest,
11231            fidl::encoding::DefaultFuchsiaResourceDialect,
11232        > for (T0, T1)
11233    {
11234        #[inline]
11235        unsafe fn encode(
11236            self,
11237            encoder: &mut fidl::encoding::Encoder<
11238                '_,
11239                fidl::encoding::DefaultFuchsiaResourceDialect,
11240            >,
11241            offset: usize,
11242            depth: fidl::encoding::Depth,
11243        ) -> fidl::Result<()> {
11244            encoder.debug_check_bounds::<CapabilityStoreDictionaryLegacyExportRequest>(offset);
11245            // Zero out padding regions. There's no need to apply masks
11246            // because the unmasked parts will be overwritten by fields.
11247            unsafe {
11248                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
11249                (ptr as *mut u64).write_unaligned(0);
11250            }
11251            // Write the fields.
11252            self.0.encode(encoder, offset + 0, depth)?;
11253            self.1.encode(encoder, offset + 8, depth)?;
11254            Ok(())
11255        }
11256    }
11257
11258    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11259        for CapabilityStoreDictionaryLegacyExportRequest
11260    {
11261        #[inline(always)]
11262        fn new_empty() -> Self {
11263            Self {
11264                id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
11265                server_end: fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11266            }
11267        }
11268
11269        #[inline]
11270        unsafe fn decode(
11271            &mut self,
11272            decoder: &mut fidl::encoding::Decoder<
11273                '_,
11274                fidl::encoding::DefaultFuchsiaResourceDialect,
11275            >,
11276            offset: usize,
11277            _depth: fidl::encoding::Depth,
11278        ) -> fidl::Result<()> {
11279            decoder.debug_check_bounds::<Self>(offset);
11280            // Verify that padding bytes are zero.
11281            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
11282            let padval = unsafe { (ptr as *const u64).read_unaligned() };
11283            let mask = 0xffffffff00000000u64;
11284            let maskedval = padval & mask;
11285            if maskedval != 0 {
11286                return Err(fidl::Error::NonZeroPadding {
11287                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
11288                });
11289            }
11290            fidl::decode!(
11291                u64,
11292                fidl::encoding::DefaultFuchsiaResourceDialect,
11293                &mut self.id,
11294                decoder,
11295                offset + 0,
11296                _depth
11297            )?;
11298            fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.server_end, decoder, offset + 8, _depth)?;
11299            Ok(())
11300        }
11301    }
11302
11303    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDictionaryLegacyImportRequest {
11304        type Borrowed<'a> = &'a mut Self;
11305        fn take_or_borrow<'a>(
11306            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11307        ) -> Self::Borrowed<'a> {
11308            value
11309        }
11310    }
11311
11312    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDictionaryLegacyImportRequest {
11313        type Owned = Self;
11314
11315        #[inline(always)]
11316        fn inline_align(_context: fidl::encoding::Context) -> usize {
11317            8
11318        }
11319
11320        #[inline(always)]
11321        fn inline_size(_context: fidl::encoding::Context) -> usize {
11322            16
11323        }
11324    }
11325
11326    unsafe impl
11327        fidl::encoding::Encode<
11328            CapabilityStoreDictionaryLegacyImportRequest,
11329            fidl::encoding::DefaultFuchsiaResourceDialect,
11330        > for &mut CapabilityStoreDictionaryLegacyImportRequest
11331    {
11332        #[inline]
11333        unsafe fn encode(
11334            self,
11335            encoder: &mut fidl::encoding::Encoder<
11336                '_,
11337                fidl::encoding::DefaultFuchsiaResourceDialect,
11338            >,
11339            offset: usize,
11340            _depth: fidl::encoding::Depth,
11341        ) -> fidl::Result<()> {
11342            encoder.debug_check_bounds::<CapabilityStoreDictionaryLegacyImportRequest>(offset);
11343            // Delegate to tuple encoding.
11344            fidl::encoding::Encode::<
11345                CapabilityStoreDictionaryLegacyImportRequest,
11346                fidl::encoding::DefaultFuchsiaResourceDialect,
11347            >::encode(
11348                (
11349                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
11350                    <fidl::encoding::HandleType<
11351                        fidl::Channel,
11352                        { fidl::ObjectType::CHANNEL.into_raw() },
11353                        2147483648,
11354                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11355                        &mut self.client_end
11356                    ),
11357                ),
11358                encoder,
11359                offset,
11360                _depth,
11361            )
11362        }
11363    }
11364    unsafe impl<
11365            T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
11366            T1: fidl::encoding::Encode<
11367                fidl::encoding::HandleType<
11368                    fidl::Channel,
11369                    { fidl::ObjectType::CHANNEL.into_raw() },
11370                    2147483648,
11371                >,
11372                fidl::encoding::DefaultFuchsiaResourceDialect,
11373            >,
11374        >
11375        fidl::encoding::Encode<
11376            CapabilityStoreDictionaryLegacyImportRequest,
11377            fidl::encoding::DefaultFuchsiaResourceDialect,
11378        > for (T0, T1)
11379    {
11380        #[inline]
11381        unsafe fn encode(
11382            self,
11383            encoder: &mut fidl::encoding::Encoder<
11384                '_,
11385                fidl::encoding::DefaultFuchsiaResourceDialect,
11386            >,
11387            offset: usize,
11388            depth: fidl::encoding::Depth,
11389        ) -> fidl::Result<()> {
11390            encoder.debug_check_bounds::<CapabilityStoreDictionaryLegacyImportRequest>(offset);
11391            // Zero out padding regions. There's no need to apply masks
11392            // because the unmasked parts will be overwritten by fields.
11393            unsafe {
11394                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
11395                (ptr as *mut u64).write_unaligned(0);
11396            }
11397            // Write the fields.
11398            self.0.encode(encoder, offset + 0, depth)?;
11399            self.1.encode(encoder, offset + 8, depth)?;
11400            Ok(())
11401        }
11402    }
11403
11404    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11405        for CapabilityStoreDictionaryLegacyImportRequest
11406    {
11407        #[inline(always)]
11408        fn new_empty() -> Self {
11409            Self {
11410                id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
11411                client_end: fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11412            }
11413        }
11414
11415        #[inline]
11416        unsafe fn decode(
11417            &mut self,
11418            decoder: &mut fidl::encoding::Decoder<
11419                '_,
11420                fidl::encoding::DefaultFuchsiaResourceDialect,
11421            >,
11422            offset: usize,
11423            _depth: fidl::encoding::Depth,
11424        ) -> fidl::Result<()> {
11425            decoder.debug_check_bounds::<Self>(offset);
11426            // Verify that padding bytes are zero.
11427            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
11428            let padval = unsafe { (ptr as *const u64).read_unaligned() };
11429            let mask = 0xffffffff00000000u64;
11430            let maskedval = padval & mask;
11431            if maskedval != 0 {
11432                return Err(fidl::Error::NonZeroPadding {
11433                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
11434                });
11435            }
11436            fidl::decode!(
11437                u64,
11438                fidl::encoding::DefaultFuchsiaResourceDialect,
11439                &mut self.id,
11440                decoder,
11441                offset + 0,
11442                _depth
11443            )?;
11444            fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.client_end, decoder, offset + 8, _depth)?;
11445            Ok(())
11446        }
11447    }
11448
11449    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDirConnectorCreateRequest {
11450        type Borrowed<'a> = &'a mut Self;
11451        fn take_or_borrow<'a>(
11452            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11453        ) -> Self::Borrowed<'a> {
11454            value
11455        }
11456    }
11457
11458    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDirConnectorCreateRequest {
11459        type Owned = Self;
11460
11461        #[inline(always)]
11462        fn inline_align(_context: fidl::encoding::Context) -> usize {
11463            8
11464        }
11465
11466        #[inline(always)]
11467        fn inline_size(_context: fidl::encoding::Context) -> usize {
11468            16
11469        }
11470    }
11471
11472    unsafe impl
11473        fidl::encoding::Encode<
11474            CapabilityStoreDirConnectorCreateRequest,
11475            fidl::encoding::DefaultFuchsiaResourceDialect,
11476        > for &mut CapabilityStoreDirConnectorCreateRequest
11477    {
11478        #[inline]
11479        unsafe fn encode(
11480            self,
11481            encoder: &mut fidl::encoding::Encoder<
11482                '_,
11483                fidl::encoding::DefaultFuchsiaResourceDialect,
11484            >,
11485            offset: usize,
11486            _depth: fidl::encoding::Depth,
11487        ) -> fidl::Result<()> {
11488            encoder.debug_check_bounds::<CapabilityStoreDirConnectorCreateRequest>(offset);
11489            // Delegate to tuple encoding.
11490            fidl::encoding::Encode::<CapabilityStoreDirConnectorCreateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
11491                (
11492                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
11493                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirReceiverMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.receiver),
11494                ),
11495                encoder, offset, _depth
11496            )
11497        }
11498    }
11499    unsafe impl<
11500            T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
11501            T1: fidl::encoding::Encode<
11502                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirReceiverMarker>>,
11503                fidl::encoding::DefaultFuchsiaResourceDialect,
11504            >,
11505        >
11506        fidl::encoding::Encode<
11507            CapabilityStoreDirConnectorCreateRequest,
11508            fidl::encoding::DefaultFuchsiaResourceDialect,
11509        > for (T0, T1)
11510    {
11511        #[inline]
11512        unsafe fn encode(
11513            self,
11514            encoder: &mut fidl::encoding::Encoder<
11515                '_,
11516                fidl::encoding::DefaultFuchsiaResourceDialect,
11517            >,
11518            offset: usize,
11519            depth: fidl::encoding::Depth,
11520        ) -> fidl::Result<()> {
11521            encoder.debug_check_bounds::<CapabilityStoreDirConnectorCreateRequest>(offset);
11522            // Zero out padding regions. There's no need to apply masks
11523            // because the unmasked parts will be overwritten by fields.
11524            unsafe {
11525                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
11526                (ptr as *mut u64).write_unaligned(0);
11527            }
11528            // Write the fields.
11529            self.0.encode(encoder, offset + 0, depth)?;
11530            self.1.encode(encoder, offset + 8, depth)?;
11531            Ok(())
11532        }
11533    }
11534
11535    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11536        for CapabilityStoreDirConnectorCreateRequest
11537    {
11538        #[inline(always)]
11539        fn new_empty() -> Self {
11540            Self {
11541                id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
11542                receiver: fidl::new_empty!(
11543                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirReceiverMarker>>,
11544                    fidl::encoding::DefaultFuchsiaResourceDialect
11545                ),
11546            }
11547        }
11548
11549        #[inline]
11550        unsafe fn decode(
11551            &mut self,
11552            decoder: &mut fidl::encoding::Decoder<
11553                '_,
11554                fidl::encoding::DefaultFuchsiaResourceDialect,
11555            >,
11556            offset: usize,
11557            _depth: fidl::encoding::Depth,
11558        ) -> fidl::Result<()> {
11559            decoder.debug_check_bounds::<Self>(offset);
11560            // Verify that padding bytes are zero.
11561            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
11562            let padval = unsafe { (ptr as *const u64).read_unaligned() };
11563            let mask = 0xffffffff00000000u64;
11564            let maskedval = padval & mask;
11565            if maskedval != 0 {
11566                return Err(fidl::Error::NonZeroPadding {
11567                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
11568                });
11569            }
11570            fidl::decode!(
11571                u64,
11572                fidl::encoding::DefaultFuchsiaResourceDialect,
11573                &mut self.id,
11574                decoder,
11575                offset + 0,
11576                _depth
11577            )?;
11578            fidl::decode!(
11579                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirReceiverMarker>>,
11580                fidl::encoding::DefaultFuchsiaResourceDialect,
11581                &mut self.receiver,
11582                decoder,
11583                offset + 8,
11584                _depth
11585            )?;
11586            Ok(())
11587        }
11588    }
11589
11590    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDirConnectorOpenRequest {
11591        type Borrowed<'a> = &'a mut Self;
11592        fn take_or_borrow<'a>(
11593            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11594        ) -> Self::Borrowed<'a> {
11595            value
11596        }
11597    }
11598
11599    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDirConnectorOpenRequest {
11600        type Owned = Self;
11601
11602        #[inline(always)]
11603        fn inline_align(_context: fidl::encoding::Context) -> usize {
11604            8
11605        }
11606
11607        #[inline(always)]
11608        fn inline_size(_context: fidl::encoding::Context) -> usize {
11609            16
11610        }
11611    }
11612
11613    unsafe impl
11614        fidl::encoding::Encode<
11615            CapabilityStoreDirConnectorOpenRequest,
11616            fidl::encoding::DefaultFuchsiaResourceDialect,
11617        > for &mut CapabilityStoreDirConnectorOpenRequest
11618    {
11619        #[inline]
11620        unsafe fn encode(
11621            self,
11622            encoder: &mut fidl::encoding::Encoder<
11623                '_,
11624                fidl::encoding::DefaultFuchsiaResourceDialect,
11625            >,
11626            offset: usize,
11627            _depth: fidl::encoding::Depth,
11628        ) -> fidl::Result<()> {
11629            encoder.debug_check_bounds::<CapabilityStoreDirConnectorOpenRequest>(offset);
11630            // Delegate to tuple encoding.
11631            fidl::encoding::Encode::<
11632                CapabilityStoreDirConnectorOpenRequest,
11633                fidl::encoding::DefaultFuchsiaResourceDialect,
11634            >::encode(
11635                (
11636                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
11637                    <fidl::encoding::Endpoint<
11638                        fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
11639                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11640                        &mut self.server_end
11641                    ),
11642                ),
11643                encoder,
11644                offset,
11645                _depth,
11646            )
11647        }
11648    }
11649    unsafe impl<
11650            T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
11651            T1: fidl::encoding::Encode<
11652                fidl::encoding::Endpoint<
11653                    fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
11654                >,
11655                fidl::encoding::DefaultFuchsiaResourceDialect,
11656            >,
11657        >
11658        fidl::encoding::Encode<
11659            CapabilityStoreDirConnectorOpenRequest,
11660            fidl::encoding::DefaultFuchsiaResourceDialect,
11661        > for (T0, T1)
11662    {
11663        #[inline]
11664        unsafe fn encode(
11665            self,
11666            encoder: &mut fidl::encoding::Encoder<
11667                '_,
11668                fidl::encoding::DefaultFuchsiaResourceDialect,
11669            >,
11670            offset: usize,
11671            depth: fidl::encoding::Depth,
11672        ) -> fidl::Result<()> {
11673            encoder.debug_check_bounds::<CapabilityStoreDirConnectorOpenRequest>(offset);
11674            // Zero out padding regions. There's no need to apply masks
11675            // because the unmasked parts will be overwritten by fields.
11676            unsafe {
11677                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
11678                (ptr as *mut u64).write_unaligned(0);
11679            }
11680            // Write the fields.
11681            self.0.encode(encoder, offset + 0, depth)?;
11682            self.1.encode(encoder, offset + 8, depth)?;
11683            Ok(())
11684        }
11685    }
11686
11687    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11688        for CapabilityStoreDirConnectorOpenRequest
11689    {
11690        #[inline(always)]
11691        fn new_empty() -> Self {
11692            Self {
11693                id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
11694                server_end: fidl::new_empty!(
11695                    fidl::encoding::Endpoint<
11696                        fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
11697                    >,
11698                    fidl::encoding::DefaultFuchsiaResourceDialect
11699                ),
11700            }
11701        }
11702
11703        #[inline]
11704        unsafe fn decode(
11705            &mut self,
11706            decoder: &mut fidl::encoding::Decoder<
11707                '_,
11708                fidl::encoding::DefaultFuchsiaResourceDialect,
11709            >,
11710            offset: usize,
11711            _depth: fidl::encoding::Depth,
11712        ) -> fidl::Result<()> {
11713            decoder.debug_check_bounds::<Self>(offset);
11714            // Verify that padding bytes are zero.
11715            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
11716            let padval = unsafe { (ptr as *const u64).read_unaligned() };
11717            let mask = 0xffffffff00000000u64;
11718            let maskedval = padval & mask;
11719            if maskedval != 0 {
11720                return Err(fidl::Error::NonZeroPadding {
11721                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
11722                });
11723            }
11724            fidl::decode!(
11725                u64,
11726                fidl::encoding::DefaultFuchsiaResourceDialect,
11727                &mut self.id,
11728                decoder,
11729                offset + 0,
11730                _depth
11731            )?;
11732            fidl::decode!(
11733                fidl::encoding::Endpoint<
11734                    fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
11735                >,
11736                fidl::encoding::DefaultFuchsiaResourceDialect,
11737                &mut self.server_end,
11738                decoder,
11739                offset + 8,
11740                _depth
11741            )?;
11742            Ok(())
11743        }
11744    }
11745
11746    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreImportRequest {
11747        type Borrowed<'a> = &'a mut Self;
11748        fn take_or_borrow<'a>(
11749            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11750        ) -> Self::Borrowed<'a> {
11751            value
11752        }
11753    }
11754
11755    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreImportRequest {
11756        type Owned = Self;
11757
11758        #[inline(always)]
11759        fn inline_align(_context: fidl::encoding::Context) -> usize {
11760            8
11761        }
11762
11763        #[inline(always)]
11764        fn inline_size(_context: fidl::encoding::Context) -> usize {
11765            24
11766        }
11767    }
11768
11769    unsafe impl
11770        fidl::encoding::Encode<
11771            CapabilityStoreImportRequest,
11772            fidl::encoding::DefaultFuchsiaResourceDialect,
11773        > for &mut CapabilityStoreImportRequest
11774    {
11775        #[inline]
11776        unsafe fn encode(
11777            self,
11778            encoder: &mut fidl::encoding::Encoder<
11779                '_,
11780                fidl::encoding::DefaultFuchsiaResourceDialect,
11781            >,
11782            offset: usize,
11783            _depth: fidl::encoding::Depth,
11784        ) -> fidl::Result<()> {
11785            encoder.debug_check_bounds::<CapabilityStoreImportRequest>(offset);
11786            // Delegate to tuple encoding.
11787            fidl::encoding::Encode::<
11788                CapabilityStoreImportRequest,
11789                fidl::encoding::DefaultFuchsiaResourceDialect,
11790            >::encode(
11791                (
11792                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
11793                    <Capability as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11794                        &mut self.capability,
11795                    ),
11796                ),
11797                encoder,
11798                offset,
11799                _depth,
11800            )
11801        }
11802    }
11803    unsafe impl<
11804            T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
11805            T1: fidl::encoding::Encode<Capability, fidl::encoding::DefaultFuchsiaResourceDialect>,
11806        >
11807        fidl::encoding::Encode<
11808            CapabilityStoreImportRequest,
11809            fidl::encoding::DefaultFuchsiaResourceDialect,
11810        > for (T0, T1)
11811    {
11812        #[inline]
11813        unsafe fn encode(
11814            self,
11815            encoder: &mut fidl::encoding::Encoder<
11816                '_,
11817                fidl::encoding::DefaultFuchsiaResourceDialect,
11818            >,
11819            offset: usize,
11820            depth: fidl::encoding::Depth,
11821        ) -> fidl::Result<()> {
11822            encoder.debug_check_bounds::<CapabilityStoreImportRequest>(offset);
11823            // Zero out padding regions. There's no need to apply masks
11824            // because the unmasked parts will be overwritten by fields.
11825            // Write the fields.
11826            self.0.encode(encoder, offset + 0, depth)?;
11827            self.1.encode(encoder, offset + 8, depth)?;
11828            Ok(())
11829        }
11830    }
11831
11832    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11833        for CapabilityStoreImportRequest
11834    {
11835        #[inline(always)]
11836        fn new_empty() -> Self {
11837            Self {
11838                id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
11839                capability: fidl::new_empty!(
11840                    Capability,
11841                    fidl::encoding::DefaultFuchsiaResourceDialect
11842                ),
11843            }
11844        }
11845
11846        #[inline]
11847        unsafe fn decode(
11848            &mut self,
11849            decoder: &mut fidl::encoding::Decoder<
11850                '_,
11851                fidl::encoding::DefaultFuchsiaResourceDialect,
11852            >,
11853            offset: usize,
11854            _depth: fidl::encoding::Depth,
11855        ) -> fidl::Result<()> {
11856            decoder.debug_check_bounds::<Self>(offset);
11857            // Verify that padding bytes are zero.
11858            fidl::decode!(
11859                u64,
11860                fidl::encoding::DefaultFuchsiaResourceDialect,
11861                &mut self.id,
11862                decoder,
11863                offset + 0,
11864                _depth
11865            )?;
11866            fidl::decode!(
11867                Capability,
11868                fidl::encoding::DefaultFuchsiaResourceDialect,
11869                &mut self.capability,
11870                decoder,
11871                offset + 8,
11872                _depth
11873            )?;
11874            Ok(())
11875        }
11876    }
11877
11878    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreExportResponse {
11879        type Borrowed<'a> = &'a mut Self;
11880        fn take_or_borrow<'a>(
11881            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11882        ) -> Self::Borrowed<'a> {
11883            value
11884        }
11885    }
11886
11887    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreExportResponse {
11888        type Owned = Self;
11889
11890        #[inline(always)]
11891        fn inline_align(_context: fidl::encoding::Context) -> usize {
11892            8
11893        }
11894
11895        #[inline(always)]
11896        fn inline_size(_context: fidl::encoding::Context) -> usize {
11897            16
11898        }
11899    }
11900
11901    unsafe impl
11902        fidl::encoding::Encode<
11903            CapabilityStoreExportResponse,
11904            fidl::encoding::DefaultFuchsiaResourceDialect,
11905        > for &mut CapabilityStoreExportResponse
11906    {
11907        #[inline]
11908        unsafe fn encode(
11909            self,
11910            encoder: &mut fidl::encoding::Encoder<
11911                '_,
11912                fidl::encoding::DefaultFuchsiaResourceDialect,
11913            >,
11914            offset: usize,
11915            _depth: fidl::encoding::Depth,
11916        ) -> fidl::Result<()> {
11917            encoder.debug_check_bounds::<CapabilityStoreExportResponse>(offset);
11918            // Delegate to tuple encoding.
11919            fidl::encoding::Encode::<
11920                CapabilityStoreExportResponse,
11921                fidl::encoding::DefaultFuchsiaResourceDialect,
11922            >::encode(
11923                (<Capability as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11924                    &mut self.capability,
11925                ),),
11926                encoder,
11927                offset,
11928                _depth,
11929            )
11930        }
11931    }
11932    unsafe impl<T0: fidl::encoding::Encode<Capability, fidl::encoding::DefaultFuchsiaResourceDialect>>
11933        fidl::encoding::Encode<
11934            CapabilityStoreExportResponse,
11935            fidl::encoding::DefaultFuchsiaResourceDialect,
11936        > for (T0,)
11937    {
11938        #[inline]
11939        unsafe fn encode(
11940            self,
11941            encoder: &mut fidl::encoding::Encoder<
11942                '_,
11943                fidl::encoding::DefaultFuchsiaResourceDialect,
11944            >,
11945            offset: usize,
11946            depth: fidl::encoding::Depth,
11947        ) -> fidl::Result<()> {
11948            encoder.debug_check_bounds::<CapabilityStoreExportResponse>(offset);
11949            // Zero out padding regions. There's no need to apply masks
11950            // because the unmasked parts will be overwritten by fields.
11951            // Write the fields.
11952            self.0.encode(encoder, offset + 0, depth)?;
11953            Ok(())
11954        }
11955    }
11956
11957    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11958        for CapabilityStoreExportResponse
11959    {
11960        #[inline(always)]
11961        fn new_empty() -> Self {
11962            Self {
11963                capability: fidl::new_empty!(
11964                    Capability,
11965                    fidl::encoding::DefaultFuchsiaResourceDialect
11966                ),
11967            }
11968        }
11969
11970        #[inline]
11971        unsafe fn decode(
11972            &mut self,
11973            decoder: &mut fidl::encoding::Decoder<
11974                '_,
11975                fidl::encoding::DefaultFuchsiaResourceDialect,
11976            >,
11977            offset: usize,
11978            _depth: fidl::encoding::Depth,
11979        ) -> fidl::Result<()> {
11980            decoder.debug_check_bounds::<Self>(offset);
11981            // Verify that padding bytes are zero.
11982            fidl::decode!(
11983                Capability,
11984                fidl::encoding::DefaultFuchsiaResourceDialect,
11985                &mut self.capability,
11986                decoder,
11987                offset + 0,
11988                _depth
11989            )?;
11990            Ok(())
11991        }
11992    }
11993
11994    impl fidl::encoding::ResourceTypeMarker for Connector {
11995        type Borrowed<'a> = &'a mut Self;
11996        fn take_or_borrow<'a>(
11997            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11998        ) -> Self::Borrowed<'a> {
11999            value
12000        }
12001    }
12002
12003    unsafe impl fidl::encoding::TypeMarker for Connector {
12004        type Owned = Self;
12005
12006        #[inline(always)]
12007        fn inline_align(_context: fidl::encoding::Context) -> usize {
12008            4
12009        }
12010
12011        #[inline(always)]
12012        fn inline_size(_context: fidl::encoding::Context) -> usize {
12013            4
12014        }
12015    }
12016
12017    unsafe impl fidl::encoding::Encode<Connector, fidl::encoding::DefaultFuchsiaResourceDialect>
12018        for &mut Connector
12019    {
12020        #[inline]
12021        unsafe fn encode(
12022            self,
12023            encoder: &mut fidl::encoding::Encoder<
12024                '_,
12025                fidl::encoding::DefaultFuchsiaResourceDialect,
12026            >,
12027            offset: usize,
12028            _depth: fidl::encoding::Depth,
12029        ) -> fidl::Result<()> {
12030            encoder.debug_check_bounds::<Connector>(offset);
12031            // Delegate to tuple encoding.
12032            fidl::encoding::Encode::<Connector, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
12033                (
12034                    <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.token),
12035                ),
12036                encoder, offset, _depth
12037            )
12038        }
12039    }
12040    unsafe impl<
12041            T0: fidl::encoding::Encode<
12042                fidl::encoding::HandleType<
12043                    fidl::EventPair,
12044                    { fidl::ObjectType::EVENTPAIR.into_raw() },
12045                    2147483648,
12046                >,
12047                fidl::encoding::DefaultFuchsiaResourceDialect,
12048            >,
12049        > fidl::encoding::Encode<Connector, fidl::encoding::DefaultFuchsiaResourceDialect>
12050        for (T0,)
12051    {
12052        #[inline]
12053        unsafe fn encode(
12054            self,
12055            encoder: &mut fidl::encoding::Encoder<
12056                '_,
12057                fidl::encoding::DefaultFuchsiaResourceDialect,
12058            >,
12059            offset: usize,
12060            depth: fidl::encoding::Depth,
12061        ) -> fidl::Result<()> {
12062            encoder.debug_check_bounds::<Connector>(offset);
12063            // Zero out padding regions. There's no need to apply masks
12064            // because the unmasked parts will be overwritten by fields.
12065            // Write the fields.
12066            self.0.encode(encoder, offset + 0, depth)?;
12067            Ok(())
12068        }
12069    }
12070
12071    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Connector {
12072        #[inline(always)]
12073        fn new_empty() -> Self {
12074            Self {
12075                token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
12076            }
12077        }
12078
12079        #[inline]
12080        unsafe fn decode(
12081            &mut self,
12082            decoder: &mut fidl::encoding::Decoder<
12083                '_,
12084                fidl::encoding::DefaultFuchsiaResourceDialect,
12085            >,
12086            offset: usize,
12087            _depth: fidl::encoding::Depth,
12088        ) -> fidl::Result<()> {
12089            decoder.debug_check_bounds::<Self>(offset);
12090            // Verify that padding bytes are zero.
12091            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.token, decoder, offset + 0, _depth)?;
12092            Ok(())
12093        }
12094    }
12095
12096    impl fidl::encoding::ResourceTypeMarker for DictionaryDrainIteratorGetNextResponse {
12097        type Borrowed<'a> = &'a mut Self;
12098        fn take_or_borrow<'a>(
12099            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12100        ) -> Self::Borrowed<'a> {
12101            value
12102        }
12103    }
12104
12105    unsafe impl fidl::encoding::TypeMarker for DictionaryDrainIteratorGetNextResponse {
12106        type Owned = Self;
12107
12108        #[inline(always)]
12109        fn inline_align(_context: fidl::encoding::Context) -> usize {
12110            8
12111        }
12112
12113        #[inline(always)]
12114        fn inline_size(_context: fidl::encoding::Context) -> usize {
12115            24
12116        }
12117    }
12118
12119    unsafe impl
12120        fidl::encoding::Encode<
12121            DictionaryDrainIteratorGetNextResponse,
12122            fidl::encoding::DefaultFuchsiaResourceDialect,
12123        > for &mut DictionaryDrainIteratorGetNextResponse
12124    {
12125        #[inline]
12126        unsafe fn encode(
12127            self,
12128            encoder: &mut fidl::encoding::Encoder<
12129                '_,
12130                fidl::encoding::DefaultFuchsiaResourceDialect,
12131            >,
12132            offset: usize,
12133            _depth: fidl::encoding::Depth,
12134        ) -> fidl::Result<()> {
12135            encoder.debug_check_bounds::<DictionaryDrainIteratorGetNextResponse>(offset);
12136            // Delegate to tuple encoding.
12137            fidl::encoding::Encode::<DictionaryDrainIteratorGetNextResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
12138                (
12139                    <fidl::encoding::Vector<DictionaryItem, 128> as fidl::encoding::ValueTypeMarker>::borrow(&self.items),
12140                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.end_id),
12141                ),
12142                encoder, offset, _depth
12143            )
12144        }
12145    }
12146    unsafe impl<
12147            T0: fidl::encoding::Encode<
12148                fidl::encoding::Vector<DictionaryItem, 128>,
12149                fidl::encoding::DefaultFuchsiaResourceDialect,
12150            >,
12151            T1: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
12152        >
12153        fidl::encoding::Encode<
12154            DictionaryDrainIteratorGetNextResponse,
12155            fidl::encoding::DefaultFuchsiaResourceDialect,
12156        > for (T0, T1)
12157    {
12158        #[inline]
12159        unsafe fn encode(
12160            self,
12161            encoder: &mut fidl::encoding::Encoder<
12162                '_,
12163                fidl::encoding::DefaultFuchsiaResourceDialect,
12164            >,
12165            offset: usize,
12166            depth: fidl::encoding::Depth,
12167        ) -> fidl::Result<()> {
12168            encoder.debug_check_bounds::<DictionaryDrainIteratorGetNextResponse>(offset);
12169            // Zero out padding regions. There's no need to apply masks
12170            // because the unmasked parts will be overwritten by fields.
12171            // Write the fields.
12172            self.0.encode(encoder, offset + 0, depth)?;
12173            self.1.encode(encoder, offset + 16, depth)?;
12174            Ok(())
12175        }
12176    }
12177
12178    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12179        for DictionaryDrainIteratorGetNextResponse
12180    {
12181        #[inline(always)]
12182        fn new_empty() -> Self {
12183            Self {
12184                items: fidl::new_empty!(fidl::encoding::Vector<DictionaryItem, 128>, fidl::encoding::DefaultFuchsiaResourceDialect),
12185                end_id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
12186            }
12187        }
12188
12189        #[inline]
12190        unsafe fn decode(
12191            &mut self,
12192            decoder: &mut fidl::encoding::Decoder<
12193                '_,
12194                fidl::encoding::DefaultFuchsiaResourceDialect,
12195            >,
12196            offset: usize,
12197            _depth: fidl::encoding::Depth,
12198        ) -> fidl::Result<()> {
12199            decoder.debug_check_bounds::<Self>(offset);
12200            // Verify that padding bytes are zero.
12201            fidl::decode!(fidl::encoding::Vector<DictionaryItem, 128>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.items, decoder, offset + 0, _depth)?;
12202            fidl::decode!(
12203                u64,
12204                fidl::encoding::DefaultFuchsiaResourceDialect,
12205                &mut self.end_id,
12206                decoder,
12207                offset + 16,
12208                _depth
12209            )?;
12210            Ok(())
12211        }
12212    }
12213
12214    impl fidl::encoding::ResourceTypeMarker for DictionaryEnumerateIteratorGetNextResponse {
12215        type Borrowed<'a> = &'a mut Self;
12216        fn take_or_borrow<'a>(
12217            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12218        ) -> Self::Borrowed<'a> {
12219            value
12220        }
12221    }
12222
12223    unsafe impl fidl::encoding::TypeMarker for DictionaryEnumerateIteratorGetNextResponse {
12224        type Owned = Self;
12225
12226        #[inline(always)]
12227        fn inline_align(_context: fidl::encoding::Context) -> usize {
12228            8
12229        }
12230
12231        #[inline(always)]
12232        fn inline_size(_context: fidl::encoding::Context) -> usize {
12233            24
12234        }
12235    }
12236
12237    unsafe impl
12238        fidl::encoding::Encode<
12239            DictionaryEnumerateIteratorGetNextResponse,
12240            fidl::encoding::DefaultFuchsiaResourceDialect,
12241        > for &mut DictionaryEnumerateIteratorGetNextResponse
12242    {
12243        #[inline]
12244        unsafe fn encode(
12245            self,
12246            encoder: &mut fidl::encoding::Encoder<
12247                '_,
12248                fidl::encoding::DefaultFuchsiaResourceDialect,
12249            >,
12250            offset: usize,
12251            _depth: fidl::encoding::Depth,
12252        ) -> fidl::Result<()> {
12253            encoder.debug_check_bounds::<DictionaryEnumerateIteratorGetNextResponse>(offset);
12254            // Delegate to tuple encoding.
12255            fidl::encoding::Encode::<DictionaryEnumerateIteratorGetNextResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
12256                (
12257                    <fidl::encoding::Vector<DictionaryOptionalItem, 128> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.items),
12258                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.end_id),
12259                ),
12260                encoder, offset, _depth
12261            )
12262        }
12263    }
12264    unsafe impl<
12265            T0: fidl::encoding::Encode<
12266                fidl::encoding::Vector<DictionaryOptionalItem, 128>,
12267                fidl::encoding::DefaultFuchsiaResourceDialect,
12268            >,
12269            T1: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
12270        >
12271        fidl::encoding::Encode<
12272            DictionaryEnumerateIteratorGetNextResponse,
12273            fidl::encoding::DefaultFuchsiaResourceDialect,
12274        > for (T0, T1)
12275    {
12276        #[inline]
12277        unsafe fn encode(
12278            self,
12279            encoder: &mut fidl::encoding::Encoder<
12280                '_,
12281                fidl::encoding::DefaultFuchsiaResourceDialect,
12282            >,
12283            offset: usize,
12284            depth: fidl::encoding::Depth,
12285        ) -> fidl::Result<()> {
12286            encoder.debug_check_bounds::<DictionaryEnumerateIteratorGetNextResponse>(offset);
12287            // Zero out padding regions. There's no need to apply masks
12288            // because the unmasked parts will be overwritten by fields.
12289            // Write the fields.
12290            self.0.encode(encoder, offset + 0, depth)?;
12291            self.1.encode(encoder, offset + 16, depth)?;
12292            Ok(())
12293        }
12294    }
12295
12296    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12297        for DictionaryEnumerateIteratorGetNextResponse
12298    {
12299        #[inline(always)]
12300        fn new_empty() -> Self {
12301            Self {
12302                items: fidl::new_empty!(fidl::encoding::Vector<DictionaryOptionalItem, 128>, fidl::encoding::DefaultFuchsiaResourceDialect),
12303                end_id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
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!(fidl::encoding::Vector<DictionaryOptionalItem, 128>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.items, decoder, offset + 0, _depth)?;
12320            fidl::decode!(
12321                u64,
12322                fidl::encoding::DefaultFuchsiaResourceDialect,
12323                &mut self.end_id,
12324                decoder,
12325                offset + 16,
12326                _depth
12327            )?;
12328            Ok(())
12329        }
12330    }
12331
12332    impl fidl::encoding::ResourceTypeMarker for DictionaryKeysIteratorGetNextResponse {
12333        type Borrowed<'a> = &'a mut Self;
12334        fn take_or_borrow<'a>(
12335            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12336        ) -> Self::Borrowed<'a> {
12337            value
12338        }
12339    }
12340
12341    unsafe impl fidl::encoding::TypeMarker for DictionaryKeysIteratorGetNextResponse {
12342        type Owned = Self;
12343
12344        #[inline(always)]
12345        fn inline_align(_context: fidl::encoding::Context) -> usize {
12346            8
12347        }
12348
12349        #[inline(always)]
12350        fn inline_size(_context: fidl::encoding::Context) -> usize {
12351            16
12352        }
12353    }
12354
12355    unsafe impl
12356        fidl::encoding::Encode<
12357            DictionaryKeysIteratorGetNextResponse,
12358            fidl::encoding::DefaultFuchsiaResourceDialect,
12359        > for &mut DictionaryKeysIteratorGetNextResponse
12360    {
12361        #[inline]
12362        unsafe fn encode(
12363            self,
12364            encoder: &mut fidl::encoding::Encoder<
12365                '_,
12366                fidl::encoding::DefaultFuchsiaResourceDialect,
12367            >,
12368            offset: usize,
12369            _depth: fidl::encoding::Depth,
12370        ) -> fidl::Result<()> {
12371            encoder.debug_check_bounds::<DictionaryKeysIteratorGetNextResponse>(offset);
12372            // Delegate to tuple encoding.
12373            fidl::encoding::Encode::<DictionaryKeysIteratorGetNextResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
12374                (
12375                    <fidl::encoding::Vector<fidl::encoding::BoundedString<255>, 128> as fidl::encoding::ValueTypeMarker>::borrow(&self.keys),
12376                ),
12377                encoder, offset, _depth
12378            )
12379        }
12380    }
12381    unsafe impl<
12382            T0: fidl::encoding::Encode<
12383                fidl::encoding::Vector<fidl::encoding::BoundedString<255>, 128>,
12384                fidl::encoding::DefaultFuchsiaResourceDialect,
12385            >,
12386        >
12387        fidl::encoding::Encode<
12388            DictionaryKeysIteratorGetNextResponse,
12389            fidl::encoding::DefaultFuchsiaResourceDialect,
12390        > for (T0,)
12391    {
12392        #[inline]
12393        unsafe fn encode(
12394            self,
12395            encoder: &mut fidl::encoding::Encoder<
12396                '_,
12397                fidl::encoding::DefaultFuchsiaResourceDialect,
12398            >,
12399            offset: usize,
12400            depth: fidl::encoding::Depth,
12401        ) -> fidl::Result<()> {
12402            encoder.debug_check_bounds::<DictionaryKeysIteratorGetNextResponse>(offset);
12403            // Zero out padding regions. There's no need to apply masks
12404            // because the unmasked parts will be overwritten by fields.
12405            // Write the fields.
12406            self.0.encode(encoder, offset + 0, depth)?;
12407            Ok(())
12408        }
12409    }
12410
12411    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12412        for DictionaryKeysIteratorGetNextResponse
12413    {
12414        #[inline(always)]
12415        fn new_empty() -> Self {
12416            Self {
12417                keys: fidl::new_empty!(
12418                    fidl::encoding::Vector<fidl::encoding::BoundedString<255>, 128>,
12419                    fidl::encoding::DefaultFuchsiaResourceDialect
12420                ),
12421            }
12422        }
12423
12424        #[inline]
12425        unsafe fn decode(
12426            &mut self,
12427            decoder: &mut fidl::encoding::Decoder<
12428                '_,
12429                fidl::encoding::DefaultFuchsiaResourceDialect,
12430            >,
12431            offset: usize,
12432            _depth: fidl::encoding::Depth,
12433        ) -> fidl::Result<()> {
12434            decoder.debug_check_bounds::<Self>(offset);
12435            // Verify that padding bytes are zero.
12436            fidl::decode!(
12437                fidl::encoding::Vector<fidl::encoding::BoundedString<255>, 128>,
12438                fidl::encoding::DefaultFuchsiaResourceDialect,
12439                &mut self.keys,
12440                decoder,
12441                offset + 0,
12442                _depth
12443            )?;
12444            Ok(())
12445        }
12446    }
12447
12448    impl fidl::encoding::ResourceTypeMarker for DictionaryOptionalItem {
12449        type Borrowed<'a> = &'a mut Self;
12450        fn take_or_borrow<'a>(
12451            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12452        ) -> Self::Borrowed<'a> {
12453            value
12454        }
12455    }
12456
12457    unsafe impl fidl::encoding::TypeMarker for DictionaryOptionalItem {
12458        type Owned = Self;
12459
12460        #[inline(always)]
12461        fn inline_align(_context: fidl::encoding::Context) -> usize {
12462            8
12463        }
12464
12465        #[inline(always)]
12466        fn inline_size(_context: fidl::encoding::Context) -> usize {
12467            24
12468        }
12469    }
12470
12471    unsafe impl
12472        fidl::encoding::Encode<
12473            DictionaryOptionalItem,
12474            fidl::encoding::DefaultFuchsiaResourceDialect,
12475        > for &mut DictionaryOptionalItem
12476    {
12477        #[inline]
12478        unsafe fn encode(
12479            self,
12480            encoder: &mut fidl::encoding::Encoder<
12481                '_,
12482                fidl::encoding::DefaultFuchsiaResourceDialect,
12483            >,
12484            offset: usize,
12485            _depth: fidl::encoding::Depth,
12486        ) -> fidl::Result<()> {
12487            encoder.debug_check_bounds::<DictionaryOptionalItem>(offset);
12488            // Delegate to tuple encoding.
12489            fidl::encoding::Encode::<DictionaryOptionalItem, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
12490                (
12491                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(&self.key),
12492                    <fidl::encoding::Boxed<WrappedCapabilityId> as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
12493                ),
12494                encoder, offset, _depth
12495            )
12496        }
12497    }
12498    unsafe impl<
12499            T0: fidl::encoding::Encode<
12500                fidl::encoding::BoundedString<255>,
12501                fidl::encoding::DefaultFuchsiaResourceDialect,
12502            >,
12503            T1: fidl::encoding::Encode<
12504                fidl::encoding::Boxed<WrappedCapabilityId>,
12505                fidl::encoding::DefaultFuchsiaResourceDialect,
12506            >,
12507        >
12508        fidl::encoding::Encode<
12509            DictionaryOptionalItem,
12510            fidl::encoding::DefaultFuchsiaResourceDialect,
12511        > for (T0, T1)
12512    {
12513        #[inline]
12514        unsafe fn encode(
12515            self,
12516            encoder: &mut fidl::encoding::Encoder<
12517                '_,
12518                fidl::encoding::DefaultFuchsiaResourceDialect,
12519            >,
12520            offset: usize,
12521            depth: fidl::encoding::Depth,
12522        ) -> fidl::Result<()> {
12523            encoder.debug_check_bounds::<DictionaryOptionalItem>(offset);
12524            // Zero out padding regions. There's no need to apply masks
12525            // because the unmasked parts will be overwritten by fields.
12526            // Write the fields.
12527            self.0.encode(encoder, offset + 0, depth)?;
12528            self.1.encode(encoder, offset + 16, depth)?;
12529            Ok(())
12530        }
12531    }
12532
12533    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12534        for DictionaryOptionalItem
12535    {
12536        #[inline(always)]
12537        fn new_empty() -> Self {
12538            Self {
12539                key: fidl::new_empty!(
12540                    fidl::encoding::BoundedString<255>,
12541                    fidl::encoding::DefaultFuchsiaResourceDialect
12542                ),
12543                value: fidl::new_empty!(
12544                    fidl::encoding::Boxed<WrappedCapabilityId>,
12545                    fidl::encoding::DefaultFuchsiaResourceDialect
12546                ),
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!(
12563                fidl::encoding::BoundedString<255>,
12564                fidl::encoding::DefaultFuchsiaResourceDialect,
12565                &mut self.key,
12566                decoder,
12567                offset + 0,
12568                _depth
12569            )?;
12570            fidl::decode!(
12571                fidl::encoding::Boxed<WrappedCapabilityId>,
12572                fidl::encoding::DefaultFuchsiaResourceDialect,
12573                &mut self.value,
12574                decoder,
12575                offset + 16,
12576                _depth
12577            )?;
12578            Ok(())
12579        }
12580    }
12581
12582    impl fidl::encoding::ResourceTypeMarker for DictionaryRef {
12583        type Borrowed<'a> = &'a mut Self;
12584        fn take_or_borrow<'a>(
12585            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12586        ) -> Self::Borrowed<'a> {
12587            value
12588        }
12589    }
12590
12591    unsafe impl fidl::encoding::TypeMarker for DictionaryRef {
12592        type Owned = Self;
12593
12594        #[inline(always)]
12595        fn inline_align(_context: fidl::encoding::Context) -> usize {
12596            4
12597        }
12598
12599        #[inline(always)]
12600        fn inline_size(_context: fidl::encoding::Context) -> usize {
12601            4
12602        }
12603    }
12604
12605    unsafe impl fidl::encoding::Encode<DictionaryRef, fidl::encoding::DefaultFuchsiaResourceDialect>
12606        for &mut DictionaryRef
12607    {
12608        #[inline]
12609        unsafe fn encode(
12610            self,
12611            encoder: &mut fidl::encoding::Encoder<
12612                '_,
12613                fidl::encoding::DefaultFuchsiaResourceDialect,
12614            >,
12615            offset: usize,
12616            _depth: fidl::encoding::Depth,
12617        ) -> fidl::Result<()> {
12618            encoder.debug_check_bounds::<DictionaryRef>(offset);
12619            // Delegate to tuple encoding.
12620            fidl::encoding::Encode::<DictionaryRef, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
12621                (
12622                    <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.token),
12623                ),
12624                encoder, offset, _depth
12625            )
12626        }
12627    }
12628    unsafe impl<
12629            T0: fidl::encoding::Encode<
12630                fidl::encoding::HandleType<
12631                    fidl::EventPair,
12632                    { fidl::ObjectType::EVENTPAIR.into_raw() },
12633                    2147483648,
12634                >,
12635                fidl::encoding::DefaultFuchsiaResourceDialect,
12636            >,
12637        > fidl::encoding::Encode<DictionaryRef, fidl::encoding::DefaultFuchsiaResourceDialect>
12638        for (T0,)
12639    {
12640        #[inline]
12641        unsafe fn encode(
12642            self,
12643            encoder: &mut fidl::encoding::Encoder<
12644                '_,
12645                fidl::encoding::DefaultFuchsiaResourceDialect,
12646            >,
12647            offset: usize,
12648            depth: fidl::encoding::Depth,
12649        ) -> fidl::Result<()> {
12650            encoder.debug_check_bounds::<DictionaryRef>(offset);
12651            // Zero out padding regions. There's no need to apply masks
12652            // because the unmasked parts will be overwritten by fields.
12653            // Write the fields.
12654            self.0.encode(encoder, offset + 0, depth)?;
12655            Ok(())
12656        }
12657    }
12658
12659    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for DictionaryRef {
12660        #[inline(always)]
12661        fn new_empty() -> Self {
12662            Self {
12663                token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
12664            }
12665        }
12666
12667        #[inline]
12668        unsafe fn decode(
12669            &mut self,
12670            decoder: &mut fidl::encoding::Decoder<
12671                '_,
12672                fidl::encoding::DefaultFuchsiaResourceDialect,
12673            >,
12674            offset: usize,
12675            _depth: fidl::encoding::Depth,
12676        ) -> fidl::Result<()> {
12677            decoder.debug_check_bounds::<Self>(offset);
12678            // Verify that padding bytes are zero.
12679            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.token, decoder, offset + 0, _depth)?;
12680            Ok(())
12681        }
12682    }
12683
12684    impl fidl::encoding::ResourceTypeMarker for DirConnector {
12685        type Borrowed<'a> = &'a mut Self;
12686        fn take_or_borrow<'a>(
12687            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12688        ) -> Self::Borrowed<'a> {
12689            value
12690        }
12691    }
12692
12693    unsafe impl fidl::encoding::TypeMarker for DirConnector {
12694        type Owned = Self;
12695
12696        #[inline(always)]
12697        fn inline_align(_context: fidl::encoding::Context) -> usize {
12698            4
12699        }
12700
12701        #[inline(always)]
12702        fn inline_size(_context: fidl::encoding::Context) -> usize {
12703            4
12704        }
12705    }
12706
12707    unsafe impl fidl::encoding::Encode<DirConnector, fidl::encoding::DefaultFuchsiaResourceDialect>
12708        for &mut DirConnector
12709    {
12710        #[inline]
12711        unsafe fn encode(
12712            self,
12713            encoder: &mut fidl::encoding::Encoder<
12714                '_,
12715                fidl::encoding::DefaultFuchsiaResourceDialect,
12716            >,
12717            offset: usize,
12718            _depth: fidl::encoding::Depth,
12719        ) -> fidl::Result<()> {
12720            encoder.debug_check_bounds::<DirConnector>(offset);
12721            // Delegate to tuple encoding.
12722            fidl::encoding::Encode::<DirConnector, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
12723                (
12724                    <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.token),
12725                ),
12726                encoder, offset, _depth
12727            )
12728        }
12729    }
12730    unsafe impl<
12731            T0: fidl::encoding::Encode<
12732                fidl::encoding::HandleType<
12733                    fidl::EventPair,
12734                    { fidl::ObjectType::EVENTPAIR.into_raw() },
12735                    2147483648,
12736                >,
12737                fidl::encoding::DefaultFuchsiaResourceDialect,
12738            >,
12739        > fidl::encoding::Encode<DirConnector, fidl::encoding::DefaultFuchsiaResourceDialect>
12740        for (T0,)
12741    {
12742        #[inline]
12743        unsafe fn encode(
12744            self,
12745            encoder: &mut fidl::encoding::Encoder<
12746                '_,
12747                fidl::encoding::DefaultFuchsiaResourceDialect,
12748            >,
12749            offset: usize,
12750            depth: fidl::encoding::Depth,
12751        ) -> fidl::Result<()> {
12752            encoder.debug_check_bounds::<DirConnector>(offset);
12753            // Zero out padding regions. There's no need to apply masks
12754            // because the unmasked parts will be overwritten by fields.
12755            // Write the fields.
12756            self.0.encode(encoder, offset + 0, depth)?;
12757            Ok(())
12758        }
12759    }
12760
12761    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for DirConnector {
12762        #[inline(always)]
12763        fn new_empty() -> Self {
12764            Self {
12765                token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
12766            }
12767        }
12768
12769        #[inline]
12770        unsafe fn decode(
12771            &mut self,
12772            decoder: &mut fidl::encoding::Decoder<
12773                '_,
12774                fidl::encoding::DefaultFuchsiaResourceDialect,
12775            >,
12776            offset: usize,
12777            _depth: fidl::encoding::Depth,
12778        ) -> fidl::Result<()> {
12779            decoder.debug_check_bounds::<Self>(offset);
12780            // Verify that padding bytes are zero.
12781            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.token, decoder, offset + 0, _depth)?;
12782            Ok(())
12783        }
12784    }
12785
12786    impl fidl::encoding::ResourceTypeMarker for DirEntry {
12787        type Borrowed<'a> = &'a mut Self;
12788        fn take_or_borrow<'a>(
12789            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12790        ) -> Self::Borrowed<'a> {
12791            value
12792        }
12793    }
12794
12795    unsafe impl fidl::encoding::TypeMarker for DirEntry {
12796        type Owned = Self;
12797
12798        #[inline(always)]
12799        fn inline_align(_context: fidl::encoding::Context) -> usize {
12800            4
12801        }
12802
12803        #[inline(always)]
12804        fn inline_size(_context: fidl::encoding::Context) -> usize {
12805            4
12806        }
12807    }
12808
12809    unsafe impl fidl::encoding::Encode<DirEntry, fidl::encoding::DefaultFuchsiaResourceDialect>
12810        for &mut DirEntry
12811    {
12812        #[inline]
12813        unsafe fn encode(
12814            self,
12815            encoder: &mut fidl::encoding::Encoder<
12816                '_,
12817                fidl::encoding::DefaultFuchsiaResourceDialect,
12818            >,
12819            offset: usize,
12820            _depth: fidl::encoding::Depth,
12821        ) -> fidl::Result<()> {
12822            encoder.debug_check_bounds::<DirEntry>(offset);
12823            // Delegate to tuple encoding.
12824            fidl::encoding::Encode::<DirEntry, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
12825                (
12826                    <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.token),
12827                ),
12828                encoder, offset, _depth
12829            )
12830        }
12831    }
12832    unsafe impl<
12833            T0: fidl::encoding::Encode<
12834                fidl::encoding::HandleType<
12835                    fidl::EventPair,
12836                    { fidl::ObjectType::EVENTPAIR.into_raw() },
12837                    2147483648,
12838                >,
12839                fidl::encoding::DefaultFuchsiaResourceDialect,
12840            >,
12841        > fidl::encoding::Encode<DirEntry, fidl::encoding::DefaultFuchsiaResourceDialect> for (T0,)
12842    {
12843        #[inline]
12844        unsafe fn encode(
12845            self,
12846            encoder: &mut fidl::encoding::Encoder<
12847                '_,
12848                fidl::encoding::DefaultFuchsiaResourceDialect,
12849            >,
12850            offset: usize,
12851            depth: fidl::encoding::Depth,
12852        ) -> fidl::Result<()> {
12853            encoder.debug_check_bounds::<DirEntry>(offset);
12854            // Zero out padding regions. There's no need to apply masks
12855            // because the unmasked parts will be overwritten by fields.
12856            // Write the fields.
12857            self.0.encode(encoder, offset + 0, depth)?;
12858            Ok(())
12859        }
12860    }
12861
12862    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for DirEntry {
12863        #[inline(always)]
12864        fn new_empty() -> Self {
12865            Self {
12866                token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
12867            }
12868        }
12869
12870        #[inline]
12871        unsafe fn decode(
12872            &mut self,
12873            decoder: &mut fidl::encoding::Decoder<
12874                '_,
12875                fidl::encoding::DefaultFuchsiaResourceDialect,
12876            >,
12877            offset: usize,
12878            _depth: fidl::encoding::Depth,
12879        ) -> fidl::Result<()> {
12880            decoder.debug_check_bounds::<Self>(offset);
12881            // Verify that padding bytes are zero.
12882            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.token, decoder, offset + 0, _depth)?;
12883            Ok(())
12884        }
12885    }
12886
12887    impl fidl::encoding::ResourceTypeMarker for DirReceiverReceiveRequest {
12888        type Borrowed<'a> = &'a mut Self;
12889        fn take_or_borrow<'a>(
12890            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12891        ) -> Self::Borrowed<'a> {
12892            value
12893        }
12894    }
12895
12896    unsafe impl fidl::encoding::TypeMarker for DirReceiverReceiveRequest {
12897        type Owned = Self;
12898
12899        #[inline(always)]
12900        fn inline_align(_context: fidl::encoding::Context) -> usize {
12901            4
12902        }
12903
12904        #[inline(always)]
12905        fn inline_size(_context: fidl::encoding::Context) -> usize {
12906            4
12907        }
12908    }
12909
12910    unsafe impl
12911        fidl::encoding::Encode<
12912            DirReceiverReceiveRequest,
12913            fidl::encoding::DefaultFuchsiaResourceDialect,
12914        > for &mut DirReceiverReceiveRequest
12915    {
12916        #[inline]
12917        unsafe fn encode(
12918            self,
12919            encoder: &mut fidl::encoding::Encoder<
12920                '_,
12921                fidl::encoding::DefaultFuchsiaResourceDialect,
12922            >,
12923            offset: usize,
12924            _depth: fidl::encoding::Depth,
12925        ) -> fidl::Result<()> {
12926            encoder.debug_check_bounds::<DirReceiverReceiveRequest>(offset);
12927            // Delegate to tuple encoding.
12928            fidl::encoding::Encode::<
12929                DirReceiverReceiveRequest,
12930                fidl::encoding::DefaultFuchsiaResourceDialect,
12931            >::encode(
12932                (<fidl::encoding::Endpoint<
12933                    fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
12934                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
12935                    &mut self.channel
12936                ),),
12937                encoder,
12938                offset,
12939                _depth,
12940            )
12941        }
12942    }
12943    unsafe impl<
12944            T0: fidl::encoding::Encode<
12945                fidl::encoding::Endpoint<
12946                    fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
12947                >,
12948                fidl::encoding::DefaultFuchsiaResourceDialect,
12949            >,
12950        >
12951        fidl::encoding::Encode<
12952            DirReceiverReceiveRequest,
12953            fidl::encoding::DefaultFuchsiaResourceDialect,
12954        > for (T0,)
12955    {
12956        #[inline]
12957        unsafe fn encode(
12958            self,
12959            encoder: &mut fidl::encoding::Encoder<
12960                '_,
12961                fidl::encoding::DefaultFuchsiaResourceDialect,
12962            >,
12963            offset: usize,
12964            depth: fidl::encoding::Depth,
12965        ) -> fidl::Result<()> {
12966            encoder.debug_check_bounds::<DirReceiverReceiveRequest>(offset);
12967            // Zero out padding regions. There's no need to apply masks
12968            // because the unmasked parts will be overwritten by fields.
12969            // Write the fields.
12970            self.0.encode(encoder, offset + 0, depth)?;
12971            Ok(())
12972        }
12973    }
12974
12975    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12976        for DirReceiverReceiveRequest
12977    {
12978        #[inline(always)]
12979        fn new_empty() -> Self {
12980            Self {
12981                channel: fidl::new_empty!(
12982                    fidl::encoding::Endpoint<
12983                        fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
12984                    >,
12985                    fidl::encoding::DefaultFuchsiaResourceDialect
12986                ),
12987            }
12988        }
12989
12990        #[inline]
12991        unsafe fn decode(
12992            &mut self,
12993            decoder: &mut fidl::encoding::Decoder<
12994                '_,
12995                fidl::encoding::DefaultFuchsiaResourceDialect,
12996            >,
12997            offset: usize,
12998            _depth: fidl::encoding::Depth,
12999        ) -> fidl::Result<()> {
13000            decoder.debug_check_bounds::<Self>(offset);
13001            // Verify that padding bytes are zero.
13002            fidl::decode!(
13003                fidl::encoding::Endpoint<
13004                    fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
13005                >,
13006                fidl::encoding::DefaultFuchsiaResourceDialect,
13007                &mut self.channel,
13008                decoder,
13009                offset + 0,
13010                _depth
13011            )?;
13012            Ok(())
13013        }
13014    }
13015
13016    impl fidl::encoding::ResourceTypeMarker for InstanceToken {
13017        type Borrowed<'a> = &'a mut Self;
13018        fn take_or_borrow<'a>(
13019            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13020        ) -> Self::Borrowed<'a> {
13021            value
13022        }
13023    }
13024
13025    unsafe impl fidl::encoding::TypeMarker for InstanceToken {
13026        type Owned = Self;
13027
13028        #[inline(always)]
13029        fn inline_align(_context: fidl::encoding::Context) -> usize {
13030            4
13031        }
13032
13033        #[inline(always)]
13034        fn inline_size(_context: fidl::encoding::Context) -> usize {
13035            4
13036        }
13037    }
13038
13039    unsafe impl fidl::encoding::Encode<InstanceToken, fidl::encoding::DefaultFuchsiaResourceDialect>
13040        for &mut InstanceToken
13041    {
13042        #[inline]
13043        unsafe fn encode(
13044            self,
13045            encoder: &mut fidl::encoding::Encoder<
13046                '_,
13047                fidl::encoding::DefaultFuchsiaResourceDialect,
13048            >,
13049            offset: usize,
13050            _depth: fidl::encoding::Depth,
13051        ) -> fidl::Result<()> {
13052            encoder.debug_check_bounds::<InstanceToken>(offset);
13053            // Delegate to tuple encoding.
13054            fidl::encoding::Encode::<InstanceToken, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
13055                (
13056                    <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.token),
13057                ),
13058                encoder, offset, _depth
13059            )
13060        }
13061    }
13062    unsafe impl<
13063            T0: fidl::encoding::Encode<
13064                fidl::encoding::HandleType<
13065                    fidl::EventPair,
13066                    { fidl::ObjectType::EVENTPAIR.into_raw() },
13067                    2147483648,
13068                >,
13069                fidl::encoding::DefaultFuchsiaResourceDialect,
13070            >,
13071        > fidl::encoding::Encode<InstanceToken, fidl::encoding::DefaultFuchsiaResourceDialect>
13072        for (T0,)
13073    {
13074        #[inline]
13075        unsafe fn encode(
13076            self,
13077            encoder: &mut fidl::encoding::Encoder<
13078                '_,
13079                fidl::encoding::DefaultFuchsiaResourceDialect,
13080            >,
13081            offset: usize,
13082            depth: fidl::encoding::Depth,
13083        ) -> fidl::Result<()> {
13084            encoder.debug_check_bounds::<InstanceToken>(offset);
13085            // Zero out padding regions. There's no need to apply masks
13086            // because the unmasked parts will be overwritten by fields.
13087            // Write the fields.
13088            self.0.encode(encoder, offset + 0, depth)?;
13089            Ok(())
13090        }
13091    }
13092
13093    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for InstanceToken {
13094        #[inline(always)]
13095        fn new_empty() -> Self {
13096            Self {
13097                token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
13098            }
13099        }
13100
13101        #[inline]
13102        unsafe fn decode(
13103            &mut self,
13104            decoder: &mut fidl::encoding::Decoder<
13105                '_,
13106                fidl::encoding::DefaultFuchsiaResourceDialect,
13107            >,
13108            offset: usize,
13109            _depth: fidl::encoding::Depth,
13110        ) -> fidl::Result<()> {
13111            decoder.debug_check_bounds::<Self>(offset);
13112            // Verify that padding bytes are zero.
13113            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.token, decoder, offset + 0, _depth)?;
13114            Ok(())
13115        }
13116    }
13117
13118    impl fidl::encoding::ResourceTypeMarker for ProtocolPayload {
13119        type Borrowed<'a> = &'a mut Self;
13120        fn take_or_borrow<'a>(
13121            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13122        ) -> Self::Borrowed<'a> {
13123            value
13124        }
13125    }
13126
13127    unsafe impl fidl::encoding::TypeMarker for ProtocolPayload {
13128        type Owned = Self;
13129
13130        #[inline(always)]
13131        fn inline_align(_context: fidl::encoding::Context) -> usize {
13132            4
13133        }
13134
13135        #[inline(always)]
13136        fn inline_size(_context: fidl::encoding::Context) -> usize {
13137            4
13138        }
13139    }
13140
13141    unsafe impl
13142        fidl::encoding::Encode<ProtocolPayload, fidl::encoding::DefaultFuchsiaResourceDialect>
13143        for &mut ProtocolPayload
13144    {
13145        #[inline]
13146        unsafe fn encode(
13147            self,
13148            encoder: &mut fidl::encoding::Encoder<
13149                '_,
13150                fidl::encoding::DefaultFuchsiaResourceDialect,
13151            >,
13152            offset: usize,
13153            _depth: fidl::encoding::Depth,
13154        ) -> fidl::Result<()> {
13155            encoder.debug_check_bounds::<ProtocolPayload>(offset);
13156            // Delegate to tuple encoding.
13157            fidl::encoding::Encode::<ProtocolPayload, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
13158                (
13159                    <fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.channel),
13160                ),
13161                encoder, offset, _depth
13162            )
13163        }
13164    }
13165    unsafe impl<
13166            T0: fidl::encoding::Encode<
13167                fidl::encoding::HandleType<
13168                    fidl::Channel,
13169                    { fidl::ObjectType::CHANNEL.into_raw() },
13170                    2147483648,
13171                >,
13172                fidl::encoding::DefaultFuchsiaResourceDialect,
13173            >,
13174        > fidl::encoding::Encode<ProtocolPayload, fidl::encoding::DefaultFuchsiaResourceDialect>
13175        for (T0,)
13176    {
13177        #[inline]
13178        unsafe fn encode(
13179            self,
13180            encoder: &mut fidl::encoding::Encoder<
13181                '_,
13182                fidl::encoding::DefaultFuchsiaResourceDialect,
13183            >,
13184            offset: usize,
13185            depth: fidl::encoding::Depth,
13186        ) -> fidl::Result<()> {
13187            encoder.debug_check_bounds::<ProtocolPayload>(offset);
13188            // Zero out padding regions. There's no need to apply masks
13189            // because the unmasked parts will be overwritten by fields.
13190            // Write the fields.
13191            self.0.encode(encoder, offset + 0, depth)?;
13192            Ok(())
13193        }
13194    }
13195
13196    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13197        for ProtocolPayload
13198    {
13199        #[inline(always)]
13200        fn new_empty() -> Self {
13201            Self {
13202                channel: fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
13203            }
13204        }
13205
13206        #[inline]
13207        unsafe fn decode(
13208            &mut self,
13209            decoder: &mut fidl::encoding::Decoder<
13210                '_,
13211                fidl::encoding::DefaultFuchsiaResourceDialect,
13212            >,
13213            offset: usize,
13214            _depth: fidl::encoding::Depth,
13215        ) -> fidl::Result<()> {
13216            decoder.debug_check_bounds::<Self>(offset);
13217            // Verify that padding bytes are zero.
13218            fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.channel, decoder, offset + 0, _depth)?;
13219            Ok(())
13220        }
13221    }
13222
13223    impl RouteRequest {
13224        #[inline(always)]
13225        fn max_ordinal_present(&self) -> u64 {
13226            if let Some(_) = self.metadata {
13227                return 2;
13228            }
13229            if let Some(_) = self.requesting {
13230                return 1;
13231            }
13232            0
13233        }
13234    }
13235
13236    impl fidl::encoding::ResourceTypeMarker for RouteRequest {
13237        type Borrowed<'a> = &'a mut Self;
13238        fn take_or_borrow<'a>(
13239            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13240        ) -> Self::Borrowed<'a> {
13241            value
13242        }
13243    }
13244
13245    unsafe impl fidl::encoding::TypeMarker for RouteRequest {
13246        type Owned = Self;
13247
13248        #[inline(always)]
13249        fn inline_align(_context: fidl::encoding::Context) -> usize {
13250            8
13251        }
13252
13253        #[inline(always)]
13254        fn inline_size(_context: fidl::encoding::Context) -> usize {
13255            16
13256        }
13257    }
13258
13259    unsafe impl fidl::encoding::Encode<RouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
13260        for &mut RouteRequest
13261    {
13262        unsafe fn encode(
13263            self,
13264            encoder: &mut fidl::encoding::Encoder<
13265                '_,
13266                fidl::encoding::DefaultFuchsiaResourceDialect,
13267            >,
13268            offset: usize,
13269            mut depth: fidl::encoding::Depth,
13270        ) -> fidl::Result<()> {
13271            encoder.debug_check_bounds::<RouteRequest>(offset);
13272            // Vector header
13273            let max_ordinal: u64 = self.max_ordinal_present();
13274            encoder.write_num(max_ordinal, offset);
13275            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
13276            // Calling encoder.out_of_line_offset(0) is not allowed.
13277            if max_ordinal == 0 {
13278                return Ok(());
13279            }
13280            depth.increment()?;
13281            let envelope_size = 8;
13282            let bytes_len = max_ordinal as usize * envelope_size;
13283            #[allow(unused_variables)]
13284            let offset = encoder.out_of_line_offset(bytes_len);
13285            let mut _prev_end_offset: usize = 0;
13286            if 1 > max_ordinal {
13287                return Ok(());
13288            }
13289
13290            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13291            // are envelope_size bytes.
13292            let cur_offset: usize = (1 - 1) * envelope_size;
13293
13294            // Zero reserved fields.
13295            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13296
13297            // Safety:
13298            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13299            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13300            //   envelope_size bytes, there is always sufficient room.
13301            fidl::encoding::encode_in_envelope_optional::<
13302                InstanceToken,
13303                fidl::encoding::DefaultFuchsiaResourceDialect,
13304            >(
13305                self.requesting
13306                    .as_mut()
13307                    .map(<InstanceToken as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
13308                encoder,
13309                offset + cur_offset,
13310                depth,
13311            )?;
13312
13313            _prev_end_offset = cur_offset + envelope_size;
13314            if 2 > max_ordinal {
13315                return Ok(());
13316            }
13317
13318            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13319            // are envelope_size bytes.
13320            let cur_offset: usize = (2 - 1) * envelope_size;
13321
13322            // Zero reserved fields.
13323            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13324
13325            // Safety:
13326            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13327            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13328            //   envelope_size bytes, there is always sufficient room.
13329            fidl::encoding::encode_in_envelope_optional::<
13330                DictionaryRef,
13331                fidl::encoding::DefaultFuchsiaResourceDialect,
13332            >(
13333                self.metadata
13334                    .as_mut()
13335                    .map(<DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
13336                encoder,
13337                offset + cur_offset,
13338                depth,
13339            )?;
13340
13341            _prev_end_offset = cur_offset + envelope_size;
13342
13343            Ok(())
13344        }
13345    }
13346
13347    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for RouteRequest {
13348        #[inline(always)]
13349        fn new_empty() -> Self {
13350            Self::default()
13351        }
13352
13353        unsafe fn decode(
13354            &mut self,
13355            decoder: &mut fidl::encoding::Decoder<
13356                '_,
13357                fidl::encoding::DefaultFuchsiaResourceDialect,
13358            >,
13359            offset: usize,
13360            mut depth: fidl::encoding::Depth,
13361        ) -> fidl::Result<()> {
13362            decoder.debug_check_bounds::<Self>(offset);
13363            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13364                None => return Err(fidl::Error::NotNullable),
13365                Some(len) => len,
13366            };
13367            // Calling decoder.out_of_line_offset(0) is not allowed.
13368            if len == 0 {
13369                return Ok(());
13370            };
13371            depth.increment()?;
13372            let envelope_size = 8;
13373            let bytes_len = len * envelope_size;
13374            let offset = decoder.out_of_line_offset(bytes_len)?;
13375            // Decode the envelope for each type.
13376            let mut _next_ordinal_to_read = 0;
13377            let mut next_offset = offset;
13378            let end_offset = offset + bytes_len;
13379            _next_ordinal_to_read += 1;
13380            if next_offset >= end_offset {
13381                return Ok(());
13382            }
13383
13384            // Decode unknown envelopes for gaps in ordinals.
13385            while _next_ordinal_to_read < 1 {
13386                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13387                _next_ordinal_to_read += 1;
13388                next_offset += envelope_size;
13389            }
13390
13391            let next_out_of_line = decoder.next_out_of_line();
13392            let handles_before = decoder.remaining_handles();
13393            if let Some((inlined, num_bytes, num_handles)) =
13394                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13395            {
13396                let member_inline_size =
13397                    <InstanceToken as fidl::encoding::TypeMarker>::inline_size(decoder.context);
13398                if inlined != (member_inline_size <= 4) {
13399                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13400                }
13401                let inner_offset;
13402                let mut inner_depth = depth.clone();
13403                if inlined {
13404                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13405                    inner_offset = next_offset;
13406                } else {
13407                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13408                    inner_depth.increment()?;
13409                }
13410                let val_ref = self.requesting.get_or_insert_with(|| {
13411                    fidl::new_empty!(InstanceToken, fidl::encoding::DefaultFuchsiaResourceDialect)
13412                });
13413                fidl::decode!(
13414                    InstanceToken,
13415                    fidl::encoding::DefaultFuchsiaResourceDialect,
13416                    val_ref,
13417                    decoder,
13418                    inner_offset,
13419                    inner_depth
13420                )?;
13421                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13422                {
13423                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13424                }
13425                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13426                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13427                }
13428            }
13429
13430            next_offset += envelope_size;
13431            _next_ordinal_to_read += 1;
13432            if next_offset >= end_offset {
13433                return Ok(());
13434            }
13435
13436            // Decode unknown envelopes for gaps in ordinals.
13437            while _next_ordinal_to_read < 2 {
13438                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13439                _next_ordinal_to_read += 1;
13440                next_offset += envelope_size;
13441            }
13442
13443            let next_out_of_line = decoder.next_out_of_line();
13444            let handles_before = decoder.remaining_handles();
13445            if let Some((inlined, num_bytes, num_handles)) =
13446                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13447            {
13448                let member_inline_size =
13449                    <DictionaryRef as fidl::encoding::TypeMarker>::inline_size(decoder.context);
13450                if inlined != (member_inline_size <= 4) {
13451                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13452                }
13453                let inner_offset;
13454                let mut inner_depth = depth.clone();
13455                if inlined {
13456                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13457                    inner_offset = next_offset;
13458                } else {
13459                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13460                    inner_depth.increment()?;
13461                }
13462                let val_ref = self.metadata.get_or_insert_with(|| {
13463                    fidl::new_empty!(DictionaryRef, fidl::encoding::DefaultFuchsiaResourceDialect)
13464                });
13465                fidl::decode!(
13466                    DictionaryRef,
13467                    fidl::encoding::DefaultFuchsiaResourceDialect,
13468                    val_ref,
13469                    decoder,
13470                    inner_offset,
13471                    inner_depth
13472                )?;
13473                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13474                {
13475                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13476                }
13477                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13478                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13479                }
13480            }
13481
13482            next_offset += envelope_size;
13483
13484            // Decode the remaining unknown envelopes.
13485            while next_offset < end_offset {
13486                _next_ordinal_to_read += 1;
13487                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13488                next_offset += envelope_size;
13489            }
13490
13491            Ok(())
13492        }
13493    }
13494
13495    impl fidl::encoding::ResourceTypeMarker for Capability {
13496        type Borrowed<'a> = &'a mut Self;
13497        fn take_or_borrow<'a>(
13498            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13499        ) -> Self::Borrowed<'a> {
13500            value
13501        }
13502    }
13503
13504    unsafe impl fidl::encoding::TypeMarker for Capability {
13505        type Owned = Self;
13506
13507        #[inline(always)]
13508        fn inline_align(_context: fidl::encoding::Context) -> usize {
13509            8
13510        }
13511
13512        #[inline(always)]
13513        fn inline_size(_context: fidl::encoding::Context) -> usize {
13514            16
13515        }
13516    }
13517
13518    unsafe impl fidl::encoding::Encode<Capability, fidl::encoding::DefaultFuchsiaResourceDialect>
13519        for &mut Capability
13520    {
13521        #[inline]
13522        unsafe fn encode(
13523            self,
13524            encoder: &mut fidl::encoding::Encoder<
13525                '_,
13526                fidl::encoding::DefaultFuchsiaResourceDialect,
13527            >,
13528            offset: usize,
13529            _depth: fidl::encoding::Depth,
13530        ) -> fidl::Result<()> {
13531            encoder.debug_check_bounds::<Capability>(offset);
13532            encoder.write_num::<u64>(self.ordinal(), offset);
13533            match self {
13534            Capability::Unit(ref val) => {
13535                fidl::encoding::encode_in_envelope::<Unit, fidl::encoding::DefaultFuchsiaResourceDialect>(
13536                    <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
13537                    encoder, offset + 8, _depth
13538                )
13539            }
13540            Capability::Handle(ref mut val) => {
13541                fidl::encoding::encode_in_envelope::<fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect>(
13542                    <fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
13543                    encoder, offset + 8, _depth
13544                )
13545            }
13546            Capability::Data(ref val) => {
13547                fidl::encoding::encode_in_envelope::<Data, fidl::encoding::DefaultFuchsiaResourceDialect>(
13548                    <Data as fidl::encoding::ValueTypeMarker>::borrow(val),
13549                    encoder, offset + 8, _depth
13550                )
13551            }
13552            Capability::Dictionary(ref mut val) => {
13553                fidl::encoding::encode_in_envelope::<DictionaryRef, fidl::encoding::DefaultFuchsiaResourceDialect>(
13554                    <DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
13555                    encoder, offset + 8, _depth
13556                )
13557            }
13558            Capability::Connector(ref mut val) => {
13559                fidl::encoding::encode_in_envelope::<Connector, fidl::encoding::DefaultFuchsiaResourceDialect>(
13560                    <Connector as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
13561                    encoder, offset + 8, _depth
13562                )
13563            }
13564            Capability::DirConnector(ref mut val) => {
13565                fidl::encoding::encode_in_envelope::<DirConnector, fidl::encoding::DefaultFuchsiaResourceDialect>(
13566                    <DirConnector as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
13567                    encoder, offset + 8, _depth
13568                )
13569            }
13570            Capability::Directory(ref mut val) => {
13571                fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
13572                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
13573                    encoder, offset + 8, _depth
13574                )
13575            }
13576            Capability::DirEntry(ref mut val) => {
13577                fidl::encoding::encode_in_envelope::<DirEntry, fidl::encoding::DefaultFuchsiaResourceDialect>(
13578                    <DirEntry as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
13579                    encoder, offset + 8, _depth
13580                )
13581            }
13582            Capability::ConnectorRouter(ref mut val) => {
13583                fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ConnectorRouterMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
13584                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ConnectorRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
13585                    encoder, offset + 8, _depth
13586                )
13587            }
13588            Capability::DictionaryRouter(ref mut val) => {
13589                fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DictionaryRouterMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
13590                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DictionaryRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
13591                    encoder, offset + 8, _depth
13592                )
13593            }
13594            Capability::DirEntryRouter(ref mut val) => {
13595                fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirEntryRouterMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
13596                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirEntryRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
13597                    encoder, offset + 8, _depth
13598                )
13599            }
13600            Capability::DataRouter(ref mut val) => {
13601                fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DataRouterMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
13602                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DataRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
13603                    encoder, offset + 8, _depth
13604                )
13605            }
13606            Capability::DirConnectorRouter(ref mut val) => {
13607                fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirConnectorRouterMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
13608                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirConnectorRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
13609                    encoder, offset + 8, _depth
13610                )
13611            }
13612            Capability::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
13613        }
13614        }
13615    }
13616
13617    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Capability {
13618        #[inline(always)]
13619        fn new_empty() -> Self {
13620            Self::__SourceBreaking { unknown_ordinal: 0 }
13621        }
13622
13623        #[inline]
13624        unsafe fn decode(
13625            &mut self,
13626            decoder: &mut fidl::encoding::Decoder<
13627                '_,
13628                fidl::encoding::DefaultFuchsiaResourceDialect,
13629            >,
13630            offset: usize,
13631            mut depth: fidl::encoding::Depth,
13632        ) -> fidl::Result<()> {
13633            decoder.debug_check_bounds::<Self>(offset);
13634            #[allow(unused_variables)]
13635            let next_out_of_line = decoder.next_out_of_line();
13636            let handles_before = decoder.remaining_handles();
13637            let (ordinal, inlined, num_bytes, num_handles) =
13638                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
13639
13640            let member_inline_size = match ordinal {
13641            1 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13642            2 => <fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13643            3 => <Data as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13644            4 => <DictionaryRef as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13645            5 => <Connector as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13646            6 => <DirConnector as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13647            7 => <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13648            8 => <DirEntry as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13649            9 => <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ConnectorRouterMarker>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13650            10 => <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DictionaryRouterMarker>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13651            11 => <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirEntryRouterMarker>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13652            12 => <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DataRouterMarker>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13653            13 => <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirConnectorRouterMarker>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13654            0 => return Err(fidl::Error::UnknownUnionTag),
13655            _ => num_bytes as usize,
13656        };
13657
13658            if inlined != (member_inline_size <= 4) {
13659                return Err(fidl::Error::InvalidInlineBitInEnvelope);
13660            }
13661            let _inner_offset;
13662            if inlined {
13663                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
13664                _inner_offset = offset + 8;
13665            } else {
13666                depth.increment()?;
13667                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13668            }
13669            match ordinal {
13670                1 => {
13671                    #[allow(irrefutable_let_patterns)]
13672                    if let Capability::Unit(_) = self {
13673                        // Do nothing, read the value into the object
13674                    } else {
13675                        // Initialize `self` to the right variant
13676                        *self = Capability::Unit(fidl::new_empty!(
13677                            Unit,
13678                            fidl::encoding::DefaultFuchsiaResourceDialect
13679                        ));
13680                    }
13681                    #[allow(irrefutable_let_patterns)]
13682                    if let Capability::Unit(ref mut val) = self {
13683                        fidl::decode!(
13684                            Unit,
13685                            fidl::encoding::DefaultFuchsiaResourceDialect,
13686                            val,
13687                            decoder,
13688                            _inner_offset,
13689                            depth
13690                        )?;
13691                    } else {
13692                        unreachable!()
13693                    }
13694                }
13695                2 => {
13696                    #[allow(irrefutable_let_patterns)]
13697                    if let Capability::Handle(_) = self {
13698                        // Do nothing, read the value into the object
13699                    } else {
13700                        // Initialize `self` to the right variant
13701                        *self = Capability::Handle(
13702                            fidl::new_empty!(fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
13703                        );
13704                    }
13705                    #[allow(irrefutable_let_patterns)]
13706                    if let Capability::Handle(ref mut val) = self {
13707                        fidl::decode!(fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val, decoder, _inner_offset, depth)?;
13708                    } else {
13709                        unreachable!()
13710                    }
13711                }
13712                3 => {
13713                    #[allow(irrefutable_let_patterns)]
13714                    if let Capability::Data(_) = self {
13715                        // Do nothing, read the value into the object
13716                    } else {
13717                        // Initialize `self` to the right variant
13718                        *self = Capability::Data(fidl::new_empty!(
13719                            Data,
13720                            fidl::encoding::DefaultFuchsiaResourceDialect
13721                        ));
13722                    }
13723                    #[allow(irrefutable_let_patterns)]
13724                    if let Capability::Data(ref mut val) = self {
13725                        fidl::decode!(
13726                            Data,
13727                            fidl::encoding::DefaultFuchsiaResourceDialect,
13728                            val,
13729                            decoder,
13730                            _inner_offset,
13731                            depth
13732                        )?;
13733                    } else {
13734                        unreachable!()
13735                    }
13736                }
13737                4 => {
13738                    #[allow(irrefutable_let_patterns)]
13739                    if let Capability::Dictionary(_) = self {
13740                        // Do nothing, read the value into the object
13741                    } else {
13742                        // Initialize `self` to the right variant
13743                        *self = Capability::Dictionary(fidl::new_empty!(
13744                            DictionaryRef,
13745                            fidl::encoding::DefaultFuchsiaResourceDialect
13746                        ));
13747                    }
13748                    #[allow(irrefutable_let_patterns)]
13749                    if let Capability::Dictionary(ref mut val) = self {
13750                        fidl::decode!(
13751                            DictionaryRef,
13752                            fidl::encoding::DefaultFuchsiaResourceDialect,
13753                            val,
13754                            decoder,
13755                            _inner_offset,
13756                            depth
13757                        )?;
13758                    } else {
13759                        unreachable!()
13760                    }
13761                }
13762                5 => {
13763                    #[allow(irrefutable_let_patterns)]
13764                    if let Capability::Connector(_) = self {
13765                        // Do nothing, read the value into the object
13766                    } else {
13767                        // Initialize `self` to the right variant
13768                        *self = Capability::Connector(fidl::new_empty!(
13769                            Connector,
13770                            fidl::encoding::DefaultFuchsiaResourceDialect
13771                        ));
13772                    }
13773                    #[allow(irrefutable_let_patterns)]
13774                    if let Capability::Connector(ref mut val) = self {
13775                        fidl::decode!(
13776                            Connector,
13777                            fidl::encoding::DefaultFuchsiaResourceDialect,
13778                            val,
13779                            decoder,
13780                            _inner_offset,
13781                            depth
13782                        )?;
13783                    } else {
13784                        unreachable!()
13785                    }
13786                }
13787                6 => {
13788                    #[allow(irrefutable_let_patterns)]
13789                    if let Capability::DirConnector(_) = self {
13790                        // Do nothing, read the value into the object
13791                    } else {
13792                        // Initialize `self` to the right variant
13793                        *self = Capability::DirConnector(fidl::new_empty!(
13794                            DirConnector,
13795                            fidl::encoding::DefaultFuchsiaResourceDialect
13796                        ));
13797                    }
13798                    #[allow(irrefutable_let_patterns)]
13799                    if let Capability::DirConnector(ref mut val) = self {
13800                        fidl::decode!(
13801                            DirConnector,
13802                            fidl::encoding::DefaultFuchsiaResourceDialect,
13803                            val,
13804                            decoder,
13805                            _inner_offset,
13806                            depth
13807                        )?;
13808                    } else {
13809                        unreachable!()
13810                    }
13811                }
13812                7 => {
13813                    #[allow(irrefutable_let_patterns)]
13814                    if let Capability::Directory(_) = self {
13815                        // Do nothing, read the value into the object
13816                    } else {
13817                        // Initialize `self` to the right variant
13818                        *self = Capability::Directory(fidl::new_empty!(
13819                            fidl::encoding::Endpoint<
13820                                fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
13821                            >,
13822                            fidl::encoding::DefaultFuchsiaResourceDialect
13823                        ));
13824                    }
13825                    #[allow(irrefutable_let_patterns)]
13826                    if let Capability::Directory(ref mut val) = self {
13827                        fidl::decode!(
13828                            fidl::encoding::Endpoint<
13829                                fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
13830                            >,
13831                            fidl::encoding::DefaultFuchsiaResourceDialect,
13832                            val,
13833                            decoder,
13834                            _inner_offset,
13835                            depth
13836                        )?;
13837                    } else {
13838                        unreachable!()
13839                    }
13840                }
13841                8 => {
13842                    #[allow(irrefutable_let_patterns)]
13843                    if let Capability::DirEntry(_) = self {
13844                        // Do nothing, read the value into the object
13845                    } else {
13846                        // Initialize `self` to the right variant
13847                        *self = Capability::DirEntry(fidl::new_empty!(
13848                            DirEntry,
13849                            fidl::encoding::DefaultFuchsiaResourceDialect
13850                        ));
13851                    }
13852                    #[allow(irrefutable_let_patterns)]
13853                    if let Capability::DirEntry(ref mut val) = self {
13854                        fidl::decode!(
13855                            DirEntry,
13856                            fidl::encoding::DefaultFuchsiaResourceDialect,
13857                            val,
13858                            decoder,
13859                            _inner_offset,
13860                            depth
13861                        )?;
13862                    } else {
13863                        unreachable!()
13864                    }
13865                }
13866                9 => {
13867                    #[allow(irrefutable_let_patterns)]
13868                    if let Capability::ConnectorRouter(_) = self {
13869                        // Do nothing, read the value into the object
13870                    } else {
13871                        // Initialize `self` to the right variant
13872                        *self = Capability::ConnectorRouter(fidl::new_empty!(
13873                            fidl::encoding::Endpoint<
13874                                fidl::endpoints::ClientEnd<ConnectorRouterMarker>,
13875                            >,
13876                            fidl::encoding::DefaultFuchsiaResourceDialect
13877                        ));
13878                    }
13879                    #[allow(irrefutable_let_patterns)]
13880                    if let Capability::ConnectorRouter(ref mut val) = self {
13881                        fidl::decode!(
13882                            fidl::encoding::Endpoint<
13883                                fidl::endpoints::ClientEnd<ConnectorRouterMarker>,
13884                            >,
13885                            fidl::encoding::DefaultFuchsiaResourceDialect,
13886                            val,
13887                            decoder,
13888                            _inner_offset,
13889                            depth
13890                        )?;
13891                    } else {
13892                        unreachable!()
13893                    }
13894                }
13895                10 => {
13896                    #[allow(irrefutable_let_patterns)]
13897                    if let Capability::DictionaryRouter(_) = self {
13898                        // Do nothing, read the value into the object
13899                    } else {
13900                        // Initialize `self` to the right variant
13901                        *self = Capability::DictionaryRouter(fidl::new_empty!(
13902                            fidl::encoding::Endpoint<
13903                                fidl::endpoints::ClientEnd<DictionaryRouterMarker>,
13904                            >,
13905                            fidl::encoding::DefaultFuchsiaResourceDialect
13906                        ));
13907                    }
13908                    #[allow(irrefutable_let_patterns)]
13909                    if let Capability::DictionaryRouter(ref mut val) = self {
13910                        fidl::decode!(
13911                            fidl::encoding::Endpoint<
13912                                fidl::endpoints::ClientEnd<DictionaryRouterMarker>,
13913                            >,
13914                            fidl::encoding::DefaultFuchsiaResourceDialect,
13915                            val,
13916                            decoder,
13917                            _inner_offset,
13918                            depth
13919                        )?;
13920                    } else {
13921                        unreachable!()
13922                    }
13923                }
13924                11 => {
13925                    #[allow(irrefutable_let_patterns)]
13926                    if let Capability::DirEntryRouter(_) = self {
13927                        // Do nothing, read the value into the object
13928                    } else {
13929                        // Initialize `self` to the right variant
13930                        *self = Capability::DirEntryRouter(fidl::new_empty!(
13931                            fidl::encoding::Endpoint<
13932                                fidl::endpoints::ClientEnd<DirEntryRouterMarker>,
13933                            >,
13934                            fidl::encoding::DefaultFuchsiaResourceDialect
13935                        ));
13936                    }
13937                    #[allow(irrefutable_let_patterns)]
13938                    if let Capability::DirEntryRouter(ref mut val) = self {
13939                        fidl::decode!(
13940                            fidl::encoding::Endpoint<
13941                                fidl::endpoints::ClientEnd<DirEntryRouterMarker>,
13942                            >,
13943                            fidl::encoding::DefaultFuchsiaResourceDialect,
13944                            val,
13945                            decoder,
13946                            _inner_offset,
13947                            depth
13948                        )?;
13949                    } else {
13950                        unreachable!()
13951                    }
13952                }
13953                12 => {
13954                    #[allow(irrefutable_let_patterns)]
13955                    if let Capability::DataRouter(_) = self {
13956                        // Do nothing, read the value into the object
13957                    } else {
13958                        // Initialize `self` to the right variant
13959                        *self = Capability::DataRouter(fidl::new_empty!(
13960                            fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DataRouterMarker>>,
13961                            fidl::encoding::DefaultFuchsiaResourceDialect
13962                        ));
13963                    }
13964                    #[allow(irrefutable_let_patterns)]
13965                    if let Capability::DataRouter(ref mut val) = self {
13966                        fidl::decode!(
13967                            fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DataRouterMarker>>,
13968                            fidl::encoding::DefaultFuchsiaResourceDialect,
13969                            val,
13970                            decoder,
13971                            _inner_offset,
13972                            depth
13973                        )?;
13974                    } else {
13975                        unreachable!()
13976                    }
13977                }
13978                13 => {
13979                    #[allow(irrefutable_let_patterns)]
13980                    if let Capability::DirConnectorRouter(_) = self {
13981                        // Do nothing, read the value into the object
13982                    } else {
13983                        // Initialize `self` to the right variant
13984                        *self = Capability::DirConnectorRouter(fidl::new_empty!(
13985                            fidl::encoding::Endpoint<
13986                                fidl::endpoints::ClientEnd<DirConnectorRouterMarker>,
13987                            >,
13988                            fidl::encoding::DefaultFuchsiaResourceDialect
13989                        ));
13990                    }
13991                    #[allow(irrefutable_let_patterns)]
13992                    if let Capability::DirConnectorRouter(ref mut val) = self {
13993                        fidl::decode!(
13994                            fidl::encoding::Endpoint<
13995                                fidl::endpoints::ClientEnd<DirConnectorRouterMarker>,
13996                            >,
13997                            fidl::encoding::DefaultFuchsiaResourceDialect,
13998                            val,
13999                            decoder,
14000                            _inner_offset,
14001                            depth
14002                        )?;
14003                    } else {
14004                        unreachable!()
14005                    }
14006                }
14007                #[allow(deprecated)]
14008                ordinal => {
14009                    for _ in 0..num_handles {
14010                        decoder.drop_next_handle()?;
14011                    }
14012                    *self = Capability::__SourceBreaking { unknown_ordinal: ordinal };
14013                }
14014            }
14015            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
14016                return Err(fidl::Error::InvalidNumBytesInEnvelope);
14017            }
14018            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14019                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14020            }
14021            Ok(())
14022        }
14023    }
14024
14025    impl fidl::encoding::ResourceTypeMarker for ConnectorRouterRouteResponse {
14026        type Borrowed<'a> = &'a mut Self;
14027        fn take_or_borrow<'a>(
14028            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14029        ) -> Self::Borrowed<'a> {
14030            value
14031        }
14032    }
14033
14034    unsafe impl fidl::encoding::TypeMarker for ConnectorRouterRouteResponse {
14035        type Owned = Self;
14036
14037        #[inline(always)]
14038        fn inline_align(_context: fidl::encoding::Context) -> usize {
14039            8
14040        }
14041
14042        #[inline(always)]
14043        fn inline_size(_context: fidl::encoding::Context) -> usize {
14044            16
14045        }
14046    }
14047
14048    unsafe impl
14049        fidl::encoding::Encode<
14050            ConnectorRouterRouteResponse,
14051            fidl::encoding::DefaultFuchsiaResourceDialect,
14052        > for &mut ConnectorRouterRouteResponse
14053    {
14054        #[inline]
14055        unsafe fn encode(
14056            self,
14057            encoder: &mut fidl::encoding::Encoder<
14058                '_,
14059                fidl::encoding::DefaultFuchsiaResourceDialect,
14060            >,
14061            offset: usize,
14062            _depth: fidl::encoding::Depth,
14063        ) -> fidl::Result<()> {
14064            encoder.debug_check_bounds::<ConnectorRouterRouteResponse>(offset);
14065            encoder.write_num::<u64>(self.ordinal(), offset);
14066            match self {
14067                ConnectorRouterRouteResponse::Connector(ref mut val) => {
14068                    fidl::encoding::encode_in_envelope::<
14069                        Connector,
14070                        fidl::encoding::DefaultFuchsiaResourceDialect,
14071                    >(
14072                        <Connector as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
14073                        encoder,
14074                        offset + 8,
14075                        _depth,
14076                    )
14077                }
14078                ConnectorRouterRouteResponse::Unavailable(ref val) => {
14079                    fidl::encoding::encode_in_envelope::<
14080                        Unit,
14081                        fidl::encoding::DefaultFuchsiaResourceDialect,
14082                    >(
14083                        <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
14084                        encoder,
14085                        offset + 8,
14086                        _depth,
14087                    )
14088                }
14089            }
14090        }
14091    }
14092
14093    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14094        for ConnectorRouterRouteResponse
14095    {
14096        #[inline(always)]
14097        fn new_empty() -> Self {
14098            Self::Connector(fidl::new_empty!(
14099                Connector,
14100                fidl::encoding::DefaultFuchsiaResourceDialect
14101            ))
14102        }
14103
14104        #[inline]
14105        unsafe fn decode(
14106            &mut self,
14107            decoder: &mut fidl::encoding::Decoder<
14108                '_,
14109                fidl::encoding::DefaultFuchsiaResourceDialect,
14110            >,
14111            offset: usize,
14112            mut depth: fidl::encoding::Depth,
14113        ) -> fidl::Result<()> {
14114            decoder.debug_check_bounds::<Self>(offset);
14115            #[allow(unused_variables)]
14116            let next_out_of_line = decoder.next_out_of_line();
14117            let handles_before = decoder.remaining_handles();
14118            let (ordinal, inlined, num_bytes, num_handles) =
14119                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
14120
14121            let member_inline_size = match ordinal {
14122                1 => <Connector as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14123                2 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14124                _ => return Err(fidl::Error::UnknownUnionTag),
14125            };
14126
14127            if inlined != (member_inline_size <= 4) {
14128                return Err(fidl::Error::InvalidInlineBitInEnvelope);
14129            }
14130            let _inner_offset;
14131            if inlined {
14132                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
14133                _inner_offset = offset + 8;
14134            } else {
14135                depth.increment()?;
14136                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14137            }
14138            match ordinal {
14139                1 => {
14140                    #[allow(irrefutable_let_patterns)]
14141                    if let ConnectorRouterRouteResponse::Connector(_) = self {
14142                        // Do nothing, read the value into the object
14143                    } else {
14144                        // Initialize `self` to the right variant
14145                        *self = ConnectorRouterRouteResponse::Connector(fidl::new_empty!(
14146                            Connector,
14147                            fidl::encoding::DefaultFuchsiaResourceDialect
14148                        ));
14149                    }
14150                    #[allow(irrefutable_let_patterns)]
14151                    if let ConnectorRouterRouteResponse::Connector(ref mut val) = self {
14152                        fidl::decode!(
14153                            Connector,
14154                            fidl::encoding::DefaultFuchsiaResourceDialect,
14155                            val,
14156                            decoder,
14157                            _inner_offset,
14158                            depth
14159                        )?;
14160                    } else {
14161                        unreachable!()
14162                    }
14163                }
14164                2 => {
14165                    #[allow(irrefutable_let_patterns)]
14166                    if let ConnectorRouterRouteResponse::Unavailable(_) = self {
14167                        // Do nothing, read the value into the object
14168                    } else {
14169                        // Initialize `self` to the right variant
14170                        *self = ConnectorRouterRouteResponse::Unavailable(fidl::new_empty!(
14171                            Unit,
14172                            fidl::encoding::DefaultFuchsiaResourceDialect
14173                        ));
14174                    }
14175                    #[allow(irrefutable_let_patterns)]
14176                    if let ConnectorRouterRouteResponse::Unavailable(ref mut val) = self {
14177                        fidl::decode!(
14178                            Unit,
14179                            fidl::encoding::DefaultFuchsiaResourceDialect,
14180                            val,
14181                            decoder,
14182                            _inner_offset,
14183                            depth
14184                        )?;
14185                    } else {
14186                        unreachable!()
14187                    }
14188                }
14189                ordinal => panic!("unexpected ordinal {:?}", ordinal),
14190            }
14191            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
14192                return Err(fidl::Error::InvalidNumBytesInEnvelope);
14193            }
14194            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14195                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14196            }
14197            Ok(())
14198        }
14199    }
14200
14201    impl fidl::encoding::ResourceTypeMarker for DataRouterRouteResponse {
14202        type Borrowed<'a> = &'a mut Self;
14203        fn take_or_borrow<'a>(
14204            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14205        ) -> Self::Borrowed<'a> {
14206            value
14207        }
14208    }
14209
14210    unsafe impl fidl::encoding::TypeMarker for DataRouterRouteResponse {
14211        type Owned = Self;
14212
14213        #[inline(always)]
14214        fn inline_align(_context: fidl::encoding::Context) -> usize {
14215            8
14216        }
14217
14218        #[inline(always)]
14219        fn inline_size(_context: fidl::encoding::Context) -> usize {
14220            16
14221        }
14222    }
14223
14224    unsafe impl
14225        fidl::encoding::Encode<
14226            DataRouterRouteResponse,
14227            fidl::encoding::DefaultFuchsiaResourceDialect,
14228        > for &mut DataRouterRouteResponse
14229    {
14230        #[inline]
14231        unsafe fn encode(
14232            self,
14233            encoder: &mut fidl::encoding::Encoder<
14234                '_,
14235                fidl::encoding::DefaultFuchsiaResourceDialect,
14236            >,
14237            offset: usize,
14238            _depth: fidl::encoding::Depth,
14239        ) -> fidl::Result<()> {
14240            encoder.debug_check_bounds::<DataRouterRouteResponse>(offset);
14241            encoder.write_num::<u64>(self.ordinal(), offset);
14242            match self {
14243                DataRouterRouteResponse::Data(ref val) => fidl::encoding::encode_in_envelope::<
14244                    Data,
14245                    fidl::encoding::DefaultFuchsiaResourceDialect,
14246                >(
14247                    <Data as fidl::encoding::ValueTypeMarker>::borrow(val),
14248                    encoder,
14249                    offset + 8,
14250                    _depth,
14251                ),
14252                DataRouterRouteResponse::Unavailable(ref val) => {
14253                    fidl::encoding::encode_in_envelope::<
14254                        Unit,
14255                        fidl::encoding::DefaultFuchsiaResourceDialect,
14256                    >(
14257                        <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
14258                        encoder,
14259                        offset + 8,
14260                        _depth,
14261                    )
14262                }
14263            }
14264        }
14265    }
14266
14267    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14268        for DataRouterRouteResponse
14269    {
14270        #[inline(always)]
14271        fn new_empty() -> Self {
14272            Self::Data(fidl::new_empty!(Data, fidl::encoding::DefaultFuchsiaResourceDialect))
14273        }
14274
14275        #[inline]
14276        unsafe fn decode(
14277            &mut self,
14278            decoder: &mut fidl::encoding::Decoder<
14279                '_,
14280                fidl::encoding::DefaultFuchsiaResourceDialect,
14281            >,
14282            offset: usize,
14283            mut depth: fidl::encoding::Depth,
14284        ) -> fidl::Result<()> {
14285            decoder.debug_check_bounds::<Self>(offset);
14286            #[allow(unused_variables)]
14287            let next_out_of_line = decoder.next_out_of_line();
14288            let handles_before = decoder.remaining_handles();
14289            let (ordinal, inlined, num_bytes, num_handles) =
14290                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
14291
14292            let member_inline_size = match ordinal {
14293                1 => <Data as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14294                2 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14295                _ => return Err(fidl::Error::UnknownUnionTag),
14296            };
14297
14298            if inlined != (member_inline_size <= 4) {
14299                return Err(fidl::Error::InvalidInlineBitInEnvelope);
14300            }
14301            let _inner_offset;
14302            if inlined {
14303                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
14304                _inner_offset = offset + 8;
14305            } else {
14306                depth.increment()?;
14307                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14308            }
14309            match ordinal {
14310                1 => {
14311                    #[allow(irrefutable_let_patterns)]
14312                    if let DataRouterRouteResponse::Data(_) = self {
14313                        // Do nothing, read the value into the object
14314                    } else {
14315                        // Initialize `self` to the right variant
14316                        *self = DataRouterRouteResponse::Data(fidl::new_empty!(
14317                            Data,
14318                            fidl::encoding::DefaultFuchsiaResourceDialect
14319                        ));
14320                    }
14321                    #[allow(irrefutable_let_patterns)]
14322                    if let DataRouterRouteResponse::Data(ref mut val) = self {
14323                        fidl::decode!(
14324                            Data,
14325                            fidl::encoding::DefaultFuchsiaResourceDialect,
14326                            val,
14327                            decoder,
14328                            _inner_offset,
14329                            depth
14330                        )?;
14331                    } else {
14332                        unreachable!()
14333                    }
14334                }
14335                2 => {
14336                    #[allow(irrefutable_let_patterns)]
14337                    if let DataRouterRouteResponse::Unavailable(_) = self {
14338                        // Do nothing, read the value into the object
14339                    } else {
14340                        // Initialize `self` to the right variant
14341                        *self = DataRouterRouteResponse::Unavailable(fidl::new_empty!(
14342                            Unit,
14343                            fidl::encoding::DefaultFuchsiaResourceDialect
14344                        ));
14345                    }
14346                    #[allow(irrefutable_let_patterns)]
14347                    if let DataRouterRouteResponse::Unavailable(ref mut val) = self {
14348                        fidl::decode!(
14349                            Unit,
14350                            fidl::encoding::DefaultFuchsiaResourceDialect,
14351                            val,
14352                            decoder,
14353                            _inner_offset,
14354                            depth
14355                        )?;
14356                    } else {
14357                        unreachable!()
14358                    }
14359                }
14360                ordinal => panic!("unexpected ordinal {:?}", ordinal),
14361            }
14362            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
14363                return Err(fidl::Error::InvalidNumBytesInEnvelope);
14364            }
14365            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14366                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14367            }
14368            Ok(())
14369        }
14370    }
14371
14372    impl fidl::encoding::ResourceTypeMarker for DictionaryRouterRouteResponse {
14373        type Borrowed<'a> = &'a mut Self;
14374        fn take_or_borrow<'a>(
14375            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14376        ) -> Self::Borrowed<'a> {
14377            value
14378        }
14379    }
14380
14381    unsafe impl fidl::encoding::TypeMarker for DictionaryRouterRouteResponse {
14382        type Owned = Self;
14383
14384        #[inline(always)]
14385        fn inline_align(_context: fidl::encoding::Context) -> usize {
14386            8
14387        }
14388
14389        #[inline(always)]
14390        fn inline_size(_context: fidl::encoding::Context) -> usize {
14391            16
14392        }
14393    }
14394
14395    unsafe impl
14396        fidl::encoding::Encode<
14397            DictionaryRouterRouteResponse,
14398            fidl::encoding::DefaultFuchsiaResourceDialect,
14399        > for &mut DictionaryRouterRouteResponse
14400    {
14401        #[inline]
14402        unsafe fn encode(
14403            self,
14404            encoder: &mut fidl::encoding::Encoder<
14405                '_,
14406                fidl::encoding::DefaultFuchsiaResourceDialect,
14407            >,
14408            offset: usize,
14409            _depth: fidl::encoding::Depth,
14410        ) -> fidl::Result<()> {
14411            encoder.debug_check_bounds::<DictionaryRouterRouteResponse>(offset);
14412            encoder.write_num::<u64>(self.ordinal(), offset);
14413            match self {
14414                DictionaryRouterRouteResponse::Dictionary(ref mut val) => {
14415                    fidl::encoding::encode_in_envelope::<
14416                        DictionaryRef,
14417                        fidl::encoding::DefaultFuchsiaResourceDialect,
14418                    >(
14419                        <DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
14420                        encoder,
14421                        offset + 8,
14422                        _depth,
14423                    )
14424                }
14425                DictionaryRouterRouteResponse::Unavailable(ref val) => {
14426                    fidl::encoding::encode_in_envelope::<
14427                        Unit,
14428                        fidl::encoding::DefaultFuchsiaResourceDialect,
14429                    >(
14430                        <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
14431                        encoder,
14432                        offset + 8,
14433                        _depth,
14434                    )
14435                }
14436            }
14437        }
14438    }
14439
14440    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14441        for DictionaryRouterRouteResponse
14442    {
14443        #[inline(always)]
14444        fn new_empty() -> Self {
14445            Self::Dictionary(fidl::new_empty!(
14446                DictionaryRef,
14447                fidl::encoding::DefaultFuchsiaResourceDialect
14448            ))
14449        }
14450
14451        #[inline]
14452        unsafe fn decode(
14453            &mut self,
14454            decoder: &mut fidl::encoding::Decoder<
14455                '_,
14456                fidl::encoding::DefaultFuchsiaResourceDialect,
14457            >,
14458            offset: usize,
14459            mut depth: fidl::encoding::Depth,
14460        ) -> fidl::Result<()> {
14461            decoder.debug_check_bounds::<Self>(offset);
14462            #[allow(unused_variables)]
14463            let next_out_of_line = decoder.next_out_of_line();
14464            let handles_before = decoder.remaining_handles();
14465            let (ordinal, inlined, num_bytes, num_handles) =
14466                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
14467
14468            let member_inline_size = match ordinal {
14469                1 => <DictionaryRef as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14470                2 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14471                _ => return Err(fidl::Error::UnknownUnionTag),
14472            };
14473
14474            if inlined != (member_inline_size <= 4) {
14475                return Err(fidl::Error::InvalidInlineBitInEnvelope);
14476            }
14477            let _inner_offset;
14478            if inlined {
14479                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
14480                _inner_offset = offset + 8;
14481            } else {
14482                depth.increment()?;
14483                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14484            }
14485            match ordinal {
14486                1 => {
14487                    #[allow(irrefutable_let_patterns)]
14488                    if let DictionaryRouterRouteResponse::Dictionary(_) = self {
14489                        // Do nothing, read the value into the object
14490                    } else {
14491                        // Initialize `self` to the right variant
14492                        *self = DictionaryRouterRouteResponse::Dictionary(fidl::new_empty!(
14493                            DictionaryRef,
14494                            fidl::encoding::DefaultFuchsiaResourceDialect
14495                        ));
14496                    }
14497                    #[allow(irrefutable_let_patterns)]
14498                    if let DictionaryRouterRouteResponse::Dictionary(ref mut val) = self {
14499                        fidl::decode!(
14500                            DictionaryRef,
14501                            fidl::encoding::DefaultFuchsiaResourceDialect,
14502                            val,
14503                            decoder,
14504                            _inner_offset,
14505                            depth
14506                        )?;
14507                    } else {
14508                        unreachable!()
14509                    }
14510                }
14511                2 => {
14512                    #[allow(irrefutable_let_patterns)]
14513                    if let DictionaryRouterRouteResponse::Unavailable(_) = self {
14514                        // Do nothing, read the value into the object
14515                    } else {
14516                        // Initialize `self` to the right variant
14517                        *self = DictionaryRouterRouteResponse::Unavailable(fidl::new_empty!(
14518                            Unit,
14519                            fidl::encoding::DefaultFuchsiaResourceDialect
14520                        ));
14521                    }
14522                    #[allow(irrefutable_let_patterns)]
14523                    if let DictionaryRouterRouteResponse::Unavailable(ref mut val) = self {
14524                        fidl::decode!(
14525                            Unit,
14526                            fidl::encoding::DefaultFuchsiaResourceDialect,
14527                            val,
14528                            decoder,
14529                            _inner_offset,
14530                            depth
14531                        )?;
14532                    } else {
14533                        unreachable!()
14534                    }
14535                }
14536                ordinal => panic!("unexpected ordinal {:?}", ordinal),
14537            }
14538            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
14539                return Err(fidl::Error::InvalidNumBytesInEnvelope);
14540            }
14541            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14542                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14543            }
14544            Ok(())
14545        }
14546    }
14547
14548    impl fidl::encoding::ResourceTypeMarker for DirConnectorRouterRouteResponse {
14549        type Borrowed<'a> = &'a mut Self;
14550        fn take_or_borrow<'a>(
14551            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14552        ) -> Self::Borrowed<'a> {
14553            value
14554        }
14555    }
14556
14557    unsafe impl fidl::encoding::TypeMarker for DirConnectorRouterRouteResponse {
14558        type Owned = Self;
14559
14560        #[inline(always)]
14561        fn inline_align(_context: fidl::encoding::Context) -> usize {
14562            8
14563        }
14564
14565        #[inline(always)]
14566        fn inline_size(_context: fidl::encoding::Context) -> usize {
14567            16
14568        }
14569    }
14570
14571    unsafe impl
14572        fidl::encoding::Encode<
14573            DirConnectorRouterRouteResponse,
14574            fidl::encoding::DefaultFuchsiaResourceDialect,
14575        > for &mut DirConnectorRouterRouteResponse
14576    {
14577        #[inline]
14578        unsafe fn encode(
14579            self,
14580            encoder: &mut fidl::encoding::Encoder<
14581                '_,
14582                fidl::encoding::DefaultFuchsiaResourceDialect,
14583            >,
14584            offset: usize,
14585            _depth: fidl::encoding::Depth,
14586        ) -> fidl::Result<()> {
14587            encoder.debug_check_bounds::<DirConnectorRouterRouteResponse>(offset);
14588            encoder.write_num::<u64>(self.ordinal(), offset);
14589            match self {
14590                DirConnectorRouterRouteResponse::DirConnector(ref mut val) => {
14591                    fidl::encoding::encode_in_envelope::<
14592                        DirConnector,
14593                        fidl::encoding::DefaultFuchsiaResourceDialect,
14594                    >(
14595                        <DirConnector as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
14596                        encoder,
14597                        offset + 8,
14598                        _depth,
14599                    )
14600                }
14601                DirConnectorRouterRouteResponse::Unavailable(ref val) => {
14602                    fidl::encoding::encode_in_envelope::<
14603                        Unit,
14604                        fidl::encoding::DefaultFuchsiaResourceDialect,
14605                    >(
14606                        <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
14607                        encoder,
14608                        offset + 8,
14609                        _depth,
14610                    )
14611                }
14612            }
14613        }
14614    }
14615
14616    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14617        for DirConnectorRouterRouteResponse
14618    {
14619        #[inline(always)]
14620        fn new_empty() -> Self {
14621            Self::DirConnector(fidl::new_empty!(
14622                DirConnector,
14623                fidl::encoding::DefaultFuchsiaResourceDialect
14624            ))
14625        }
14626
14627        #[inline]
14628        unsafe fn decode(
14629            &mut self,
14630            decoder: &mut fidl::encoding::Decoder<
14631                '_,
14632                fidl::encoding::DefaultFuchsiaResourceDialect,
14633            >,
14634            offset: usize,
14635            mut depth: fidl::encoding::Depth,
14636        ) -> fidl::Result<()> {
14637            decoder.debug_check_bounds::<Self>(offset);
14638            #[allow(unused_variables)]
14639            let next_out_of_line = decoder.next_out_of_line();
14640            let handles_before = decoder.remaining_handles();
14641            let (ordinal, inlined, num_bytes, num_handles) =
14642                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
14643
14644            let member_inline_size = match ordinal {
14645                1 => <DirConnector as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14646                2 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14647                _ => return Err(fidl::Error::UnknownUnionTag),
14648            };
14649
14650            if inlined != (member_inline_size <= 4) {
14651                return Err(fidl::Error::InvalidInlineBitInEnvelope);
14652            }
14653            let _inner_offset;
14654            if inlined {
14655                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
14656                _inner_offset = offset + 8;
14657            } else {
14658                depth.increment()?;
14659                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14660            }
14661            match ordinal {
14662                1 => {
14663                    #[allow(irrefutable_let_patterns)]
14664                    if let DirConnectorRouterRouteResponse::DirConnector(_) = self {
14665                        // Do nothing, read the value into the object
14666                    } else {
14667                        // Initialize `self` to the right variant
14668                        *self = DirConnectorRouterRouteResponse::DirConnector(fidl::new_empty!(
14669                            DirConnector,
14670                            fidl::encoding::DefaultFuchsiaResourceDialect
14671                        ));
14672                    }
14673                    #[allow(irrefutable_let_patterns)]
14674                    if let DirConnectorRouterRouteResponse::DirConnector(ref mut val) = self {
14675                        fidl::decode!(
14676                            DirConnector,
14677                            fidl::encoding::DefaultFuchsiaResourceDialect,
14678                            val,
14679                            decoder,
14680                            _inner_offset,
14681                            depth
14682                        )?;
14683                    } else {
14684                        unreachable!()
14685                    }
14686                }
14687                2 => {
14688                    #[allow(irrefutable_let_patterns)]
14689                    if let DirConnectorRouterRouteResponse::Unavailable(_) = self {
14690                        // Do nothing, read the value into the object
14691                    } else {
14692                        // Initialize `self` to the right variant
14693                        *self = DirConnectorRouterRouteResponse::Unavailable(fidl::new_empty!(
14694                            Unit,
14695                            fidl::encoding::DefaultFuchsiaResourceDialect
14696                        ));
14697                    }
14698                    #[allow(irrefutable_let_patterns)]
14699                    if let DirConnectorRouterRouteResponse::Unavailable(ref mut val) = self {
14700                        fidl::decode!(
14701                            Unit,
14702                            fidl::encoding::DefaultFuchsiaResourceDialect,
14703                            val,
14704                            decoder,
14705                            _inner_offset,
14706                            depth
14707                        )?;
14708                    } else {
14709                        unreachable!()
14710                    }
14711                }
14712                ordinal => panic!("unexpected ordinal {:?}", ordinal),
14713            }
14714            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
14715                return Err(fidl::Error::InvalidNumBytesInEnvelope);
14716            }
14717            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14718                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14719            }
14720            Ok(())
14721        }
14722    }
14723
14724    impl fidl::encoding::ResourceTypeMarker for DirEntryRouterRouteResponse {
14725        type Borrowed<'a> = &'a mut Self;
14726        fn take_or_borrow<'a>(
14727            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14728        ) -> Self::Borrowed<'a> {
14729            value
14730        }
14731    }
14732
14733    unsafe impl fidl::encoding::TypeMarker for DirEntryRouterRouteResponse {
14734        type Owned = Self;
14735
14736        #[inline(always)]
14737        fn inline_align(_context: fidl::encoding::Context) -> usize {
14738            8
14739        }
14740
14741        #[inline(always)]
14742        fn inline_size(_context: fidl::encoding::Context) -> usize {
14743            16
14744        }
14745    }
14746
14747    unsafe impl
14748        fidl::encoding::Encode<
14749            DirEntryRouterRouteResponse,
14750            fidl::encoding::DefaultFuchsiaResourceDialect,
14751        > for &mut DirEntryRouterRouteResponse
14752    {
14753        #[inline]
14754        unsafe fn encode(
14755            self,
14756            encoder: &mut fidl::encoding::Encoder<
14757                '_,
14758                fidl::encoding::DefaultFuchsiaResourceDialect,
14759            >,
14760            offset: usize,
14761            _depth: fidl::encoding::Depth,
14762        ) -> fidl::Result<()> {
14763            encoder.debug_check_bounds::<DirEntryRouterRouteResponse>(offset);
14764            encoder.write_num::<u64>(self.ordinal(), offset);
14765            match self {
14766                DirEntryRouterRouteResponse::DirEntry(ref mut val) => {
14767                    fidl::encoding::encode_in_envelope::<
14768                        DirEntry,
14769                        fidl::encoding::DefaultFuchsiaResourceDialect,
14770                    >(
14771                        <DirEntry as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
14772                        encoder,
14773                        offset + 8,
14774                        _depth,
14775                    )
14776                }
14777                DirEntryRouterRouteResponse::Unavailable(ref val) => {
14778                    fidl::encoding::encode_in_envelope::<
14779                        Unit,
14780                        fidl::encoding::DefaultFuchsiaResourceDialect,
14781                    >(
14782                        <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
14783                        encoder,
14784                        offset + 8,
14785                        _depth,
14786                    )
14787                }
14788            }
14789        }
14790    }
14791
14792    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14793        for DirEntryRouterRouteResponse
14794    {
14795        #[inline(always)]
14796        fn new_empty() -> Self {
14797            Self::DirEntry(fidl::new_empty!(
14798                DirEntry,
14799                fidl::encoding::DefaultFuchsiaResourceDialect
14800            ))
14801        }
14802
14803        #[inline]
14804        unsafe fn decode(
14805            &mut self,
14806            decoder: &mut fidl::encoding::Decoder<
14807                '_,
14808                fidl::encoding::DefaultFuchsiaResourceDialect,
14809            >,
14810            offset: usize,
14811            mut depth: fidl::encoding::Depth,
14812        ) -> fidl::Result<()> {
14813            decoder.debug_check_bounds::<Self>(offset);
14814            #[allow(unused_variables)]
14815            let next_out_of_line = decoder.next_out_of_line();
14816            let handles_before = decoder.remaining_handles();
14817            let (ordinal, inlined, num_bytes, num_handles) =
14818                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
14819
14820            let member_inline_size = match ordinal {
14821                1 => <DirEntry as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14822                2 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14823                _ => return Err(fidl::Error::UnknownUnionTag),
14824            };
14825
14826            if inlined != (member_inline_size <= 4) {
14827                return Err(fidl::Error::InvalidInlineBitInEnvelope);
14828            }
14829            let _inner_offset;
14830            if inlined {
14831                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
14832                _inner_offset = offset + 8;
14833            } else {
14834                depth.increment()?;
14835                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14836            }
14837            match ordinal {
14838                1 => {
14839                    #[allow(irrefutable_let_patterns)]
14840                    if let DirEntryRouterRouteResponse::DirEntry(_) = self {
14841                        // Do nothing, read the value into the object
14842                    } else {
14843                        // Initialize `self` to the right variant
14844                        *self = DirEntryRouterRouteResponse::DirEntry(fidl::new_empty!(
14845                            DirEntry,
14846                            fidl::encoding::DefaultFuchsiaResourceDialect
14847                        ));
14848                    }
14849                    #[allow(irrefutable_let_patterns)]
14850                    if let DirEntryRouterRouteResponse::DirEntry(ref mut val) = self {
14851                        fidl::decode!(
14852                            DirEntry,
14853                            fidl::encoding::DefaultFuchsiaResourceDialect,
14854                            val,
14855                            decoder,
14856                            _inner_offset,
14857                            depth
14858                        )?;
14859                    } else {
14860                        unreachable!()
14861                    }
14862                }
14863                2 => {
14864                    #[allow(irrefutable_let_patterns)]
14865                    if let DirEntryRouterRouteResponse::Unavailable(_) = self {
14866                        // Do nothing, read the value into the object
14867                    } else {
14868                        // Initialize `self` to the right variant
14869                        *self = DirEntryRouterRouteResponse::Unavailable(fidl::new_empty!(
14870                            Unit,
14871                            fidl::encoding::DefaultFuchsiaResourceDialect
14872                        ));
14873                    }
14874                    #[allow(irrefutable_let_patterns)]
14875                    if let DirEntryRouterRouteResponse::Unavailable(ref mut val) = self {
14876                        fidl::decode!(
14877                            Unit,
14878                            fidl::encoding::DefaultFuchsiaResourceDialect,
14879                            val,
14880                            decoder,
14881                            _inner_offset,
14882                            depth
14883                        )?;
14884                    } else {
14885                        unreachable!()
14886                    }
14887                }
14888                ordinal => panic!("unexpected ordinal {:?}", ordinal),
14889            }
14890            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
14891                return Err(fidl::Error::InvalidNumBytesInEnvelope);
14892            }
14893            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14894                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14895            }
14896            Ok(())
14897        }
14898    }
14899
14900    impl fidl::encoding::ResourceTypeMarker for DirectoryRouterRouteResponse {
14901        type Borrowed<'a> = &'a mut Self;
14902        fn take_or_borrow<'a>(
14903            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14904        ) -> Self::Borrowed<'a> {
14905            value
14906        }
14907    }
14908
14909    unsafe impl fidl::encoding::TypeMarker for DirectoryRouterRouteResponse {
14910        type Owned = Self;
14911
14912        #[inline(always)]
14913        fn inline_align(_context: fidl::encoding::Context) -> usize {
14914            8
14915        }
14916
14917        #[inline(always)]
14918        fn inline_size(_context: fidl::encoding::Context) -> usize {
14919            16
14920        }
14921    }
14922
14923    unsafe impl
14924        fidl::encoding::Encode<
14925            DirectoryRouterRouteResponse,
14926            fidl::encoding::DefaultFuchsiaResourceDialect,
14927        > for &mut DirectoryRouterRouteResponse
14928    {
14929        #[inline]
14930        unsafe fn encode(
14931            self,
14932            encoder: &mut fidl::encoding::Encoder<
14933                '_,
14934                fidl::encoding::DefaultFuchsiaResourceDialect,
14935            >,
14936            offset: usize,
14937            _depth: fidl::encoding::Depth,
14938        ) -> fidl::Result<()> {
14939            encoder.debug_check_bounds::<DirectoryRouterRouteResponse>(offset);
14940            encoder.write_num::<u64>(self.ordinal(), offset);
14941            match self {
14942                DirectoryRouterRouteResponse::Directory(ref mut val) => {
14943                    fidl::encoding::encode_in_envelope::<
14944                        fidl::encoding::Endpoint<
14945                            fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
14946                        >,
14947                        fidl::encoding::DefaultFuchsiaResourceDialect,
14948                    >(
14949                        <fidl::encoding::Endpoint<
14950                            fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
14951                        > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
14952                            val
14953                        ),
14954                        encoder,
14955                        offset + 8,
14956                        _depth,
14957                    )
14958                }
14959                DirectoryRouterRouteResponse::Unavailable(ref val) => {
14960                    fidl::encoding::encode_in_envelope::<
14961                        Unit,
14962                        fidl::encoding::DefaultFuchsiaResourceDialect,
14963                    >(
14964                        <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
14965                        encoder,
14966                        offset + 8,
14967                        _depth,
14968                    )
14969                }
14970            }
14971        }
14972    }
14973
14974    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14975        for DirectoryRouterRouteResponse
14976    {
14977        #[inline(always)]
14978        fn new_empty() -> Self {
14979            Self::Directory(fidl::new_empty!(
14980                fidl::encoding::Endpoint<
14981                    fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
14982                >,
14983                fidl::encoding::DefaultFuchsiaResourceDialect
14984            ))
14985        }
14986
14987        #[inline]
14988        unsafe fn decode(
14989            &mut self,
14990            decoder: &mut fidl::encoding::Decoder<
14991                '_,
14992                fidl::encoding::DefaultFuchsiaResourceDialect,
14993            >,
14994            offset: usize,
14995            mut depth: fidl::encoding::Depth,
14996        ) -> fidl::Result<()> {
14997            decoder.debug_check_bounds::<Self>(offset);
14998            #[allow(unused_variables)]
14999            let next_out_of_line = decoder.next_out_of_line();
15000            let handles_before = decoder.remaining_handles();
15001            let (ordinal, inlined, num_bytes, num_handles) =
15002                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
15003
15004            let member_inline_size = match ordinal {
15005                1 => <fidl::encoding::Endpoint<
15006                    fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
15007                > as fidl::encoding::TypeMarker>::inline_size(decoder.context),
15008                2 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
15009                _ => return Err(fidl::Error::UnknownUnionTag),
15010            };
15011
15012            if inlined != (member_inline_size <= 4) {
15013                return Err(fidl::Error::InvalidInlineBitInEnvelope);
15014            }
15015            let _inner_offset;
15016            if inlined {
15017                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
15018                _inner_offset = offset + 8;
15019            } else {
15020                depth.increment()?;
15021                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15022            }
15023            match ordinal {
15024                1 => {
15025                    #[allow(irrefutable_let_patterns)]
15026                    if let DirectoryRouterRouteResponse::Directory(_) = self {
15027                        // Do nothing, read the value into the object
15028                    } else {
15029                        // Initialize `self` to the right variant
15030                        *self = DirectoryRouterRouteResponse::Directory(fidl::new_empty!(
15031                            fidl::encoding::Endpoint<
15032                                fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
15033                            >,
15034                            fidl::encoding::DefaultFuchsiaResourceDialect
15035                        ));
15036                    }
15037                    #[allow(irrefutable_let_patterns)]
15038                    if let DirectoryRouterRouteResponse::Directory(ref mut val) = self {
15039                        fidl::decode!(
15040                            fidl::encoding::Endpoint<
15041                                fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
15042                            >,
15043                            fidl::encoding::DefaultFuchsiaResourceDialect,
15044                            val,
15045                            decoder,
15046                            _inner_offset,
15047                            depth
15048                        )?;
15049                    } else {
15050                        unreachable!()
15051                    }
15052                }
15053                2 => {
15054                    #[allow(irrefutable_let_patterns)]
15055                    if let DirectoryRouterRouteResponse::Unavailable(_) = self {
15056                        // Do nothing, read the value into the object
15057                    } else {
15058                        // Initialize `self` to the right variant
15059                        *self = DirectoryRouterRouteResponse::Unavailable(fidl::new_empty!(
15060                            Unit,
15061                            fidl::encoding::DefaultFuchsiaResourceDialect
15062                        ));
15063                    }
15064                    #[allow(irrefutable_let_patterns)]
15065                    if let DirectoryRouterRouteResponse::Unavailable(ref mut val) = self {
15066                        fidl::decode!(
15067                            Unit,
15068                            fidl::encoding::DefaultFuchsiaResourceDialect,
15069                            val,
15070                            decoder,
15071                            _inner_offset,
15072                            depth
15073                        )?;
15074                    } else {
15075                        unreachable!()
15076                    }
15077                }
15078                ordinal => panic!("unexpected ordinal {:?}", ordinal),
15079            }
15080            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
15081                return Err(fidl::Error::InvalidNumBytesInEnvelope);
15082            }
15083            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15084                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15085            }
15086            Ok(())
15087        }
15088    }
15089}