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    #[deprecated = "Strict unions should not use `is_unknown`"]
352    #[inline]
353    pub fn is_unknown(&self) -> bool {
354        false
355    }
356}
357
358impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
359    for ConnectorRouterRouteResponse
360{
361}
362
363#[derive(Debug, PartialEq)]
364pub enum DataRouterRouteResponse {
365    Data(Data),
366    Unavailable(Unit),
367}
368
369impl DataRouterRouteResponse {
370    #[inline]
371    pub fn ordinal(&self) -> u64 {
372        match *self {
373            Self::Data(_) => 1,
374            Self::Unavailable(_) => 2,
375        }
376    }
377
378    #[deprecated = "Strict unions should not use `is_unknown`"]
379    #[inline]
380    pub fn is_unknown(&self) -> bool {
381        false
382    }
383}
384
385impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DataRouterRouteResponse {}
386
387#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
388pub enum DictionaryRouterRouteResponse {
389    Dictionary(DictionaryRef),
390    Unavailable(Unit),
391}
392
393impl DictionaryRouterRouteResponse {
394    #[inline]
395    pub fn ordinal(&self) -> u64 {
396        match *self {
397            Self::Dictionary(_) => 1,
398            Self::Unavailable(_) => 2,
399        }
400    }
401
402    #[deprecated = "Strict unions should not use `is_unknown`"]
403    #[inline]
404    pub fn is_unknown(&self) -> bool {
405        false
406    }
407}
408
409impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
410    for DictionaryRouterRouteResponse
411{
412}
413
414#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
415pub enum DirConnectorRouterRouteResponse {
416    DirConnector(DirConnector),
417    Unavailable(Unit),
418}
419
420impl DirConnectorRouterRouteResponse {
421    #[inline]
422    pub fn ordinal(&self) -> u64 {
423        match *self {
424            Self::DirConnector(_) => 1,
425            Self::Unavailable(_) => 2,
426        }
427    }
428
429    #[deprecated = "Strict unions should not use `is_unknown`"]
430    #[inline]
431    pub fn is_unknown(&self) -> bool {
432        false
433    }
434}
435
436impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
437    for DirConnectorRouterRouteResponse
438{
439}
440
441#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
442pub enum DirEntryRouterRouteResponse {
443    DirEntry(DirEntry),
444    Unavailable(Unit),
445}
446
447impl DirEntryRouterRouteResponse {
448    #[inline]
449    pub fn ordinal(&self) -> u64 {
450        match *self {
451            Self::DirEntry(_) => 1,
452            Self::Unavailable(_) => 2,
453        }
454    }
455
456    #[deprecated = "Strict unions should not use `is_unknown`"]
457    #[inline]
458    pub fn is_unknown(&self) -> bool {
459        false
460    }
461}
462
463impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
464    for DirEntryRouterRouteResponse
465{
466}
467
468#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
469pub enum DirectoryRouterRouteResponse {
470    Directory(fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>),
471    Unavailable(Unit),
472}
473
474impl DirectoryRouterRouteResponse {
475    #[inline]
476    pub fn ordinal(&self) -> u64 {
477        match *self {
478            Self::Directory(_) => 1,
479            Self::Unavailable(_) => 2,
480        }
481    }
482
483    #[deprecated = "Strict unions should not use `is_unknown`"]
484    #[inline]
485    pub fn is_unknown(&self) -> bool {
486        false
487    }
488}
489
490impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
491    for DirectoryRouterRouteResponse
492{
493}
494
495#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
496pub struct CapabilityStoreMarker;
497
498impl fidl::endpoints::ProtocolMarker for CapabilityStoreMarker {
499    type Proxy = CapabilityStoreProxy;
500    type RequestStream = CapabilityStoreRequestStream;
501    #[cfg(target_os = "fuchsia")]
502    type SynchronousProxy = CapabilityStoreSynchronousProxy;
503
504    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.CapabilityStore";
505}
506impl fidl::endpoints::DiscoverableProtocolMarker for CapabilityStoreMarker {}
507pub type CapabilityStoreDuplicateResult = Result<(), CapabilityStoreError>;
508pub type CapabilityStoreDropResult = Result<(), CapabilityStoreError>;
509pub type CapabilityStoreExportResult = Result<Capability, CapabilityStoreError>;
510pub type CapabilityStoreImportResult = Result<(), CapabilityStoreError>;
511pub type CapabilityStoreConnectorCreateResult = Result<(), CapabilityStoreError>;
512pub type CapabilityStoreConnectorOpenResult = Result<(), CapabilityStoreError>;
513pub type CapabilityStoreDirConnectorCreateResult = Result<(), CapabilityStoreError>;
514pub type CapabilityStoreDirConnectorOpenResult = Result<(), CapabilityStoreError>;
515pub type CapabilityStoreDictionaryCreateResult = Result<(), CapabilityStoreError>;
516pub type CapabilityStoreDictionaryLegacyImportResult = Result<(), CapabilityStoreError>;
517pub type CapabilityStoreDictionaryLegacyExportResult = Result<(), CapabilityStoreError>;
518pub type CapabilityStoreDictionaryInsertResult = Result<(), CapabilityStoreError>;
519pub type CapabilityStoreDictionaryGetResult = Result<(), CapabilityStoreError>;
520pub type CapabilityStoreDictionaryRemoveResult = Result<(), CapabilityStoreError>;
521pub type CapabilityStoreDictionaryCopyResult = Result<(), CapabilityStoreError>;
522pub type CapabilityStoreDictionaryKeysResult = Result<(), CapabilityStoreError>;
523pub type CapabilityStoreDictionaryEnumerateResult = Result<(), CapabilityStoreError>;
524pub type CapabilityStoreDictionaryDrainResult = Result<(), CapabilityStoreError>;
525
526pub trait CapabilityStoreProxyInterface: Send + Sync {
527    type DuplicateResponseFut: std::future::Future<Output = Result<CapabilityStoreDuplicateResult, fidl::Error>>
528        + Send;
529    fn r#duplicate(&self, id: u64, dest_id: u64) -> Self::DuplicateResponseFut;
530    type DropResponseFut: std::future::Future<Output = Result<CapabilityStoreDropResult, fidl::Error>>
531        + Send;
532    fn r#drop(&self, id: u64) -> Self::DropResponseFut;
533    type ExportResponseFut: std::future::Future<Output = Result<CapabilityStoreExportResult, fidl::Error>>
534        + Send;
535    fn r#export(&self, id: u64) -> Self::ExportResponseFut;
536    type ImportResponseFut: std::future::Future<Output = Result<CapabilityStoreImportResult, fidl::Error>>
537        + Send;
538    fn r#import(&self, id: u64, capability: Capability) -> Self::ImportResponseFut;
539    type ConnectorCreateResponseFut: std::future::Future<Output = Result<CapabilityStoreConnectorCreateResult, fidl::Error>>
540        + Send;
541    fn r#connector_create(
542        &self,
543        id: u64,
544        receiver: fidl::endpoints::ClientEnd<ReceiverMarker>,
545    ) -> Self::ConnectorCreateResponseFut;
546    type ConnectorOpenResponseFut: std::future::Future<Output = Result<CapabilityStoreConnectorOpenResult, fidl::Error>>
547        + Send;
548    fn r#connector_open(
549        &self,
550        id: u64,
551        server_end: fidl::Channel,
552    ) -> Self::ConnectorOpenResponseFut;
553    type DirConnectorCreateResponseFut: std::future::Future<Output = Result<CapabilityStoreDirConnectorCreateResult, fidl::Error>>
554        + Send;
555    fn r#dir_connector_create(
556        &self,
557        id: u64,
558        receiver: fidl::endpoints::ClientEnd<DirReceiverMarker>,
559    ) -> Self::DirConnectorCreateResponseFut;
560    type DirConnectorOpenResponseFut: std::future::Future<Output = Result<CapabilityStoreDirConnectorOpenResult, fidl::Error>>
561        + Send;
562    fn r#dir_connector_open(
563        &self,
564        id: u64,
565        server_end: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
566    ) -> Self::DirConnectorOpenResponseFut;
567    type DictionaryCreateResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryCreateResult, fidl::Error>>
568        + Send;
569    fn r#dictionary_create(&self, id: u64) -> Self::DictionaryCreateResponseFut;
570    type DictionaryLegacyImportResponseFut: std::future::Future<
571            Output = Result<CapabilityStoreDictionaryLegacyImportResult, fidl::Error>,
572        > + Send;
573    fn r#dictionary_legacy_import(
574        &self,
575        id: u64,
576        client_end: fidl::Channel,
577    ) -> Self::DictionaryLegacyImportResponseFut;
578    type DictionaryLegacyExportResponseFut: std::future::Future<
579            Output = Result<CapabilityStoreDictionaryLegacyExportResult, fidl::Error>,
580        > + Send;
581    fn r#dictionary_legacy_export(
582        &self,
583        id: u64,
584        server_end: fidl::Channel,
585    ) -> Self::DictionaryLegacyExportResponseFut;
586    type DictionaryInsertResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryInsertResult, fidl::Error>>
587        + Send;
588    fn r#dictionary_insert(
589        &self,
590        id: u64,
591        item: &DictionaryItem,
592    ) -> Self::DictionaryInsertResponseFut;
593    type DictionaryGetResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryGetResult, fidl::Error>>
594        + Send;
595    fn r#dictionary_get(&self, id: u64, key: &str, dest_id: u64) -> Self::DictionaryGetResponseFut;
596    type DictionaryRemoveResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryRemoveResult, fidl::Error>>
597        + Send;
598    fn r#dictionary_remove(
599        &self,
600        id: u64,
601        key: &str,
602        dest_id: Option<&WrappedCapabilityId>,
603    ) -> Self::DictionaryRemoveResponseFut;
604    type DictionaryCopyResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryCopyResult, fidl::Error>>
605        + Send;
606    fn r#dictionary_copy(&self, id: u64, dest_id: u64) -> Self::DictionaryCopyResponseFut;
607    type DictionaryKeysResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryKeysResult, fidl::Error>>
608        + Send;
609    fn r#dictionary_keys(
610        &self,
611        id: u64,
612        iterator: fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>,
613    ) -> Self::DictionaryKeysResponseFut;
614    type DictionaryEnumerateResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryEnumerateResult, fidl::Error>>
615        + Send;
616    fn r#dictionary_enumerate(
617        &self,
618        id: u64,
619        iterator: fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
620    ) -> Self::DictionaryEnumerateResponseFut;
621    type DictionaryDrainResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryDrainResult, fidl::Error>>
622        + Send;
623    fn r#dictionary_drain(
624        &self,
625        id: u64,
626        iterator: Option<fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>>,
627    ) -> Self::DictionaryDrainResponseFut;
628}
629#[derive(Debug)]
630#[cfg(target_os = "fuchsia")]
631pub struct CapabilityStoreSynchronousProxy {
632    client: fidl::client::sync::Client,
633}
634
635#[cfg(target_os = "fuchsia")]
636impl fidl::endpoints::SynchronousProxy for CapabilityStoreSynchronousProxy {
637    type Proxy = CapabilityStoreProxy;
638    type Protocol = CapabilityStoreMarker;
639
640    fn from_channel(inner: fidl::Channel) -> Self {
641        Self::new(inner)
642    }
643
644    fn into_channel(self) -> fidl::Channel {
645        self.client.into_channel()
646    }
647
648    fn as_channel(&self) -> &fidl::Channel {
649        self.client.as_channel()
650    }
651}
652
653#[cfg(target_os = "fuchsia")]
654impl CapabilityStoreSynchronousProxy {
655    pub fn new(channel: fidl::Channel) -> Self {
656        let protocol_name = <CapabilityStoreMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
657        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
658    }
659
660    pub fn into_channel(self) -> fidl::Channel {
661        self.client.into_channel()
662    }
663
664    /// Waits until an event arrives and returns it. It is safe for other
665    /// threads to make concurrent requests while waiting for an event.
666    pub fn wait_for_event(
667        &self,
668        deadline: zx::MonotonicInstant,
669    ) -> Result<CapabilityStoreEvent, fidl::Error> {
670        CapabilityStoreEvent::decode(self.client.wait_for_event(deadline)?)
671    }
672
673    /// Duplicates the capability with `id` to `dest_id`.
674    ///
675    /// Errors:
676    ///
677    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
678    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
679    /// - `NOT_DUPLICATABLE` if `id` could not be duplicated.
680    pub fn r#duplicate(
681        &self,
682        mut id: u64,
683        mut dest_id: u64,
684        ___deadline: zx::MonotonicInstant,
685    ) -> Result<CapabilityStoreDuplicateResult, fidl::Error> {
686        let _response =
687            self.client
688                .send_query::<CapabilityStoreDuplicateRequest, fidl::encoding::FlexibleResultType<
689                    fidl::encoding::EmptyStruct,
690                    CapabilityStoreError,
691                >>(
692                    (id, dest_id),
693                    0x5d5d35d9c20a2184,
694                    fidl::encoding::DynamicFlags::FLEXIBLE,
695                    ___deadline,
696                )?
697                .into_result::<CapabilityStoreMarker>("duplicate")?;
698        Ok(_response.map(|x| x))
699    }
700
701    /// Drops the capability with `id` from this [`CapabilityStore`].
702    ///
703    /// Errors:
704    ///
705    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
706    pub fn r#drop(
707        &self,
708        mut id: u64,
709        ___deadline: zx::MonotonicInstant,
710    ) -> Result<CapabilityStoreDropResult, fidl::Error> {
711        let _response =
712            self.client
713                .send_query::<CapabilityStoreDropRequest, fidl::encoding::FlexibleResultType<
714                    fidl::encoding::EmptyStruct,
715                    CapabilityStoreError,
716                >>(
717                    (id,), 0xa745c0990fc2559, fidl::encoding::DynamicFlags::FLEXIBLE, ___deadline
718                )?
719                .into_result::<CapabilityStoreMarker>("drop")?;
720        Ok(_response.map(|x| x))
721    }
722
723    /// Exports the capability with the client-assigned identifier `id` to
724    /// `capability`. This operation removes the capability from the store. If
725    /// this is not desired, [Duplicate] the capability first.
726    ///
727    /// Errors:
728    ///
729    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
730    pub fn r#export(
731        &self,
732        mut id: u64,
733        ___deadline: zx::MonotonicInstant,
734    ) -> Result<CapabilityStoreExportResult, fidl::Error> {
735        let _response =
736            self.client
737                .send_query::<CapabilityStoreExportRequest, fidl::encoding::FlexibleResultType<
738                    CapabilityStoreExportResponse,
739                    CapabilityStoreError,
740                >>(
741                    (id,), 0x3237a8f4748faff, fidl::encoding::DynamicFlags::FLEXIBLE, ___deadline
742                )?
743                .into_result::<CapabilityStoreMarker>("export")?;
744        Ok(_response.map(|x| x.capability))
745    }
746
747    /// Imports `capability` into this store with the client-assigned `id`.
748    ///
749    /// Errors:
750    ///
751    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
752    /// - `BAD_CAPABILITY` if `capability` was not a valid [Capability].
753    pub fn r#import(
754        &self,
755        mut id: u64,
756        mut capability: Capability,
757        ___deadline: zx::MonotonicInstant,
758    ) -> Result<CapabilityStoreImportResult, fidl::Error> {
759        let _response =
760            self.client
761                .send_query::<CapabilityStoreImportRequest, fidl::encoding::FlexibleResultType<
762                    fidl::encoding::EmptyStruct,
763                    CapabilityStoreError,
764                >>(
765                    (id, &mut capability),
766                    0x1f96157a29f4539b,
767                    fidl::encoding::DynamicFlags::FLEXIBLE,
768                    ___deadline,
769                )?
770                .into_result::<CapabilityStoreMarker>("import")?;
771        Ok(_response.map(|x| x))
772    }
773
774    /// Creates a [Connector] from a [Receiver]. Incoming connections to the [Connector] will be
775    /// dispatched to this [Receiver].
776    ///
777    /// Errors:
778    ///
779    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
780    pub fn r#connector_create(
781        &self,
782        mut id: u64,
783        mut receiver: fidl::endpoints::ClientEnd<ReceiverMarker>,
784        ___deadline: zx::MonotonicInstant,
785    ) -> Result<CapabilityStoreConnectorCreateResult, fidl::Error> {
786        let _response = self.client.send_query::<
787            CapabilityStoreConnectorCreateRequest,
788            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
789        >(
790            (id, receiver,),
791            0x29592c5d63e91c25,
792            fidl::encoding::DynamicFlags::FLEXIBLE,
793            ___deadline,
794        )?
795        .into_result::<CapabilityStoreMarker>("connector_create")?;
796        Ok(_response.map(|x| x))
797    }
798
799    /// Open a connection from the provided [Connector] capability that will be dispatched to
800    /// the [Receiver] on the other end.
801    ///
802    /// If there is an error, it will be reported as a zx.Status epitaph on `server_end`.
803    ///
804    /// Errors:
805    ///
806    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
807    /// - `WRONG_TYPE` if `id` was not a connector capability.
808    pub fn r#connector_open(
809        &self,
810        mut id: u64,
811        mut server_end: fidl::Channel,
812        ___deadline: zx::MonotonicInstant,
813    ) -> Result<CapabilityStoreConnectorOpenResult, fidl::Error> {
814        let _response = self.client.send_query::<
815            CapabilityStoreConnectorOpenRequest,
816            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
817        >(
818            (id, server_end,),
819            0x537e69ab40563b9f,
820            fidl::encoding::DynamicFlags::FLEXIBLE,
821            ___deadline,
822        )?
823        .into_result::<CapabilityStoreMarker>("connector_open")?;
824        Ok(_response.map(|x| x))
825    }
826
827    /// Creates a [DirConnector] from a [DirReceiver]. Incoming connections to the [DirConnector]
828    /// will be dispatched to this [DirReceiver].
829    ///
830    /// Errors:
831    ///
832    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
833    pub fn r#dir_connector_create(
834        &self,
835        mut id: u64,
836        mut receiver: fidl::endpoints::ClientEnd<DirReceiverMarker>,
837        ___deadline: zx::MonotonicInstant,
838    ) -> Result<CapabilityStoreDirConnectorCreateResult, fidl::Error> {
839        let _response = self.client.send_query::<
840            CapabilityStoreDirConnectorCreateRequest,
841            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
842        >(
843            (id, receiver,),
844            0x186138a11ccf19bb,
845            fidl::encoding::DynamicFlags::FLEXIBLE,
846            ___deadline,
847        )?
848        .into_result::<CapabilityStoreMarker>("dir_connector_create")?;
849        Ok(_response.map(|x| x))
850    }
851
852    /// Open a connection from the provided [DirConnector] capability that will be dispatched to
853    /// the [DirReceiver] on the other end.
854    ///
855    /// This method does not take `Open`/`Open3` parameters such as `flags` or `path`.
856    /// Clients that wish to specify these can get an initial connection from this method
857    /// and call `fuchsia.io/Directory.Open` on it. See the [DirReceiver] documentation for
858    /// more information about the expectations of the server side.
859    ///
860    /// If there was an error making the connection, it will be reported as a zx.Status
861    /// epitaph on `server_end`.
862    ///
863    /// Errors:
864    ///
865    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
866    /// - `WRONG_TYPE` if `id` was not a connector capability.
867    pub fn r#dir_connector_open(
868        &self,
869        mut id: u64,
870        mut server_end: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
871        ___deadline: zx::MonotonicInstant,
872    ) -> Result<CapabilityStoreDirConnectorOpenResult, fidl::Error> {
873        let _response = self.client.send_query::<
874            CapabilityStoreDirConnectorOpenRequest,
875            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
876        >(
877            (id, server_end,),
878            0x5650d3d6a3a13901,
879            fidl::encoding::DynamicFlags::FLEXIBLE,
880            ___deadline,
881        )?
882        .into_result::<CapabilityStoreMarker>("dir_connector_open")?;
883        Ok(_response.map(|x| x))
884    }
885
886    /// Creates a new empty dictionary in this [`CapabilityStore`] with client-assigned `id`.
887    ///
888    /// Errors:
889    ///
890    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
891    pub fn r#dictionary_create(
892        &self,
893        mut id: u64,
894        ___deadline: zx::MonotonicInstant,
895    ) -> Result<CapabilityStoreDictionaryCreateResult, fidl::Error> {
896        let _response = self.client.send_query::<
897            CapabilityStoreDictionaryCreateRequest,
898            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
899        >(
900            (id,),
901            0x6997c8dfc63de093,
902            fidl::encoding::DynamicFlags::FLEXIBLE,
903            ___deadline,
904        )?
905        .into_result::<CapabilityStoreMarker>("dictionary_create")?;
906        Ok(_response.map(|x| x))
907    }
908
909    /// Imports a dictionary in the form of a channel.
910    ///
911    /// This is a legacy API to support backward compatibility with APIs that take a [Dictionary]
912    /// channel.
913    ///
914    /// Errors:
915    ///
916    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
917    /// - `BAD_CAPABILITY` if `client_end` was not a valid dictionary channel.
918    pub fn r#dictionary_legacy_import(
919        &self,
920        mut id: u64,
921        mut client_end: fidl::Channel,
922        ___deadline: zx::MonotonicInstant,
923    ) -> Result<CapabilityStoreDictionaryLegacyImportResult, fidl::Error> {
924        let _response = self.client.send_query::<
925            CapabilityStoreDictionaryLegacyImportRequest,
926            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
927        >(
928            (id, client_end,),
929            0x72fd686c37b6025f,
930            fidl::encoding::DynamicFlags::FLEXIBLE,
931            ___deadline,
932        )?
933        .into_result::<CapabilityStoreMarker>("dictionary_legacy_import")?;
934        Ok(_response.map(|x| x))
935    }
936
937    /// Binds a channel to the dictionary with `id`. The channel can
938    /// be re-imported into a [CapabilityStore] with [DictionaryImportLegacy].
939    ///
940    /// This is a legacy API to support backward compatibility with APIs that take a [Dictionary]
941    /// channel.
942    ///
943    /// Errors:
944    ///
945    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
946    pub fn r#dictionary_legacy_export(
947        &self,
948        mut id: u64,
949        mut server_end: fidl::Channel,
950        ___deadline: zx::MonotonicInstant,
951    ) -> Result<CapabilityStoreDictionaryLegacyExportResult, fidl::Error> {
952        let _response = self.client.send_query::<
953            CapabilityStoreDictionaryLegacyExportRequest,
954            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
955        >(
956            (id, server_end,),
957            0x407e15cc4bde5dcd,
958            fidl::encoding::DynamicFlags::FLEXIBLE,
959            ___deadline,
960        )?
961        .into_result::<CapabilityStoreMarker>("dictionary_legacy_export")?;
962        Ok(_response.map(|x| x))
963    }
964
965    /// Inserts `item` into the dictionary with `id`. `item.value` is moved into the dictionary and
966    /// its id is released if this call succeeds.
967    ///
968    /// Errors:
969    ///
970    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
971    /// - `WRONG_TYPE` if `id` was not a dictionary.
972    /// - `INVALID_KEY` if `item.key` was invalid.
973    /// - `ITEM_ALREADY_EXISTS` if the dictionary already contains an item with `item.key`.
974    pub fn r#dictionary_insert(
975        &self,
976        mut id: u64,
977        mut item: &DictionaryItem,
978        ___deadline: zx::MonotonicInstant,
979    ) -> Result<CapabilityStoreDictionaryInsertResult, fidl::Error> {
980        let _response = self.client.send_query::<
981            CapabilityStoreDictionaryInsertRequest,
982            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
983        >(
984            (id, item,),
985            0x7702183689d44c27,
986            fidl::encoding::DynamicFlags::FLEXIBLE,
987            ___deadline,
988        )?
989        .into_result::<CapabilityStoreMarker>("dictionary_insert")?;
990        Ok(_response.map(|x| x))
991    }
992
993    /// Get a duplicate of a capability from the dictionary with `id`, which is
994    /// loaded into `dest_id`.
995    ///
996    /// Errors:
997    ///
998    /// - `ID_NOT_FOUND` if `id` was not a recognized capability id in this store.
999    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
1000    /// - `WRONG_TYPE` if `id` was not a dictionary.
1001    /// - `INVALID_KEY` if `item.key` was invalid.
1002    /// - `ITEM_NOT_FOUND` if the dictionary does not contain `key`.
1003    /// - `NOT_DUPLICATABLE` if the capability could not be duplicated.
1004    pub fn r#dictionary_get(
1005        &self,
1006        mut id: u64,
1007        mut key: &str,
1008        mut dest_id: u64,
1009        ___deadline: zx::MonotonicInstant,
1010    ) -> Result<CapabilityStoreDictionaryGetResult, fidl::Error> {
1011        let _response = self.client.send_query::<
1012            CapabilityStoreDictionaryGetRequest,
1013            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
1014        >(
1015            (id, key, dest_id,),
1016            0x4d9e27538284add2,
1017            fidl::encoding::DynamicFlags::FLEXIBLE,
1018            ___deadline,
1019        )?
1020        .into_result::<CapabilityStoreMarker>("dictionary_get")?;
1021        Ok(_response.map(|x| x))
1022    }
1023
1024    /// Removes a key from the dictionary with `id`. If `dest_id` is present, loads the value
1025    /// into it, otherwise discards the value.
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    /// - `INVALID_KEY` if `key` was invalid.
1033    /// - `ITEM_NOT_FOUND` if the dictionary does not contain the key.
1034    pub fn r#dictionary_remove(
1035        &self,
1036        mut id: u64,
1037        mut key: &str,
1038        mut dest_id: Option<&WrappedCapabilityId>,
1039        ___deadline: zx::MonotonicInstant,
1040    ) -> Result<CapabilityStoreDictionaryRemoveResult, fidl::Error> {
1041        let _response = self.client.send_query::<
1042            CapabilityStoreDictionaryRemoveRequest,
1043            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
1044        >(
1045            (id, key, dest_id,),
1046            0x4c5c025ab05d4f3,
1047            fidl::encoding::DynamicFlags::FLEXIBLE,
1048            ___deadline,
1049        )?
1050        .into_result::<CapabilityStoreMarker>("dictionary_remove")?;
1051        Ok(_response.map(|x| x))
1052    }
1053
1054    /// Create a new dictionary that contains a duplicate of all the entries in
1055    /// the dictionary with `id`, assigning `dest_id` to the new dictionary.
1056    /// The runtime of this method is linear in the number of top-level entries
1057    /// in the dictionary.
1058    ///
1059    /// For example, if the dictionary contains nested dictionaries, the newly
1060    /// created dictionary will contain references to those same nested
1061    /// dictionaries because the entries are duplicated rather than deep-copied.
1062    ///
1063    /// Errors:
1064    ///
1065    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1066    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
1067    /// - `WRONG_TYPE` if `id` was not a dictionary.
1068    /// - `NOT_DUPLICATABLE` if one of the capabilities in `id` could not be duplicated.
1069    pub fn r#dictionary_copy(
1070        &self,
1071        mut id: u64,
1072        mut dest_id: u64,
1073        ___deadline: zx::MonotonicInstant,
1074    ) -> Result<CapabilityStoreDictionaryCopyResult, fidl::Error> {
1075        let _response = self.client.send_query::<
1076            CapabilityStoreDictionaryCopyRequest,
1077            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
1078        >(
1079            (id, dest_id,),
1080            0x3733ecdf4ea1b44f,
1081            fidl::encoding::DynamicFlags::FLEXIBLE,
1082            ___deadline,
1083        )?
1084        .into_result::<CapabilityStoreMarker>("dictionary_copy")?;
1085        Ok(_response.map(|x| x))
1086    }
1087
1088    /// Enumerates the keys in the dictionary with `id`.
1089    ///
1090    /// Errors:
1091    ///
1092    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1093    /// - `WRONG_TYPE` if `id` was not a dictionary.
1094    pub fn r#dictionary_keys(
1095        &self,
1096        mut id: u64,
1097        mut iterator: fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>,
1098        ___deadline: zx::MonotonicInstant,
1099    ) -> Result<CapabilityStoreDictionaryKeysResult, fidl::Error> {
1100        let _response = self.client.send_query::<
1101            CapabilityStoreDictionaryKeysRequest,
1102            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
1103        >(
1104            (id, iterator,),
1105            0x84b05577ceaec9e,
1106            fidl::encoding::DynamicFlags::FLEXIBLE,
1107            ___deadline,
1108        )?
1109        .into_result::<CapabilityStoreMarker>("dictionary_keys")?;
1110        Ok(_response.map(|x| x))
1111    }
1112
1113    /// Enumerates the items (keys and values) in the dictionary with `id`.
1114    ///
1115    /// Creates a duplicate of each value (capability). If a value could not be duplicated,
1116    /// the value will be null.
1117    ///
1118    /// Errors:
1119    ///
1120    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1121    /// - `WRONG_TYPE` if `id` was not a dictionary.
1122    pub fn r#dictionary_enumerate(
1123        &self,
1124        mut id: u64,
1125        mut iterator: fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
1126        ___deadline: zx::MonotonicInstant,
1127    ) -> Result<CapabilityStoreDictionaryEnumerateResult, fidl::Error> {
1128        let _response = self.client.send_query::<
1129            CapabilityStoreDictionaryEnumerateRequest,
1130            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
1131        >(
1132            (id, iterator,),
1133            0xd6279b6ced04641,
1134            fidl::encoding::DynamicFlags::FLEXIBLE,
1135            ___deadline,
1136        )?
1137        .into_result::<CapabilityStoreMarker>("dictionary_enumerate")?;
1138        Ok(_response.map(|x| x))
1139    }
1140
1141    /// Removes all the entries in this dictionary, returning them in `contents` if provided.
1142    /// If `contents` is not provided, all the items are discarded without enumerating them.
1143    ///
1144    /// Errors:
1145    ///
1146    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1147    /// - `WRONG_TYPE` if `id` was not a dictionary.
1148    pub fn r#dictionary_drain(
1149        &self,
1150        mut id: u64,
1151        mut iterator: Option<fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>>,
1152        ___deadline: zx::MonotonicInstant,
1153    ) -> Result<CapabilityStoreDictionaryDrainResult, fidl::Error> {
1154        let _response = self.client.send_query::<
1155            CapabilityStoreDictionaryDrainRequest,
1156            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
1157        >(
1158            (id, iterator,),
1159            0x28a3a3f84d928cd8,
1160            fidl::encoding::DynamicFlags::FLEXIBLE,
1161            ___deadline,
1162        )?
1163        .into_result::<CapabilityStoreMarker>("dictionary_drain")?;
1164        Ok(_response.map(|x| x))
1165    }
1166}
1167
1168#[cfg(target_os = "fuchsia")]
1169impl From<CapabilityStoreSynchronousProxy> for zx::Handle {
1170    fn from(value: CapabilityStoreSynchronousProxy) -> Self {
1171        value.into_channel().into()
1172    }
1173}
1174
1175#[cfg(target_os = "fuchsia")]
1176impl From<fidl::Channel> for CapabilityStoreSynchronousProxy {
1177    fn from(value: fidl::Channel) -> Self {
1178        Self::new(value)
1179    }
1180}
1181
1182#[derive(Debug, Clone)]
1183pub struct CapabilityStoreProxy {
1184    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1185}
1186
1187impl fidl::endpoints::Proxy for CapabilityStoreProxy {
1188    type Protocol = CapabilityStoreMarker;
1189
1190    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1191        Self::new(inner)
1192    }
1193
1194    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1195        self.client.into_channel().map_err(|client| Self { client })
1196    }
1197
1198    fn as_channel(&self) -> &::fidl::AsyncChannel {
1199        self.client.as_channel()
1200    }
1201}
1202
1203impl CapabilityStoreProxy {
1204    /// Create a new Proxy for fuchsia.component.sandbox/CapabilityStore.
1205    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1206        let protocol_name = <CapabilityStoreMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1207        Self { client: fidl::client::Client::new(channel, protocol_name) }
1208    }
1209
1210    /// Get a Stream of events from the remote end of the protocol.
1211    ///
1212    /// # Panics
1213    ///
1214    /// Panics if the event stream was already taken.
1215    pub fn take_event_stream(&self) -> CapabilityStoreEventStream {
1216        CapabilityStoreEventStream { event_receiver: self.client.take_event_receiver() }
1217    }
1218
1219    /// Duplicates the capability with `id` to `dest_id`.
1220    ///
1221    /// Errors:
1222    ///
1223    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1224    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
1225    /// - `NOT_DUPLICATABLE` if `id` could not be duplicated.
1226    pub fn r#duplicate(
1227        &self,
1228        mut id: u64,
1229        mut dest_id: u64,
1230    ) -> fidl::client::QueryResponseFut<
1231        CapabilityStoreDuplicateResult,
1232        fidl::encoding::DefaultFuchsiaResourceDialect,
1233    > {
1234        CapabilityStoreProxyInterface::r#duplicate(self, id, dest_id)
1235    }
1236
1237    /// Drops the capability with `id` from this [`CapabilityStore`].
1238    ///
1239    /// Errors:
1240    ///
1241    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1242    pub fn r#drop(
1243        &self,
1244        mut id: u64,
1245    ) -> fidl::client::QueryResponseFut<
1246        CapabilityStoreDropResult,
1247        fidl::encoding::DefaultFuchsiaResourceDialect,
1248    > {
1249        CapabilityStoreProxyInterface::r#drop(self, id)
1250    }
1251
1252    /// Exports the capability with the client-assigned identifier `id` to
1253    /// `capability`. This operation removes the capability from the store. If
1254    /// this is not desired, [Duplicate] the capability first.
1255    ///
1256    /// Errors:
1257    ///
1258    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1259    pub fn r#export(
1260        &self,
1261        mut id: u64,
1262    ) -> fidl::client::QueryResponseFut<
1263        CapabilityStoreExportResult,
1264        fidl::encoding::DefaultFuchsiaResourceDialect,
1265    > {
1266        CapabilityStoreProxyInterface::r#export(self, id)
1267    }
1268
1269    /// Imports `capability` into this store with the client-assigned `id`.
1270    ///
1271    /// Errors:
1272    ///
1273    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
1274    /// - `BAD_CAPABILITY` if `capability` was not a valid [Capability].
1275    pub fn r#import(
1276        &self,
1277        mut id: u64,
1278        mut capability: Capability,
1279    ) -> fidl::client::QueryResponseFut<
1280        CapabilityStoreImportResult,
1281        fidl::encoding::DefaultFuchsiaResourceDialect,
1282    > {
1283        CapabilityStoreProxyInterface::r#import(self, id, capability)
1284    }
1285
1286    /// Creates a [Connector] from a [Receiver]. Incoming connections to the [Connector] will be
1287    /// dispatched to this [Receiver].
1288    ///
1289    /// Errors:
1290    ///
1291    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
1292    pub fn r#connector_create(
1293        &self,
1294        mut id: u64,
1295        mut receiver: fidl::endpoints::ClientEnd<ReceiverMarker>,
1296    ) -> fidl::client::QueryResponseFut<
1297        CapabilityStoreConnectorCreateResult,
1298        fidl::encoding::DefaultFuchsiaResourceDialect,
1299    > {
1300        CapabilityStoreProxyInterface::r#connector_create(self, id, receiver)
1301    }
1302
1303    /// Open a connection from the provided [Connector] capability that will be dispatched to
1304    /// the [Receiver] on the other end.
1305    ///
1306    /// If there is an error, it will be reported as a zx.Status epitaph on `server_end`.
1307    ///
1308    /// Errors:
1309    ///
1310    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1311    /// - `WRONG_TYPE` if `id` was not a connector capability.
1312    pub fn r#connector_open(
1313        &self,
1314        mut id: u64,
1315        mut server_end: fidl::Channel,
1316    ) -> fidl::client::QueryResponseFut<
1317        CapabilityStoreConnectorOpenResult,
1318        fidl::encoding::DefaultFuchsiaResourceDialect,
1319    > {
1320        CapabilityStoreProxyInterface::r#connector_open(self, id, server_end)
1321    }
1322
1323    /// Creates a [DirConnector] from a [DirReceiver]. Incoming connections to the [DirConnector]
1324    /// will be dispatched to this [DirReceiver].
1325    ///
1326    /// Errors:
1327    ///
1328    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
1329    pub fn r#dir_connector_create(
1330        &self,
1331        mut id: u64,
1332        mut receiver: fidl::endpoints::ClientEnd<DirReceiverMarker>,
1333    ) -> fidl::client::QueryResponseFut<
1334        CapabilityStoreDirConnectorCreateResult,
1335        fidl::encoding::DefaultFuchsiaResourceDialect,
1336    > {
1337        CapabilityStoreProxyInterface::r#dir_connector_create(self, id, receiver)
1338    }
1339
1340    /// Open a connection from the provided [DirConnector] capability that will be dispatched to
1341    /// the [DirReceiver] on the other end.
1342    ///
1343    /// This method does not take `Open`/`Open3` parameters such as `flags` or `path`.
1344    /// Clients that wish to specify these can get an initial connection from this method
1345    /// and call `fuchsia.io/Directory.Open` on it. See the [DirReceiver] documentation for
1346    /// more information about the expectations of the server side.
1347    ///
1348    /// If there was an error making the connection, it will be reported as a zx.Status
1349    /// epitaph on `server_end`.
1350    ///
1351    /// Errors:
1352    ///
1353    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1354    /// - `WRONG_TYPE` if `id` was not a connector capability.
1355    pub fn r#dir_connector_open(
1356        &self,
1357        mut id: u64,
1358        mut server_end: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
1359    ) -> fidl::client::QueryResponseFut<
1360        CapabilityStoreDirConnectorOpenResult,
1361        fidl::encoding::DefaultFuchsiaResourceDialect,
1362    > {
1363        CapabilityStoreProxyInterface::r#dir_connector_open(self, id, server_end)
1364    }
1365
1366    /// Creates a new empty dictionary in this [`CapabilityStore`] with client-assigned `id`.
1367    ///
1368    /// Errors:
1369    ///
1370    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
1371    pub fn r#dictionary_create(
1372        &self,
1373        mut id: u64,
1374    ) -> fidl::client::QueryResponseFut<
1375        CapabilityStoreDictionaryCreateResult,
1376        fidl::encoding::DefaultFuchsiaResourceDialect,
1377    > {
1378        CapabilityStoreProxyInterface::r#dictionary_create(self, id)
1379    }
1380
1381    /// Imports a dictionary in the form of a channel.
1382    ///
1383    /// This is a legacy API to support backward compatibility with APIs that take a [Dictionary]
1384    /// channel.
1385    ///
1386    /// Errors:
1387    ///
1388    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
1389    /// - `BAD_CAPABILITY` if `client_end` was not a valid dictionary channel.
1390    pub fn r#dictionary_legacy_import(
1391        &self,
1392        mut id: u64,
1393        mut client_end: fidl::Channel,
1394    ) -> fidl::client::QueryResponseFut<
1395        CapabilityStoreDictionaryLegacyImportResult,
1396        fidl::encoding::DefaultFuchsiaResourceDialect,
1397    > {
1398        CapabilityStoreProxyInterface::r#dictionary_legacy_import(self, id, client_end)
1399    }
1400
1401    /// Binds a channel to the dictionary with `id`. The channel can
1402    /// be re-imported into a [CapabilityStore] with [DictionaryImportLegacy].
1403    ///
1404    /// This is a legacy API to support backward compatibility with APIs that take a [Dictionary]
1405    /// channel.
1406    ///
1407    /// Errors:
1408    ///
1409    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1410    pub fn r#dictionary_legacy_export(
1411        &self,
1412        mut id: u64,
1413        mut server_end: fidl::Channel,
1414    ) -> fidl::client::QueryResponseFut<
1415        CapabilityStoreDictionaryLegacyExportResult,
1416        fidl::encoding::DefaultFuchsiaResourceDialect,
1417    > {
1418        CapabilityStoreProxyInterface::r#dictionary_legacy_export(self, id, server_end)
1419    }
1420
1421    /// Inserts `item` into the dictionary with `id`. `item.value` is moved into the dictionary and
1422    /// its id is released if this call succeeds.
1423    ///
1424    /// Errors:
1425    ///
1426    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1427    /// - `WRONG_TYPE` if `id` was not a dictionary.
1428    /// - `INVALID_KEY` if `item.key` was invalid.
1429    /// - `ITEM_ALREADY_EXISTS` if the dictionary already contains an item with `item.key`.
1430    pub fn r#dictionary_insert(
1431        &self,
1432        mut id: u64,
1433        mut item: &DictionaryItem,
1434    ) -> fidl::client::QueryResponseFut<
1435        CapabilityStoreDictionaryInsertResult,
1436        fidl::encoding::DefaultFuchsiaResourceDialect,
1437    > {
1438        CapabilityStoreProxyInterface::r#dictionary_insert(self, id, item)
1439    }
1440
1441    /// Get a duplicate of a capability from the dictionary with `id`, which is
1442    /// loaded into `dest_id`.
1443    ///
1444    /// Errors:
1445    ///
1446    /// - `ID_NOT_FOUND` if `id` was not a recognized capability id in this store.
1447    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
1448    /// - `WRONG_TYPE` if `id` was not a dictionary.
1449    /// - `INVALID_KEY` if `item.key` was invalid.
1450    /// - `ITEM_NOT_FOUND` if the dictionary does not contain `key`.
1451    /// - `NOT_DUPLICATABLE` if the capability could not be duplicated.
1452    pub fn r#dictionary_get(
1453        &self,
1454        mut id: u64,
1455        mut key: &str,
1456        mut dest_id: u64,
1457    ) -> fidl::client::QueryResponseFut<
1458        CapabilityStoreDictionaryGetResult,
1459        fidl::encoding::DefaultFuchsiaResourceDialect,
1460    > {
1461        CapabilityStoreProxyInterface::r#dictionary_get(self, id, key, dest_id)
1462    }
1463
1464    /// Removes a key from the dictionary with `id`. If `dest_id` is present, loads the value
1465    /// into it, otherwise discards the value.
1466    ///
1467    /// Errors:
1468    ///
1469    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1470    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
1471    /// - `WRONG_TYPE` if `id` was not a dictionary.
1472    /// - `INVALID_KEY` if `key` was invalid.
1473    /// - `ITEM_NOT_FOUND` if the dictionary does not contain the key.
1474    pub fn r#dictionary_remove(
1475        &self,
1476        mut id: u64,
1477        mut key: &str,
1478        mut dest_id: Option<&WrappedCapabilityId>,
1479    ) -> fidl::client::QueryResponseFut<
1480        CapabilityStoreDictionaryRemoveResult,
1481        fidl::encoding::DefaultFuchsiaResourceDialect,
1482    > {
1483        CapabilityStoreProxyInterface::r#dictionary_remove(self, id, key, dest_id)
1484    }
1485
1486    /// Create a new dictionary that contains a duplicate of all the entries in
1487    /// the dictionary with `id`, assigning `dest_id` to the new dictionary.
1488    /// The runtime of this method is linear in the number of top-level entries
1489    /// in the dictionary.
1490    ///
1491    /// For example, if the dictionary contains nested dictionaries, the newly
1492    /// created dictionary will contain references to those same nested
1493    /// dictionaries because the entries are duplicated rather than deep-copied.
1494    ///
1495    /// Errors:
1496    ///
1497    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1498    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
1499    /// - `WRONG_TYPE` if `id` was not a dictionary.
1500    /// - `NOT_DUPLICATABLE` if one of the capabilities in `id` could not be duplicated.
1501    pub fn r#dictionary_copy(
1502        &self,
1503        mut id: u64,
1504        mut dest_id: u64,
1505    ) -> fidl::client::QueryResponseFut<
1506        CapabilityStoreDictionaryCopyResult,
1507        fidl::encoding::DefaultFuchsiaResourceDialect,
1508    > {
1509        CapabilityStoreProxyInterface::r#dictionary_copy(self, id, dest_id)
1510    }
1511
1512    /// Enumerates the keys in the dictionary with `id`.
1513    ///
1514    /// Errors:
1515    ///
1516    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1517    /// - `WRONG_TYPE` if `id` was not a dictionary.
1518    pub fn r#dictionary_keys(
1519        &self,
1520        mut id: u64,
1521        mut iterator: fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>,
1522    ) -> fidl::client::QueryResponseFut<
1523        CapabilityStoreDictionaryKeysResult,
1524        fidl::encoding::DefaultFuchsiaResourceDialect,
1525    > {
1526        CapabilityStoreProxyInterface::r#dictionary_keys(self, id, iterator)
1527    }
1528
1529    /// Enumerates the items (keys and values) in the dictionary with `id`.
1530    ///
1531    /// Creates a duplicate of each value (capability). If a value could not be duplicated,
1532    /// the value will be null.
1533    ///
1534    /// Errors:
1535    ///
1536    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1537    /// - `WRONG_TYPE` if `id` was not a dictionary.
1538    pub fn r#dictionary_enumerate(
1539        &self,
1540        mut id: u64,
1541        mut iterator: fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
1542    ) -> fidl::client::QueryResponseFut<
1543        CapabilityStoreDictionaryEnumerateResult,
1544        fidl::encoding::DefaultFuchsiaResourceDialect,
1545    > {
1546        CapabilityStoreProxyInterface::r#dictionary_enumerate(self, id, iterator)
1547    }
1548
1549    /// Removes all the entries in this dictionary, returning them in `contents` if provided.
1550    /// If `contents` is not provided, all the items are discarded without enumerating them.
1551    ///
1552    /// Errors:
1553    ///
1554    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1555    /// - `WRONG_TYPE` if `id` was not a dictionary.
1556    pub fn r#dictionary_drain(
1557        &self,
1558        mut id: u64,
1559        mut iterator: Option<fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>>,
1560    ) -> fidl::client::QueryResponseFut<
1561        CapabilityStoreDictionaryDrainResult,
1562        fidl::encoding::DefaultFuchsiaResourceDialect,
1563    > {
1564        CapabilityStoreProxyInterface::r#dictionary_drain(self, id, iterator)
1565    }
1566}
1567
1568impl CapabilityStoreProxyInterface for CapabilityStoreProxy {
1569    type DuplicateResponseFut = fidl::client::QueryResponseFut<
1570        CapabilityStoreDuplicateResult,
1571        fidl::encoding::DefaultFuchsiaResourceDialect,
1572    >;
1573    fn r#duplicate(&self, mut id: u64, mut dest_id: u64) -> Self::DuplicateResponseFut {
1574        fn _decode(
1575            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1576        ) -> Result<CapabilityStoreDuplicateResult, fidl::Error> {
1577            let _response = fidl::client::decode_transaction_body::<
1578                fidl::encoding::FlexibleResultType<
1579                    fidl::encoding::EmptyStruct,
1580                    CapabilityStoreError,
1581                >,
1582                fidl::encoding::DefaultFuchsiaResourceDialect,
1583                0x5d5d35d9c20a2184,
1584            >(_buf?)?
1585            .into_result::<CapabilityStoreMarker>("duplicate")?;
1586            Ok(_response.map(|x| x))
1587        }
1588        self.client.send_query_and_decode::<
1589            CapabilityStoreDuplicateRequest,
1590            CapabilityStoreDuplicateResult,
1591        >(
1592            (id, dest_id,),
1593            0x5d5d35d9c20a2184,
1594            fidl::encoding::DynamicFlags::FLEXIBLE,
1595            _decode,
1596        )
1597    }
1598
1599    type DropResponseFut = fidl::client::QueryResponseFut<
1600        CapabilityStoreDropResult,
1601        fidl::encoding::DefaultFuchsiaResourceDialect,
1602    >;
1603    fn r#drop(&self, mut id: u64) -> Self::DropResponseFut {
1604        fn _decode(
1605            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1606        ) -> Result<CapabilityStoreDropResult, fidl::Error> {
1607            let _response = fidl::client::decode_transaction_body::<
1608                fidl::encoding::FlexibleResultType<
1609                    fidl::encoding::EmptyStruct,
1610                    CapabilityStoreError,
1611                >,
1612                fidl::encoding::DefaultFuchsiaResourceDialect,
1613                0xa745c0990fc2559,
1614            >(_buf?)?
1615            .into_result::<CapabilityStoreMarker>("drop")?;
1616            Ok(_response.map(|x| x))
1617        }
1618        self.client.send_query_and_decode::<CapabilityStoreDropRequest, CapabilityStoreDropResult>(
1619            (id,),
1620            0xa745c0990fc2559,
1621            fidl::encoding::DynamicFlags::FLEXIBLE,
1622            _decode,
1623        )
1624    }
1625
1626    type ExportResponseFut = fidl::client::QueryResponseFut<
1627        CapabilityStoreExportResult,
1628        fidl::encoding::DefaultFuchsiaResourceDialect,
1629    >;
1630    fn r#export(&self, mut id: u64) -> Self::ExportResponseFut {
1631        fn _decode(
1632            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1633        ) -> Result<CapabilityStoreExportResult, fidl::Error> {
1634            let _response = fidl::client::decode_transaction_body::<
1635                fidl::encoding::FlexibleResultType<
1636                    CapabilityStoreExportResponse,
1637                    CapabilityStoreError,
1638                >,
1639                fidl::encoding::DefaultFuchsiaResourceDialect,
1640                0x3237a8f4748faff,
1641            >(_buf?)?
1642            .into_result::<CapabilityStoreMarker>("export")?;
1643            Ok(_response.map(|x| x.capability))
1644        }
1645        self.client
1646            .send_query_and_decode::<CapabilityStoreExportRequest, CapabilityStoreExportResult>(
1647                (id,),
1648                0x3237a8f4748faff,
1649                fidl::encoding::DynamicFlags::FLEXIBLE,
1650                _decode,
1651            )
1652    }
1653
1654    type ImportResponseFut = fidl::client::QueryResponseFut<
1655        CapabilityStoreImportResult,
1656        fidl::encoding::DefaultFuchsiaResourceDialect,
1657    >;
1658    fn r#import(&self, mut id: u64, mut capability: Capability) -> Self::ImportResponseFut {
1659        fn _decode(
1660            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1661        ) -> Result<CapabilityStoreImportResult, fidl::Error> {
1662            let _response = fidl::client::decode_transaction_body::<
1663                fidl::encoding::FlexibleResultType<
1664                    fidl::encoding::EmptyStruct,
1665                    CapabilityStoreError,
1666                >,
1667                fidl::encoding::DefaultFuchsiaResourceDialect,
1668                0x1f96157a29f4539b,
1669            >(_buf?)?
1670            .into_result::<CapabilityStoreMarker>("import")?;
1671            Ok(_response.map(|x| x))
1672        }
1673        self.client
1674            .send_query_and_decode::<CapabilityStoreImportRequest, CapabilityStoreImportResult>(
1675                (id, &mut capability),
1676                0x1f96157a29f4539b,
1677                fidl::encoding::DynamicFlags::FLEXIBLE,
1678                _decode,
1679            )
1680    }
1681
1682    type ConnectorCreateResponseFut = fidl::client::QueryResponseFut<
1683        CapabilityStoreConnectorCreateResult,
1684        fidl::encoding::DefaultFuchsiaResourceDialect,
1685    >;
1686    fn r#connector_create(
1687        &self,
1688        mut id: u64,
1689        mut receiver: fidl::endpoints::ClientEnd<ReceiverMarker>,
1690    ) -> Self::ConnectorCreateResponseFut {
1691        fn _decode(
1692            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1693        ) -> Result<CapabilityStoreConnectorCreateResult, fidl::Error> {
1694            let _response = fidl::client::decode_transaction_body::<
1695                fidl::encoding::FlexibleResultType<
1696                    fidl::encoding::EmptyStruct,
1697                    CapabilityStoreError,
1698                >,
1699                fidl::encoding::DefaultFuchsiaResourceDialect,
1700                0x29592c5d63e91c25,
1701            >(_buf?)?
1702            .into_result::<CapabilityStoreMarker>("connector_create")?;
1703            Ok(_response.map(|x| x))
1704        }
1705        self.client.send_query_and_decode::<
1706            CapabilityStoreConnectorCreateRequest,
1707            CapabilityStoreConnectorCreateResult,
1708        >(
1709            (id, receiver,),
1710            0x29592c5d63e91c25,
1711            fidl::encoding::DynamicFlags::FLEXIBLE,
1712            _decode,
1713        )
1714    }
1715
1716    type ConnectorOpenResponseFut = fidl::client::QueryResponseFut<
1717        CapabilityStoreConnectorOpenResult,
1718        fidl::encoding::DefaultFuchsiaResourceDialect,
1719    >;
1720    fn r#connector_open(
1721        &self,
1722        mut id: u64,
1723        mut server_end: fidl::Channel,
1724    ) -> Self::ConnectorOpenResponseFut {
1725        fn _decode(
1726            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1727        ) -> Result<CapabilityStoreConnectorOpenResult, fidl::Error> {
1728            let _response = fidl::client::decode_transaction_body::<
1729                fidl::encoding::FlexibleResultType<
1730                    fidl::encoding::EmptyStruct,
1731                    CapabilityStoreError,
1732                >,
1733                fidl::encoding::DefaultFuchsiaResourceDialect,
1734                0x537e69ab40563b9f,
1735            >(_buf?)?
1736            .into_result::<CapabilityStoreMarker>("connector_open")?;
1737            Ok(_response.map(|x| x))
1738        }
1739        self.client.send_query_and_decode::<
1740            CapabilityStoreConnectorOpenRequest,
1741            CapabilityStoreConnectorOpenResult,
1742        >(
1743            (id, server_end,),
1744            0x537e69ab40563b9f,
1745            fidl::encoding::DynamicFlags::FLEXIBLE,
1746            _decode,
1747        )
1748    }
1749
1750    type DirConnectorCreateResponseFut = fidl::client::QueryResponseFut<
1751        CapabilityStoreDirConnectorCreateResult,
1752        fidl::encoding::DefaultFuchsiaResourceDialect,
1753    >;
1754    fn r#dir_connector_create(
1755        &self,
1756        mut id: u64,
1757        mut receiver: fidl::endpoints::ClientEnd<DirReceiverMarker>,
1758    ) -> Self::DirConnectorCreateResponseFut {
1759        fn _decode(
1760            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1761        ) -> Result<CapabilityStoreDirConnectorCreateResult, fidl::Error> {
1762            let _response = fidl::client::decode_transaction_body::<
1763                fidl::encoding::FlexibleResultType<
1764                    fidl::encoding::EmptyStruct,
1765                    CapabilityStoreError,
1766                >,
1767                fidl::encoding::DefaultFuchsiaResourceDialect,
1768                0x186138a11ccf19bb,
1769            >(_buf?)?
1770            .into_result::<CapabilityStoreMarker>("dir_connector_create")?;
1771            Ok(_response.map(|x| x))
1772        }
1773        self.client.send_query_and_decode::<
1774            CapabilityStoreDirConnectorCreateRequest,
1775            CapabilityStoreDirConnectorCreateResult,
1776        >(
1777            (id, receiver,),
1778            0x186138a11ccf19bb,
1779            fidl::encoding::DynamicFlags::FLEXIBLE,
1780            _decode,
1781        )
1782    }
1783
1784    type DirConnectorOpenResponseFut = fidl::client::QueryResponseFut<
1785        CapabilityStoreDirConnectorOpenResult,
1786        fidl::encoding::DefaultFuchsiaResourceDialect,
1787    >;
1788    fn r#dir_connector_open(
1789        &self,
1790        mut id: u64,
1791        mut server_end: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
1792    ) -> Self::DirConnectorOpenResponseFut {
1793        fn _decode(
1794            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1795        ) -> Result<CapabilityStoreDirConnectorOpenResult, fidl::Error> {
1796            let _response = fidl::client::decode_transaction_body::<
1797                fidl::encoding::FlexibleResultType<
1798                    fidl::encoding::EmptyStruct,
1799                    CapabilityStoreError,
1800                >,
1801                fidl::encoding::DefaultFuchsiaResourceDialect,
1802                0x5650d3d6a3a13901,
1803            >(_buf?)?
1804            .into_result::<CapabilityStoreMarker>("dir_connector_open")?;
1805            Ok(_response.map(|x| x))
1806        }
1807        self.client.send_query_and_decode::<
1808            CapabilityStoreDirConnectorOpenRequest,
1809            CapabilityStoreDirConnectorOpenResult,
1810        >(
1811            (id, server_end,),
1812            0x5650d3d6a3a13901,
1813            fidl::encoding::DynamicFlags::FLEXIBLE,
1814            _decode,
1815        )
1816    }
1817
1818    type DictionaryCreateResponseFut = fidl::client::QueryResponseFut<
1819        CapabilityStoreDictionaryCreateResult,
1820        fidl::encoding::DefaultFuchsiaResourceDialect,
1821    >;
1822    fn r#dictionary_create(&self, mut id: u64) -> Self::DictionaryCreateResponseFut {
1823        fn _decode(
1824            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1825        ) -> Result<CapabilityStoreDictionaryCreateResult, fidl::Error> {
1826            let _response = fidl::client::decode_transaction_body::<
1827                fidl::encoding::FlexibleResultType<
1828                    fidl::encoding::EmptyStruct,
1829                    CapabilityStoreError,
1830                >,
1831                fidl::encoding::DefaultFuchsiaResourceDialect,
1832                0x6997c8dfc63de093,
1833            >(_buf?)?
1834            .into_result::<CapabilityStoreMarker>("dictionary_create")?;
1835            Ok(_response.map(|x| x))
1836        }
1837        self.client.send_query_and_decode::<
1838            CapabilityStoreDictionaryCreateRequest,
1839            CapabilityStoreDictionaryCreateResult,
1840        >(
1841            (id,),
1842            0x6997c8dfc63de093,
1843            fidl::encoding::DynamicFlags::FLEXIBLE,
1844            _decode,
1845        )
1846    }
1847
1848    type DictionaryLegacyImportResponseFut = fidl::client::QueryResponseFut<
1849        CapabilityStoreDictionaryLegacyImportResult,
1850        fidl::encoding::DefaultFuchsiaResourceDialect,
1851    >;
1852    fn r#dictionary_legacy_import(
1853        &self,
1854        mut id: u64,
1855        mut client_end: fidl::Channel,
1856    ) -> Self::DictionaryLegacyImportResponseFut {
1857        fn _decode(
1858            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1859        ) -> Result<CapabilityStoreDictionaryLegacyImportResult, fidl::Error> {
1860            let _response = fidl::client::decode_transaction_body::<
1861                fidl::encoding::FlexibleResultType<
1862                    fidl::encoding::EmptyStruct,
1863                    CapabilityStoreError,
1864                >,
1865                fidl::encoding::DefaultFuchsiaResourceDialect,
1866                0x72fd686c37b6025f,
1867            >(_buf?)?
1868            .into_result::<CapabilityStoreMarker>("dictionary_legacy_import")?;
1869            Ok(_response.map(|x| x))
1870        }
1871        self.client.send_query_and_decode::<
1872            CapabilityStoreDictionaryLegacyImportRequest,
1873            CapabilityStoreDictionaryLegacyImportResult,
1874        >(
1875            (id, client_end,),
1876            0x72fd686c37b6025f,
1877            fidl::encoding::DynamicFlags::FLEXIBLE,
1878            _decode,
1879        )
1880    }
1881
1882    type DictionaryLegacyExportResponseFut = fidl::client::QueryResponseFut<
1883        CapabilityStoreDictionaryLegacyExportResult,
1884        fidl::encoding::DefaultFuchsiaResourceDialect,
1885    >;
1886    fn r#dictionary_legacy_export(
1887        &self,
1888        mut id: u64,
1889        mut server_end: fidl::Channel,
1890    ) -> Self::DictionaryLegacyExportResponseFut {
1891        fn _decode(
1892            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1893        ) -> Result<CapabilityStoreDictionaryLegacyExportResult, fidl::Error> {
1894            let _response = fidl::client::decode_transaction_body::<
1895                fidl::encoding::FlexibleResultType<
1896                    fidl::encoding::EmptyStruct,
1897                    CapabilityStoreError,
1898                >,
1899                fidl::encoding::DefaultFuchsiaResourceDialect,
1900                0x407e15cc4bde5dcd,
1901            >(_buf?)?
1902            .into_result::<CapabilityStoreMarker>("dictionary_legacy_export")?;
1903            Ok(_response.map(|x| x))
1904        }
1905        self.client.send_query_and_decode::<
1906            CapabilityStoreDictionaryLegacyExportRequest,
1907            CapabilityStoreDictionaryLegacyExportResult,
1908        >(
1909            (id, server_end,),
1910            0x407e15cc4bde5dcd,
1911            fidl::encoding::DynamicFlags::FLEXIBLE,
1912            _decode,
1913        )
1914    }
1915
1916    type DictionaryInsertResponseFut = fidl::client::QueryResponseFut<
1917        CapabilityStoreDictionaryInsertResult,
1918        fidl::encoding::DefaultFuchsiaResourceDialect,
1919    >;
1920    fn r#dictionary_insert(
1921        &self,
1922        mut id: u64,
1923        mut item: &DictionaryItem,
1924    ) -> Self::DictionaryInsertResponseFut {
1925        fn _decode(
1926            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1927        ) -> Result<CapabilityStoreDictionaryInsertResult, fidl::Error> {
1928            let _response = fidl::client::decode_transaction_body::<
1929                fidl::encoding::FlexibleResultType<
1930                    fidl::encoding::EmptyStruct,
1931                    CapabilityStoreError,
1932                >,
1933                fidl::encoding::DefaultFuchsiaResourceDialect,
1934                0x7702183689d44c27,
1935            >(_buf?)?
1936            .into_result::<CapabilityStoreMarker>("dictionary_insert")?;
1937            Ok(_response.map(|x| x))
1938        }
1939        self.client.send_query_and_decode::<
1940            CapabilityStoreDictionaryInsertRequest,
1941            CapabilityStoreDictionaryInsertResult,
1942        >(
1943            (id, item,),
1944            0x7702183689d44c27,
1945            fidl::encoding::DynamicFlags::FLEXIBLE,
1946            _decode,
1947        )
1948    }
1949
1950    type DictionaryGetResponseFut = fidl::client::QueryResponseFut<
1951        CapabilityStoreDictionaryGetResult,
1952        fidl::encoding::DefaultFuchsiaResourceDialect,
1953    >;
1954    fn r#dictionary_get(
1955        &self,
1956        mut id: u64,
1957        mut key: &str,
1958        mut dest_id: u64,
1959    ) -> Self::DictionaryGetResponseFut {
1960        fn _decode(
1961            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1962        ) -> Result<CapabilityStoreDictionaryGetResult, fidl::Error> {
1963            let _response = fidl::client::decode_transaction_body::<
1964                fidl::encoding::FlexibleResultType<
1965                    fidl::encoding::EmptyStruct,
1966                    CapabilityStoreError,
1967                >,
1968                fidl::encoding::DefaultFuchsiaResourceDialect,
1969                0x4d9e27538284add2,
1970            >(_buf?)?
1971            .into_result::<CapabilityStoreMarker>("dictionary_get")?;
1972            Ok(_response.map(|x| x))
1973        }
1974        self.client.send_query_and_decode::<
1975            CapabilityStoreDictionaryGetRequest,
1976            CapabilityStoreDictionaryGetResult,
1977        >(
1978            (id, key, dest_id,),
1979            0x4d9e27538284add2,
1980            fidl::encoding::DynamicFlags::FLEXIBLE,
1981            _decode,
1982        )
1983    }
1984
1985    type DictionaryRemoveResponseFut = fidl::client::QueryResponseFut<
1986        CapabilityStoreDictionaryRemoveResult,
1987        fidl::encoding::DefaultFuchsiaResourceDialect,
1988    >;
1989    fn r#dictionary_remove(
1990        &self,
1991        mut id: u64,
1992        mut key: &str,
1993        mut dest_id: Option<&WrappedCapabilityId>,
1994    ) -> Self::DictionaryRemoveResponseFut {
1995        fn _decode(
1996            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1997        ) -> Result<CapabilityStoreDictionaryRemoveResult, fidl::Error> {
1998            let _response = fidl::client::decode_transaction_body::<
1999                fidl::encoding::FlexibleResultType<
2000                    fidl::encoding::EmptyStruct,
2001                    CapabilityStoreError,
2002                >,
2003                fidl::encoding::DefaultFuchsiaResourceDialect,
2004                0x4c5c025ab05d4f3,
2005            >(_buf?)?
2006            .into_result::<CapabilityStoreMarker>("dictionary_remove")?;
2007            Ok(_response.map(|x| x))
2008        }
2009        self.client.send_query_and_decode::<
2010            CapabilityStoreDictionaryRemoveRequest,
2011            CapabilityStoreDictionaryRemoveResult,
2012        >(
2013            (id, key, dest_id,),
2014            0x4c5c025ab05d4f3,
2015            fidl::encoding::DynamicFlags::FLEXIBLE,
2016            _decode,
2017        )
2018    }
2019
2020    type DictionaryCopyResponseFut = fidl::client::QueryResponseFut<
2021        CapabilityStoreDictionaryCopyResult,
2022        fidl::encoding::DefaultFuchsiaResourceDialect,
2023    >;
2024    fn r#dictionary_copy(&self, mut id: u64, mut dest_id: u64) -> Self::DictionaryCopyResponseFut {
2025        fn _decode(
2026            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2027        ) -> Result<CapabilityStoreDictionaryCopyResult, fidl::Error> {
2028            let _response = fidl::client::decode_transaction_body::<
2029                fidl::encoding::FlexibleResultType<
2030                    fidl::encoding::EmptyStruct,
2031                    CapabilityStoreError,
2032                >,
2033                fidl::encoding::DefaultFuchsiaResourceDialect,
2034                0x3733ecdf4ea1b44f,
2035            >(_buf?)?
2036            .into_result::<CapabilityStoreMarker>("dictionary_copy")?;
2037            Ok(_response.map(|x| x))
2038        }
2039        self.client.send_query_and_decode::<
2040            CapabilityStoreDictionaryCopyRequest,
2041            CapabilityStoreDictionaryCopyResult,
2042        >(
2043            (id, dest_id,),
2044            0x3733ecdf4ea1b44f,
2045            fidl::encoding::DynamicFlags::FLEXIBLE,
2046            _decode,
2047        )
2048    }
2049
2050    type DictionaryKeysResponseFut = fidl::client::QueryResponseFut<
2051        CapabilityStoreDictionaryKeysResult,
2052        fidl::encoding::DefaultFuchsiaResourceDialect,
2053    >;
2054    fn r#dictionary_keys(
2055        &self,
2056        mut id: u64,
2057        mut iterator: fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>,
2058    ) -> Self::DictionaryKeysResponseFut {
2059        fn _decode(
2060            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2061        ) -> Result<CapabilityStoreDictionaryKeysResult, fidl::Error> {
2062            let _response = fidl::client::decode_transaction_body::<
2063                fidl::encoding::FlexibleResultType<
2064                    fidl::encoding::EmptyStruct,
2065                    CapabilityStoreError,
2066                >,
2067                fidl::encoding::DefaultFuchsiaResourceDialect,
2068                0x84b05577ceaec9e,
2069            >(_buf?)?
2070            .into_result::<CapabilityStoreMarker>("dictionary_keys")?;
2071            Ok(_response.map(|x| x))
2072        }
2073        self.client.send_query_and_decode::<
2074            CapabilityStoreDictionaryKeysRequest,
2075            CapabilityStoreDictionaryKeysResult,
2076        >(
2077            (id, iterator,),
2078            0x84b05577ceaec9e,
2079            fidl::encoding::DynamicFlags::FLEXIBLE,
2080            _decode,
2081        )
2082    }
2083
2084    type DictionaryEnumerateResponseFut = fidl::client::QueryResponseFut<
2085        CapabilityStoreDictionaryEnumerateResult,
2086        fidl::encoding::DefaultFuchsiaResourceDialect,
2087    >;
2088    fn r#dictionary_enumerate(
2089        &self,
2090        mut id: u64,
2091        mut iterator: fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
2092    ) -> Self::DictionaryEnumerateResponseFut {
2093        fn _decode(
2094            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2095        ) -> Result<CapabilityStoreDictionaryEnumerateResult, fidl::Error> {
2096            let _response = fidl::client::decode_transaction_body::<
2097                fidl::encoding::FlexibleResultType<
2098                    fidl::encoding::EmptyStruct,
2099                    CapabilityStoreError,
2100                >,
2101                fidl::encoding::DefaultFuchsiaResourceDialect,
2102                0xd6279b6ced04641,
2103            >(_buf?)?
2104            .into_result::<CapabilityStoreMarker>("dictionary_enumerate")?;
2105            Ok(_response.map(|x| x))
2106        }
2107        self.client.send_query_and_decode::<
2108            CapabilityStoreDictionaryEnumerateRequest,
2109            CapabilityStoreDictionaryEnumerateResult,
2110        >(
2111            (id, iterator,),
2112            0xd6279b6ced04641,
2113            fidl::encoding::DynamicFlags::FLEXIBLE,
2114            _decode,
2115        )
2116    }
2117
2118    type DictionaryDrainResponseFut = fidl::client::QueryResponseFut<
2119        CapabilityStoreDictionaryDrainResult,
2120        fidl::encoding::DefaultFuchsiaResourceDialect,
2121    >;
2122    fn r#dictionary_drain(
2123        &self,
2124        mut id: u64,
2125        mut iterator: Option<fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>>,
2126    ) -> Self::DictionaryDrainResponseFut {
2127        fn _decode(
2128            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2129        ) -> Result<CapabilityStoreDictionaryDrainResult, fidl::Error> {
2130            let _response = fidl::client::decode_transaction_body::<
2131                fidl::encoding::FlexibleResultType<
2132                    fidl::encoding::EmptyStruct,
2133                    CapabilityStoreError,
2134                >,
2135                fidl::encoding::DefaultFuchsiaResourceDialect,
2136                0x28a3a3f84d928cd8,
2137            >(_buf?)?
2138            .into_result::<CapabilityStoreMarker>("dictionary_drain")?;
2139            Ok(_response.map(|x| x))
2140        }
2141        self.client.send_query_and_decode::<
2142            CapabilityStoreDictionaryDrainRequest,
2143            CapabilityStoreDictionaryDrainResult,
2144        >(
2145            (id, iterator,),
2146            0x28a3a3f84d928cd8,
2147            fidl::encoding::DynamicFlags::FLEXIBLE,
2148            _decode,
2149        )
2150    }
2151}
2152
2153pub struct CapabilityStoreEventStream {
2154    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2155}
2156
2157impl std::marker::Unpin for CapabilityStoreEventStream {}
2158
2159impl futures::stream::FusedStream for CapabilityStoreEventStream {
2160    fn is_terminated(&self) -> bool {
2161        self.event_receiver.is_terminated()
2162    }
2163}
2164
2165impl futures::Stream for CapabilityStoreEventStream {
2166    type Item = Result<CapabilityStoreEvent, fidl::Error>;
2167
2168    fn poll_next(
2169        mut self: std::pin::Pin<&mut Self>,
2170        cx: &mut std::task::Context<'_>,
2171    ) -> std::task::Poll<Option<Self::Item>> {
2172        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2173            &mut self.event_receiver,
2174            cx
2175        )?) {
2176            Some(buf) => std::task::Poll::Ready(Some(CapabilityStoreEvent::decode(buf))),
2177            None => std::task::Poll::Ready(None),
2178        }
2179    }
2180}
2181
2182#[derive(Debug)]
2183pub enum CapabilityStoreEvent {
2184    #[non_exhaustive]
2185    _UnknownEvent {
2186        /// Ordinal of the event that was sent.
2187        ordinal: u64,
2188    },
2189}
2190
2191impl CapabilityStoreEvent {
2192    /// Decodes a message buffer as a [`CapabilityStoreEvent`].
2193    fn decode(
2194        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2195    ) -> Result<CapabilityStoreEvent, fidl::Error> {
2196        let (bytes, _handles) = buf.split_mut();
2197        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2198        debug_assert_eq!(tx_header.tx_id, 0);
2199        match tx_header.ordinal {
2200            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2201                Ok(CapabilityStoreEvent::_UnknownEvent { ordinal: tx_header.ordinal })
2202            }
2203            _ => Err(fidl::Error::UnknownOrdinal {
2204                ordinal: tx_header.ordinal,
2205                protocol_name:
2206                    <CapabilityStoreMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2207            }),
2208        }
2209    }
2210}
2211
2212/// A Stream of incoming requests for fuchsia.component.sandbox/CapabilityStore.
2213pub struct CapabilityStoreRequestStream {
2214    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2215    is_terminated: bool,
2216}
2217
2218impl std::marker::Unpin for CapabilityStoreRequestStream {}
2219
2220impl futures::stream::FusedStream for CapabilityStoreRequestStream {
2221    fn is_terminated(&self) -> bool {
2222        self.is_terminated
2223    }
2224}
2225
2226impl fidl::endpoints::RequestStream for CapabilityStoreRequestStream {
2227    type Protocol = CapabilityStoreMarker;
2228    type ControlHandle = CapabilityStoreControlHandle;
2229
2230    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2231        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2232    }
2233
2234    fn control_handle(&self) -> Self::ControlHandle {
2235        CapabilityStoreControlHandle { inner: self.inner.clone() }
2236    }
2237
2238    fn into_inner(
2239        self,
2240    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2241    {
2242        (self.inner, self.is_terminated)
2243    }
2244
2245    fn from_inner(
2246        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2247        is_terminated: bool,
2248    ) -> Self {
2249        Self { inner, is_terminated }
2250    }
2251}
2252
2253impl futures::Stream for CapabilityStoreRequestStream {
2254    type Item = Result<CapabilityStoreRequest, fidl::Error>;
2255
2256    fn poll_next(
2257        mut self: std::pin::Pin<&mut Self>,
2258        cx: &mut std::task::Context<'_>,
2259    ) -> std::task::Poll<Option<Self::Item>> {
2260        let this = &mut *self;
2261        if this.inner.check_shutdown(cx) {
2262            this.is_terminated = true;
2263            return std::task::Poll::Ready(None);
2264        }
2265        if this.is_terminated {
2266            panic!("polled CapabilityStoreRequestStream after completion");
2267        }
2268        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2269            |bytes, handles| {
2270                match this.inner.channel().read_etc(cx, bytes, handles) {
2271                    std::task::Poll::Ready(Ok(())) => {}
2272                    std::task::Poll::Pending => return std::task::Poll::Pending,
2273                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2274                        this.is_terminated = true;
2275                        return std::task::Poll::Ready(None);
2276                    }
2277                    std::task::Poll::Ready(Err(e)) => {
2278                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2279                            e.into(),
2280                        ))))
2281                    }
2282                }
2283
2284                // A message has been received from the channel
2285                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2286
2287                std::task::Poll::Ready(Some(match header.ordinal {
2288                    0x5d5d35d9c20a2184 => {
2289                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2290                        let mut req = fidl::new_empty!(
2291                            CapabilityStoreDuplicateRequest,
2292                            fidl::encoding::DefaultFuchsiaResourceDialect
2293                        );
2294                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDuplicateRequest>(&header, _body_bytes, handles, &mut req)?;
2295                        let control_handle =
2296                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2297                        Ok(CapabilityStoreRequest::Duplicate {
2298                            id: req.id,
2299                            dest_id: req.dest_id,
2300
2301                            responder: CapabilityStoreDuplicateResponder {
2302                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2303                                tx_id: header.tx_id,
2304                            },
2305                        })
2306                    }
2307                    0xa745c0990fc2559 => {
2308                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2309                        let mut req = fidl::new_empty!(
2310                            CapabilityStoreDropRequest,
2311                            fidl::encoding::DefaultFuchsiaResourceDialect
2312                        );
2313                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDropRequest>(&header, _body_bytes, handles, &mut req)?;
2314                        let control_handle =
2315                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2316                        Ok(CapabilityStoreRequest::Drop {
2317                            id: req.id,
2318
2319                            responder: CapabilityStoreDropResponder {
2320                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2321                                tx_id: header.tx_id,
2322                            },
2323                        })
2324                    }
2325                    0x3237a8f4748faff => {
2326                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2327                        let mut req = fidl::new_empty!(
2328                            CapabilityStoreExportRequest,
2329                            fidl::encoding::DefaultFuchsiaResourceDialect
2330                        );
2331                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreExportRequest>(&header, _body_bytes, handles, &mut req)?;
2332                        let control_handle =
2333                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2334                        Ok(CapabilityStoreRequest::Export {
2335                            id: req.id,
2336
2337                            responder: CapabilityStoreExportResponder {
2338                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2339                                tx_id: header.tx_id,
2340                            },
2341                        })
2342                    }
2343                    0x1f96157a29f4539b => {
2344                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2345                        let mut req = fidl::new_empty!(
2346                            CapabilityStoreImportRequest,
2347                            fidl::encoding::DefaultFuchsiaResourceDialect
2348                        );
2349                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreImportRequest>(&header, _body_bytes, handles, &mut req)?;
2350                        let control_handle =
2351                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2352                        Ok(CapabilityStoreRequest::Import {
2353                            id: req.id,
2354                            capability: req.capability,
2355
2356                            responder: CapabilityStoreImportResponder {
2357                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2358                                tx_id: header.tx_id,
2359                            },
2360                        })
2361                    }
2362                    0x29592c5d63e91c25 => {
2363                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2364                        let mut req = fidl::new_empty!(
2365                            CapabilityStoreConnectorCreateRequest,
2366                            fidl::encoding::DefaultFuchsiaResourceDialect
2367                        );
2368                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreConnectorCreateRequest>(&header, _body_bytes, handles, &mut req)?;
2369                        let control_handle =
2370                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2371                        Ok(CapabilityStoreRequest::ConnectorCreate {
2372                            id: req.id,
2373                            receiver: req.receiver,
2374
2375                            responder: CapabilityStoreConnectorCreateResponder {
2376                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2377                                tx_id: header.tx_id,
2378                            },
2379                        })
2380                    }
2381                    0x537e69ab40563b9f => {
2382                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2383                        let mut req = fidl::new_empty!(
2384                            CapabilityStoreConnectorOpenRequest,
2385                            fidl::encoding::DefaultFuchsiaResourceDialect
2386                        );
2387                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreConnectorOpenRequest>(&header, _body_bytes, handles, &mut req)?;
2388                        let control_handle =
2389                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2390                        Ok(CapabilityStoreRequest::ConnectorOpen {
2391                            id: req.id,
2392                            server_end: req.server_end,
2393
2394                            responder: CapabilityStoreConnectorOpenResponder {
2395                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2396                                tx_id: header.tx_id,
2397                            },
2398                        })
2399                    }
2400                    0x186138a11ccf19bb => {
2401                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2402                        let mut req = fidl::new_empty!(
2403                            CapabilityStoreDirConnectorCreateRequest,
2404                            fidl::encoding::DefaultFuchsiaResourceDialect
2405                        );
2406                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDirConnectorCreateRequest>(&header, _body_bytes, handles, &mut req)?;
2407                        let control_handle =
2408                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2409                        Ok(CapabilityStoreRequest::DirConnectorCreate {
2410                            id: req.id,
2411                            receiver: req.receiver,
2412
2413                            responder: CapabilityStoreDirConnectorCreateResponder {
2414                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2415                                tx_id: header.tx_id,
2416                            },
2417                        })
2418                    }
2419                    0x5650d3d6a3a13901 => {
2420                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2421                        let mut req = fidl::new_empty!(
2422                            CapabilityStoreDirConnectorOpenRequest,
2423                            fidl::encoding::DefaultFuchsiaResourceDialect
2424                        );
2425                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDirConnectorOpenRequest>(&header, _body_bytes, handles, &mut req)?;
2426                        let control_handle =
2427                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2428                        Ok(CapabilityStoreRequest::DirConnectorOpen {
2429                            id: req.id,
2430                            server_end: req.server_end,
2431
2432                            responder: CapabilityStoreDirConnectorOpenResponder {
2433                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2434                                tx_id: header.tx_id,
2435                            },
2436                        })
2437                    }
2438                    0x6997c8dfc63de093 => {
2439                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2440                        let mut req = fidl::new_empty!(
2441                            CapabilityStoreDictionaryCreateRequest,
2442                            fidl::encoding::DefaultFuchsiaResourceDialect
2443                        );
2444                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryCreateRequest>(&header, _body_bytes, handles, &mut req)?;
2445                        let control_handle =
2446                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2447                        Ok(CapabilityStoreRequest::DictionaryCreate {
2448                            id: req.id,
2449
2450                            responder: CapabilityStoreDictionaryCreateResponder {
2451                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2452                                tx_id: header.tx_id,
2453                            },
2454                        })
2455                    }
2456                    0x72fd686c37b6025f => {
2457                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2458                        let mut req = fidl::new_empty!(
2459                            CapabilityStoreDictionaryLegacyImportRequest,
2460                            fidl::encoding::DefaultFuchsiaResourceDialect
2461                        );
2462                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryLegacyImportRequest>(&header, _body_bytes, handles, &mut req)?;
2463                        let control_handle =
2464                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2465                        Ok(CapabilityStoreRequest::DictionaryLegacyImport {
2466                            id: req.id,
2467                            client_end: req.client_end,
2468
2469                            responder: CapabilityStoreDictionaryLegacyImportResponder {
2470                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2471                                tx_id: header.tx_id,
2472                            },
2473                        })
2474                    }
2475                    0x407e15cc4bde5dcd => {
2476                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2477                        let mut req = fidl::new_empty!(
2478                            CapabilityStoreDictionaryLegacyExportRequest,
2479                            fidl::encoding::DefaultFuchsiaResourceDialect
2480                        );
2481                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryLegacyExportRequest>(&header, _body_bytes, handles, &mut req)?;
2482                        let control_handle =
2483                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2484                        Ok(CapabilityStoreRequest::DictionaryLegacyExport {
2485                            id: req.id,
2486                            server_end: req.server_end,
2487
2488                            responder: CapabilityStoreDictionaryLegacyExportResponder {
2489                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2490                                tx_id: header.tx_id,
2491                            },
2492                        })
2493                    }
2494                    0x7702183689d44c27 => {
2495                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2496                        let mut req = fidl::new_empty!(
2497                            CapabilityStoreDictionaryInsertRequest,
2498                            fidl::encoding::DefaultFuchsiaResourceDialect
2499                        );
2500                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryInsertRequest>(&header, _body_bytes, handles, &mut req)?;
2501                        let control_handle =
2502                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2503                        Ok(CapabilityStoreRequest::DictionaryInsert {
2504                            id: req.id,
2505                            item: req.item,
2506
2507                            responder: CapabilityStoreDictionaryInsertResponder {
2508                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2509                                tx_id: header.tx_id,
2510                            },
2511                        })
2512                    }
2513                    0x4d9e27538284add2 => {
2514                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2515                        let mut req = fidl::new_empty!(
2516                            CapabilityStoreDictionaryGetRequest,
2517                            fidl::encoding::DefaultFuchsiaResourceDialect
2518                        );
2519                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryGetRequest>(&header, _body_bytes, handles, &mut req)?;
2520                        let control_handle =
2521                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2522                        Ok(CapabilityStoreRequest::DictionaryGet {
2523                            id: req.id,
2524                            key: req.key,
2525                            dest_id: req.dest_id,
2526
2527                            responder: CapabilityStoreDictionaryGetResponder {
2528                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2529                                tx_id: header.tx_id,
2530                            },
2531                        })
2532                    }
2533                    0x4c5c025ab05d4f3 => {
2534                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2535                        let mut req = fidl::new_empty!(
2536                            CapabilityStoreDictionaryRemoveRequest,
2537                            fidl::encoding::DefaultFuchsiaResourceDialect
2538                        );
2539                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryRemoveRequest>(&header, _body_bytes, handles, &mut req)?;
2540                        let control_handle =
2541                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2542                        Ok(CapabilityStoreRequest::DictionaryRemove {
2543                            id: req.id,
2544                            key: req.key,
2545                            dest_id: req.dest_id,
2546
2547                            responder: CapabilityStoreDictionaryRemoveResponder {
2548                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2549                                tx_id: header.tx_id,
2550                            },
2551                        })
2552                    }
2553                    0x3733ecdf4ea1b44f => {
2554                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2555                        let mut req = fidl::new_empty!(
2556                            CapabilityStoreDictionaryCopyRequest,
2557                            fidl::encoding::DefaultFuchsiaResourceDialect
2558                        );
2559                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryCopyRequest>(&header, _body_bytes, handles, &mut req)?;
2560                        let control_handle =
2561                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2562                        Ok(CapabilityStoreRequest::DictionaryCopy {
2563                            id: req.id,
2564                            dest_id: req.dest_id,
2565
2566                            responder: CapabilityStoreDictionaryCopyResponder {
2567                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2568                                tx_id: header.tx_id,
2569                            },
2570                        })
2571                    }
2572                    0x84b05577ceaec9e => {
2573                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2574                        let mut req = fidl::new_empty!(
2575                            CapabilityStoreDictionaryKeysRequest,
2576                            fidl::encoding::DefaultFuchsiaResourceDialect
2577                        );
2578                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryKeysRequest>(&header, _body_bytes, handles, &mut req)?;
2579                        let control_handle =
2580                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2581                        Ok(CapabilityStoreRequest::DictionaryKeys {
2582                            id: req.id,
2583                            iterator: req.iterator,
2584
2585                            responder: CapabilityStoreDictionaryKeysResponder {
2586                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2587                                tx_id: header.tx_id,
2588                            },
2589                        })
2590                    }
2591                    0xd6279b6ced04641 => {
2592                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2593                        let mut req = fidl::new_empty!(
2594                            CapabilityStoreDictionaryEnumerateRequest,
2595                            fidl::encoding::DefaultFuchsiaResourceDialect
2596                        );
2597                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryEnumerateRequest>(&header, _body_bytes, handles, &mut req)?;
2598                        let control_handle =
2599                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2600                        Ok(CapabilityStoreRequest::DictionaryEnumerate {
2601                            id: req.id,
2602                            iterator: req.iterator,
2603
2604                            responder: CapabilityStoreDictionaryEnumerateResponder {
2605                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2606                                tx_id: header.tx_id,
2607                            },
2608                        })
2609                    }
2610                    0x28a3a3f84d928cd8 => {
2611                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2612                        let mut req = fidl::new_empty!(
2613                            CapabilityStoreDictionaryDrainRequest,
2614                            fidl::encoding::DefaultFuchsiaResourceDialect
2615                        );
2616                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryDrainRequest>(&header, _body_bytes, handles, &mut req)?;
2617                        let control_handle =
2618                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2619                        Ok(CapabilityStoreRequest::DictionaryDrain {
2620                            id: req.id,
2621                            iterator: req.iterator,
2622
2623                            responder: CapabilityStoreDictionaryDrainResponder {
2624                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2625                                tx_id: header.tx_id,
2626                            },
2627                        })
2628                    }
2629                    _ if header.tx_id == 0
2630                        && header
2631                            .dynamic_flags()
2632                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2633                    {
2634                        Ok(CapabilityStoreRequest::_UnknownMethod {
2635                            ordinal: header.ordinal,
2636                            control_handle: CapabilityStoreControlHandle {
2637                                inner: this.inner.clone(),
2638                            },
2639                            method_type: fidl::MethodType::OneWay,
2640                        })
2641                    }
2642                    _ if header
2643                        .dynamic_flags()
2644                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2645                    {
2646                        this.inner.send_framework_err(
2647                            fidl::encoding::FrameworkErr::UnknownMethod,
2648                            header.tx_id,
2649                            header.ordinal,
2650                            header.dynamic_flags(),
2651                            (bytes, handles),
2652                        )?;
2653                        Ok(CapabilityStoreRequest::_UnknownMethod {
2654                            ordinal: header.ordinal,
2655                            control_handle: CapabilityStoreControlHandle {
2656                                inner: this.inner.clone(),
2657                            },
2658                            method_type: fidl::MethodType::TwoWay,
2659                        })
2660                    }
2661                    _ => Err(fidl::Error::UnknownOrdinal {
2662                        ordinal: header.ordinal,
2663                        protocol_name:
2664                            <CapabilityStoreMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2665                    }),
2666                }))
2667            },
2668        )
2669    }
2670}
2671
2672/// Protocol that represents the concept of a "capability store", a repository
2673/// for [Capability]s that are held by the component framework runtime.
2674///
2675/// [CapabilityStore] serves as the main bridge between the component runtime and clients
2676/// that enables them to operate on and exchange [Capability]s. A [CapabilityStore] instance
2677/// contains a set of [Capability]s, each of which has a [CapabilityId] assigned by the client.
2678///
2679/// Normally, a program would not exchange a [CapabilityStore] or [CapabilityId] with other
2680/// programs -- a [CapabilityStore] connection and its enclosed capabilities are intended to
2681/// be "local" to a program. Instead, if a program wishes to exchange a [Capability] with other
2682/// programs, it should [Export] the [Capability] out of the store, send the [Capability] to the
2683/// target program, which can then [Import] the capability into its own store.
2684///
2685/// [CapabilityStore] is also used to manage capability lifetimes. The lifetime of a capability is
2686/// scoped to the [CapabilityStore] in which it resides; i.e. to drop the [CapabilityStore]
2687/// connections to release the capabilities instead it. In addition, [CapabilityStore] supports a
2688/// [Drop] API to drop an individual [Capability] reference. (Note that it is possible for a
2689/// some capabilities, like [DictionaryRef], to have multiple references, in which case all of
2690/// the references must be dropped for the underlying resource to be released.)
2691///
2692/// A note about semantics: the [CapabilityStore] APIs do not return [CapabilityId]s, because
2693/// [CapabilityId]s are assigned by the client. Instead, when a method would semantically return
2694/// a capability, this is expressed by taking the destination [CapabilityId] as an output parameter.
2695#[derive(Debug)]
2696pub enum CapabilityStoreRequest {
2697    /// Duplicates the capability with `id` to `dest_id`.
2698    ///
2699    /// Errors:
2700    ///
2701    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2702    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
2703    /// - `NOT_DUPLICATABLE` if `id` could not be duplicated.
2704    Duplicate { id: u64, dest_id: u64, responder: CapabilityStoreDuplicateResponder },
2705    /// Drops the capability with `id` from this [`CapabilityStore`].
2706    ///
2707    /// Errors:
2708    ///
2709    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2710    Drop { id: u64, responder: CapabilityStoreDropResponder },
2711    /// Exports the capability with the client-assigned identifier `id` to
2712    /// `capability`. This operation removes the capability from the store. If
2713    /// this is not desired, [Duplicate] the capability first.
2714    ///
2715    /// Errors:
2716    ///
2717    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2718    Export { id: u64, responder: CapabilityStoreExportResponder },
2719    /// Imports `capability` into this store with the client-assigned `id`.
2720    ///
2721    /// Errors:
2722    ///
2723    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
2724    /// - `BAD_CAPABILITY` if `capability` was not a valid [Capability].
2725    Import { id: u64, capability: Capability, responder: CapabilityStoreImportResponder },
2726    /// Creates a [Connector] from a [Receiver]. Incoming connections to the [Connector] will be
2727    /// dispatched to this [Receiver].
2728    ///
2729    /// Errors:
2730    ///
2731    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
2732    ConnectorCreate {
2733        id: u64,
2734        receiver: fidl::endpoints::ClientEnd<ReceiverMarker>,
2735        responder: CapabilityStoreConnectorCreateResponder,
2736    },
2737    /// Open a connection from the provided [Connector] capability that will be dispatched to
2738    /// the [Receiver] on the other end.
2739    ///
2740    /// If there is an error, it will be reported as a zx.Status epitaph on `server_end`.
2741    ///
2742    /// Errors:
2743    ///
2744    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2745    /// - `WRONG_TYPE` if `id` was not a connector capability.
2746    ConnectorOpen {
2747        id: u64,
2748        server_end: fidl::Channel,
2749        responder: CapabilityStoreConnectorOpenResponder,
2750    },
2751    /// Creates a [DirConnector] from a [DirReceiver]. Incoming connections to the [DirConnector]
2752    /// will be dispatched to this [DirReceiver].
2753    ///
2754    /// Errors:
2755    ///
2756    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
2757    DirConnectorCreate {
2758        id: u64,
2759        receiver: fidl::endpoints::ClientEnd<DirReceiverMarker>,
2760        responder: CapabilityStoreDirConnectorCreateResponder,
2761    },
2762    /// Open a connection from the provided [DirConnector] capability that will be dispatched to
2763    /// the [DirReceiver] on the other end.
2764    ///
2765    /// This method does not take `Open`/`Open3` parameters such as `flags` or `path`.
2766    /// Clients that wish to specify these can get an initial connection from this method
2767    /// and call `fuchsia.io/Directory.Open` on it. See the [DirReceiver] documentation for
2768    /// more information about the expectations of the server side.
2769    ///
2770    /// If there was an error making the connection, it will be reported as a zx.Status
2771    /// epitaph on `server_end`.
2772    ///
2773    /// Errors:
2774    ///
2775    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2776    /// - `WRONG_TYPE` if `id` was not a connector capability.
2777    DirConnectorOpen {
2778        id: u64,
2779        server_end: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
2780        responder: CapabilityStoreDirConnectorOpenResponder,
2781    },
2782    /// Creates a new empty dictionary in this [`CapabilityStore`] with client-assigned `id`.
2783    ///
2784    /// Errors:
2785    ///
2786    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
2787    DictionaryCreate { id: u64, responder: CapabilityStoreDictionaryCreateResponder },
2788    /// Imports a dictionary in the form of a channel.
2789    ///
2790    /// This is a legacy API to support backward compatibility with APIs that take a [Dictionary]
2791    /// channel.
2792    ///
2793    /// Errors:
2794    ///
2795    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
2796    /// - `BAD_CAPABILITY` if `client_end` was not a valid dictionary channel.
2797    DictionaryLegacyImport {
2798        id: u64,
2799        client_end: fidl::Channel,
2800        responder: CapabilityStoreDictionaryLegacyImportResponder,
2801    },
2802    /// Binds a channel to the dictionary with `id`. The channel can
2803    /// be re-imported into a [CapabilityStore] with [DictionaryImportLegacy].
2804    ///
2805    /// This is a legacy API to support backward compatibility with APIs that take a [Dictionary]
2806    /// channel.
2807    ///
2808    /// Errors:
2809    ///
2810    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2811    DictionaryLegacyExport {
2812        id: u64,
2813        server_end: fidl::Channel,
2814        responder: CapabilityStoreDictionaryLegacyExportResponder,
2815    },
2816    /// Inserts `item` into the dictionary with `id`. `item.value` is moved into the dictionary and
2817    /// its id is released if this call succeeds.
2818    ///
2819    /// Errors:
2820    ///
2821    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2822    /// - `WRONG_TYPE` if `id` was not a dictionary.
2823    /// - `INVALID_KEY` if `item.key` was invalid.
2824    /// - `ITEM_ALREADY_EXISTS` if the dictionary already contains an item with `item.key`.
2825    DictionaryInsert {
2826        id: u64,
2827        item: DictionaryItem,
2828        responder: CapabilityStoreDictionaryInsertResponder,
2829    },
2830    /// Get a duplicate of a capability from the dictionary with `id`, which is
2831    /// loaded into `dest_id`.
2832    ///
2833    /// Errors:
2834    ///
2835    /// - `ID_NOT_FOUND` if `id` was not a recognized capability id in this store.
2836    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
2837    /// - `WRONG_TYPE` if `id` was not a dictionary.
2838    /// - `INVALID_KEY` if `item.key` was invalid.
2839    /// - `ITEM_NOT_FOUND` if the dictionary does not contain `key`.
2840    /// - `NOT_DUPLICATABLE` if the capability could not be duplicated.
2841    DictionaryGet {
2842        id: u64,
2843        key: String,
2844        dest_id: u64,
2845        responder: CapabilityStoreDictionaryGetResponder,
2846    },
2847    /// Removes a key from the dictionary with `id`. If `dest_id` is present, loads the value
2848    /// into it, otherwise discards the value.
2849    ///
2850    /// Errors:
2851    ///
2852    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2853    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
2854    /// - `WRONG_TYPE` if `id` was not a dictionary.
2855    /// - `INVALID_KEY` if `key` was invalid.
2856    /// - `ITEM_NOT_FOUND` if the dictionary does not contain the key.
2857    DictionaryRemove {
2858        id: u64,
2859        key: String,
2860        dest_id: Option<Box<WrappedCapabilityId>>,
2861        responder: CapabilityStoreDictionaryRemoveResponder,
2862    },
2863    /// Create a new dictionary that contains a duplicate of all the entries in
2864    /// the dictionary with `id`, assigning `dest_id` to the new dictionary.
2865    /// The runtime of this method is linear in the number of top-level entries
2866    /// in the dictionary.
2867    ///
2868    /// For example, if the dictionary contains nested dictionaries, the newly
2869    /// created dictionary will contain references to those same nested
2870    /// dictionaries because the entries are duplicated rather than deep-copied.
2871    ///
2872    /// Errors:
2873    ///
2874    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2875    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
2876    /// - `WRONG_TYPE` if `id` was not a dictionary.
2877    /// - `NOT_DUPLICATABLE` if one of the capabilities in `id` could not be duplicated.
2878    DictionaryCopy { id: u64, dest_id: u64, responder: CapabilityStoreDictionaryCopyResponder },
2879    /// Enumerates the keys in the dictionary with `id`.
2880    ///
2881    /// Errors:
2882    ///
2883    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2884    /// - `WRONG_TYPE` if `id` was not a dictionary.
2885    DictionaryKeys {
2886        id: u64,
2887        iterator: fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>,
2888        responder: CapabilityStoreDictionaryKeysResponder,
2889    },
2890    /// Enumerates the items (keys and values) in the dictionary with `id`.
2891    ///
2892    /// Creates a duplicate of each value (capability). If a value could not be duplicated,
2893    /// the value will be null.
2894    ///
2895    /// Errors:
2896    ///
2897    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2898    /// - `WRONG_TYPE` if `id` was not a dictionary.
2899    DictionaryEnumerate {
2900        id: u64,
2901        iterator: fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
2902        responder: CapabilityStoreDictionaryEnumerateResponder,
2903    },
2904    /// Removes all the entries in this dictionary, returning them in `contents` if provided.
2905    /// If `contents` is not provided, all the items are discarded without enumerating them.
2906    ///
2907    /// Errors:
2908    ///
2909    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2910    /// - `WRONG_TYPE` if `id` was not a dictionary.
2911    DictionaryDrain {
2912        id: u64,
2913        iterator: Option<fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>>,
2914        responder: CapabilityStoreDictionaryDrainResponder,
2915    },
2916    /// An interaction was received which does not match any known method.
2917    #[non_exhaustive]
2918    _UnknownMethod {
2919        /// Ordinal of the method that was called.
2920        ordinal: u64,
2921        control_handle: CapabilityStoreControlHandle,
2922        method_type: fidl::MethodType,
2923    },
2924}
2925
2926impl CapabilityStoreRequest {
2927    #[allow(irrefutable_let_patterns)]
2928    pub fn into_duplicate(self) -> Option<(u64, u64, CapabilityStoreDuplicateResponder)> {
2929        if let CapabilityStoreRequest::Duplicate { id, dest_id, responder } = self {
2930            Some((id, dest_id, responder))
2931        } else {
2932            None
2933        }
2934    }
2935
2936    #[allow(irrefutable_let_patterns)]
2937    pub fn into_drop(self) -> Option<(u64, CapabilityStoreDropResponder)> {
2938        if let CapabilityStoreRequest::Drop { id, responder } = self {
2939            Some((id, responder))
2940        } else {
2941            None
2942        }
2943    }
2944
2945    #[allow(irrefutable_let_patterns)]
2946    pub fn into_export(self) -> Option<(u64, CapabilityStoreExportResponder)> {
2947        if let CapabilityStoreRequest::Export { id, responder } = self {
2948            Some((id, responder))
2949        } else {
2950            None
2951        }
2952    }
2953
2954    #[allow(irrefutable_let_patterns)]
2955    pub fn into_import(self) -> Option<(u64, Capability, CapabilityStoreImportResponder)> {
2956        if let CapabilityStoreRequest::Import { id, capability, responder } = self {
2957            Some((id, capability, responder))
2958        } else {
2959            None
2960        }
2961    }
2962
2963    #[allow(irrefutable_let_patterns)]
2964    pub fn into_connector_create(
2965        self,
2966    ) -> Option<(
2967        u64,
2968        fidl::endpoints::ClientEnd<ReceiverMarker>,
2969        CapabilityStoreConnectorCreateResponder,
2970    )> {
2971        if let CapabilityStoreRequest::ConnectorCreate { id, receiver, responder } = self {
2972            Some((id, receiver, responder))
2973        } else {
2974            None
2975        }
2976    }
2977
2978    #[allow(irrefutable_let_patterns)]
2979    pub fn into_connector_open(
2980        self,
2981    ) -> Option<(u64, fidl::Channel, CapabilityStoreConnectorOpenResponder)> {
2982        if let CapabilityStoreRequest::ConnectorOpen { id, server_end, responder } = self {
2983            Some((id, server_end, responder))
2984        } else {
2985            None
2986        }
2987    }
2988
2989    #[allow(irrefutable_let_patterns)]
2990    pub fn into_dir_connector_create(
2991        self,
2992    ) -> Option<(
2993        u64,
2994        fidl::endpoints::ClientEnd<DirReceiverMarker>,
2995        CapabilityStoreDirConnectorCreateResponder,
2996    )> {
2997        if let CapabilityStoreRequest::DirConnectorCreate { id, receiver, responder } = self {
2998            Some((id, receiver, responder))
2999        } else {
3000            None
3001        }
3002    }
3003
3004    #[allow(irrefutable_let_patterns)]
3005    pub fn into_dir_connector_open(
3006        self,
3007    ) -> Option<(
3008        u64,
3009        fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
3010        CapabilityStoreDirConnectorOpenResponder,
3011    )> {
3012        if let CapabilityStoreRequest::DirConnectorOpen { id, server_end, responder } = self {
3013            Some((id, server_end, responder))
3014        } else {
3015            None
3016        }
3017    }
3018
3019    #[allow(irrefutable_let_patterns)]
3020    pub fn into_dictionary_create(self) -> Option<(u64, CapabilityStoreDictionaryCreateResponder)> {
3021        if let CapabilityStoreRequest::DictionaryCreate { id, responder } = self {
3022            Some((id, responder))
3023        } else {
3024            None
3025        }
3026    }
3027
3028    #[allow(irrefutable_let_patterns)]
3029    pub fn into_dictionary_legacy_import(
3030        self,
3031    ) -> Option<(u64, fidl::Channel, CapabilityStoreDictionaryLegacyImportResponder)> {
3032        if let CapabilityStoreRequest::DictionaryLegacyImport { id, client_end, responder } = self {
3033            Some((id, client_end, responder))
3034        } else {
3035            None
3036        }
3037    }
3038
3039    #[allow(irrefutable_let_patterns)]
3040    pub fn into_dictionary_legacy_export(
3041        self,
3042    ) -> Option<(u64, fidl::Channel, CapabilityStoreDictionaryLegacyExportResponder)> {
3043        if let CapabilityStoreRequest::DictionaryLegacyExport { id, server_end, responder } = self {
3044            Some((id, server_end, responder))
3045        } else {
3046            None
3047        }
3048    }
3049
3050    #[allow(irrefutable_let_patterns)]
3051    pub fn into_dictionary_insert(
3052        self,
3053    ) -> Option<(u64, DictionaryItem, CapabilityStoreDictionaryInsertResponder)> {
3054        if let CapabilityStoreRequest::DictionaryInsert { id, item, responder } = self {
3055            Some((id, item, responder))
3056        } else {
3057            None
3058        }
3059    }
3060
3061    #[allow(irrefutable_let_patterns)]
3062    pub fn into_dictionary_get(
3063        self,
3064    ) -> Option<(u64, String, u64, CapabilityStoreDictionaryGetResponder)> {
3065        if let CapabilityStoreRequest::DictionaryGet { id, key, dest_id, responder } = self {
3066            Some((id, key, dest_id, responder))
3067        } else {
3068            None
3069        }
3070    }
3071
3072    #[allow(irrefutable_let_patterns)]
3073    pub fn into_dictionary_remove(
3074        self,
3075    ) -> Option<(
3076        u64,
3077        String,
3078        Option<Box<WrappedCapabilityId>>,
3079        CapabilityStoreDictionaryRemoveResponder,
3080    )> {
3081        if let CapabilityStoreRequest::DictionaryRemove { id, key, dest_id, responder } = self {
3082            Some((id, key, dest_id, responder))
3083        } else {
3084            None
3085        }
3086    }
3087
3088    #[allow(irrefutable_let_patterns)]
3089    pub fn into_dictionary_copy(
3090        self,
3091    ) -> Option<(u64, u64, CapabilityStoreDictionaryCopyResponder)> {
3092        if let CapabilityStoreRequest::DictionaryCopy { id, dest_id, responder } = self {
3093            Some((id, dest_id, responder))
3094        } else {
3095            None
3096        }
3097    }
3098
3099    #[allow(irrefutable_let_patterns)]
3100    pub fn into_dictionary_keys(
3101        self,
3102    ) -> Option<(
3103        u64,
3104        fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>,
3105        CapabilityStoreDictionaryKeysResponder,
3106    )> {
3107        if let CapabilityStoreRequest::DictionaryKeys { id, iterator, responder } = self {
3108            Some((id, iterator, responder))
3109        } else {
3110            None
3111        }
3112    }
3113
3114    #[allow(irrefutable_let_patterns)]
3115    pub fn into_dictionary_enumerate(
3116        self,
3117    ) -> Option<(
3118        u64,
3119        fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
3120        CapabilityStoreDictionaryEnumerateResponder,
3121    )> {
3122        if let CapabilityStoreRequest::DictionaryEnumerate { id, iterator, responder } = self {
3123            Some((id, iterator, responder))
3124        } else {
3125            None
3126        }
3127    }
3128
3129    #[allow(irrefutable_let_patterns)]
3130    pub fn into_dictionary_drain(
3131        self,
3132    ) -> Option<(
3133        u64,
3134        Option<fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>>,
3135        CapabilityStoreDictionaryDrainResponder,
3136    )> {
3137        if let CapabilityStoreRequest::DictionaryDrain { id, iterator, responder } = self {
3138            Some((id, iterator, responder))
3139        } else {
3140            None
3141        }
3142    }
3143
3144    /// Name of the method defined in FIDL
3145    pub fn method_name(&self) -> &'static str {
3146        match *self {
3147            CapabilityStoreRequest::Duplicate { .. } => "duplicate",
3148            CapabilityStoreRequest::Drop { .. } => "drop",
3149            CapabilityStoreRequest::Export { .. } => "export",
3150            CapabilityStoreRequest::Import { .. } => "import",
3151            CapabilityStoreRequest::ConnectorCreate { .. } => "connector_create",
3152            CapabilityStoreRequest::ConnectorOpen { .. } => "connector_open",
3153            CapabilityStoreRequest::DirConnectorCreate { .. } => "dir_connector_create",
3154            CapabilityStoreRequest::DirConnectorOpen { .. } => "dir_connector_open",
3155            CapabilityStoreRequest::DictionaryCreate { .. } => "dictionary_create",
3156            CapabilityStoreRequest::DictionaryLegacyImport { .. } => "dictionary_legacy_import",
3157            CapabilityStoreRequest::DictionaryLegacyExport { .. } => "dictionary_legacy_export",
3158            CapabilityStoreRequest::DictionaryInsert { .. } => "dictionary_insert",
3159            CapabilityStoreRequest::DictionaryGet { .. } => "dictionary_get",
3160            CapabilityStoreRequest::DictionaryRemove { .. } => "dictionary_remove",
3161            CapabilityStoreRequest::DictionaryCopy { .. } => "dictionary_copy",
3162            CapabilityStoreRequest::DictionaryKeys { .. } => "dictionary_keys",
3163            CapabilityStoreRequest::DictionaryEnumerate { .. } => "dictionary_enumerate",
3164            CapabilityStoreRequest::DictionaryDrain { .. } => "dictionary_drain",
3165            CapabilityStoreRequest::_UnknownMethod {
3166                method_type: fidl::MethodType::OneWay,
3167                ..
3168            } => "unknown one-way method",
3169            CapabilityStoreRequest::_UnknownMethod {
3170                method_type: fidl::MethodType::TwoWay,
3171                ..
3172            } => "unknown two-way method",
3173        }
3174    }
3175}
3176
3177#[derive(Debug, Clone)]
3178pub struct CapabilityStoreControlHandle {
3179    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3180}
3181
3182impl fidl::endpoints::ControlHandle for CapabilityStoreControlHandle {
3183    fn shutdown(&self) {
3184        self.inner.shutdown()
3185    }
3186    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3187        self.inner.shutdown_with_epitaph(status)
3188    }
3189
3190    fn is_closed(&self) -> bool {
3191        self.inner.channel().is_closed()
3192    }
3193    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3194        self.inner.channel().on_closed()
3195    }
3196
3197    #[cfg(target_os = "fuchsia")]
3198    fn signal_peer(
3199        &self,
3200        clear_mask: zx::Signals,
3201        set_mask: zx::Signals,
3202    ) -> Result<(), zx_status::Status> {
3203        use fidl::Peered;
3204        self.inner.channel().signal_peer(clear_mask, set_mask)
3205    }
3206}
3207
3208impl CapabilityStoreControlHandle {}
3209
3210#[must_use = "FIDL methods require a response to be sent"]
3211#[derive(Debug)]
3212pub struct CapabilityStoreDuplicateResponder {
3213    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3214    tx_id: u32,
3215}
3216
3217/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3218/// if the responder is dropped without sending a response, so that the client
3219/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3220impl std::ops::Drop for CapabilityStoreDuplicateResponder {
3221    fn drop(&mut self) {
3222        self.control_handle.shutdown();
3223        // Safety: drops once, never accessed again
3224        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3225    }
3226}
3227
3228impl fidl::endpoints::Responder for CapabilityStoreDuplicateResponder {
3229    type ControlHandle = CapabilityStoreControlHandle;
3230
3231    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3232        &self.control_handle
3233    }
3234
3235    fn drop_without_shutdown(mut self) {
3236        // Safety: drops once, never accessed again due to mem::forget
3237        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3238        // Prevent Drop from running (which would shut down the channel)
3239        std::mem::forget(self);
3240    }
3241}
3242
3243impl CapabilityStoreDuplicateResponder {
3244    /// Sends a response to the FIDL transaction.
3245    ///
3246    /// Sets the channel to shutdown if an error occurs.
3247    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3248        let _result = self.send_raw(result);
3249        if _result.is_err() {
3250            self.control_handle.shutdown();
3251        }
3252        self.drop_without_shutdown();
3253        _result
3254    }
3255
3256    /// Similar to "send" but does not shutdown the channel if an error occurs.
3257    pub fn send_no_shutdown_on_err(
3258        self,
3259        mut result: Result<(), CapabilityStoreError>,
3260    ) -> Result<(), fidl::Error> {
3261        let _result = self.send_raw(result);
3262        self.drop_without_shutdown();
3263        _result
3264    }
3265
3266    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3267        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3268            fidl::encoding::EmptyStruct,
3269            CapabilityStoreError,
3270        >>(
3271            fidl::encoding::FlexibleResult::new(result),
3272            self.tx_id,
3273            0x5d5d35d9c20a2184,
3274            fidl::encoding::DynamicFlags::FLEXIBLE,
3275        )
3276    }
3277}
3278
3279#[must_use = "FIDL methods require a response to be sent"]
3280#[derive(Debug)]
3281pub struct CapabilityStoreDropResponder {
3282    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3283    tx_id: u32,
3284}
3285
3286/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3287/// if the responder is dropped without sending a response, so that the client
3288/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3289impl std::ops::Drop for CapabilityStoreDropResponder {
3290    fn drop(&mut self) {
3291        self.control_handle.shutdown();
3292        // Safety: drops once, never accessed again
3293        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3294    }
3295}
3296
3297impl fidl::endpoints::Responder for CapabilityStoreDropResponder {
3298    type ControlHandle = CapabilityStoreControlHandle;
3299
3300    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3301        &self.control_handle
3302    }
3303
3304    fn drop_without_shutdown(mut self) {
3305        // Safety: drops once, never accessed again due to mem::forget
3306        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3307        // Prevent Drop from running (which would shut down the channel)
3308        std::mem::forget(self);
3309    }
3310}
3311
3312impl CapabilityStoreDropResponder {
3313    /// Sends a response to the FIDL transaction.
3314    ///
3315    /// Sets the channel to shutdown if an error occurs.
3316    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3317        let _result = self.send_raw(result);
3318        if _result.is_err() {
3319            self.control_handle.shutdown();
3320        }
3321        self.drop_without_shutdown();
3322        _result
3323    }
3324
3325    /// Similar to "send" but does not shutdown the channel if an error occurs.
3326    pub fn send_no_shutdown_on_err(
3327        self,
3328        mut result: Result<(), CapabilityStoreError>,
3329    ) -> Result<(), fidl::Error> {
3330        let _result = self.send_raw(result);
3331        self.drop_without_shutdown();
3332        _result
3333    }
3334
3335    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3336        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3337            fidl::encoding::EmptyStruct,
3338            CapabilityStoreError,
3339        >>(
3340            fidl::encoding::FlexibleResult::new(result),
3341            self.tx_id,
3342            0xa745c0990fc2559,
3343            fidl::encoding::DynamicFlags::FLEXIBLE,
3344        )
3345    }
3346}
3347
3348#[must_use = "FIDL methods require a response to be sent"]
3349#[derive(Debug)]
3350pub struct CapabilityStoreExportResponder {
3351    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3352    tx_id: u32,
3353}
3354
3355/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3356/// if the responder is dropped without sending a response, so that the client
3357/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3358impl std::ops::Drop for CapabilityStoreExportResponder {
3359    fn drop(&mut self) {
3360        self.control_handle.shutdown();
3361        // Safety: drops once, never accessed again
3362        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3363    }
3364}
3365
3366impl fidl::endpoints::Responder for CapabilityStoreExportResponder {
3367    type ControlHandle = CapabilityStoreControlHandle;
3368
3369    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3370        &self.control_handle
3371    }
3372
3373    fn drop_without_shutdown(mut self) {
3374        // Safety: drops once, never accessed again due to mem::forget
3375        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3376        // Prevent Drop from running (which would shut down the channel)
3377        std::mem::forget(self);
3378    }
3379}
3380
3381impl CapabilityStoreExportResponder {
3382    /// Sends a response to the FIDL transaction.
3383    ///
3384    /// Sets the channel to shutdown if an error occurs.
3385    pub fn send(
3386        self,
3387        mut result: Result<Capability, CapabilityStoreError>,
3388    ) -> Result<(), fidl::Error> {
3389        let _result = self.send_raw(result);
3390        if _result.is_err() {
3391            self.control_handle.shutdown();
3392        }
3393        self.drop_without_shutdown();
3394        _result
3395    }
3396
3397    /// Similar to "send" but does not shutdown the channel if an error occurs.
3398    pub fn send_no_shutdown_on_err(
3399        self,
3400        mut result: Result<Capability, CapabilityStoreError>,
3401    ) -> Result<(), fidl::Error> {
3402        let _result = self.send_raw(result);
3403        self.drop_without_shutdown();
3404        _result
3405    }
3406
3407    fn send_raw(
3408        &self,
3409        mut result: Result<Capability, CapabilityStoreError>,
3410    ) -> Result<(), fidl::Error> {
3411        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3412            CapabilityStoreExportResponse,
3413            CapabilityStoreError,
3414        >>(
3415            fidl::encoding::FlexibleResult::new(
3416                result.as_mut().map_err(|e| *e).map(|capability| (capability,)),
3417            ),
3418            self.tx_id,
3419            0x3237a8f4748faff,
3420            fidl::encoding::DynamicFlags::FLEXIBLE,
3421        )
3422    }
3423}
3424
3425#[must_use = "FIDL methods require a response to be sent"]
3426#[derive(Debug)]
3427pub struct CapabilityStoreImportResponder {
3428    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3429    tx_id: u32,
3430}
3431
3432/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3433/// if the responder is dropped without sending a response, so that the client
3434/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3435impl std::ops::Drop for CapabilityStoreImportResponder {
3436    fn drop(&mut self) {
3437        self.control_handle.shutdown();
3438        // Safety: drops once, never accessed again
3439        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3440    }
3441}
3442
3443impl fidl::endpoints::Responder for CapabilityStoreImportResponder {
3444    type ControlHandle = CapabilityStoreControlHandle;
3445
3446    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3447        &self.control_handle
3448    }
3449
3450    fn drop_without_shutdown(mut self) {
3451        // Safety: drops once, never accessed again due to mem::forget
3452        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3453        // Prevent Drop from running (which would shut down the channel)
3454        std::mem::forget(self);
3455    }
3456}
3457
3458impl CapabilityStoreImportResponder {
3459    /// Sends a response to the FIDL transaction.
3460    ///
3461    /// Sets the channel to shutdown if an error occurs.
3462    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3463        let _result = self.send_raw(result);
3464        if _result.is_err() {
3465            self.control_handle.shutdown();
3466        }
3467        self.drop_without_shutdown();
3468        _result
3469    }
3470
3471    /// Similar to "send" but does not shutdown the channel if an error occurs.
3472    pub fn send_no_shutdown_on_err(
3473        self,
3474        mut result: Result<(), CapabilityStoreError>,
3475    ) -> Result<(), fidl::Error> {
3476        let _result = self.send_raw(result);
3477        self.drop_without_shutdown();
3478        _result
3479    }
3480
3481    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3482        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3483            fidl::encoding::EmptyStruct,
3484            CapabilityStoreError,
3485        >>(
3486            fidl::encoding::FlexibleResult::new(result),
3487            self.tx_id,
3488            0x1f96157a29f4539b,
3489            fidl::encoding::DynamicFlags::FLEXIBLE,
3490        )
3491    }
3492}
3493
3494#[must_use = "FIDL methods require a response to be sent"]
3495#[derive(Debug)]
3496pub struct CapabilityStoreConnectorCreateResponder {
3497    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3498    tx_id: u32,
3499}
3500
3501/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3502/// if the responder is dropped without sending a response, so that the client
3503/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3504impl std::ops::Drop for CapabilityStoreConnectorCreateResponder {
3505    fn drop(&mut self) {
3506        self.control_handle.shutdown();
3507        // Safety: drops once, never accessed again
3508        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3509    }
3510}
3511
3512impl fidl::endpoints::Responder for CapabilityStoreConnectorCreateResponder {
3513    type ControlHandle = CapabilityStoreControlHandle;
3514
3515    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3516        &self.control_handle
3517    }
3518
3519    fn drop_without_shutdown(mut self) {
3520        // Safety: drops once, never accessed again due to mem::forget
3521        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3522        // Prevent Drop from running (which would shut down the channel)
3523        std::mem::forget(self);
3524    }
3525}
3526
3527impl CapabilityStoreConnectorCreateResponder {
3528    /// Sends a response to the FIDL transaction.
3529    ///
3530    /// Sets the channel to shutdown if an error occurs.
3531    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3532        let _result = self.send_raw(result);
3533        if _result.is_err() {
3534            self.control_handle.shutdown();
3535        }
3536        self.drop_without_shutdown();
3537        _result
3538    }
3539
3540    /// Similar to "send" but does not shutdown the channel if an error occurs.
3541    pub fn send_no_shutdown_on_err(
3542        self,
3543        mut result: Result<(), CapabilityStoreError>,
3544    ) -> Result<(), fidl::Error> {
3545        let _result = self.send_raw(result);
3546        self.drop_without_shutdown();
3547        _result
3548    }
3549
3550    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3551        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3552            fidl::encoding::EmptyStruct,
3553            CapabilityStoreError,
3554        >>(
3555            fidl::encoding::FlexibleResult::new(result),
3556            self.tx_id,
3557            0x29592c5d63e91c25,
3558            fidl::encoding::DynamicFlags::FLEXIBLE,
3559        )
3560    }
3561}
3562
3563#[must_use = "FIDL methods require a response to be sent"]
3564#[derive(Debug)]
3565pub struct CapabilityStoreConnectorOpenResponder {
3566    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3567    tx_id: u32,
3568}
3569
3570/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3571/// if the responder is dropped without sending a response, so that the client
3572/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3573impl std::ops::Drop for CapabilityStoreConnectorOpenResponder {
3574    fn drop(&mut self) {
3575        self.control_handle.shutdown();
3576        // Safety: drops once, never accessed again
3577        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3578    }
3579}
3580
3581impl fidl::endpoints::Responder for CapabilityStoreConnectorOpenResponder {
3582    type ControlHandle = CapabilityStoreControlHandle;
3583
3584    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3585        &self.control_handle
3586    }
3587
3588    fn drop_without_shutdown(mut self) {
3589        // Safety: drops once, never accessed again due to mem::forget
3590        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3591        // Prevent Drop from running (which would shut down the channel)
3592        std::mem::forget(self);
3593    }
3594}
3595
3596impl CapabilityStoreConnectorOpenResponder {
3597    /// Sends a response to the FIDL transaction.
3598    ///
3599    /// Sets the channel to shutdown if an error occurs.
3600    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3601        let _result = self.send_raw(result);
3602        if _result.is_err() {
3603            self.control_handle.shutdown();
3604        }
3605        self.drop_without_shutdown();
3606        _result
3607    }
3608
3609    /// Similar to "send" but does not shutdown the channel if an error occurs.
3610    pub fn send_no_shutdown_on_err(
3611        self,
3612        mut result: Result<(), CapabilityStoreError>,
3613    ) -> Result<(), fidl::Error> {
3614        let _result = self.send_raw(result);
3615        self.drop_without_shutdown();
3616        _result
3617    }
3618
3619    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3620        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3621            fidl::encoding::EmptyStruct,
3622            CapabilityStoreError,
3623        >>(
3624            fidl::encoding::FlexibleResult::new(result),
3625            self.tx_id,
3626            0x537e69ab40563b9f,
3627            fidl::encoding::DynamicFlags::FLEXIBLE,
3628        )
3629    }
3630}
3631
3632#[must_use = "FIDL methods require a response to be sent"]
3633#[derive(Debug)]
3634pub struct CapabilityStoreDirConnectorCreateResponder {
3635    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3636    tx_id: u32,
3637}
3638
3639/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3640/// if the responder is dropped without sending a response, so that the client
3641/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3642impl std::ops::Drop for CapabilityStoreDirConnectorCreateResponder {
3643    fn drop(&mut self) {
3644        self.control_handle.shutdown();
3645        // Safety: drops once, never accessed again
3646        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3647    }
3648}
3649
3650impl fidl::endpoints::Responder for CapabilityStoreDirConnectorCreateResponder {
3651    type ControlHandle = CapabilityStoreControlHandle;
3652
3653    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3654        &self.control_handle
3655    }
3656
3657    fn drop_without_shutdown(mut self) {
3658        // Safety: drops once, never accessed again due to mem::forget
3659        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3660        // Prevent Drop from running (which would shut down the channel)
3661        std::mem::forget(self);
3662    }
3663}
3664
3665impl CapabilityStoreDirConnectorCreateResponder {
3666    /// Sends a response to the FIDL transaction.
3667    ///
3668    /// Sets the channel to shutdown if an error occurs.
3669    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3670        let _result = self.send_raw(result);
3671        if _result.is_err() {
3672            self.control_handle.shutdown();
3673        }
3674        self.drop_without_shutdown();
3675        _result
3676    }
3677
3678    /// Similar to "send" but does not shutdown the channel if an error occurs.
3679    pub fn send_no_shutdown_on_err(
3680        self,
3681        mut result: Result<(), CapabilityStoreError>,
3682    ) -> Result<(), fidl::Error> {
3683        let _result = self.send_raw(result);
3684        self.drop_without_shutdown();
3685        _result
3686    }
3687
3688    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3689        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3690            fidl::encoding::EmptyStruct,
3691            CapabilityStoreError,
3692        >>(
3693            fidl::encoding::FlexibleResult::new(result),
3694            self.tx_id,
3695            0x186138a11ccf19bb,
3696            fidl::encoding::DynamicFlags::FLEXIBLE,
3697        )
3698    }
3699}
3700
3701#[must_use = "FIDL methods require a response to be sent"]
3702#[derive(Debug)]
3703pub struct CapabilityStoreDirConnectorOpenResponder {
3704    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3705    tx_id: u32,
3706}
3707
3708/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3709/// if the responder is dropped without sending a response, so that the client
3710/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3711impl std::ops::Drop for CapabilityStoreDirConnectorOpenResponder {
3712    fn drop(&mut self) {
3713        self.control_handle.shutdown();
3714        // Safety: drops once, never accessed again
3715        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3716    }
3717}
3718
3719impl fidl::endpoints::Responder for CapabilityStoreDirConnectorOpenResponder {
3720    type ControlHandle = CapabilityStoreControlHandle;
3721
3722    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3723        &self.control_handle
3724    }
3725
3726    fn drop_without_shutdown(mut self) {
3727        // Safety: drops once, never accessed again due to mem::forget
3728        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3729        // Prevent Drop from running (which would shut down the channel)
3730        std::mem::forget(self);
3731    }
3732}
3733
3734impl CapabilityStoreDirConnectorOpenResponder {
3735    /// Sends a response to the FIDL transaction.
3736    ///
3737    /// Sets the channel to shutdown if an error occurs.
3738    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3739        let _result = self.send_raw(result);
3740        if _result.is_err() {
3741            self.control_handle.shutdown();
3742        }
3743        self.drop_without_shutdown();
3744        _result
3745    }
3746
3747    /// Similar to "send" but does not shutdown the channel if an error occurs.
3748    pub fn send_no_shutdown_on_err(
3749        self,
3750        mut result: Result<(), CapabilityStoreError>,
3751    ) -> Result<(), fidl::Error> {
3752        let _result = self.send_raw(result);
3753        self.drop_without_shutdown();
3754        _result
3755    }
3756
3757    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3758        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3759            fidl::encoding::EmptyStruct,
3760            CapabilityStoreError,
3761        >>(
3762            fidl::encoding::FlexibleResult::new(result),
3763            self.tx_id,
3764            0x5650d3d6a3a13901,
3765            fidl::encoding::DynamicFlags::FLEXIBLE,
3766        )
3767    }
3768}
3769
3770#[must_use = "FIDL methods require a response to be sent"]
3771#[derive(Debug)]
3772pub struct CapabilityStoreDictionaryCreateResponder {
3773    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3774    tx_id: u32,
3775}
3776
3777/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3778/// if the responder is dropped without sending a response, so that the client
3779/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3780impl std::ops::Drop for CapabilityStoreDictionaryCreateResponder {
3781    fn drop(&mut self) {
3782        self.control_handle.shutdown();
3783        // Safety: drops once, never accessed again
3784        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3785    }
3786}
3787
3788impl fidl::endpoints::Responder for CapabilityStoreDictionaryCreateResponder {
3789    type ControlHandle = CapabilityStoreControlHandle;
3790
3791    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3792        &self.control_handle
3793    }
3794
3795    fn drop_without_shutdown(mut self) {
3796        // Safety: drops once, never accessed again due to mem::forget
3797        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3798        // Prevent Drop from running (which would shut down the channel)
3799        std::mem::forget(self);
3800    }
3801}
3802
3803impl CapabilityStoreDictionaryCreateResponder {
3804    /// Sends a response to the FIDL transaction.
3805    ///
3806    /// Sets the channel to shutdown if an error occurs.
3807    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3808        let _result = self.send_raw(result);
3809        if _result.is_err() {
3810            self.control_handle.shutdown();
3811        }
3812        self.drop_without_shutdown();
3813        _result
3814    }
3815
3816    /// Similar to "send" but does not shutdown the channel if an error occurs.
3817    pub fn send_no_shutdown_on_err(
3818        self,
3819        mut result: Result<(), CapabilityStoreError>,
3820    ) -> Result<(), fidl::Error> {
3821        let _result = self.send_raw(result);
3822        self.drop_without_shutdown();
3823        _result
3824    }
3825
3826    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3827        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3828            fidl::encoding::EmptyStruct,
3829            CapabilityStoreError,
3830        >>(
3831            fidl::encoding::FlexibleResult::new(result),
3832            self.tx_id,
3833            0x6997c8dfc63de093,
3834            fidl::encoding::DynamicFlags::FLEXIBLE,
3835        )
3836    }
3837}
3838
3839#[must_use = "FIDL methods require a response to be sent"]
3840#[derive(Debug)]
3841pub struct CapabilityStoreDictionaryLegacyImportResponder {
3842    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3843    tx_id: u32,
3844}
3845
3846/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3847/// if the responder is dropped without sending a response, so that the client
3848/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3849impl std::ops::Drop for CapabilityStoreDictionaryLegacyImportResponder {
3850    fn drop(&mut self) {
3851        self.control_handle.shutdown();
3852        // Safety: drops once, never accessed again
3853        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3854    }
3855}
3856
3857impl fidl::endpoints::Responder for CapabilityStoreDictionaryLegacyImportResponder {
3858    type ControlHandle = CapabilityStoreControlHandle;
3859
3860    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3861        &self.control_handle
3862    }
3863
3864    fn drop_without_shutdown(mut self) {
3865        // Safety: drops once, never accessed again due to mem::forget
3866        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3867        // Prevent Drop from running (which would shut down the channel)
3868        std::mem::forget(self);
3869    }
3870}
3871
3872impl CapabilityStoreDictionaryLegacyImportResponder {
3873    /// Sends a response to the FIDL transaction.
3874    ///
3875    /// Sets the channel to shutdown if an error occurs.
3876    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3877        let _result = self.send_raw(result);
3878        if _result.is_err() {
3879            self.control_handle.shutdown();
3880        }
3881        self.drop_without_shutdown();
3882        _result
3883    }
3884
3885    /// Similar to "send" but does not shutdown the channel if an error occurs.
3886    pub fn send_no_shutdown_on_err(
3887        self,
3888        mut result: Result<(), CapabilityStoreError>,
3889    ) -> Result<(), fidl::Error> {
3890        let _result = self.send_raw(result);
3891        self.drop_without_shutdown();
3892        _result
3893    }
3894
3895    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3896        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3897            fidl::encoding::EmptyStruct,
3898            CapabilityStoreError,
3899        >>(
3900            fidl::encoding::FlexibleResult::new(result),
3901            self.tx_id,
3902            0x72fd686c37b6025f,
3903            fidl::encoding::DynamicFlags::FLEXIBLE,
3904        )
3905    }
3906}
3907
3908#[must_use = "FIDL methods require a response to be sent"]
3909#[derive(Debug)]
3910pub struct CapabilityStoreDictionaryLegacyExportResponder {
3911    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3912    tx_id: u32,
3913}
3914
3915/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3916/// if the responder is dropped without sending a response, so that the client
3917/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3918impl std::ops::Drop for CapabilityStoreDictionaryLegacyExportResponder {
3919    fn drop(&mut self) {
3920        self.control_handle.shutdown();
3921        // Safety: drops once, never accessed again
3922        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3923    }
3924}
3925
3926impl fidl::endpoints::Responder for CapabilityStoreDictionaryLegacyExportResponder {
3927    type ControlHandle = CapabilityStoreControlHandle;
3928
3929    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3930        &self.control_handle
3931    }
3932
3933    fn drop_without_shutdown(mut self) {
3934        // Safety: drops once, never accessed again due to mem::forget
3935        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3936        // Prevent Drop from running (which would shut down the channel)
3937        std::mem::forget(self);
3938    }
3939}
3940
3941impl CapabilityStoreDictionaryLegacyExportResponder {
3942    /// Sends a response to the FIDL transaction.
3943    ///
3944    /// Sets the channel to shutdown if an error occurs.
3945    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3946        let _result = self.send_raw(result);
3947        if _result.is_err() {
3948            self.control_handle.shutdown();
3949        }
3950        self.drop_without_shutdown();
3951        _result
3952    }
3953
3954    /// Similar to "send" but does not shutdown the channel if an error occurs.
3955    pub fn send_no_shutdown_on_err(
3956        self,
3957        mut result: Result<(), CapabilityStoreError>,
3958    ) -> Result<(), fidl::Error> {
3959        let _result = self.send_raw(result);
3960        self.drop_without_shutdown();
3961        _result
3962    }
3963
3964    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3965        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3966            fidl::encoding::EmptyStruct,
3967            CapabilityStoreError,
3968        >>(
3969            fidl::encoding::FlexibleResult::new(result),
3970            self.tx_id,
3971            0x407e15cc4bde5dcd,
3972            fidl::encoding::DynamicFlags::FLEXIBLE,
3973        )
3974    }
3975}
3976
3977#[must_use = "FIDL methods require a response to be sent"]
3978#[derive(Debug)]
3979pub struct CapabilityStoreDictionaryInsertResponder {
3980    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3981    tx_id: u32,
3982}
3983
3984/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3985/// if the responder is dropped without sending a response, so that the client
3986/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3987impl std::ops::Drop for CapabilityStoreDictionaryInsertResponder {
3988    fn drop(&mut self) {
3989        self.control_handle.shutdown();
3990        // Safety: drops once, never accessed again
3991        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3992    }
3993}
3994
3995impl fidl::endpoints::Responder for CapabilityStoreDictionaryInsertResponder {
3996    type ControlHandle = CapabilityStoreControlHandle;
3997
3998    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3999        &self.control_handle
4000    }
4001
4002    fn drop_without_shutdown(mut self) {
4003        // Safety: drops once, never accessed again due to mem::forget
4004        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4005        // Prevent Drop from running (which would shut down the channel)
4006        std::mem::forget(self);
4007    }
4008}
4009
4010impl CapabilityStoreDictionaryInsertResponder {
4011    /// Sends a response to the FIDL transaction.
4012    ///
4013    /// Sets the channel to shutdown if an error occurs.
4014    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4015        let _result = self.send_raw(result);
4016        if _result.is_err() {
4017            self.control_handle.shutdown();
4018        }
4019        self.drop_without_shutdown();
4020        _result
4021    }
4022
4023    /// Similar to "send" but does not shutdown the channel if an error occurs.
4024    pub fn send_no_shutdown_on_err(
4025        self,
4026        mut result: Result<(), CapabilityStoreError>,
4027    ) -> Result<(), fidl::Error> {
4028        let _result = self.send_raw(result);
4029        self.drop_without_shutdown();
4030        _result
4031    }
4032
4033    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4034        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4035            fidl::encoding::EmptyStruct,
4036            CapabilityStoreError,
4037        >>(
4038            fidl::encoding::FlexibleResult::new(result),
4039            self.tx_id,
4040            0x7702183689d44c27,
4041            fidl::encoding::DynamicFlags::FLEXIBLE,
4042        )
4043    }
4044}
4045
4046#[must_use = "FIDL methods require a response to be sent"]
4047#[derive(Debug)]
4048pub struct CapabilityStoreDictionaryGetResponder {
4049    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
4050    tx_id: u32,
4051}
4052
4053/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
4054/// if the responder is dropped without sending a response, so that the client
4055/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4056impl std::ops::Drop for CapabilityStoreDictionaryGetResponder {
4057    fn drop(&mut self) {
4058        self.control_handle.shutdown();
4059        // Safety: drops once, never accessed again
4060        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4061    }
4062}
4063
4064impl fidl::endpoints::Responder for CapabilityStoreDictionaryGetResponder {
4065    type ControlHandle = CapabilityStoreControlHandle;
4066
4067    fn control_handle(&self) -> &CapabilityStoreControlHandle {
4068        &self.control_handle
4069    }
4070
4071    fn drop_without_shutdown(mut self) {
4072        // Safety: drops once, never accessed again due to mem::forget
4073        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4074        // Prevent Drop from running (which would shut down the channel)
4075        std::mem::forget(self);
4076    }
4077}
4078
4079impl CapabilityStoreDictionaryGetResponder {
4080    /// Sends a response to the FIDL transaction.
4081    ///
4082    /// Sets the channel to shutdown if an error occurs.
4083    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4084        let _result = self.send_raw(result);
4085        if _result.is_err() {
4086            self.control_handle.shutdown();
4087        }
4088        self.drop_without_shutdown();
4089        _result
4090    }
4091
4092    /// Similar to "send" but does not shutdown the channel if an error occurs.
4093    pub fn send_no_shutdown_on_err(
4094        self,
4095        mut result: Result<(), CapabilityStoreError>,
4096    ) -> Result<(), fidl::Error> {
4097        let _result = self.send_raw(result);
4098        self.drop_without_shutdown();
4099        _result
4100    }
4101
4102    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4103        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4104            fidl::encoding::EmptyStruct,
4105            CapabilityStoreError,
4106        >>(
4107            fidl::encoding::FlexibleResult::new(result),
4108            self.tx_id,
4109            0x4d9e27538284add2,
4110            fidl::encoding::DynamicFlags::FLEXIBLE,
4111        )
4112    }
4113}
4114
4115#[must_use = "FIDL methods require a response to be sent"]
4116#[derive(Debug)]
4117pub struct CapabilityStoreDictionaryRemoveResponder {
4118    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
4119    tx_id: u32,
4120}
4121
4122/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
4123/// if the responder is dropped without sending a response, so that the client
4124/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4125impl std::ops::Drop for CapabilityStoreDictionaryRemoveResponder {
4126    fn drop(&mut self) {
4127        self.control_handle.shutdown();
4128        // Safety: drops once, never accessed again
4129        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4130    }
4131}
4132
4133impl fidl::endpoints::Responder for CapabilityStoreDictionaryRemoveResponder {
4134    type ControlHandle = CapabilityStoreControlHandle;
4135
4136    fn control_handle(&self) -> &CapabilityStoreControlHandle {
4137        &self.control_handle
4138    }
4139
4140    fn drop_without_shutdown(mut self) {
4141        // Safety: drops once, never accessed again due to mem::forget
4142        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4143        // Prevent Drop from running (which would shut down the channel)
4144        std::mem::forget(self);
4145    }
4146}
4147
4148impl CapabilityStoreDictionaryRemoveResponder {
4149    /// Sends a response to the FIDL transaction.
4150    ///
4151    /// Sets the channel to shutdown if an error occurs.
4152    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4153        let _result = self.send_raw(result);
4154        if _result.is_err() {
4155            self.control_handle.shutdown();
4156        }
4157        self.drop_without_shutdown();
4158        _result
4159    }
4160
4161    /// Similar to "send" but does not shutdown the channel if an error occurs.
4162    pub fn send_no_shutdown_on_err(
4163        self,
4164        mut result: Result<(), CapabilityStoreError>,
4165    ) -> Result<(), fidl::Error> {
4166        let _result = self.send_raw(result);
4167        self.drop_without_shutdown();
4168        _result
4169    }
4170
4171    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4172        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4173            fidl::encoding::EmptyStruct,
4174            CapabilityStoreError,
4175        >>(
4176            fidl::encoding::FlexibleResult::new(result),
4177            self.tx_id,
4178            0x4c5c025ab05d4f3,
4179            fidl::encoding::DynamicFlags::FLEXIBLE,
4180        )
4181    }
4182}
4183
4184#[must_use = "FIDL methods require a response to be sent"]
4185#[derive(Debug)]
4186pub struct CapabilityStoreDictionaryCopyResponder {
4187    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
4188    tx_id: u32,
4189}
4190
4191/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
4192/// if the responder is dropped without sending a response, so that the client
4193/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4194impl std::ops::Drop for CapabilityStoreDictionaryCopyResponder {
4195    fn drop(&mut self) {
4196        self.control_handle.shutdown();
4197        // Safety: drops once, never accessed again
4198        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4199    }
4200}
4201
4202impl fidl::endpoints::Responder for CapabilityStoreDictionaryCopyResponder {
4203    type ControlHandle = CapabilityStoreControlHandle;
4204
4205    fn control_handle(&self) -> &CapabilityStoreControlHandle {
4206        &self.control_handle
4207    }
4208
4209    fn drop_without_shutdown(mut self) {
4210        // Safety: drops once, never accessed again due to mem::forget
4211        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4212        // Prevent Drop from running (which would shut down the channel)
4213        std::mem::forget(self);
4214    }
4215}
4216
4217impl CapabilityStoreDictionaryCopyResponder {
4218    /// Sends a response to the FIDL transaction.
4219    ///
4220    /// Sets the channel to shutdown if an error occurs.
4221    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4222        let _result = self.send_raw(result);
4223        if _result.is_err() {
4224            self.control_handle.shutdown();
4225        }
4226        self.drop_without_shutdown();
4227        _result
4228    }
4229
4230    /// Similar to "send" but does not shutdown the channel if an error occurs.
4231    pub fn send_no_shutdown_on_err(
4232        self,
4233        mut result: Result<(), CapabilityStoreError>,
4234    ) -> Result<(), fidl::Error> {
4235        let _result = self.send_raw(result);
4236        self.drop_without_shutdown();
4237        _result
4238    }
4239
4240    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4241        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4242            fidl::encoding::EmptyStruct,
4243            CapabilityStoreError,
4244        >>(
4245            fidl::encoding::FlexibleResult::new(result),
4246            self.tx_id,
4247            0x3733ecdf4ea1b44f,
4248            fidl::encoding::DynamicFlags::FLEXIBLE,
4249        )
4250    }
4251}
4252
4253#[must_use = "FIDL methods require a response to be sent"]
4254#[derive(Debug)]
4255pub struct CapabilityStoreDictionaryKeysResponder {
4256    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
4257    tx_id: u32,
4258}
4259
4260/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
4261/// if the responder is dropped without sending a response, so that the client
4262/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4263impl std::ops::Drop for CapabilityStoreDictionaryKeysResponder {
4264    fn drop(&mut self) {
4265        self.control_handle.shutdown();
4266        // Safety: drops once, never accessed again
4267        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4268    }
4269}
4270
4271impl fidl::endpoints::Responder for CapabilityStoreDictionaryKeysResponder {
4272    type ControlHandle = CapabilityStoreControlHandle;
4273
4274    fn control_handle(&self) -> &CapabilityStoreControlHandle {
4275        &self.control_handle
4276    }
4277
4278    fn drop_without_shutdown(mut self) {
4279        // Safety: drops once, never accessed again due to mem::forget
4280        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4281        // Prevent Drop from running (which would shut down the channel)
4282        std::mem::forget(self);
4283    }
4284}
4285
4286impl CapabilityStoreDictionaryKeysResponder {
4287    /// Sends a response to the FIDL transaction.
4288    ///
4289    /// Sets the channel to shutdown if an error occurs.
4290    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4291        let _result = self.send_raw(result);
4292        if _result.is_err() {
4293            self.control_handle.shutdown();
4294        }
4295        self.drop_without_shutdown();
4296        _result
4297    }
4298
4299    /// Similar to "send" but does not shutdown the channel if an error occurs.
4300    pub fn send_no_shutdown_on_err(
4301        self,
4302        mut result: Result<(), CapabilityStoreError>,
4303    ) -> Result<(), fidl::Error> {
4304        let _result = self.send_raw(result);
4305        self.drop_without_shutdown();
4306        _result
4307    }
4308
4309    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4310        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4311            fidl::encoding::EmptyStruct,
4312            CapabilityStoreError,
4313        >>(
4314            fidl::encoding::FlexibleResult::new(result),
4315            self.tx_id,
4316            0x84b05577ceaec9e,
4317            fidl::encoding::DynamicFlags::FLEXIBLE,
4318        )
4319    }
4320}
4321
4322#[must_use = "FIDL methods require a response to be sent"]
4323#[derive(Debug)]
4324pub struct CapabilityStoreDictionaryEnumerateResponder {
4325    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
4326    tx_id: u32,
4327}
4328
4329/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
4330/// if the responder is dropped without sending a response, so that the client
4331/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4332impl std::ops::Drop for CapabilityStoreDictionaryEnumerateResponder {
4333    fn drop(&mut self) {
4334        self.control_handle.shutdown();
4335        // Safety: drops once, never accessed again
4336        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4337    }
4338}
4339
4340impl fidl::endpoints::Responder for CapabilityStoreDictionaryEnumerateResponder {
4341    type ControlHandle = CapabilityStoreControlHandle;
4342
4343    fn control_handle(&self) -> &CapabilityStoreControlHandle {
4344        &self.control_handle
4345    }
4346
4347    fn drop_without_shutdown(mut self) {
4348        // Safety: drops once, never accessed again due to mem::forget
4349        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4350        // Prevent Drop from running (which would shut down the channel)
4351        std::mem::forget(self);
4352    }
4353}
4354
4355impl CapabilityStoreDictionaryEnumerateResponder {
4356    /// Sends a response to the FIDL transaction.
4357    ///
4358    /// Sets the channel to shutdown if an error occurs.
4359    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4360        let _result = self.send_raw(result);
4361        if _result.is_err() {
4362            self.control_handle.shutdown();
4363        }
4364        self.drop_without_shutdown();
4365        _result
4366    }
4367
4368    /// Similar to "send" but does not shutdown the channel if an error occurs.
4369    pub fn send_no_shutdown_on_err(
4370        self,
4371        mut result: Result<(), CapabilityStoreError>,
4372    ) -> Result<(), fidl::Error> {
4373        let _result = self.send_raw(result);
4374        self.drop_without_shutdown();
4375        _result
4376    }
4377
4378    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4379        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4380            fidl::encoding::EmptyStruct,
4381            CapabilityStoreError,
4382        >>(
4383            fidl::encoding::FlexibleResult::new(result),
4384            self.tx_id,
4385            0xd6279b6ced04641,
4386            fidl::encoding::DynamicFlags::FLEXIBLE,
4387        )
4388    }
4389}
4390
4391#[must_use = "FIDL methods require a response to be sent"]
4392#[derive(Debug)]
4393pub struct CapabilityStoreDictionaryDrainResponder {
4394    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
4395    tx_id: u32,
4396}
4397
4398/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
4399/// if the responder is dropped without sending a response, so that the client
4400/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4401impl std::ops::Drop for CapabilityStoreDictionaryDrainResponder {
4402    fn drop(&mut self) {
4403        self.control_handle.shutdown();
4404        // Safety: drops once, never accessed again
4405        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4406    }
4407}
4408
4409impl fidl::endpoints::Responder for CapabilityStoreDictionaryDrainResponder {
4410    type ControlHandle = CapabilityStoreControlHandle;
4411
4412    fn control_handle(&self) -> &CapabilityStoreControlHandle {
4413        &self.control_handle
4414    }
4415
4416    fn drop_without_shutdown(mut self) {
4417        // Safety: drops once, never accessed again due to mem::forget
4418        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4419        // Prevent Drop from running (which would shut down the channel)
4420        std::mem::forget(self);
4421    }
4422}
4423
4424impl CapabilityStoreDictionaryDrainResponder {
4425    /// Sends a response to the FIDL transaction.
4426    ///
4427    /// Sets the channel to shutdown if an error occurs.
4428    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4429        let _result = self.send_raw(result);
4430        if _result.is_err() {
4431            self.control_handle.shutdown();
4432        }
4433        self.drop_without_shutdown();
4434        _result
4435    }
4436
4437    /// Similar to "send" but does not shutdown the channel if an error occurs.
4438    pub fn send_no_shutdown_on_err(
4439        self,
4440        mut result: Result<(), CapabilityStoreError>,
4441    ) -> Result<(), fidl::Error> {
4442        let _result = self.send_raw(result);
4443        self.drop_without_shutdown();
4444        _result
4445    }
4446
4447    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4448        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4449            fidl::encoding::EmptyStruct,
4450            CapabilityStoreError,
4451        >>(
4452            fidl::encoding::FlexibleResult::new(result),
4453            self.tx_id,
4454            0x28a3a3f84d928cd8,
4455            fidl::encoding::DynamicFlags::FLEXIBLE,
4456        )
4457    }
4458}
4459
4460#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4461pub struct ConnectorRouterMarker;
4462
4463impl fidl::endpoints::ProtocolMarker for ConnectorRouterMarker {
4464    type Proxy = ConnectorRouterProxy;
4465    type RequestStream = ConnectorRouterRequestStream;
4466    #[cfg(target_os = "fuchsia")]
4467    type SynchronousProxy = ConnectorRouterSynchronousProxy;
4468
4469    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.ConnectorRouter";
4470}
4471impl fidl::endpoints::DiscoverableProtocolMarker for ConnectorRouterMarker {}
4472pub type ConnectorRouterRouteResult = Result<ConnectorRouterRouteResponse, RouterError>;
4473
4474pub trait ConnectorRouterProxyInterface: Send + Sync {
4475    type RouteResponseFut: std::future::Future<Output = Result<ConnectorRouterRouteResult, fidl::Error>>
4476        + Send;
4477    fn r#route(&self, payload: RouteRequest) -> Self::RouteResponseFut;
4478}
4479#[derive(Debug)]
4480#[cfg(target_os = "fuchsia")]
4481pub struct ConnectorRouterSynchronousProxy {
4482    client: fidl::client::sync::Client,
4483}
4484
4485#[cfg(target_os = "fuchsia")]
4486impl fidl::endpoints::SynchronousProxy for ConnectorRouterSynchronousProxy {
4487    type Proxy = ConnectorRouterProxy;
4488    type Protocol = ConnectorRouterMarker;
4489
4490    fn from_channel(inner: fidl::Channel) -> Self {
4491        Self::new(inner)
4492    }
4493
4494    fn into_channel(self) -> fidl::Channel {
4495        self.client.into_channel()
4496    }
4497
4498    fn as_channel(&self) -> &fidl::Channel {
4499        self.client.as_channel()
4500    }
4501}
4502
4503#[cfg(target_os = "fuchsia")]
4504impl ConnectorRouterSynchronousProxy {
4505    pub fn new(channel: fidl::Channel) -> Self {
4506        let protocol_name = <ConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4507        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
4508    }
4509
4510    pub fn into_channel(self) -> fidl::Channel {
4511        self.client.into_channel()
4512    }
4513
4514    /// Waits until an event arrives and returns it. It is safe for other
4515    /// threads to make concurrent requests while waiting for an event.
4516    pub fn wait_for_event(
4517        &self,
4518        deadline: zx::MonotonicInstant,
4519    ) -> Result<ConnectorRouterEvent, fidl::Error> {
4520        ConnectorRouterEvent::decode(self.client.wait_for_event(deadline)?)
4521    }
4522
4523    pub fn r#route(
4524        &self,
4525        mut payload: RouteRequest,
4526        ___deadline: zx::MonotonicInstant,
4527    ) -> Result<ConnectorRouterRouteResult, fidl::Error> {
4528        let _response = self.client.send_query::<
4529            RouteRequest,
4530            fidl::encoding::FlexibleResultType<ConnectorRouterRouteResponse, RouterError>,
4531        >(
4532            &mut payload,
4533            0x74dbb8bc13730766,
4534            fidl::encoding::DynamicFlags::FLEXIBLE,
4535            ___deadline,
4536        )?
4537        .into_result::<ConnectorRouterMarker>("route")?;
4538        Ok(_response.map(|x| x))
4539    }
4540}
4541
4542#[cfg(target_os = "fuchsia")]
4543impl From<ConnectorRouterSynchronousProxy> for zx::Handle {
4544    fn from(value: ConnectorRouterSynchronousProxy) -> Self {
4545        value.into_channel().into()
4546    }
4547}
4548
4549#[cfg(target_os = "fuchsia")]
4550impl From<fidl::Channel> for ConnectorRouterSynchronousProxy {
4551    fn from(value: fidl::Channel) -> Self {
4552        Self::new(value)
4553    }
4554}
4555
4556#[derive(Debug, Clone)]
4557pub struct ConnectorRouterProxy {
4558    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
4559}
4560
4561impl fidl::endpoints::Proxy for ConnectorRouterProxy {
4562    type Protocol = ConnectorRouterMarker;
4563
4564    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
4565        Self::new(inner)
4566    }
4567
4568    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
4569        self.client.into_channel().map_err(|client| Self { client })
4570    }
4571
4572    fn as_channel(&self) -> &::fidl::AsyncChannel {
4573        self.client.as_channel()
4574    }
4575}
4576
4577impl ConnectorRouterProxy {
4578    /// Create a new Proxy for fuchsia.component.sandbox/ConnectorRouter.
4579    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
4580        let protocol_name = <ConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4581        Self { client: fidl::client::Client::new(channel, protocol_name) }
4582    }
4583
4584    /// Get a Stream of events from the remote end of the protocol.
4585    ///
4586    /// # Panics
4587    ///
4588    /// Panics if the event stream was already taken.
4589    pub fn take_event_stream(&self) -> ConnectorRouterEventStream {
4590        ConnectorRouterEventStream { event_receiver: self.client.take_event_receiver() }
4591    }
4592
4593    pub fn r#route(
4594        &self,
4595        mut payload: RouteRequest,
4596    ) -> fidl::client::QueryResponseFut<
4597        ConnectorRouterRouteResult,
4598        fidl::encoding::DefaultFuchsiaResourceDialect,
4599    > {
4600        ConnectorRouterProxyInterface::r#route(self, payload)
4601    }
4602}
4603
4604impl ConnectorRouterProxyInterface for ConnectorRouterProxy {
4605    type RouteResponseFut = fidl::client::QueryResponseFut<
4606        ConnectorRouterRouteResult,
4607        fidl::encoding::DefaultFuchsiaResourceDialect,
4608    >;
4609    fn r#route(&self, mut payload: RouteRequest) -> Self::RouteResponseFut {
4610        fn _decode(
4611            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4612        ) -> Result<ConnectorRouterRouteResult, fidl::Error> {
4613            let _response = fidl::client::decode_transaction_body::<
4614                fidl::encoding::FlexibleResultType<ConnectorRouterRouteResponse, RouterError>,
4615                fidl::encoding::DefaultFuchsiaResourceDialect,
4616                0x74dbb8bc13730766,
4617            >(_buf?)?
4618            .into_result::<ConnectorRouterMarker>("route")?;
4619            Ok(_response.map(|x| x))
4620        }
4621        self.client.send_query_and_decode::<RouteRequest, ConnectorRouterRouteResult>(
4622            &mut payload,
4623            0x74dbb8bc13730766,
4624            fidl::encoding::DynamicFlags::FLEXIBLE,
4625            _decode,
4626        )
4627    }
4628}
4629
4630pub struct ConnectorRouterEventStream {
4631    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
4632}
4633
4634impl std::marker::Unpin for ConnectorRouterEventStream {}
4635
4636impl futures::stream::FusedStream for ConnectorRouterEventStream {
4637    fn is_terminated(&self) -> bool {
4638        self.event_receiver.is_terminated()
4639    }
4640}
4641
4642impl futures::Stream for ConnectorRouterEventStream {
4643    type Item = Result<ConnectorRouterEvent, fidl::Error>;
4644
4645    fn poll_next(
4646        mut self: std::pin::Pin<&mut Self>,
4647        cx: &mut std::task::Context<'_>,
4648    ) -> std::task::Poll<Option<Self::Item>> {
4649        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4650            &mut self.event_receiver,
4651            cx
4652        )?) {
4653            Some(buf) => std::task::Poll::Ready(Some(ConnectorRouterEvent::decode(buf))),
4654            None => std::task::Poll::Ready(None),
4655        }
4656    }
4657}
4658
4659#[derive(Debug)]
4660pub enum ConnectorRouterEvent {
4661    #[non_exhaustive]
4662    _UnknownEvent {
4663        /// Ordinal of the event that was sent.
4664        ordinal: u64,
4665    },
4666}
4667
4668impl ConnectorRouterEvent {
4669    /// Decodes a message buffer as a [`ConnectorRouterEvent`].
4670    fn decode(
4671        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4672    ) -> Result<ConnectorRouterEvent, fidl::Error> {
4673        let (bytes, _handles) = buf.split_mut();
4674        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4675        debug_assert_eq!(tx_header.tx_id, 0);
4676        match tx_header.ordinal {
4677            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4678                Ok(ConnectorRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
4679            }
4680            _ => Err(fidl::Error::UnknownOrdinal {
4681                ordinal: tx_header.ordinal,
4682                protocol_name:
4683                    <ConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4684            }),
4685        }
4686    }
4687}
4688
4689/// A Stream of incoming requests for fuchsia.component.sandbox/ConnectorRouter.
4690pub struct ConnectorRouterRequestStream {
4691    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4692    is_terminated: bool,
4693}
4694
4695impl std::marker::Unpin for ConnectorRouterRequestStream {}
4696
4697impl futures::stream::FusedStream for ConnectorRouterRequestStream {
4698    fn is_terminated(&self) -> bool {
4699        self.is_terminated
4700    }
4701}
4702
4703impl fidl::endpoints::RequestStream for ConnectorRouterRequestStream {
4704    type Protocol = ConnectorRouterMarker;
4705    type ControlHandle = ConnectorRouterControlHandle;
4706
4707    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
4708        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4709    }
4710
4711    fn control_handle(&self) -> Self::ControlHandle {
4712        ConnectorRouterControlHandle { inner: self.inner.clone() }
4713    }
4714
4715    fn into_inner(
4716        self,
4717    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
4718    {
4719        (self.inner, self.is_terminated)
4720    }
4721
4722    fn from_inner(
4723        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4724        is_terminated: bool,
4725    ) -> Self {
4726        Self { inner, is_terminated }
4727    }
4728}
4729
4730impl futures::Stream for ConnectorRouterRequestStream {
4731    type Item = Result<ConnectorRouterRequest, fidl::Error>;
4732
4733    fn poll_next(
4734        mut self: std::pin::Pin<&mut Self>,
4735        cx: &mut std::task::Context<'_>,
4736    ) -> std::task::Poll<Option<Self::Item>> {
4737        let this = &mut *self;
4738        if this.inner.check_shutdown(cx) {
4739            this.is_terminated = true;
4740            return std::task::Poll::Ready(None);
4741        }
4742        if this.is_terminated {
4743            panic!("polled ConnectorRouterRequestStream after completion");
4744        }
4745        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4746            |bytes, handles| {
4747                match this.inner.channel().read_etc(cx, bytes, handles) {
4748                    std::task::Poll::Ready(Ok(())) => {}
4749                    std::task::Poll::Pending => return std::task::Poll::Pending,
4750                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4751                        this.is_terminated = true;
4752                        return std::task::Poll::Ready(None);
4753                    }
4754                    std::task::Poll::Ready(Err(e)) => {
4755                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4756                            e.into(),
4757                        ))))
4758                    }
4759                }
4760
4761                // A message has been received from the channel
4762                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4763
4764                std::task::Poll::Ready(Some(match header.ordinal {
4765                    0x74dbb8bc13730766 => {
4766                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4767                        let mut req = fidl::new_empty!(
4768                            RouteRequest,
4769                            fidl::encoding::DefaultFuchsiaResourceDialect
4770                        );
4771                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RouteRequest>(&header, _body_bytes, handles, &mut req)?;
4772                        let control_handle =
4773                            ConnectorRouterControlHandle { inner: this.inner.clone() };
4774                        Ok(ConnectorRouterRequest::Route {
4775                            payload: req,
4776                            responder: ConnectorRouterRouteResponder {
4777                                control_handle: std::mem::ManuallyDrop::new(control_handle),
4778                                tx_id: header.tx_id,
4779                            },
4780                        })
4781                    }
4782                    _ if header.tx_id == 0
4783                        && header
4784                            .dynamic_flags()
4785                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
4786                    {
4787                        Ok(ConnectorRouterRequest::_UnknownMethod {
4788                            ordinal: header.ordinal,
4789                            control_handle: ConnectorRouterControlHandle {
4790                                inner: this.inner.clone(),
4791                            },
4792                            method_type: fidl::MethodType::OneWay,
4793                        })
4794                    }
4795                    _ if header
4796                        .dynamic_flags()
4797                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
4798                    {
4799                        this.inner.send_framework_err(
4800                            fidl::encoding::FrameworkErr::UnknownMethod,
4801                            header.tx_id,
4802                            header.ordinal,
4803                            header.dynamic_flags(),
4804                            (bytes, handles),
4805                        )?;
4806                        Ok(ConnectorRouterRequest::_UnknownMethod {
4807                            ordinal: header.ordinal,
4808                            control_handle: ConnectorRouterControlHandle {
4809                                inner: this.inner.clone(),
4810                            },
4811                            method_type: fidl::MethodType::TwoWay,
4812                        })
4813                    }
4814                    _ => Err(fidl::Error::UnknownOrdinal {
4815                        ordinal: header.ordinal,
4816                        protocol_name:
4817                            <ConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4818                    }),
4819                }))
4820            },
4821        )
4822    }
4823}
4824
4825#[derive(Debug)]
4826pub enum ConnectorRouterRequest {
4827    Route {
4828        payload: RouteRequest,
4829        responder: ConnectorRouterRouteResponder,
4830    },
4831    /// An interaction was received which does not match any known method.
4832    #[non_exhaustive]
4833    _UnknownMethod {
4834        /// Ordinal of the method that was called.
4835        ordinal: u64,
4836        control_handle: ConnectorRouterControlHandle,
4837        method_type: fidl::MethodType,
4838    },
4839}
4840
4841impl ConnectorRouterRequest {
4842    #[allow(irrefutable_let_patterns)]
4843    pub fn into_route(self) -> Option<(RouteRequest, ConnectorRouterRouteResponder)> {
4844        if let ConnectorRouterRequest::Route { payload, responder } = self {
4845            Some((payload, responder))
4846        } else {
4847            None
4848        }
4849    }
4850
4851    /// Name of the method defined in FIDL
4852    pub fn method_name(&self) -> &'static str {
4853        match *self {
4854            ConnectorRouterRequest::Route { .. } => "route",
4855            ConnectorRouterRequest::_UnknownMethod {
4856                method_type: fidl::MethodType::OneWay,
4857                ..
4858            } => "unknown one-way method",
4859            ConnectorRouterRequest::_UnknownMethod {
4860                method_type: fidl::MethodType::TwoWay,
4861                ..
4862            } => "unknown two-way method",
4863        }
4864    }
4865}
4866
4867#[derive(Debug, Clone)]
4868pub struct ConnectorRouterControlHandle {
4869    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4870}
4871
4872impl fidl::endpoints::ControlHandle for ConnectorRouterControlHandle {
4873    fn shutdown(&self) {
4874        self.inner.shutdown()
4875    }
4876    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
4877        self.inner.shutdown_with_epitaph(status)
4878    }
4879
4880    fn is_closed(&self) -> bool {
4881        self.inner.channel().is_closed()
4882    }
4883    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4884        self.inner.channel().on_closed()
4885    }
4886
4887    #[cfg(target_os = "fuchsia")]
4888    fn signal_peer(
4889        &self,
4890        clear_mask: zx::Signals,
4891        set_mask: zx::Signals,
4892    ) -> Result<(), zx_status::Status> {
4893        use fidl::Peered;
4894        self.inner.channel().signal_peer(clear_mask, set_mask)
4895    }
4896}
4897
4898impl ConnectorRouterControlHandle {}
4899
4900#[must_use = "FIDL methods require a response to be sent"]
4901#[derive(Debug)]
4902pub struct ConnectorRouterRouteResponder {
4903    control_handle: std::mem::ManuallyDrop<ConnectorRouterControlHandle>,
4904    tx_id: u32,
4905}
4906
4907/// Set the the channel to be shutdown (see [`ConnectorRouterControlHandle::shutdown`])
4908/// if the responder is dropped without sending a response, so that the client
4909/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4910impl std::ops::Drop for ConnectorRouterRouteResponder {
4911    fn drop(&mut self) {
4912        self.control_handle.shutdown();
4913        // Safety: drops once, never accessed again
4914        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4915    }
4916}
4917
4918impl fidl::endpoints::Responder for ConnectorRouterRouteResponder {
4919    type ControlHandle = ConnectorRouterControlHandle;
4920
4921    fn control_handle(&self) -> &ConnectorRouterControlHandle {
4922        &self.control_handle
4923    }
4924
4925    fn drop_without_shutdown(mut self) {
4926        // Safety: drops once, never accessed again due to mem::forget
4927        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4928        // Prevent Drop from running (which would shut down the channel)
4929        std::mem::forget(self);
4930    }
4931}
4932
4933impl ConnectorRouterRouteResponder {
4934    /// Sends a response to the FIDL transaction.
4935    ///
4936    /// Sets the channel to shutdown if an error occurs.
4937    pub fn send(
4938        self,
4939        mut result: Result<ConnectorRouterRouteResponse, RouterError>,
4940    ) -> Result<(), fidl::Error> {
4941        let _result = self.send_raw(result);
4942        if _result.is_err() {
4943            self.control_handle.shutdown();
4944        }
4945        self.drop_without_shutdown();
4946        _result
4947    }
4948
4949    /// Similar to "send" but does not shutdown the channel if an error occurs.
4950    pub fn send_no_shutdown_on_err(
4951        self,
4952        mut result: Result<ConnectorRouterRouteResponse, RouterError>,
4953    ) -> Result<(), fidl::Error> {
4954        let _result = self.send_raw(result);
4955        self.drop_without_shutdown();
4956        _result
4957    }
4958
4959    fn send_raw(
4960        &self,
4961        mut result: Result<ConnectorRouterRouteResponse, RouterError>,
4962    ) -> Result<(), fidl::Error> {
4963        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4964            ConnectorRouterRouteResponse,
4965            RouterError,
4966        >>(
4967            fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
4968            self.tx_id,
4969            0x74dbb8bc13730766,
4970            fidl::encoding::DynamicFlags::FLEXIBLE,
4971        )
4972    }
4973}
4974
4975#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4976pub struct DataRouterMarker;
4977
4978impl fidl::endpoints::ProtocolMarker for DataRouterMarker {
4979    type Proxy = DataRouterProxy;
4980    type RequestStream = DataRouterRequestStream;
4981    #[cfg(target_os = "fuchsia")]
4982    type SynchronousProxy = DataRouterSynchronousProxy;
4983
4984    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.DataRouter";
4985}
4986impl fidl::endpoints::DiscoverableProtocolMarker for DataRouterMarker {}
4987pub type DataRouterRouteResult = Result<DataRouterRouteResponse, RouterError>;
4988
4989pub trait DataRouterProxyInterface: Send + Sync {
4990    type RouteResponseFut: std::future::Future<Output = Result<DataRouterRouteResult, fidl::Error>>
4991        + Send;
4992    fn r#route(&self, payload: RouteRequest) -> Self::RouteResponseFut;
4993}
4994#[derive(Debug)]
4995#[cfg(target_os = "fuchsia")]
4996pub struct DataRouterSynchronousProxy {
4997    client: fidl::client::sync::Client,
4998}
4999
5000#[cfg(target_os = "fuchsia")]
5001impl fidl::endpoints::SynchronousProxy for DataRouterSynchronousProxy {
5002    type Proxy = DataRouterProxy;
5003    type Protocol = DataRouterMarker;
5004
5005    fn from_channel(inner: fidl::Channel) -> Self {
5006        Self::new(inner)
5007    }
5008
5009    fn into_channel(self) -> fidl::Channel {
5010        self.client.into_channel()
5011    }
5012
5013    fn as_channel(&self) -> &fidl::Channel {
5014        self.client.as_channel()
5015    }
5016}
5017
5018#[cfg(target_os = "fuchsia")]
5019impl DataRouterSynchronousProxy {
5020    pub fn new(channel: fidl::Channel) -> Self {
5021        let protocol_name = <DataRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5022        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
5023    }
5024
5025    pub fn into_channel(self) -> fidl::Channel {
5026        self.client.into_channel()
5027    }
5028
5029    /// Waits until an event arrives and returns it. It is safe for other
5030    /// threads to make concurrent requests while waiting for an event.
5031    pub fn wait_for_event(
5032        &self,
5033        deadline: zx::MonotonicInstant,
5034    ) -> Result<DataRouterEvent, fidl::Error> {
5035        DataRouterEvent::decode(self.client.wait_for_event(deadline)?)
5036    }
5037
5038    pub fn r#route(
5039        &self,
5040        mut payload: RouteRequest,
5041        ___deadline: zx::MonotonicInstant,
5042    ) -> Result<DataRouterRouteResult, fidl::Error> {
5043        let _response = self.client.send_query::<
5044            RouteRequest,
5045            fidl::encoding::FlexibleResultType<DataRouterRouteResponse, RouterError>,
5046        >(
5047            &mut payload,
5048            0x2e87dc44dfc53804,
5049            fidl::encoding::DynamicFlags::FLEXIBLE,
5050            ___deadline,
5051        )?
5052        .into_result::<DataRouterMarker>("route")?;
5053        Ok(_response.map(|x| x))
5054    }
5055}
5056
5057#[cfg(target_os = "fuchsia")]
5058impl From<DataRouterSynchronousProxy> for zx::Handle {
5059    fn from(value: DataRouterSynchronousProxy) -> Self {
5060        value.into_channel().into()
5061    }
5062}
5063
5064#[cfg(target_os = "fuchsia")]
5065impl From<fidl::Channel> for DataRouterSynchronousProxy {
5066    fn from(value: fidl::Channel) -> Self {
5067        Self::new(value)
5068    }
5069}
5070
5071#[derive(Debug, Clone)]
5072pub struct DataRouterProxy {
5073    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
5074}
5075
5076impl fidl::endpoints::Proxy for DataRouterProxy {
5077    type Protocol = DataRouterMarker;
5078
5079    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
5080        Self::new(inner)
5081    }
5082
5083    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
5084        self.client.into_channel().map_err(|client| Self { client })
5085    }
5086
5087    fn as_channel(&self) -> &::fidl::AsyncChannel {
5088        self.client.as_channel()
5089    }
5090}
5091
5092impl DataRouterProxy {
5093    /// Create a new Proxy for fuchsia.component.sandbox/DataRouter.
5094    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5095        let protocol_name = <DataRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5096        Self { client: fidl::client::Client::new(channel, protocol_name) }
5097    }
5098
5099    /// Get a Stream of events from the remote end of the protocol.
5100    ///
5101    /// # Panics
5102    ///
5103    /// Panics if the event stream was already taken.
5104    pub fn take_event_stream(&self) -> DataRouterEventStream {
5105        DataRouterEventStream { event_receiver: self.client.take_event_receiver() }
5106    }
5107
5108    pub fn r#route(
5109        &self,
5110        mut payload: RouteRequest,
5111    ) -> fidl::client::QueryResponseFut<
5112        DataRouterRouteResult,
5113        fidl::encoding::DefaultFuchsiaResourceDialect,
5114    > {
5115        DataRouterProxyInterface::r#route(self, payload)
5116    }
5117}
5118
5119impl DataRouterProxyInterface for DataRouterProxy {
5120    type RouteResponseFut = fidl::client::QueryResponseFut<
5121        DataRouterRouteResult,
5122        fidl::encoding::DefaultFuchsiaResourceDialect,
5123    >;
5124    fn r#route(&self, mut payload: RouteRequest) -> Self::RouteResponseFut {
5125        fn _decode(
5126            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5127        ) -> Result<DataRouterRouteResult, fidl::Error> {
5128            let _response = fidl::client::decode_transaction_body::<
5129                fidl::encoding::FlexibleResultType<DataRouterRouteResponse, RouterError>,
5130                fidl::encoding::DefaultFuchsiaResourceDialect,
5131                0x2e87dc44dfc53804,
5132            >(_buf?)?
5133            .into_result::<DataRouterMarker>("route")?;
5134            Ok(_response.map(|x| x))
5135        }
5136        self.client.send_query_and_decode::<RouteRequest, DataRouterRouteResult>(
5137            &mut payload,
5138            0x2e87dc44dfc53804,
5139            fidl::encoding::DynamicFlags::FLEXIBLE,
5140            _decode,
5141        )
5142    }
5143}
5144
5145pub struct DataRouterEventStream {
5146    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
5147}
5148
5149impl std::marker::Unpin for DataRouterEventStream {}
5150
5151impl futures::stream::FusedStream for DataRouterEventStream {
5152    fn is_terminated(&self) -> bool {
5153        self.event_receiver.is_terminated()
5154    }
5155}
5156
5157impl futures::Stream for DataRouterEventStream {
5158    type Item = Result<DataRouterEvent, fidl::Error>;
5159
5160    fn poll_next(
5161        mut self: std::pin::Pin<&mut Self>,
5162        cx: &mut std::task::Context<'_>,
5163    ) -> std::task::Poll<Option<Self::Item>> {
5164        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5165            &mut self.event_receiver,
5166            cx
5167        )?) {
5168            Some(buf) => std::task::Poll::Ready(Some(DataRouterEvent::decode(buf))),
5169            None => std::task::Poll::Ready(None),
5170        }
5171    }
5172}
5173
5174#[derive(Debug)]
5175pub enum DataRouterEvent {
5176    #[non_exhaustive]
5177    _UnknownEvent {
5178        /// Ordinal of the event that was sent.
5179        ordinal: u64,
5180    },
5181}
5182
5183impl DataRouterEvent {
5184    /// Decodes a message buffer as a [`DataRouterEvent`].
5185    fn decode(
5186        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5187    ) -> Result<DataRouterEvent, fidl::Error> {
5188        let (bytes, _handles) = buf.split_mut();
5189        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5190        debug_assert_eq!(tx_header.tx_id, 0);
5191        match tx_header.ordinal {
5192            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
5193                Ok(DataRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
5194            }
5195            _ => Err(fidl::Error::UnknownOrdinal {
5196                ordinal: tx_header.ordinal,
5197                protocol_name: <DataRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5198            }),
5199        }
5200    }
5201}
5202
5203/// A Stream of incoming requests for fuchsia.component.sandbox/DataRouter.
5204pub struct DataRouterRequestStream {
5205    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5206    is_terminated: bool,
5207}
5208
5209impl std::marker::Unpin for DataRouterRequestStream {}
5210
5211impl futures::stream::FusedStream for DataRouterRequestStream {
5212    fn is_terminated(&self) -> bool {
5213        self.is_terminated
5214    }
5215}
5216
5217impl fidl::endpoints::RequestStream for DataRouterRequestStream {
5218    type Protocol = DataRouterMarker;
5219    type ControlHandle = DataRouterControlHandle;
5220
5221    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5222        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5223    }
5224
5225    fn control_handle(&self) -> Self::ControlHandle {
5226        DataRouterControlHandle { inner: self.inner.clone() }
5227    }
5228
5229    fn into_inner(
5230        self,
5231    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5232    {
5233        (self.inner, self.is_terminated)
5234    }
5235
5236    fn from_inner(
5237        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5238        is_terminated: bool,
5239    ) -> Self {
5240        Self { inner, is_terminated }
5241    }
5242}
5243
5244impl futures::Stream for DataRouterRequestStream {
5245    type Item = Result<DataRouterRequest, fidl::Error>;
5246
5247    fn poll_next(
5248        mut self: std::pin::Pin<&mut Self>,
5249        cx: &mut std::task::Context<'_>,
5250    ) -> std::task::Poll<Option<Self::Item>> {
5251        let this = &mut *self;
5252        if this.inner.check_shutdown(cx) {
5253            this.is_terminated = true;
5254            return std::task::Poll::Ready(None);
5255        }
5256        if this.is_terminated {
5257            panic!("polled DataRouterRequestStream after completion");
5258        }
5259        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
5260            |bytes, handles| {
5261                match this.inner.channel().read_etc(cx, bytes, handles) {
5262                    std::task::Poll::Ready(Ok(())) => {}
5263                    std::task::Poll::Pending => return std::task::Poll::Pending,
5264                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
5265                        this.is_terminated = true;
5266                        return std::task::Poll::Ready(None);
5267                    }
5268                    std::task::Poll::Ready(Err(e)) => {
5269                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5270                            e.into(),
5271                        ))))
5272                    }
5273                }
5274
5275                // A message has been received from the channel
5276                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5277
5278                std::task::Poll::Ready(Some(match header.ordinal {
5279                    0x2e87dc44dfc53804 => {
5280                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5281                        let mut req = fidl::new_empty!(
5282                            RouteRequest,
5283                            fidl::encoding::DefaultFuchsiaResourceDialect
5284                        );
5285                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RouteRequest>(&header, _body_bytes, handles, &mut req)?;
5286                        let control_handle = DataRouterControlHandle { inner: this.inner.clone() };
5287                        Ok(DataRouterRequest::Route {
5288                            payload: req,
5289                            responder: DataRouterRouteResponder {
5290                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5291                                tx_id: header.tx_id,
5292                            },
5293                        })
5294                    }
5295                    _ if header.tx_id == 0
5296                        && header
5297                            .dynamic_flags()
5298                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5299                    {
5300                        Ok(DataRouterRequest::_UnknownMethod {
5301                            ordinal: header.ordinal,
5302                            control_handle: DataRouterControlHandle { inner: this.inner.clone() },
5303                            method_type: fidl::MethodType::OneWay,
5304                        })
5305                    }
5306                    _ if header
5307                        .dynamic_flags()
5308                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5309                    {
5310                        this.inner.send_framework_err(
5311                            fidl::encoding::FrameworkErr::UnknownMethod,
5312                            header.tx_id,
5313                            header.ordinal,
5314                            header.dynamic_flags(),
5315                            (bytes, handles),
5316                        )?;
5317                        Ok(DataRouterRequest::_UnknownMethod {
5318                            ordinal: header.ordinal,
5319                            control_handle: DataRouterControlHandle { inner: this.inner.clone() },
5320                            method_type: fidl::MethodType::TwoWay,
5321                        })
5322                    }
5323                    _ => Err(fidl::Error::UnknownOrdinal {
5324                        ordinal: header.ordinal,
5325                        protocol_name:
5326                            <DataRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5327                    }),
5328                }))
5329            },
5330        )
5331    }
5332}
5333
5334#[derive(Debug)]
5335pub enum DataRouterRequest {
5336    Route {
5337        payload: RouteRequest,
5338        responder: DataRouterRouteResponder,
5339    },
5340    /// An interaction was received which does not match any known method.
5341    #[non_exhaustive]
5342    _UnknownMethod {
5343        /// Ordinal of the method that was called.
5344        ordinal: u64,
5345        control_handle: DataRouterControlHandle,
5346        method_type: fidl::MethodType,
5347    },
5348}
5349
5350impl DataRouterRequest {
5351    #[allow(irrefutable_let_patterns)]
5352    pub fn into_route(self) -> Option<(RouteRequest, DataRouterRouteResponder)> {
5353        if let DataRouterRequest::Route { payload, responder } = self {
5354            Some((payload, responder))
5355        } else {
5356            None
5357        }
5358    }
5359
5360    /// Name of the method defined in FIDL
5361    pub fn method_name(&self) -> &'static str {
5362        match *self {
5363            DataRouterRequest::Route { .. } => "route",
5364            DataRouterRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
5365                "unknown one-way method"
5366            }
5367            DataRouterRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
5368                "unknown two-way method"
5369            }
5370        }
5371    }
5372}
5373
5374#[derive(Debug, Clone)]
5375pub struct DataRouterControlHandle {
5376    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5377}
5378
5379impl fidl::endpoints::ControlHandle for DataRouterControlHandle {
5380    fn shutdown(&self) {
5381        self.inner.shutdown()
5382    }
5383    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
5384        self.inner.shutdown_with_epitaph(status)
5385    }
5386
5387    fn is_closed(&self) -> bool {
5388        self.inner.channel().is_closed()
5389    }
5390    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
5391        self.inner.channel().on_closed()
5392    }
5393
5394    #[cfg(target_os = "fuchsia")]
5395    fn signal_peer(
5396        &self,
5397        clear_mask: zx::Signals,
5398        set_mask: zx::Signals,
5399    ) -> Result<(), zx_status::Status> {
5400        use fidl::Peered;
5401        self.inner.channel().signal_peer(clear_mask, set_mask)
5402    }
5403}
5404
5405impl DataRouterControlHandle {}
5406
5407#[must_use = "FIDL methods require a response to be sent"]
5408#[derive(Debug)]
5409pub struct DataRouterRouteResponder {
5410    control_handle: std::mem::ManuallyDrop<DataRouterControlHandle>,
5411    tx_id: u32,
5412}
5413
5414/// Set the the channel to be shutdown (see [`DataRouterControlHandle::shutdown`])
5415/// if the responder is dropped without sending a response, so that the client
5416/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5417impl std::ops::Drop for DataRouterRouteResponder {
5418    fn drop(&mut self) {
5419        self.control_handle.shutdown();
5420        // Safety: drops once, never accessed again
5421        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5422    }
5423}
5424
5425impl fidl::endpoints::Responder for DataRouterRouteResponder {
5426    type ControlHandle = DataRouterControlHandle;
5427
5428    fn control_handle(&self) -> &DataRouterControlHandle {
5429        &self.control_handle
5430    }
5431
5432    fn drop_without_shutdown(mut self) {
5433        // Safety: drops once, never accessed again due to mem::forget
5434        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5435        // Prevent Drop from running (which would shut down the channel)
5436        std::mem::forget(self);
5437    }
5438}
5439
5440impl DataRouterRouteResponder {
5441    /// Sends a response to the FIDL transaction.
5442    ///
5443    /// Sets the channel to shutdown if an error occurs.
5444    pub fn send(
5445        self,
5446        mut result: Result<DataRouterRouteResponse, RouterError>,
5447    ) -> Result<(), fidl::Error> {
5448        let _result = self.send_raw(result);
5449        if _result.is_err() {
5450            self.control_handle.shutdown();
5451        }
5452        self.drop_without_shutdown();
5453        _result
5454    }
5455
5456    /// Similar to "send" but does not shutdown the channel if an error occurs.
5457    pub fn send_no_shutdown_on_err(
5458        self,
5459        mut result: Result<DataRouterRouteResponse, RouterError>,
5460    ) -> Result<(), fidl::Error> {
5461        let _result = self.send_raw(result);
5462        self.drop_without_shutdown();
5463        _result
5464    }
5465
5466    fn send_raw(
5467        &self,
5468        mut result: Result<DataRouterRouteResponse, RouterError>,
5469    ) -> Result<(), fidl::Error> {
5470        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
5471            DataRouterRouteResponse,
5472            RouterError,
5473        >>(
5474            fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
5475            self.tx_id,
5476            0x2e87dc44dfc53804,
5477            fidl::encoding::DynamicFlags::FLEXIBLE,
5478        )
5479    }
5480}
5481
5482#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5483pub struct DictionaryMarker;
5484
5485impl fidl::endpoints::ProtocolMarker for DictionaryMarker {
5486    type Proxy = DictionaryProxy;
5487    type RequestStream = DictionaryRequestStream;
5488    #[cfg(target_os = "fuchsia")]
5489    type SynchronousProxy = DictionarySynchronousProxy;
5490
5491    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.Dictionary";
5492}
5493impl fidl::endpoints::DiscoverableProtocolMarker for DictionaryMarker {}
5494
5495pub trait DictionaryProxyInterface: Send + Sync {}
5496#[derive(Debug)]
5497#[cfg(target_os = "fuchsia")]
5498pub struct DictionarySynchronousProxy {
5499    client: fidl::client::sync::Client,
5500}
5501
5502#[cfg(target_os = "fuchsia")]
5503impl fidl::endpoints::SynchronousProxy for DictionarySynchronousProxy {
5504    type Proxy = DictionaryProxy;
5505    type Protocol = DictionaryMarker;
5506
5507    fn from_channel(inner: fidl::Channel) -> Self {
5508        Self::new(inner)
5509    }
5510
5511    fn into_channel(self) -> fidl::Channel {
5512        self.client.into_channel()
5513    }
5514
5515    fn as_channel(&self) -> &fidl::Channel {
5516        self.client.as_channel()
5517    }
5518}
5519
5520#[cfg(target_os = "fuchsia")]
5521impl DictionarySynchronousProxy {
5522    pub fn new(channel: fidl::Channel) -> Self {
5523        let protocol_name = <DictionaryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5524        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
5525    }
5526
5527    pub fn into_channel(self) -> fidl::Channel {
5528        self.client.into_channel()
5529    }
5530
5531    /// Waits until an event arrives and returns it. It is safe for other
5532    /// threads to make concurrent requests while waiting for an event.
5533    pub fn wait_for_event(
5534        &self,
5535        deadline: zx::MonotonicInstant,
5536    ) -> Result<DictionaryEvent, fidl::Error> {
5537        DictionaryEvent::decode(self.client.wait_for_event(deadline)?)
5538    }
5539}
5540
5541#[cfg(target_os = "fuchsia")]
5542impl From<DictionarySynchronousProxy> for zx::Handle {
5543    fn from(value: DictionarySynchronousProxy) -> Self {
5544        value.into_channel().into()
5545    }
5546}
5547
5548#[cfg(target_os = "fuchsia")]
5549impl From<fidl::Channel> for DictionarySynchronousProxy {
5550    fn from(value: fidl::Channel) -> Self {
5551        Self::new(value)
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#[derive(Debug, Clone)]
5944pub struct DictionaryDrainIteratorProxy {
5945    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
5946}
5947
5948impl fidl::endpoints::Proxy for DictionaryDrainIteratorProxy {
5949    type Protocol = DictionaryDrainIteratorMarker;
5950
5951    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
5952        Self::new(inner)
5953    }
5954
5955    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
5956        self.client.into_channel().map_err(|client| Self { client })
5957    }
5958
5959    fn as_channel(&self) -> &::fidl::AsyncChannel {
5960        self.client.as_channel()
5961    }
5962}
5963
5964impl DictionaryDrainIteratorProxy {
5965    /// Create a new Proxy for fuchsia.component.sandbox/DictionaryDrainIterator.
5966    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5967        let protocol_name =
5968            <DictionaryDrainIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5969        Self { client: fidl::client::Client::new(channel, protocol_name) }
5970    }
5971
5972    /// Get a Stream of events from the remote end of the protocol.
5973    ///
5974    /// # Panics
5975    ///
5976    /// Panics if the event stream was already taken.
5977    pub fn take_event_stream(&self) -> DictionaryDrainIteratorEventStream {
5978        DictionaryDrainIteratorEventStream { event_receiver: self.client.take_event_receiver() }
5979    }
5980
5981    /// Returns the next batch of results for a [Dictionary.Drain] call, returning up to
5982    /// `limit` results. `limit` can be at most [MAX_DICTIONARY_ITERATOR_CHUNK].
5983    ///
5984    /// Each returned capability will be assigned a monotonically increasing [CapabilityId] starting
5985    /// from `start_id`.
5986    ///
5987    /// In addition to the `items`, returns `end_id`, which is one more than the highest id reserved
5988    /// by [GetNext]. `end_id` can be used as the `start_id` for the next call to [GetNext].
5989    ///
5990    /// If [GetNext] returns an error, the server will also close the channel.
5991    ///
5992    /// Errors:
5993    ///
5994    /// - `ID_ALREADY_EXISTS` if some id in the range `[start_id, limit)` already exists in this
5995    ///   store.
5996    /// - `INVALID_ARGS` if `limit` was `0` or greater than `MAX_DICTIONARY_ITERATOR_CHUNK`.
5997    pub fn r#get_next(
5998        &self,
5999        mut start_id: u64,
6000        mut limit: u32,
6001    ) -> fidl::client::QueryResponseFut<
6002        DictionaryDrainIteratorGetNextResult,
6003        fidl::encoding::DefaultFuchsiaResourceDialect,
6004    > {
6005        DictionaryDrainIteratorProxyInterface::r#get_next(self, start_id, limit)
6006    }
6007}
6008
6009impl DictionaryDrainIteratorProxyInterface for DictionaryDrainIteratorProxy {
6010    type GetNextResponseFut = fidl::client::QueryResponseFut<
6011        DictionaryDrainIteratorGetNextResult,
6012        fidl::encoding::DefaultFuchsiaResourceDialect,
6013    >;
6014    fn r#get_next(&self, mut start_id: u64, mut limit: u32) -> Self::GetNextResponseFut {
6015        fn _decode(
6016            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6017        ) -> Result<DictionaryDrainIteratorGetNextResult, fidl::Error> {
6018            let _response = fidl::client::decode_transaction_body::<
6019                fidl::encoding::FlexibleResultType<
6020                    DictionaryDrainIteratorGetNextResponse,
6021                    CapabilityStoreError,
6022                >,
6023                fidl::encoding::DefaultFuchsiaResourceDialect,
6024                0x4f8082ca1ee26061,
6025            >(_buf?)?
6026            .into_result::<DictionaryDrainIteratorMarker>("get_next")?;
6027            Ok(_response.map(|x| (x.items, x.end_id)))
6028        }
6029        self.client.send_query_and_decode::<
6030            DictionaryDrainIteratorGetNextRequest,
6031            DictionaryDrainIteratorGetNextResult,
6032        >(
6033            (start_id, limit,),
6034            0x4f8082ca1ee26061,
6035            fidl::encoding::DynamicFlags::FLEXIBLE,
6036            _decode,
6037        )
6038    }
6039}
6040
6041pub struct DictionaryDrainIteratorEventStream {
6042    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6043}
6044
6045impl std::marker::Unpin for DictionaryDrainIteratorEventStream {}
6046
6047impl futures::stream::FusedStream for DictionaryDrainIteratorEventStream {
6048    fn is_terminated(&self) -> bool {
6049        self.event_receiver.is_terminated()
6050    }
6051}
6052
6053impl futures::Stream for DictionaryDrainIteratorEventStream {
6054    type Item = Result<DictionaryDrainIteratorEvent, fidl::Error>;
6055
6056    fn poll_next(
6057        mut self: std::pin::Pin<&mut Self>,
6058        cx: &mut std::task::Context<'_>,
6059    ) -> std::task::Poll<Option<Self::Item>> {
6060        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6061            &mut self.event_receiver,
6062            cx
6063        )?) {
6064            Some(buf) => std::task::Poll::Ready(Some(DictionaryDrainIteratorEvent::decode(buf))),
6065            None => std::task::Poll::Ready(None),
6066        }
6067    }
6068}
6069
6070#[derive(Debug)]
6071pub enum DictionaryDrainIteratorEvent {
6072    #[non_exhaustive]
6073    _UnknownEvent {
6074        /// Ordinal of the event that was sent.
6075        ordinal: u64,
6076    },
6077}
6078
6079impl DictionaryDrainIteratorEvent {
6080    /// Decodes a message buffer as a [`DictionaryDrainIteratorEvent`].
6081    fn decode(
6082        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6083    ) -> Result<DictionaryDrainIteratorEvent, fidl::Error> {
6084        let (bytes, _handles) = buf.split_mut();
6085        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6086        debug_assert_eq!(tx_header.tx_id, 0);
6087        match tx_header.ordinal {
6088            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6089                Ok(DictionaryDrainIteratorEvent::_UnknownEvent { ordinal: tx_header.ordinal })
6090            }
6091            _ => Err(fidl::Error::UnknownOrdinal {
6092                ordinal: tx_header.ordinal,
6093                protocol_name:
6094                    <DictionaryDrainIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6095            }),
6096        }
6097    }
6098}
6099
6100/// A Stream of incoming requests for fuchsia.component.sandbox/DictionaryDrainIterator.
6101pub struct DictionaryDrainIteratorRequestStream {
6102    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6103    is_terminated: bool,
6104}
6105
6106impl std::marker::Unpin for DictionaryDrainIteratorRequestStream {}
6107
6108impl futures::stream::FusedStream for DictionaryDrainIteratorRequestStream {
6109    fn is_terminated(&self) -> bool {
6110        self.is_terminated
6111    }
6112}
6113
6114impl fidl::endpoints::RequestStream for DictionaryDrainIteratorRequestStream {
6115    type Protocol = DictionaryDrainIteratorMarker;
6116    type ControlHandle = DictionaryDrainIteratorControlHandle;
6117
6118    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6119        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6120    }
6121
6122    fn control_handle(&self) -> Self::ControlHandle {
6123        DictionaryDrainIteratorControlHandle { inner: self.inner.clone() }
6124    }
6125
6126    fn into_inner(
6127        self,
6128    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6129    {
6130        (self.inner, self.is_terminated)
6131    }
6132
6133    fn from_inner(
6134        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6135        is_terminated: bool,
6136    ) -> Self {
6137        Self { inner, is_terminated }
6138    }
6139}
6140
6141impl futures::Stream for DictionaryDrainIteratorRequestStream {
6142    type Item = Result<DictionaryDrainIteratorRequest, fidl::Error>;
6143
6144    fn poll_next(
6145        mut self: std::pin::Pin<&mut Self>,
6146        cx: &mut std::task::Context<'_>,
6147    ) -> std::task::Poll<Option<Self::Item>> {
6148        let this = &mut *self;
6149        if this.inner.check_shutdown(cx) {
6150            this.is_terminated = true;
6151            return std::task::Poll::Ready(None);
6152        }
6153        if this.is_terminated {
6154            panic!("polled DictionaryDrainIteratorRequestStream after completion");
6155        }
6156        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
6157            |bytes, handles| {
6158                match this.inner.channel().read_etc(cx, bytes, handles) {
6159                    std::task::Poll::Ready(Ok(())) => {}
6160                    std::task::Poll::Pending => return std::task::Poll::Pending,
6161                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
6162                        this.is_terminated = true;
6163                        return std::task::Poll::Ready(None);
6164                    }
6165                    std::task::Poll::Ready(Err(e)) => {
6166                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6167                            e.into(),
6168                        ))))
6169                    }
6170                }
6171
6172                // A message has been received from the channel
6173                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6174
6175                std::task::Poll::Ready(Some(match header.ordinal {
6176                0x4f8082ca1ee26061 => {
6177                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6178                    let mut req = fidl::new_empty!(DictionaryDrainIteratorGetNextRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
6179                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DictionaryDrainIteratorGetNextRequest>(&header, _body_bytes, handles, &mut req)?;
6180                    let control_handle = DictionaryDrainIteratorControlHandle {
6181                        inner: this.inner.clone(),
6182                    };
6183                    Ok(DictionaryDrainIteratorRequest::GetNext {start_id: req.start_id,
6184limit: req.limit,
6185
6186                        responder: DictionaryDrainIteratorGetNextResponder {
6187                            control_handle: std::mem::ManuallyDrop::new(control_handle),
6188                            tx_id: header.tx_id,
6189                        },
6190                    })
6191                }
6192                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6193                    Ok(DictionaryDrainIteratorRequest::_UnknownMethod {
6194                        ordinal: header.ordinal,
6195                        control_handle: DictionaryDrainIteratorControlHandle { inner: this.inner.clone() },
6196                        method_type: fidl::MethodType::OneWay,
6197                    })
6198                }
6199                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6200                    this.inner.send_framework_err(
6201                        fidl::encoding::FrameworkErr::UnknownMethod,
6202                        header.tx_id,
6203                        header.ordinal,
6204                        header.dynamic_flags(),
6205                        (bytes, handles),
6206                    )?;
6207                    Ok(DictionaryDrainIteratorRequest::_UnknownMethod {
6208                        ordinal: header.ordinal,
6209                        control_handle: DictionaryDrainIteratorControlHandle { inner: this.inner.clone() },
6210                        method_type: fidl::MethodType::TwoWay,
6211                    })
6212                }
6213                _ => Err(fidl::Error::UnknownOrdinal {
6214                    ordinal: header.ordinal,
6215                    protocol_name: <DictionaryDrainIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6216                }),
6217            }))
6218            },
6219        )
6220    }
6221}
6222
6223#[derive(Debug)]
6224pub enum DictionaryDrainIteratorRequest {
6225    /// Returns the next batch of results for a [Dictionary.Drain] call, returning up to
6226    /// `limit` results. `limit` can be at most [MAX_DICTIONARY_ITERATOR_CHUNK].
6227    ///
6228    /// Each returned capability will be assigned a monotonically increasing [CapabilityId] starting
6229    /// from `start_id`.
6230    ///
6231    /// In addition to the `items`, returns `end_id`, which is one more than the highest id reserved
6232    /// by [GetNext]. `end_id` can be used as the `start_id` for the next call to [GetNext].
6233    ///
6234    /// If [GetNext] returns an error, the server will also close the channel.
6235    ///
6236    /// Errors:
6237    ///
6238    /// - `ID_ALREADY_EXISTS` if some id in the range `[start_id, limit)` already exists in this
6239    ///   store.
6240    /// - `INVALID_ARGS` if `limit` was `0` or greater than `MAX_DICTIONARY_ITERATOR_CHUNK`.
6241    GetNext { start_id: u64, limit: u32, responder: DictionaryDrainIteratorGetNextResponder },
6242    /// An interaction was received which does not match any known method.
6243    #[non_exhaustive]
6244    _UnknownMethod {
6245        /// Ordinal of the method that was called.
6246        ordinal: u64,
6247        control_handle: DictionaryDrainIteratorControlHandle,
6248        method_type: fidl::MethodType,
6249    },
6250}
6251
6252impl DictionaryDrainIteratorRequest {
6253    #[allow(irrefutable_let_patterns)]
6254    pub fn into_get_next(self) -> Option<(u64, u32, DictionaryDrainIteratorGetNextResponder)> {
6255        if let DictionaryDrainIteratorRequest::GetNext { start_id, limit, responder } = self {
6256            Some((start_id, limit, responder))
6257        } else {
6258            None
6259        }
6260    }
6261
6262    /// Name of the method defined in FIDL
6263    pub fn method_name(&self) -> &'static str {
6264        match *self {
6265            DictionaryDrainIteratorRequest::GetNext { .. } => "get_next",
6266            DictionaryDrainIteratorRequest::_UnknownMethod {
6267                method_type: fidl::MethodType::OneWay,
6268                ..
6269            } => "unknown one-way method",
6270            DictionaryDrainIteratorRequest::_UnknownMethod {
6271                method_type: fidl::MethodType::TwoWay,
6272                ..
6273            } => "unknown two-way method",
6274        }
6275    }
6276}
6277
6278#[derive(Debug, Clone)]
6279pub struct DictionaryDrainIteratorControlHandle {
6280    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6281}
6282
6283impl fidl::endpoints::ControlHandle for DictionaryDrainIteratorControlHandle {
6284    fn shutdown(&self) {
6285        self.inner.shutdown()
6286    }
6287    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
6288        self.inner.shutdown_with_epitaph(status)
6289    }
6290
6291    fn is_closed(&self) -> bool {
6292        self.inner.channel().is_closed()
6293    }
6294    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6295        self.inner.channel().on_closed()
6296    }
6297
6298    #[cfg(target_os = "fuchsia")]
6299    fn signal_peer(
6300        &self,
6301        clear_mask: zx::Signals,
6302        set_mask: zx::Signals,
6303    ) -> Result<(), zx_status::Status> {
6304        use fidl::Peered;
6305        self.inner.channel().signal_peer(clear_mask, set_mask)
6306    }
6307}
6308
6309impl DictionaryDrainIteratorControlHandle {}
6310
6311#[must_use = "FIDL methods require a response to be sent"]
6312#[derive(Debug)]
6313pub struct DictionaryDrainIteratorGetNextResponder {
6314    control_handle: std::mem::ManuallyDrop<DictionaryDrainIteratorControlHandle>,
6315    tx_id: u32,
6316}
6317
6318/// Set the the channel to be shutdown (see [`DictionaryDrainIteratorControlHandle::shutdown`])
6319/// if the responder is dropped without sending a response, so that the client
6320/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6321impl std::ops::Drop for DictionaryDrainIteratorGetNextResponder {
6322    fn drop(&mut self) {
6323        self.control_handle.shutdown();
6324        // Safety: drops once, never accessed again
6325        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6326    }
6327}
6328
6329impl fidl::endpoints::Responder for DictionaryDrainIteratorGetNextResponder {
6330    type ControlHandle = DictionaryDrainIteratorControlHandle;
6331
6332    fn control_handle(&self) -> &DictionaryDrainIteratorControlHandle {
6333        &self.control_handle
6334    }
6335
6336    fn drop_without_shutdown(mut self) {
6337        // Safety: drops once, never accessed again due to mem::forget
6338        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6339        // Prevent Drop from running (which would shut down the channel)
6340        std::mem::forget(self);
6341    }
6342}
6343
6344impl DictionaryDrainIteratorGetNextResponder {
6345    /// Sends a response to the FIDL transaction.
6346    ///
6347    /// Sets the channel to shutdown if an error occurs.
6348    pub fn send(
6349        self,
6350        mut result: Result<(&[DictionaryItem], u64), CapabilityStoreError>,
6351    ) -> Result<(), fidl::Error> {
6352        let _result = self.send_raw(result);
6353        if _result.is_err() {
6354            self.control_handle.shutdown();
6355        }
6356        self.drop_without_shutdown();
6357        _result
6358    }
6359
6360    /// Similar to "send" but does not shutdown the channel if an error occurs.
6361    pub fn send_no_shutdown_on_err(
6362        self,
6363        mut result: Result<(&[DictionaryItem], u64), CapabilityStoreError>,
6364    ) -> Result<(), fidl::Error> {
6365        let _result = self.send_raw(result);
6366        self.drop_without_shutdown();
6367        _result
6368    }
6369
6370    fn send_raw(
6371        &self,
6372        mut result: Result<(&[DictionaryItem], u64), CapabilityStoreError>,
6373    ) -> Result<(), fidl::Error> {
6374        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
6375            DictionaryDrainIteratorGetNextResponse,
6376            CapabilityStoreError,
6377        >>(
6378            fidl::encoding::FlexibleResult::new(result),
6379            self.tx_id,
6380            0x4f8082ca1ee26061,
6381            fidl::encoding::DynamicFlags::FLEXIBLE,
6382        )
6383    }
6384}
6385
6386#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6387pub struct DictionaryEnumerateIteratorMarker;
6388
6389impl fidl::endpoints::ProtocolMarker for DictionaryEnumerateIteratorMarker {
6390    type Proxy = DictionaryEnumerateIteratorProxy;
6391    type RequestStream = DictionaryEnumerateIteratorRequestStream;
6392    #[cfg(target_os = "fuchsia")]
6393    type SynchronousProxy = DictionaryEnumerateIteratorSynchronousProxy;
6394
6395    const DEBUG_NAME: &'static str = "(anonymous) DictionaryEnumerateIterator";
6396}
6397pub type DictionaryEnumerateIteratorGetNextResult =
6398    Result<(Vec<DictionaryOptionalItem>, u64), CapabilityStoreError>;
6399
6400pub trait DictionaryEnumerateIteratorProxyInterface: Send + Sync {
6401    type GetNextResponseFut: std::future::Future<Output = Result<DictionaryEnumerateIteratorGetNextResult, fidl::Error>>
6402        + Send;
6403    fn r#get_next(&self, start_id: u64, limit: u32) -> Self::GetNextResponseFut;
6404}
6405#[derive(Debug)]
6406#[cfg(target_os = "fuchsia")]
6407pub struct DictionaryEnumerateIteratorSynchronousProxy {
6408    client: fidl::client::sync::Client,
6409}
6410
6411#[cfg(target_os = "fuchsia")]
6412impl fidl::endpoints::SynchronousProxy for DictionaryEnumerateIteratorSynchronousProxy {
6413    type Proxy = DictionaryEnumerateIteratorProxy;
6414    type Protocol = DictionaryEnumerateIteratorMarker;
6415
6416    fn from_channel(inner: fidl::Channel) -> Self {
6417        Self::new(inner)
6418    }
6419
6420    fn into_channel(self) -> fidl::Channel {
6421        self.client.into_channel()
6422    }
6423
6424    fn as_channel(&self) -> &fidl::Channel {
6425        self.client.as_channel()
6426    }
6427}
6428
6429#[cfg(target_os = "fuchsia")]
6430impl DictionaryEnumerateIteratorSynchronousProxy {
6431    pub fn new(channel: fidl::Channel) -> Self {
6432        let protocol_name =
6433            <DictionaryEnumerateIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6434        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
6435    }
6436
6437    pub fn into_channel(self) -> fidl::Channel {
6438        self.client.into_channel()
6439    }
6440
6441    /// Waits until an event arrives and returns it. It is safe for other
6442    /// threads to make concurrent requests while waiting for an event.
6443    pub fn wait_for_event(
6444        &self,
6445        deadline: zx::MonotonicInstant,
6446    ) -> Result<DictionaryEnumerateIteratorEvent, fidl::Error> {
6447        DictionaryEnumerateIteratorEvent::decode(self.client.wait_for_event(deadline)?)
6448    }
6449
6450    /// Returns the next batch of results for a [Dictionary.Enumerate] call, returning up to
6451    /// `limit` results. `limit` can be at most [MAX_DICTIONARY_ITERATOR_CHUNK].
6452    ///
6453    /// The value of each of `items` is a duplicate of the original capability
6454    /// ([CapabilityStore.Duplicate]), unless it could not be duplicated, it which case it will
6455    /// be null.
6456    ///
6457    /// Each returned capability will be assigned a monotonically increasing [CapabilityId] starting
6458    /// from `start_id`.
6459    ///
6460    /// In addition to the `items`, returns `end_id`, which is one more than the highest id reserved
6461    /// by [GetNext]. `end_id` can be used as the `start_id` for the next call to [GetNext].
6462    ///
6463    /// If [GetNext] returns an error, the server will also close the channel.
6464    ///
6465    /// Errors:
6466    ///
6467    /// - `ID_ALREADY_EXISTS` if some id in the range `[start_id, limit)` already exists in this
6468    ///   store.
6469    /// - `INVALID_ARGS` if `limit` was `0` or greater than `MAX_DICTIONARY_ITERATOR_CHUNK`.
6470    pub fn r#get_next(
6471        &self,
6472        mut start_id: u64,
6473        mut limit: u32,
6474        ___deadline: zx::MonotonicInstant,
6475    ) -> Result<DictionaryEnumerateIteratorGetNextResult, fidl::Error> {
6476        let _response = self.client.send_query::<
6477            DictionaryEnumerateIteratorGetNextRequest,
6478            fidl::encoding::FlexibleResultType<DictionaryEnumerateIteratorGetNextResponse, CapabilityStoreError>,
6479        >(
6480            (start_id, limit,),
6481            0x14f8bc286512f5cf,
6482            fidl::encoding::DynamicFlags::FLEXIBLE,
6483            ___deadline,
6484        )?
6485        .into_result::<DictionaryEnumerateIteratorMarker>("get_next")?;
6486        Ok(_response.map(|x| (x.items, x.end_id)))
6487    }
6488}
6489
6490#[cfg(target_os = "fuchsia")]
6491impl From<DictionaryEnumerateIteratorSynchronousProxy> for zx::Handle {
6492    fn from(value: DictionaryEnumerateIteratorSynchronousProxy) -> Self {
6493        value.into_channel().into()
6494    }
6495}
6496
6497#[cfg(target_os = "fuchsia")]
6498impl From<fidl::Channel> for DictionaryEnumerateIteratorSynchronousProxy {
6499    fn from(value: fidl::Channel) -> Self {
6500        Self::new(value)
6501    }
6502}
6503
6504#[derive(Debug, Clone)]
6505pub struct DictionaryEnumerateIteratorProxy {
6506    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6507}
6508
6509impl fidl::endpoints::Proxy for DictionaryEnumerateIteratorProxy {
6510    type Protocol = DictionaryEnumerateIteratorMarker;
6511
6512    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6513        Self::new(inner)
6514    }
6515
6516    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6517        self.client.into_channel().map_err(|client| Self { client })
6518    }
6519
6520    fn as_channel(&self) -> &::fidl::AsyncChannel {
6521        self.client.as_channel()
6522    }
6523}
6524
6525impl DictionaryEnumerateIteratorProxy {
6526    /// Create a new Proxy for fuchsia.component.sandbox/DictionaryEnumerateIterator.
6527    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6528        let protocol_name =
6529            <DictionaryEnumerateIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6530        Self { client: fidl::client::Client::new(channel, protocol_name) }
6531    }
6532
6533    /// Get a Stream of events from the remote end of the protocol.
6534    ///
6535    /// # Panics
6536    ///
6537    /// Panics if the event stream was already taken.
6538    pub fn take_event_stream(&self) -> DictionaryEnumerateIteratorEventStream {
6539        DictionaryEnumerateIteratorEventStream { event_receiver: self.client.take_event_receiver() }
6540    }
6541
6542    /// Returns the next batch of results for a [Dictionary.Enumerate] call, returning up to
6543    /// `limit` results. `limit` can be at most [MAX_DICTIONARY_ITERATOR_CHUNK].
6544    ///
6545    /// The value of each of `items` is a duplicate of the original capability
6546    /// ([CapabilityStore.Duplicate]), unless it could not be duplicated, it which case it will
6547    /// be null.
6548    ///
6549    /// Each returned capability will be assigned a monotonically increasing [CapabilityId] starting
6550    /// from `start_id`.
6551    ///
6552    /// In addition to the `items`, returns `end_id`, which is one more than the highest id reserved
6553    /// by [GetNext]. `end_id` can be used as the `start_id` for the next call to [GetNext].
6554    ///
6555    /// If [GetNext] returns an error, the server will also close the channel.
6556    ///
6557    /// Errors:
6558    ///
6559    /// - `ID_ALREADY_EXISTS` if some id in the range `[start_id, limit)` already exists in this
6560    ///   store.
6561    /// - `INVALID_ARGS` if `limit` was `0` or greater than `MAX_DICTIONARY_ITERATOR_CHUNK`.
6562    pub fn r#get_next(
6563        &self,
6564        mut start_id: u64,
6565        mut limit: u32,
6566    ) -> fidl::client::QueryResponseFut<
6567        DictionaryEnumerateIteratorGetNextResult,
6568        fidl::encoding::DefaultFuchsiaResourceDialect,
6569    > {
6570        DictionaryEnumerateIteratorProxyInterface::r#get_next(self, start_id, limit)
6571    }
6572}
6573
6574impl DictionaryEnumerateIteratorProxyInterface for DictionaryEnumerateIteratorProxy {
6575    type GetNextResponseFut = fidl::client::QueryResponseFut<
6576        DictionaryEnumerateIteratorGetNextResult,
6577        fidl::encoding::DefaultFuchsiaResourceDialect,
6578    >;
6579    fn r#get_next(&self, mut start_id: u64, mut limit: u32) -> Self::GetNextResponseFut {
6580        fn _decode(
6581            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6582        ) -> Result<DictionaryEnumerateIteratorGetNextResult, fidl::Error> {
6583            let _response = fidl::client::decode_transaction_body::<
6584                fidl::encoding::FlexibleResultType<
6585                    DictionaryEnumerateIteratorGetNextResponse,
6586                    CapabilityStoreError,
6587                >,
6588                fidl::encoding::DefaultFuchsiaResourceDialect,
6589                0x14f8bc286512f5cf,
6590            >(_buf?)?
6591            .into_result::<DictionaryEnumerateIteratorMarker>("get_next")?;
6592            Ok(_response.map(|x| (x.items, x.end_id)))
6593        }
6594        self.client.send_query_and_decode::<
6595            DictionaryEnumerateIteratorGetNextRequest,
6596            DictionaryEnumerateIteratorGetNextResult,
6597        >(
6598            (start_id, limit,),
6599            0x14f8bc286512f5cf,
6600            fidl::encoding::DynamicFlags::FLEXIBLE,
6601            _decode,
6602        )
6603    }
6604}
6605
6606pub struct DictionaryEnumerateIteratorEventStream {
6607    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6608}
6609
6610impl std::marker::Unpin for DictionaryEnumerateIteratorEventStream {}
6611
6612impl futures::stream::FusedStream for DictionaryEnumerateIteratorEventStream {
6613    fn is_terminated(&self) -> bool {
6614        self.event_receiver.is_terminated()
6615    }
6616}
6617
6618impl futures::Stream for DictionaryEnumerateIteratorEventStream {
6619    type Item = Result<DictionaryEnumerateIteratorEvent, fidl::Error>;
6620
6621    fn poll_next(
6622        mut self: std::pin::Pin<&mut Self>,
6623        cx: &mut std::task::Context<'_>,
6624    ) -> std::task::Poll<Option<Self::Item>> {
6625        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6626            &mut self.event_receiver,
6627            cx
6628        )?) {
6629            Some(buf) => {
6630                std::task::Poll::Ready(Some(DictionaryEnumerateIteratorEvent::decode(buf)))
6631            }
6632            None => std::task::Poll::Ready(None),
6633        }
6634    }
6635}
6636
6637#[derive(Debug)]
6638pub enum DictionaryEnumerateIteratorEvent {
6639    #[non_exhaustive]
6640    _UnknownEvent {
6641        /// Ordinal of the event that was sent.
6642        ordinal: u64,
6643    },
6644}
6645
6646impl DictionaryEnumerateIteratorEvent {
6647    /// Decodes a message buffer as a [`DictionaryEnumerateIteratorEvent`].
6648    fn decode(
6649        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6650    ) -> Result<DictionaryEnumerateIteratorEvent, fidl::Error> {
6651        let (bytes, _handles) = buf.split_mut();
6652        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6653        debug_assert_eq!(tx_header.tx_id, 0);
6654        match tx_header.ordinal {
6655            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6656                Ok(DictionaryEnumerateIteratorEvent::_UnknownEvent {
6657                    ordinal: tx_header.ordinal,
6658                })
6659            }
6660            _ => Err(fidl::Error::UnknownOrdinal {
6661                ordinal: tx_header.ordinal,
6662                protocol_name: <DictionaryEnumerateIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6663            })
6664        }
6665    }
6666}
6667
6668/// A Stream of incoming requests for fuchsia.component.sandbox/DictionaryEnumerateIterator.
6669pub struct DictionaryEnumerateIteratorRequestStream {
6670    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6671    is_terminated: bool,
6672}
6673
6674impl std::marker::Unpin for DictionaryEnumerateIteratorRequestStream {}
6675
6676impl futures::stream::FusedStream for DictionaryEnumerateIteratorRequestStream {
6677    fn is_terminated(&self) -> bool {
6678        self.is_terminated
6679    }
6680}
6681
6682impl fidl::endpoints::RequestStream for DictionaryEnumerateIteratorRequestStream {
6683    type Protocol = DictionaryEnumerateIteratorMarker;
6684    type ControlHandle = DictionaryEnumerateIteratorControlHandle;
6685
6686    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6687        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6688    }
6689
6690    fn control_handle(&self) -> Self::ControlHandle {
6691        DictionaryEnumerateIteratorControlHandle { inner: self.inner.clone() }
6692    }
6693
6694    fn into_inner(
6695        self,
6696    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6697    {
6698        (self.inner, self.is_terminated)
6699    }
6700
6701    fn from_inner(
6702        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6703        is_terminated: bool,
6704    ) -> Self {
6705        Self { inner, is_terminated }
6706    }
6707}
6708
6709impl futures::Stream for DictionaryEnumerateIteratorRequestStream {
6710    type Item = Result<DictionaryEnumerateIteratorRequest, fidl::Error>;
6711
6712    fn poll_next(
6713        mut self: std::pin::Pin<&mut Self>,
6714        cx: &mut std::task::Context<'_>,
6715    ) -> std::task::Poll<Option<Self::Item>> {
6716        let this = &mut *self;
6717        if this.inner.check_shutdown(cx) {
6718            this.is_terminated = true;
6719            return std::task::Poll::Ready(None);
6720        }
6721        if this.is_terminated {
6722            panic!("polled DictionaryEnumerateIteratorRequestStream after completion");
6723        }
6724        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
6725            |bytes, handles| {
6726                match this.inner.channel().read_etc(cx, bytes, handles) {
6727                    std::task::Poll::Ready(Ok(())) => {}
6728                    std::task::Poll::Pending => return std::task::Poll::Pending,
6729                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
6730                        this.is_terminated = true;
6731                        return std::task::Poll::Ready(None);
6732                    }
6733                    std::task::Poll::Ready(Err(e)) => {
6734                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6735                            e.into(),
6736                        ))))
6737                    }
6738                }
6739
6740                // A message has been received from the channel
6741                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6742
6743                std::task::Poll::Ready(Some(match header.ordinal {
6744                0x14f8bc286512f5cf => {
6745                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6746                    let mut req = fidl::new_empty!(DictionaryEnumerateIteratorGetNextRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
6747                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DictionaryEnumerateIteratorGetNextRequest>(&header, _body_bytes, handles, &mut req)?;
6748                    let control_handle = DictionaryEnumerateIteratorControlHandle {
6749                        inner: this.inner.clone(),
6750                    };
6751                    Ok(DictionaryEnumerateIteratorRequest::GetNext {start_id: req.start_id,
6752limit: req.limit,
6753
6754                        responder: DictionaryEnumerateIteratorGetNextResponder {
6755                            control_handle: std::mem::ManuallyDrop::new(control_handle),
6756                            tx_id: header.tx_id,
6757                        },
6758                    })
6759                }
6760                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6761                    Ok(DictionaryEnumerateIteratorRequest::_UnknownMethod {
6762                        ordinal: header.ordinal,
6763                        control_handle: DictionaryEnumerateIteratorControlHandle { inner: this.inner.clone() },
6764                        method_type: fidl::MethodType::OneWay,
6765                    })
6766                }
6767                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6768                    this.inner.send_framework_err(
6769                        fidl::encoding::FrameworkErr::UnknownMethod,
6770                        header.tx_id,
6771                        header.ordinal,
6772                        header.dynamic_flags(),
6773                        (bytes, handles),
6774                    )?;
6775                    Ok(DictionaryEnumerateIteratorRequest::_UnknownMethod {
6776                        ordinal: header.ordinal,
6777                        control_handle: DictionaryEnumerateIteratorControlHandle { inner: this.inner.clone() },
6778                        method_type: fidl::MethodType::TwoWay,
6779                    })
6780                }
6781                _ => Err(fidl::Error::UnknownOrdinal {
6782                    ordinal: header.ordinal,
6783                    protocol_name: <DictionaryEnumerateIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6784                }),
6785            }))
6786            },
6787        )
6788    }
6789}
6790
6791#[derive(Debug)]
6792pub enum DictionaryEnumerateIteratorRequest {
6793    /// Returns the next batch of results for a [Dictionary.Enumerate] call, returning up to
6794    /// `limit` results. `limit` can be at most [MAX_DICTIONARY_ITERATOR_CHUNK].
6795    ///
6796    /// The value of each of `items` is a duplicate of the original capability
6797    /// ([CapabilityStore.Duplicate]), unless it could not be duplicated, it which case it will
6798    /// be null.
6799    ///
6800    /// Each returned capability will be assigned a monotonically increasing [CapabilityId] starting
6801    /// from `start_id`.
6802    ///
6803    /// In addition to the `items`, returns `end_id`, which is one more than the highest id reserved
6804    /// by [GetNext]. `end_id` can be used as the `start_id` for the next call to [GetNext].
6805    ///
6806    /// If [GetNext] returns an error, the server will also close the channel.
6807    ///
6808    /// Errors:
6809    ///
6810    /// - `ID_ALREADY_EXISTS` if some id in the range `[start_id, limit)` already exists in this
6811    ///   store.
6812    /// - `INVALID_ARGS` if `limit` was `0` or greater than `MAX_DICTIONARY_ITERATOR_CHUNK`.
6813    GetNext { start_id: u64, limit: u32, responder: DictionaryEnumerateIteratorGetNextResponder },
6814    /// An interaction was received which does not match any known method.
6815    #[non_exhaustive]
6816    _UnknownMethod {
6817        /// Ordinal of the method that was called.
6818        ordinal: u64,
6819        control_handle: DictionaryEnumerateIteratorControlHandle,
6820        method_type: fidl::MethodType,
6821    },
6822}
6823
6824impl DictionaryEnumerateIteratorRequest {
6825    #[allow(irrefutable_let_patterns)]
6826    pub fn into_get_next(self) -> Option<(u64, u32, DictionaryEnumerateIteratorGetNextResponder)> {
6827        if let DictionaryEnumerateIteratorRequest::GetNext { start_id, limit, responder } = self {
6828            Some((start_id, limit, responder))
6829        } else {
6830            None
6831        }
6832    }
6833
6834    /// Name of the method defined in FIDL
6835    pub fn method_name(&self) -> &'static str {
6836        match *self {
6837            DictionaryEnumerateIteratorRequest::GetNext { .. } => "get_next",
6838            DictionaryEnumerateIteratorRequest::_UnknownMethod {
6839                method_type: fidl::MethodType::OneWay,
6840                ..
6841            } => "unknown one-way method",
6842            DictionaryEnumerateIteratorRequest::_UnknownMethod {
6843                method_type: fidl::MethodType::TwoWay,
6844                ..
6845            } => "unknown two-way method",
6846        }
6847    }
6848}
6849
6850#[derive(Debug, Clone)]
6851pub struct DictionaryEnumerateIteratorControlHandle {
6852    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6853}
6854
6855impl fidl::endpoints::ControlHandle for DictionaryEnumerateIteratorControlHandle {
6856    fn shutdown(&self) {
6857        self.inner.shutdown()
6858    }
6859    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
6860        self.inner.shutdown_with_epitaph(status)
6861    }
6862
6863    fn is_closed(&self) -> bool {
6864        self.inner.channel().is_closed()
6865    }
6866    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6867        self.inner.channel().on_closed()
6868    }
6869
6870    #[cfg(target_os = "fuchsia")]
6871    fn signal_peer(
6872        &self,
6873        clear_mask: zx::Signals,
6874        set_mask: zx::Signals,
6875    ) -> Result<(), zx_status::Status> {
6876        use fidl::Peered;
6877        self.inner.channel().signal_peer(clear_mask, set_mask)
6878    }
6879}
6880
6881impl DictionaryEnumerateIteratorControlHandle {}
6882
6883#[must_use = "FIDL methods require a response to be sent"]
6884#[derive(Debug)]
6885pub struct DictionaryEnumerateIteratorGetNextResponder {
6886    control_handle: std::mem::ManuallyDrop<DictionaryEnumerateIteratorControlHandle>,
6887    tx_id: u32,
6888}
6889
6890/// Set the the channel to be shutdown (see [`DictionaryEnumerateIteratorControlHandle::shutdown`])
6891/// if the responder is dropped without sending a response, so that the client
6892/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6893impl std::ops::Drop for DictionaryEnumerateIteratorGetNextResponder {
6894    fn drop(&mut self) {
6895        self.control_handle.shutdown();
6896        // Safety: drops once, never accessed again
6897        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6898    }
6899}
6900
6901impl fidl::endpoints::Responder for DictionaryEnumerateIteratorGetNextResponder {
6902    type ControlHandle = DictionaryEnumerateIteratorControlHandle;
6903
6904    fn control_handle(&self) -> &DictionaryEnumerateIteratorControlHandle {
6905        &self.control_handle
6906    }
6907
6908    fn drop_without_shutdown(mut self) {
6909        // Safety: drops once, never accessed again due to mem::forget
6910        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6911        // Prevent Drop from running (which would shut down the channel)
6912        std::mem::forget(self);
6913    }
6914}
6915
6916impl DictionaryEnumerateIteratorGetNextResponder {
6917    /// Sends a response to the FIDL transaction.
6918    ///
6919    /// Sets the channel to shutdown if an error occurs.
6920    pub fn send(
6921        self,
6922        mut result: Result<(Vec<DictionaryOptionalItem>, u64), CapabilityStoreError>,
6923    ) -> Result<(), fidl::Error> {
6924        let _result = self.send_raw(result);
6925        if _result.is_err() {
6926            self.control_handle.shutdown();
6927        }
6928        self.drop_without_shutdown();
6929        _result
6930    }
6931
6932    /// Similar to "send" but does not shutdown the channel if an error occurs.
6933    pub fn send_no_shutdown_on_err(
6934        self,
6935        mut result: Result<(Vec<DictionaryOptionalItem>, u64), CapabilityStoreError>,
6936    ) -> Result<(), fidl::Error> {
6937        let _result = self.send_raw(result);
6938        self.drop_without_shutdown();
6939        _result
6940    }
6941
6942    fn send_raw(
6943        &self,
6944        mut result: Result<(Vec<DictionaryOptionalItem>, u64), CapabilityStoreError>,
6945    ) -> Result<(), fidl::Error> {
6946        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
6947            DictionaryEnumerateIteratorGetNextResponse,
6948            CapabilityStoreError,
6949        >>(
6950            fidl::encoding::FlexibleResult::new(
6951                result
6952                    .as_mut()
6953                    .map_err(|e| *e)
6954                    .map(|(items, end_id)| (items.as_mut_slice(), *end_id)),
6955            ),
6956            self.tx_id,
6957            0x14f8bc286512f5cf,
6958            fidl::encoding::DynamicFlags::FLEXIBLE,
6959        )
6960    }
6961}
6962
6963#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6964pub struct DictionaryKeysIteratorMarker;
6965
6966impl fidl::endpoints::ProtocolMarker for DictionaryKeysIteratorMarker {
6967    type Proxy = DictionaryKeysIteratorProxy;
6968    type RequestStream = DictionaryKeysIteratorRequestStream;
6969    #[cfg(target_os = "fuchsia")]
6970    type SynchronousProxy = DictionaryKeysIteratorSynchronousProxy;
6971
6972    const DEBUG_NAME: &'static str = "(anonymous) DictionaryKeysIterator";
6973}
6974
6975pub trait DictionaryKeysIteratorProxyInterface: Send + Sync {
6976    type GetNextResponseFut: std::future::Future<Output = Result<Vec<String>, fidl::Error>> + Send;
6977    fn r#get_next(&self) -> Self::GetNextResponseFut;
6978}
6979#[derive(Debug)]
6980#[cfg(target_os = "fuchsia")]
6981pub struct DictionaryKeysIteratorSynchronousProxy {
6982    client: fidl::client::sync::Client,
6983}
6984
6985#[cfg(target_os = "fuchsia")]
6986impl fidl::endpoints::SynchronousProxy for DictionaryKeysIteratorSynchronousProxy {
6987    type Proxy = DictionaryKeysIteratorProxy;
6988    type Protocol = DictionaryKeysIteratorMarker;
6989
6990    fn from_channel(inner: fidl::Channel) -> Self {
6991        Self::new(inner)
6992    }
6993
6994    fn into_channel(self) -> fidl::Channel {
6995        self.client.into_channel()
6996    }
6997
6998    fn as_channel(&self) -> &fidl::Channel {
6999        self.client.as_channel()
7000    }
7001}
7002
7003#[cfg(target_os = "fuchsia")]
7004impl DictionaryKeysIteratorSynchronousProxy {
7005    pub fn new(channel: fidl::Channel) -> Self {
7006        let protocol_name =
7007            <DictionaryKeysIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7008        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
7009    }
7010
7011    pub fn into_channel(self) -> fidl::Channel {
7012        self.client.into_channel()
7013    }
7014
7015    /// Waits until an event arrives and returns it. It is safe for other
7016    /// threads to make concurrent requests while waiting for an event.
7017    pub fn wait_for_event(
7018        &self,
7019        deadline: zx::MonotonicInstant,
7020    ) -> Result<DictionaryKeysIteratorEvent, fidl::Error> {
7021        DictionaryKeysIteratorEvent::decode(self.client.wait_for_event(deadline)?)
7022    }
7023
7024    pub fn r#get_next(
7025        &self,
7026        ___deadline: zx::MonotonicInstant,
7027    ) -> Result<Vec<String>, fidl::Error> {
7028        let _response = self.client.send_query::<
7029            fidl::encoding::EmptyPayload,
7030            fidl::encoding::FlexibleType<DictionaryKeysIteratorGetNextResponse>,
7031        >(
7032            (),
7033            0x453828cbacca7d53,
7034            fidl::encoding::DynamicFlags::FLEXIBLE,
7035            ___deadline,
7036        )?
7037        .into_result::<DictionaryKeysIteratorMarker>("get_next")?;
7038        Ok(_response.keys)
7039    }
7040}
7041
7042#[cfg(target_os = "fuchsia")]
7043impl From<DictionaryKeysIteratorSynchronousProxy> for zx::Handle {
7044    fn from(value: DictionaryKeysIteratorSynchronousProxy) -> Self {
7045        value.into_channel().into()
7046    }
7047}
7048
7049#[cfg(target_os = "fuchsia")]
7050impl From<fidl::Channel> for DictionaryKeysIteratorSynchronousProxy {
7051    fn from(value: fidl::Channel) -> Self {
7052        Self::new(value)
7053    }
7054}
7055
7056#[derive(Debug, Clone)]
7057pub struct DictionaryKeysIteratorProxy {
7058    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
7059}
7060
7061impl fidl::endpoints::Proxy for DictionaryKeysIteratorProxy {
7062    type Protocol = DictionaryKeysIteratorMarker;
7063
7064    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
7065        Self::new(inner)
7066    }
7067
7068    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
7069        self.client.into_channel().map_err(|client| Self { client })
7070    }
7071
7072    fn as_channel(&self) -> &::fidl::AsyncChannel {
7073        self.client.as_channel()
7074    }
7075}
7076
7077impl DictionaryKeysIteratorProxy {
7078    /// Create a new Proxy for fuchsia.component.sandbox/DictionaryKeysIterator.
7079    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
7080        let protocol_name =
7081            <DictionaryKeysIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7082        Self { client: fidl::client::Client::new(channel, protocol_name) }
7083    }
7084
7085    /// Get a Stream of events from the remote end of the protocol.
7086    ///
7087    /// # Panics
7088    ///
7089    /// Panics if the event stream was already taken.
7090    pub fn take_event_stream(&self) -> DictionaryKeysIteratorEventStream {
7091        DictionaryKeysIteratorEventStream { event_receiver: self.client.take_event_receiver() }
7092    }
7093
7094    pub fn r#get_next(
7095        &self,
7096    ) -> fidl::client::QueryResponseFut<Vec<String>, fidl::encoding::DefaultFuchsiaResourceDialect>
7097    {
7098        DictionaryKeysIteratorProxyInterface::r#get_next(self)
7099    }
7100}
7101
7102impl DictionaryKeysIteratorProxyInterface for DictionaryKeysIteratorProxy {
7103    type GetNextResponseFut =
7104        fidl::client::QueryResponseFut<Vec<String>, fidl::encoding::DefaultFuchsiaResourceDialect>;
7105    fn r#get_next(&self) -> Self::GetNextResponseFut {
7106        fn _decode(
7107            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7108        ) -> Result<Vec<String>, fidl::Error> {
7109            let _response = fidl::client::decode_transaction_body::<
7110                fidl::encoding::FlexibleType<DictionaryKeysIteratorGetNextResponse>,
7111                fidl::encoding::DefaultFuchsiaResourceDialect,
7112                0x453828cbacca7d53,
7113            >(_buf?)?
7114            .into_result::<DictionaryKeysIteratorMarker>("get_next")?;
7115            Ok(_response.keys)
7116        }
7117        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<String>>(
7118            (),
7119            0x453828cbacca7d53,
7120            fidl::encoding::DynamicFlags::FLEXIBLE,
7121            _decode,
7122        )
7123    }
7124}
7125
7126pub struct DictionaryKeysIteratorEventStream {
7127    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
7128}
7129
7130impl std::marker::Unpin for DictionaryKeysIteratorEventStream {}
7131
7132impl futures::stream::FusedStream for DictionaryKeysIteratorEventStream {
7133    fn is_terminated(&self) -> bool {
7134        self.event_receiver.is_terminated()
7135    }
7136}
7137
7138impl futures::Stream for DictionaryKeysIteratorEventStream {
7139    type Item = Result<DictionaryKeysIteratorEvent, fidl::Error>;
7140
7141    fn poll_next(
7142        mut self: std::pin::Pin<&mut Self>,
7143        cx: &mut std::task::Context<'_>,
7144    ) -> std::task::Poll<Option<Self::Item>> {
7145        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7146            &mut self.event_receiver,
7147            cx
7148        )?) {
7149            Some(buf) => std::task::Poll::Ready(Some(DictionaryKeysIteratorEvent::decode(buf))),
7150            None => std::task::Poll::Ready(None),
7151        }
7152    }
7153}
7154
7155#[derive(Debug)]
7156pub enum DictionaryKeysIteratorEvent {
7157    #[non_exhaustive]
7158    _UnknownEvent {
7159        /// Ordinal of the event that was sent.
7160        ordinal: u64,
7161    },
7162}
7163
7164impl DictionaryKeysIteratorEvent {
7165    /// Decodes a message buffer as a [`DictionaryKeysIteratorEvent`].
7166    fn decode(
7167        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7168    ) -> Result<DictionaryKeysIteratorEvent, fidl::Error> {
7169        let (bytes, _handles) = buf.split_mut();
7170        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7171        debug_assert_eq!(tx_header.tx_id, 0);
7172        match tx_header.ordinal {
7173            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7174                Ok(DictionaryKeysIteratorEvent::_UnknownEvent { ordinal: tx_header.ordinal })
7175            }
7176            _ => Err(fidl::Error::UnknownOrdinal {
7177                ordinal: tx_header.ordinal,
7178                protocol_name:
7179                    <DictionaryKeysIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7180            }),
7181        }
7182    }
7183}
7184
7185/// A Stream of incoming requests for fuchsia.component.sandbox/DictionaryKeysIterator.
7186pub struct DictionaryKeysIteratorRequestStream {
7187    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7188    is_terminated: bool,
7189}
7190
7191impl std::marker::Unpin for DictionaryKeysIteratorRequestStream {}
7192
7193impl futures::stream::FusedStream for DictionaryKeysIteratorRequestStream {
7194    fn is_terminated(&self) -> bool {
7195        self.is_terminated
7196    }
7197}
7198
7199impl fidl::endpoints::RequestStream for DictionaryKeysIteratorRequestStream {
7200    type Protocol = DictionaryKeysIteratorMarker;
7201    type ControlHandle = DictionaryKeysIteratorControlHandle;
7202
7203    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
7204        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7205    }
7206
7207    fn control_handle(&self) -> Self::ControlHandle {
7208        DictionaryKeysIteratorControlHandle { inner: self.inner.clone() }
7209    }
7210
7211    fn into_inner(
7212        self,
7213    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
7214    {
7215        (self.inner, self.is_terminated)
7216    }
7217
7218    fn from_inner(
7219        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7220        is_terminated: bool,
7221    ) -> Self {
7222        Self { inner, is_terminated }
7223    }
7224}
7225
7226impl futures::Stream for DictionaryKeysIteratorRequestStream {
7227    type Item = Result<DictionaryKeysIteratorRequest, fidl::Error>;
7228
7229    fn poll_next(
7230        mut self: std::pin::Pin<&mut Self>,
7231        cx: &mut std::task::Context<'_>,
7232    ) -> std::task::Poll<Option<Self::Item>> {
7233        let this = &mut *self;
7234        if this.inner.check_shutdown(cx) {
7235            this.is_terminated = true;
7236            return std::task::Poll::Ready(None);
7237        }
7238        if this.is_terminated {
7239            panic!("polled DictionaryKeysIteratorRequestStream after completion");
7240        }
7241        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
7242            |bytes, handles| {
7243                match this.inner.channel().read_etc(cx, bytes, handles) {
7244                    std::task::Poll::Ready(Ok(())) => {}
7245                    std::task::Poll::Pending => return std::task::Poll::Pending,
7246                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
7247                        this.is_terminated = true;
7248                        return std::task::Poll::Ready(None);
7249                    }
7250                    std::task::Poll::Ready(Err(e)) => {
7251                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7252                            e.into(),
7253                        ))))
7254                    }
7255                }
7256
7257                // A message has been received from the channel
7258                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7259
7260                std::task::Poll::Ready(Some(match header.ordinal {
7261                0x453828cbacca7d53 => {
7262                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7263                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
7264                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7265                    let control_handle = DictionaryKeysIteratorControlHandle {
7266                        inner: this.inner.clone(),
7267                    };
7268                    Ok(DictionaryKeysIteratorRequest::GetNext {
7269                        responder: DictionaryKeysIteratorGetNextResponder {
7270                            control_handle: std::mem::ManuallyDrop::new(control_handle),
7271                            tx_id: header.tx_id,
7272                        },
7273                    })
7274                }
7275                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7276                    Ok(DictionaryKeysIteratorRequest::_UnknownMethod {
7277                        ordinal: header.ordinal,
7278                        control_handle: DictionaryKeysIteratorControlHandle { inner: this.inner.clone() },
7279                        method_type: fidl::MethodType::OneWay,
7280                    })
7281                }
7282                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7283                    this.inner.send_framework_err(
7284                        fidl::encoding::FrameworkErr::UnknownMethod,
7285                        header.tx_id,
7286                        header.ordinal,
7287                        header.dynamic_flags(),
7288                        (bytes, handles),
7289                    )?;
7290                    Ok(DictionaryKeysIteratorRequest::_UnknownMethod {
7291                        ordinal: header.ordinal,
7292                        control_handle: DictionaryKeysIteratorControlHandle { inner: this.inner.clone() },
7293                        method_type: fidl::MethodType::TwoWay,
7294                    })
7295                }
7296                _ => Err(fidl::Error::UnknownOrdinal {
7297                    ordinal: header.ordinal,
7298                    protocol_name: <DictionaryKeysIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7299                }),
7300            }))
7301            },
7302        )
7303    }
7304}
7305
7306#[derive(Debug)]
7307pub enum DictionaryKeysIteratorRequest {
7308    GetNext {
7309        responder: DictionaryKeysIteratorGetNextResponder,
7310    },
7311    /// An interaction was received which does not match any known method.
7312    #[non_exhaustive]
7313    _UnknownMethod {
7314        /// Ordinal of the method that was called.
7315        ordinal: u64,
7316        control_handle: DictionaryKeysIteratorControlHandle,
7317        method_type: fidl::MethodType,
7318    },
7319}
7320
7321impl DictionaryKeysIteratorRequest {
7322    #[allow(irrefutable_let_patterns)]
7323    pub fn into_get_next(self) -> Option<(DictionaryKeysIteratorGetNextResponder)> {
7324        if let DictionaryKeysIteratorRequest::GetNext { responder } = self {
7325            Some((responder))
7326        } else {
7327            None
7328        }
7329    }
7330
7331    /// Name of the method defined in FIDL
7332    pub fn method_name(&self) -> &'static str {
7333        match *self {
7334            DictionaryKeysIteratorRequest::GetNext { .. } => "get_next",
7335            DictionaryKeysIteratorRequest::_UnknownMethod {
7336                method_type: fidl::MethodType::OneWay,
7337                ..
7338            } => "unknown one-way method",
7339            DictionaryKeysIteratorRequest::_UnknownMethod {
7340                method_type: fidl::MethodType::TwoWay,
7341                ..
7342            } => "unknown two-way method",
7343        }
7344    }
7345}
7346
7347#[derive(Debug, Clone)]
7348pub struct DictionaryKeysIteratorControlHandle {
7349    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7350}
7351
7352impl fidl::endpoints::ControlHandle for DictionaryKeysIteratorControlHandle {
7353    fn shutdown(&self) {
7354        self.inner.shutdown()
7355    }
7356    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
7357        self.inner.shutdown_with_epitaph(status)
7358    }
7359
7360    fn is_closed(&self) -> bool {
7361        self.inner.channel().is_closed()
7362    }
7363    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
7364        self.inner.channel().on_closed()
7365    }
7366
7367    #[cfg(target_os = "fuchsia")]
7368    fn signal_peer(
7369        &self,
7370        clear_mask: zx::Signals,
7371        set_mask: zx::Signals,
7372    ) -> Result<(), zx_status::Status> {
7373        use fidl::Peered;
7374        self.inner.channel().signal_peer(clear_mask, set_mask)
7375    }
7376}
7377
7378impl DictionaryKeysIteratorControlHandle {}
7379
7380#[must_use = "FIDL methods require a response to be sent"]
7381#[derive(Debug)]
7382pub struct DictionaryKeysIteratorGetNextResponder {
7383    control_handle: std::mem::ManuallyDrop<DictionaryKeysIteratorControlHandle>,
7384    tx_id: u32,
7385}
7386
7387/// Set the the channel to be shutdown (see [`DictionaryKeysIteratorControlHandle::shutdown`])
7388/// if the responder is dropped without sending a response, so that the client
7389/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7390impl std::ops::Drop for DictionaryKeysIteratorGetNextResponder {
7391    fn drop(&mut self) {
7392        self.control_handle.shutdown();
7393        // Safety: drops once, never accessed again
7394        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7395    }
7396}
7397
7398impl fidl::endpoints::Responder for DictionaryKeysIteratorGetNextResponder {
7399    type ControlHandle = DictionaryKeysIteratorControlHandle;
7400
7401    fn control_handle(&self) -> &DictionaryKeysIteratorControlHandle {
7402        &self.control_handle
7403    }
7404
7405    fn drop_without_shutdown(mut self) {
7406        // Safety: drops once, never accessed again due to mem::forget
7407        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7408        // Prevent Drop from running (which would shut down the channel)
7409        std::mem::forget(self);
7410    }
7411}
7412
7413impl DictionaryKeysIteratorGetNextResponder {
7414    /// Sends a response to the FIDL transaction.
7415    ///
7416    /// Sets the channel to shutdown if an error occurs.
7417    pub fn send(self, mut keys: &[String]) -> Result<(), fidl::Error> {
7418        let _result = self.send_raw(keys);
7419        if _result.is_err() {
7420            self.control_handle.shutdown();
7421        }
7422        self.drop_without_shutdown();
7423        _result
7424    }
7425
7426    /// Similar to "send" but does not shutdown the channel if an error occurs.
7427    pub fn send_no_shutdown_on_err(self, mut keys: &[String]) -> Result<(), fidl::Error> {
7428        let _result = self.send_raw(keys);
7429        self.drop_without_shutdown();
7430        _result
7431    }
7432
7433    fn send_raw(&self, mut keys: &[String]) -> Result<(), fidl::Error> {
7434        self.control_handle
7435            .inner
7436            .send::<fidl::encoding::FlexibleType<DictionaryKeysIteratorGetNextResponse>>(
7437                fidl::encoding::Flexible::new((keys,)),
7438                self.tx_id,
7439                0x453828cbacca7d53,
7440                fidl::encoding::DynamicFlags::FLEXIBLE,
7441            )
7442    }
7443}
7444
7445#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
7446pub struct DictionaryRouterMarker;
7447
7448impl fidl::endpoints::ProtocolMarker for DictionaryRouterMarker {
7449    type Proxy = DictionaryRouterProxy;
7450    type RequestStream = DictionaryRouterRequestStream;
7451    #[cfg(target_os = "fuchsia")]
7452    type SynchronousProxy = DictionaryRouterSynchronousProxy;
7453
7454    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.DictionaryRouter";
7455}
7456impl fidl::endpoints::DiscoverableProtocolMarker for DictionaryRouterMarker {}
7457pub type DictionaryRouterRouteResult = Result<DictionaryRouterRouteResponse, RouterError>;
7458
7459pub trait DictionaryRouterProxyInterface: Send + Sync {
7460    type RouteResponseFut: std::future::Future<Output = Result<DictionaryRouterRouteResult, fidl::Error>>
7461        + Send;
7462    fn r#route(&self, payload: RouteRequest) -> Self::RouteResponseFut;
7463}
7464#[derive(Debug)]
7465#[cfg(target_os = "fuchsia")]
7466pub struct DictionaryRouterSynchronousProxy {
7467    client: fidl::client::sync::Client,
7468}
7469
7470#[cfg(target_os = "fuchsia")]
7471impl fidl::endpoints::SynchronousProxy for DictionaryRouterSynchronousProxy {
7472    type Proxy = DictionaryRouterProxy;
7473    type Protocol = DictionaryRouterMarker;
7474
7475    fn from_channel(inner: fidl::Channel) -> Self {
7476        Self::new(inner)
7477    }
7478
7479    fn into_channel(self) -> fidl::Channel {
7480        self.client.into_channel()
7481    }
7482
7483    fn as_channel(&self) -> &fidl::Channel {
7484        self.client.as_channel()
7485    }
7486}
7487
7488#[cfg(target_os = "fuchsia")]
7489impl DictionaryRouterSynchronousProxy {
7490    pub fn new(channel: fidl::Channel) -> Self {
7491        let protocol_name = <DictionaryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7492        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
7493    }
7494
7495    pub fn into_channel(self) -> fidl::Channel {
7496        self.client.into_channel()
7497    }
7498
7499    /// Waits until an event arrives and returns it. It is safe for other
7500    /// threads to make concurrent requests while waiting for an event.
7501    pub fn wait_for_event(
7502        &self,
7503        deadline: zx::MonotonicInstant,
7504    ) -> Result<DictionaryRouterEvent, fidl::Error> {
7505        DictionaryRouterEvent::decode(self.client.wait_for_event(deadline)?)
7506    }
7507
7508    pub fn r#route(
7509        &self,
7510        mut payload: RouteRequest,
7511        ___deadline: zx::MonotonicInstant,
7512    ) -> Result<DictionaryRouterRouteResult, fidl::Error> {
7513        let _response = self.client.send_query::<
7514            RouteRequest,
7515            fidl::encoding::FlexibleResultType<DictionaryRouterRouteResponse, RouterError>,
7516        >(
7517            &mut payload,
7518            0x714c65bfe54bd79f,
7519            fidl::encoding::DynamicFlags::FLEXIBLE,
7520            ___deadline,
7521        )?
7522        .into_result::<DictionaryRouterMarker>("route")?;
7523        Ok(_response.map(|x| x))
7524    }
7525}
7526
7527#[cfg(target_os = "fuchsia")]
7528impl From<DictionaryRouterSynchronousProxy> for zx::Handle {
7529    fn from(value: DictionaryRouterSynchronousProxy) -> Self {
7530        value.into_channel().into()
7531    }
7532}
7533
7534#[cfg(target_os = "fuchsia")]
7535impl From<fidl::Channel> for DictionaryRouterSynchronousProxy {
7536    fn from(value: fidl::Channel) -> Self {
7537        Self::new(value)
7538    }
7539}
7540
7541#[derive(Debug, Clone)]
7542pub struct DictionaryRouterProxy {
7543    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
7544}
7545
7546impl fidl::endpoints::Proxy for DictionaryRouterProxy {
7547    type Protocol = DictionaryRouterMarker;
7548
7549    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
7550        Self::new(inner)
7551    }
7552
7553    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
7554        self.client.into_channel().map_err(|client| Self { client })
7555    }
7556
7557    fn as_channel(&self) -> &::fidl::AsyncChannel {
7558        self.client.as_channel()
7559    }
7560}
7561
7562impl DictionaryRouterProxy {
7563    /// Create a new Proxy for fuchsia.component.sandbox/DictionaryRouter.
7564    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
7565        let protocol_name = <DictionaryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7566        Self { client: fidl::client::Client::new(channel, protocol_name) }
7567    }
7568
7569    /// Get a Stream of events from the remote end of the protocol.
7570    ///
7571    /// # Panics
7572    ///
7573    /// Panics if the event stream was already taken.
7574    pub fn take_event_stream(&self) -> DictionaryRouterEventStream {
7575        DictionaryRouterEventStream { event_receiver: self.client.take_event_receiver() }
7576    }
7577
7578    pub fn r#route(
7579        &self,
7580        mut payload: RouteRequest,
7581    ) -> fidl::client::QueryResponseFut<
7582        DictionaryRouterRouteResult,
7583        fidl::encoding::DefaultFuchsiaResourceDialect,
7584    > {
7585        DictionaryRouterProxyInterface::r#route(self, payload)
7586    }
7587}
7588
7589impl DictionaryRouterProxyInterface for DictionaryRouterProxy {
7590    type RouteResponseFut = fidl::client::QueryResponseFut<
7591        DictionaryRouterRouteResult,
7592        fidl::encoding::DefaultFuchsiaResourceDialect,
7593    >;
7594    fn r#route(&self, mut payload: RouteRequest) -> Self::RouteResponseFut {
7595        fn _decode(
7596            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7597        ) -> Result<DictionaryRouterRouteResult, fidl::Error> {
7598            let _response = fidl::client::decode_transaction_body::<
7599                fidl::encoding::FlexibleResultType<DictionaryRouterRouteResponse, RouterError>,
7600                fidl::encoding::DefaultFuchsiaResourceDialect,
7601                0x714c65bfe54bd79f,
7602            >(_buf?)?
7603            .into_result::<DictionaryRouterMarker>("route")?;
7604            Ok(_response.map(|x| x))
7605        }
7606        self.client.send_query_and_decode::<RouteRequest, DictionaryRouterRouteResult>(
7607            &mut payload,
7608            0x714c65bfe54bd79f,
7609            fidl::encoding::DynamicFlags::FLEXIBLE,
7610            _decode,
7611        )
7612    }
7613}
7614
7615pub struct DictionaryRouterEventStream {
7616    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
7617}
7618
7619impl std::marker::Unpin for DictionaryRouterEventStream {}
7620
7621impl futures::stream::FusedStream for DictionaryRouterEventStream {
7622    fn is_terminated(&self) -> bool {
7623        self.event_receiver.is_terminated()
7624    }
7625}
7626
7627impl futures::Stream for DictionaryRouterEventStream {
7628    type Item = Result<DictionaryRouterEvent, fidl::Error>;
7629
7630    fn poll_next(
7631        mut self: std::pin::Pin<&mut Self>,
7632        cx: &mut std::task::Context<'_>,
7633    ) -> std::task::Poll<Option<Self::Item>> {
7634        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7635            &mut self.event_receiver,
7636            cx
7637        )?) {
7638            Some(buf) => std::task::Poll::Ready(Some(DictionaryRouterEvent::decode(buf))),
7639            None => std::task::Poll::Ready(None),
7640        }
7641    }
7642}
7643
7644#[derive(Debug)]
7645pub enum DictionaryRouterEvent {
7646    #[non_exhaustive]
7647    _UnknownEvent {
7648        /// Ordinal of the event that was sent.
7649        ordinal: u64,
7650    },
7651}
7652
7653impl DictionaryRouterEvent {
7654    /// Decodes a message buffer as a [`DictionaryRouterEvent`].
7655    fn decode(
7656        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7657    ) -> Result<DictionaryRouterEvent, fidl::Error> {
7658        let (bytes, _handles) = buf.split_mut();
7659        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7660        debug_assert_eq!(tx_header.tx_id, 0);
7661        match tx_header.ordinal {
7662            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7663                Ok(DictionaryRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
7664            }
7665            _ => Err(fidl::Error::UnknownOrdinal {
7666                ordinal: tx_header.ordinal,
7667                protocol_name:
7668                    <DictionaryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7669            }),
7670        }
7671    }
7672}
7673
7674/// A Stream of incoming requests for fuchsia.component.sandbox/DictionaryRouter.
7675pub struct DictionaryRouterRequestStream {
7676    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7677    is_terminated: bool,
7678}
7679
7680impl std::marker::Unpin for DictionaryRouterRequestStream {}
7681
7682impl futures::stream::FusedStream for DictionaryRouterRequestStream {
7683    fn is_terminated(&self) -> bool {
7684        self.is_terminated
7685    }
7686}
7687
7688impl fidl::endpoints::RequestStream for DictionaryRouterRequestStream {
7689    type Protocol = DictionaryRouterMarker;
7690    type ControlHandle = DictionaryRouterControlHandle;
7691
7692    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
7693        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7694    }
7695
7696    fn control_handle(&self) -> Self::ControlHandle {
7697        DictionaryRouterControlHandle { inner: self.inner.clone() }
7698    }
7699
7700    fn into_inner(
7701        self,
7702    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
7703    {
7704        (self.inner, self.is_terminated)
7705    }
7706
7707    fn from_inner(
7708        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7709        is_terminated: bool,
7710    ) -> Self {
7711        Self { inner, is_terminated }
7712    }
7713}
7714
7715impl futures::Stream for DictionaryRouterRequestStream {
7716    type Item = Result<DictionaryRouterRequest, fidl::Error>;
7717
7718    fn poll_next(
7719        mut self: std::pin::Pin<&mut Self>,
7720        cx: &mut std::task::Context<'_>,
7721    ) -> std::task::Poll<Option<Self::Item>> {
7722        let this = &mut *self;
7723        if this.inner.check_shutdown(cx) {
7724            this.is_terminated = true;
7725            return std::task::Poll::Ready(None);
7726        }
7727        if this.is_terminated {
7728            panic!("polled DictionaryRouterRequestStream after completion");
7729        }
7730        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
7731            |bytes, handles| {
7732                match this.inner.channel().read_etc(cx, bytes, handles) {
7733                    std::task::Poll::Ready(Ok(())) => {}
7734                    std::task::Poll::Pending => return std::task::Poll::Pending,
7735                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
7736                        this.is_terminated = true;
7737                        return std::task::Poll::Ready(None);
7738                    }
7739                    std::task::Poll::Ready(Err(e)) => {
7740                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7741                            e.into(),
7742                        ))))
7743                    }
7744                }
7745
7746                // A message has been received from the channel
7747                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7748
7749                std::task::Poll::Ready(Some(match header.ordinal {
7750                    0x714c65bfe54bd79f => {
7751                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7752                        let mut req = fidl::new_empty!(
7753                            RouteRequest,
7754                            fidl::encoding::DefaultFuchsiaResourceDialect
7755                        );
7756                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RouteRequest>(&header, _body_bytes, handles, &mut req)?;
7757                        let control_handle =
7758                            DictionaryRouterControlHandle { inner: this.inner.clone() };
7759                        Ok(DictionaryRouterRequest::Route {
7760                            payload: req,
7761                            responder: DictionaryRouterRouteResponder {
7762                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7763                                tx_id: header.tx_id,
7764                            },
7765                        })
7766                    }
7767                    _ if header.tx_id == 0
7768                        && header
7769                            .dynamic_flags()
7770                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
7771                    {
7772                        Ok(DictionaryRouterRequest::_UnknownMethod {
7773                            ordinal: header.ordinal,
7774                            control_handle: DictionaryRouterControlHandle {
7775                                inner: this.inner.clone(),
7776                            },
7777                            method_type: fidl::MethodType::OneWay,
7778                        })
7779                    }
7780                    _ if header
7781                        .dynamic_flags()
7782                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
7783                    {
7784                        this.inner.send_framework_err(
7785                            fidl::encoding::FrameworkErr::UnknownMethod,
7786                            header.tx_id,
7787                            header.ordinal,
7788                            header.dynamic_flags(),
7789                            (bytes, handles),
7790                        )?;
7791                        Ok(DictionaryRouterRequest::_UnknownMethod {
7792                            ordinal: header.ordinal,
7793                            control_handle: DictionaryRouterControlHandle {
7794                                inner: this.inner.clone(),
7795                            },
7796                            method_type: fidl::MethodType::TwoWay,
7797                        })
7798                    }
7799                    _ => Err(fidl::Error::UnknownOrdinal {
7800                        ordinal: header.ordinal,
7801                        protocol_name:
7802                            <DictionaryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7803                    }),
7804                }))
7805            },
7806        )
7807    }
7808}
7809
7810#[derive(Debug)]
7811pub enum DictionaryRouterRequest {
7812    Route {
7813        payload: RouteRequest,
7814        responder: DictionaryRouterRouteResponder,
7815    },
7816    /// An interaction was received which does not match any known method.
7817    #[non_exhaustive]
7818    _UnknownMethod {
7819        /// Ordinal of the method that was called.
7820        ordinal: u64,
7821        control_handle: DictionaryRouterControlHandle,
7822        method_type: fidl::MethodType,
7823    },
7824}
7825
7826impl DictionaryRouterRequest {
7827    #[allow(irrefutable_let_patterns)]
7828    pub fn into_route(self) -> Option<(RouteRequest, DictionaryRouterRouteResponder)> {
7829        if let DictionaryRouterRequest::Route { payload, responder } = self {
7830            Some((payload, responder))
7831        } else {
7832            None
7833        }
7834    }
7835
7836    /// Name of the method defined in FIDL
7837    pub fn method_name(&self) -> &'static str {
7838        match *self {
7839            DictionaryRouterRequest::Route { .. } => "route",
7840            DictionaryRouterRequest::_UnknownMethod {
7841                method_type: fidl::MethodType::OneWay,
7842                ..
7843            } => "unknown one-way method",
7844            DictionaryRouterRequest::_UnknownMethod {
7845                method_type: fidl::MethodType::TwoWay,
7846                ..
7847            } => "unknown two-way method",
7848        }
7849    }
7850}
7851
7852#[derive(Debug, Clone)]
7853pub struct DictionaryRouterControlHandle {
7854    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7855}
7856
7857impl fidl::endpoints::ControlHandle for DictionaryRouterControlHandle {
7858    fn shutdown(&self) {
7859        self.inner.shutdown()
7860    }
7861    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
7862        self.inner.shutdown_with_epitaph(status)
7863    }
7864
7865    fn is_closed(&self) -> bool {
7866        self.inner.channel().is_closed()
7867    }
7868    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
7869        self.inner.channel().on_closed()
7870    }
7871
7872    #[cfg(target_os = "fuchsia")]
7873    fn signal_peer(
7874        &self,
7875        clear_mask: zx::Signals,
7876        set_mask: zx::Signals,
7877    ) -> Result<(), zx_status::Status> {
7878        use fidl::Peered;
7879        self.inner.channel().signal_peer(clear_mask, set_mask)
7880    }
7881}
7882
7883impl DictionaryRouterControlHandle {}
7884
7885#[must_use = "FIDL methods require a response to be sent"]
7886#[derive(Debug)]
7887pub struct DictionaryRouterRouteResponder {
7888    control_handle: std::mem::ManuallyDrop<DictionaryRouterControlHandle>,
7889    tx_id: u32,
7890}
7891
7892/// Set the the channel to be shutdown (see [`DictionaryRouterControlHandle::shutdown`])
7893/// if the responder is dropped without sending a response, so that the client
7894/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7895impl std::ops::Drop for DictionaryRouterRouteResponder {
7896    fn drop(&mut self) {
7897        self.control_handle.shutdown();
7898        // Safety: drops once, never accessed again
7899        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7900    }
7901}
7902
7903impl fidl::endpoints::Responder for DictionaryRouterRouteResponder {
7904    type ControlHandle = DictionaryRouterControlHandle;
7905
7906    fn control_handle(&self) -> &DictionaryRouterControlHandle {
7907        &self.control_handle
7908    }
7909
7910    fn drop_without_shutdown(mut self) {
7911        // Safety: drops once, never accessed again due to mem::forget
7912        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7913        // Prevent Drop from running (which would shut down the channel)
7914        std::mem::forget(self);
7915    }
7916}
7917
7918impl DictionaryRouterRouteResponder {
7919    /// Sends a response to the FIDL transaction.
7920    ///
7921    /// Sets the channel to shutdown if an error occurs.
7922    pub fn send(
7923        self,
7924        mut result: Result<DictionaryRouterRouteResponse, RouterError>,
7925    ) -> Result<(), fidl::Error> {
7926        let _result = self.send_raw(result);
7927        if _result.is_err() {
7928            self.control_handle.shutdown();
7929        }
7930        self.drop_without_shutdown();
7931        _result
7932    }
7933
7934    /// Similar to "send" but does not shutdown the channel if an error occurs.
7935    pub fn send_no_shutdown_on_err(
7936        self,
7937        mut result: Result<DictionaryRouterRouteResponse, RouterError>,
7938    ) -> Result<(), fidl::Error> {
7939        let _result = self.send_raw(result);
7940        self.drop_without_shutdown();
7941        _result
7942    }
7943
7944    fn send_raw(
7945        &self,
7946        mut result: Result<DictionaryRouterRouteResponse, RouterError>,
7947    ) -> Result<(), fidl::Error> {
7948        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
7949            DictionaryRouterRouteResponse,
7950            RouterError,
7951        >>(
7952            fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
7953            self.tx_id,
7954            0x714c65bfe54bd79f,
7955            fidl::encoding::DynamicFlags::FLEXIBLE,
7956        )
7957    }
7958}
7959
7960#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
7961pub struct DirConnectorRouterMarker;
7962
7963impl fidl::endpoints::ProtocolMarker for DirConnectorRouterMarker {
7964    type Proxy = DirConnectorRouterProxy;
7965    type RequestStream = DirConnectorRouterRequestStream;
7966    #[cfg(target_os = "fuchsia")]
7967    type SynchronousProxy = DirConnectorRouterSynchronousProxy;
7968
7969    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.DirConnectorRouter";
7970}
7971impl fidl::endpoints::DiscoverableProtocolMarker for DirConnectorRouterMarker {}
7972pub type DirConnectorRouterRouteResult = Result<DirConnectorRouterRouteResponse, RouterError>;
7973
7974pub trait DirConnectorRouterProxyInterface: Send + Sync {
7975    type RouteResponseFut: std::future::Future<Output = Result<DirConnectorRouterRouteResult, fidl::Error>>
7976        + Send;
7977    fn r#route(&self, payload: RouteRequest) -> Self::RouteResponseFut;
7978}
7979#[derive(Debug)]
7980#[cfg(target_os = "fuchsia")]
7981pub struct DirConnectorRouterSynchronousProxy {
7982    client: fidl::client::sync::Client,
7983}
7984
7985#[cfg(target_os = "fuchsia")]
7986impl fidl::endpoints::SynchronousProxy for DirConnectorRouterSynchronousProxy {
7987    type Proxy = DirConnectorRouterProxy;
7988    type Protocol = DirConnectorRouterMarker;
7989
7990    fn from_channel(inner: fidl::Channel) -> Self {
7991        Self::new(inner)
7992    }
7993
7994    fn into_channel(self) -> fidl::Channel {
7995        self.client.into_channel()
7996    }
7997
7998    fn as_channel(&self) -> &fidl::Channel {
7999        self.client.as_channel()
8000    }
8001}
8002
8003#[cfg(target_os = "fuchsia")]
8004impl DirConnectorRouterSynchronousProxy {
8005    pub fn new(channel: fidl::Channel) -> Self {
8006        let protocol_name =
8007            <DirConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8008        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
8009    }
8010
8011    pub fn into_channel(self) -> fidl::Channel {
8012        self.client.into_channel()
8013    }
8014
8015    /// Waits until an event arrives and returns it. It is safe for other
8016    /// threads to make concurrent requests while waiting for an event.
8017    pub fn wait_for_event(
8018        &self,
8019        deadline: zx::MonotonicInstant,
8020    ) -> Result<DirConnectorRouterEvent, fidl::Error> {
8021        DirConnectorRouterEvent::decode(self.client.wait_for_event(deadline)?)
8022    }
8023
8024    pub fn r#route(
8025        &self,
8026        mut payload: RouteRequest,
8027        ___deadline: zx::MonotonicInstant,
8028    ) -> Result<DirConnectorRouterRouteResult, fidl::Error> {
8029        let _response = self.client.send_query::<
8030            RouteRequest,
8031            fidl::encoding::FlexibleResultType<DirConnectorRouterRouteResponse, RouterError>,
8032        >(
8033            &mut payload,
8034            0xd7e0f01da2c8e40,
8035            fidl::encoding::DynamicFlags::FLEXIBLE,
8036            ___deadline,
8037        )?
8038        .into_result::<DirConnectorRouterMarker>("route")?;
8039        Ok(_response.map(|x| x))
8040    }
8041}
8042
8043#[cfg(target_os = "fuchsia")]
8044impl From<DirConnectorRouterSynchronousProxy> for zx::Handle {
8045    fn from(value: DirConnectorRouterSynchronousProxy) -> Self {
8046        value.into_channel().into()
8047    }
8048}
8049
8050#[cfg(target_os = "fuchsia")]
8051impl From<fidl::Channel> for DirConnectorRouterSynchronousProxy {
8052    fn from(value: fidl::Channel) -> Self {
8053        Self::new(value)
8054    }
8055}
8056
8057#[derive(Debug, Clone)]
8058pub struct DirConnectorRouterProxy {
8059    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
8060}
8061
8062impl fidl::endpoints::Proxy for DirConnectorRouterProxy {
8063    type Protocol = DirConnectorRouterMarker;
8064
8065    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
8066        Self::new(inner)
8067    }
8068
8069    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
8070        self.client.into_channel().map_err(|client| Self { client })
8071    }
8072
8073    fn as_channel(&self) -> &::fidl::AsyncChannel {
8074        self.client.as_channel()
8075    }
8076}
8077
8078impl DirConnectorRouterProxy {
8079    /// Create a new Proxy for fuchsia.component.sandbox/DirConnectorRouter.
8080    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
8081        let protocol_name =
8082            <DirConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8083        Self { client: fidl::client::Client::new(channel, protocol_name) }
8084    }
8085
8086    /// Get a Stream of events from the remote end of the protocol.
8087    ///
8088    /// # Panics
8089    ///
8090    /// Panics if the event stream was already taken.
8091    pub fn take_event_stream(&self) -> DirConnectorRouterEventStream {
8092        DirConnectorRouterEventStream { event_receiver: self.client.take_event_receiver() }
8093    }
8094
8095    pub fn r#route(
8096        &self,
8097        mut payload: RouteRequest,
8098    ) -> fidl::client::QueryResponseFut<
8099        DirConnectorRouterRouteResult,
8100        fidl::encoding::DefaultFuchsiaResourceDialect,
8101    > {
8102        DirConnectorRouterProxyInterface::r#route(self, payload)
8103    }
8104}
8105
8106impl DirConnectorRouterProxyInterface for DirConnectorRouterProxy {
8107    type RouteResponseFut = fidl::client::QueryResponseFut<
8108        DirConnectorRouterRouteResult,
8109        fidl::encoding::DefaultFuchsiaResourceDialect,
8110    >;
8111    fn r#route(&self, mut payload: RouteRequest) -> Self::RouteResponseFut {
8112        fn _decode(
8113            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8114        ) -> Result<DirConnectorRouterRouteResult, fidl::Error> {
8115            let _response = fidl::client::decode_transaction_body::<
8116                fidl::encoding::FlexibleResultType<DirConnectorRouterRouteResponse, RouterError>,
8117                fidl::encoding::DefaultFuchsiaResourceDialect,
8118                0xd7e0f01da2c8e40,
8119            >(_buf?)?
8120            .into_result::<DirConnectorRouterMarker>("route")?;
8121            Ok(_response.map(|x| x))
8122        }
8123        self.client.send_query_and_decode::<RouteRequest, DirConnectorRouterRouteResult>(
8124            &mut payload,
8125            0xd7e0f01da2c8e40,
8126            fidl::encoding::DynamicFlags::FLEXIBLE,
8127            _decode,
8128        )
8129    }
8130}
8131
8132pub struct DirConnectorRouterEventStream {
8133    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
8134}
8135
8136impl std::marker::Unpin for DirConnectorRouterEventStream {}
8137
8138impl futures::stream::FusedStream for DirConnectorRouterEventStream {
8139    fn is_terminated(&self) -> bool {
8140        self.event_receiver.is_terminated()
8141    }
8142}
8143
8144impl futures::Stream for DirConnectorRouterEventStream {
8145    type Item = Result<DirConnectorRouterEvent, fidl::Error>;
8146
8147    fn poll_next(
8148        mut self: std::pin::Pin<&mut Self>,
8149        cx: &mut std::task::Context<'_>,
8150    ) -> std::task::Poll<Option<Self::Item>> {
8151        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
8152            &mut self.event_receiver,
8153            cx
8154        )?) {
8155            Some(buf) => std::task::Poll::Ready(Some(DirConnectorRouterEvent::decode(buf))),
8156            None => std::task::Poll::Ready(None),
8157        }
8158    }
8159}
8160
8161#[derive(Debug)]
8162pub enum DirConnectorRouterEvent {
8163    #[non_exhaustive]
8164    _UnknownEvent {
8165        /// Ordinal of the event that was sent.
8166        ordinal: u64,
8167    },
8168}
8169
8170impl DirConnectorRouterEvent {
8171    /// Decodes a message buffer as a [`DirConnectorRouterEvent`].
8172    fn decode(
8173        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
8174    ) -> Result<DirConnectorRouterEvent, fidl::Error> {
8175        let (bytes, _handles) = buf.split_mut();
8176        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8177        debug_assert_eq!(tx_header.tx_id, 0);
8178        match tx_header.ordinal {
8179            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
8180                Ok(DirConnectorRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
8181            }
8182            _ => Err(fidl::Error::UnknownOrdinal {
8183                ordinal: tx_header.ordinal,
8184                protocol_name:
8185                    <DirConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8186            }),
8187        }
8188    }
8189}
8190
8191/// A Stream of incoming requests for fuchsia.component.sandbox/DirConnectorRouter.
8192pub struct DirConnectorRouterRequestStream {
8193    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8194    is_terminated: bool,
8195}
8196
8197impl std::marker::Unpin for DirConnectorRouterRequestStream {}
8198
8199impl futures::stream::FusedStream for DirConnectorRouterRequestStream {
8200    fn is_terminated(&self) -> bool {
8201        self.is_terminated
8202    }
8203}
8204
8205impl fidl::endpoints::RequestStream for DirConnectorRouterRequestStream {
8206    type Protocol = DirConnectorRouterMarker;
8207    type ControlHandle = DirConnectorRouterControlHandle;
8208
8209    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
8210        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
8211    }
8212
8213    fn control_handle(&self) -> Self::ControlHandle {
8214        DirConnectorRouterControlHandle { inner: self.inner.clone() }
8215    }
8216
8217    fn into_inner(
8218        self,
8219    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
8220    {
8221        (self.inner, self.is_terminated)
8222    }
8223
8224    fn from_inner(
8225        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8226        is_terminated: bool,
8227    ) -> Self {
8228        Self { inner, is_terminated }
8229    }
8230}
8231
8232impl futures::Stream for DirConnectorRouterRequestStream {
8233    type Item = Result<DirConnectorRouterRequest, fidl::Error>;
8234
8235    fn poll_next(
8236        mut self: std::pin::Pin<&mut Self>,
8237        cx: &mut std::task::Context<'_>,
8238    ) -> std::task::Poll<Option<Self::Item>> {
8239        let this = &mut *self;
8240        if this.inner.check_shutdown(cx) {
8241            this.is_terminated = true;
8242            return std::task::Poll::Ready(None);
8243        }
8244        if this.is_terminated {
8245            panic!("polled DirConnectorRouterRequestStream after completion");
8246        }
8247        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
8248            |bytes, handles| {
8249                match this.inner.channel().read_etc(cx, bytes, handles) {
8250                    std::task::Poll::Ready(Ok(())) => {}
8251                    std::task::Poll::Pending => return std::task::Poll::Pending,
8252                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
8253                        this.is_terminated = true;
8254                        return std::task::Poll::Ready(None);
8255                    }
8256                    std::task::Poll::Ready(Err(e)) => {
8257                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
8258                            e.into(),
8259                        ))))
8260                    }
8261                }
8262
8263                // A message has been received from the channel
8264                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8265
8266                std::task::Poll::Ready(Some(match header.ordinal {
8267                0xd7e0f01da2c8e40 => {
8268                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
8269                    let mut req = fidl::new_empty!(RouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
8270                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RouteRequest>(&header, _body_bytes, handles, &mut req)?;
8271                    let control_handle = DirConnectorRouterControlHandle {
8272                        inner: this.inner.clone(),
8273                    };
8274                    Ok(DirConnectorRouterRequest::Route {payload: req,
8275                        responder: DirConnectorRouterRouteResponder {
8276                            control_handle: std::mem::ManuallyDrop::new(control_handle),
8277                            tx_id: header.tx_id,
8278                        },
8279                    })
8280                }
8281                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
8282                    Ok(DirConnectorRouterRequest::_UnknownMethod {
8283                        ordinal: header.ordinal,
8284                        control_handle: DirConnectorRouterControlHandle { inner: this.inner.clone() },
8285                        method_type: fidl::MethodType::OneWay,
8286                    })
8287                }
8288                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
8289                    this.inner.send_framework_err(
8290                        fidl::encoding::FrameworkErr::UnknownMethod,
8291                        header.tx_id,
8292                        header.ordinal,
8293                        header.dynamic_flags(),
8294                        (bytes, handles),
8295                    )?;
8296                    Ok(DirConnectorRouterRequest::_UnknownMethod {
8297                        ordinal: header.ordinal,
8298                        control_handle: DirConnectorRouterControlHandle { inner: this.inner.clone() },
8299                        method_type: fidl::MethodType::TwoWay,
8300                    })
8301                }
8302                _ => Err(fidl::Error::UnknownOrdinal {
8303                    ordinal: header.ordinal,
8304                    protocol_name: <DirConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8305                }),
8306            }))
8307            },
8308        )
8309    }
8310}
8311
8312#[derive(Debug)]
8313pub enum DirConnectorRouterRequest {
8314    Route {
8315        payload: RouteRequest,
8316        responder: DirConnectorRouterRouteResponder,
8317    },
8318    /// An interaction was received which does not match any known method.
8319    #[non_exhaustive]
8320    _UnknownMethod {
8321        /// Ordinal of the method that was called.
8322        ordinal: u64,
8323        control_handle: DirConnectorRouterControlHandle,
8324        method_type: fidl::MethodType,
8325    },
8326}
8327
8328impl DirConnectorRouterRequest {
8329    #[allow(irrefutable_let_patterns)]
8330    pub fn into_route(self) -> Option<(RouteRequest, DirConnectorRouterRouteResponder)> {
8331        if let DirConnectorRouterRequest::Route { payload, responder } = self {
8332            Some((payload, responder))
8333        } else {
8334            None
8335        }
8336    }
8337
8338    /// Name of the method defined in FIDL
8339    pub fn method_name(&self) -> &'static str {
8340        match *self {
8341            DirConnectorRouterRequest::Route { .. } => "route",
8342            DirConnectorRouterRequest::_UnknownMethod {
8343                method_type: fidl::MethodType::OneWay,
8344                ..
8345            } => "unknown one-way method",
8346            DirConnectorRouterRequest::_UnknownMethod {
8347                method_type: fidl::MethodType::TwoWay,
8348                ..
8349            } => "unknown two-way method",
8350        }
8351    }
8352}
8353
8354#[derive(Debug, Clone)]
8355pub struct DirConnectorRouterControlHandle {
8356    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8357}
8358
8359impl fidl::endpoints::ControlHandle for DirConnectorRouterControlHandle {
8360    fn shutdown(&self) {
8361        self.inner.shutdown()
8362    }
8363    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
8364        self.inner.shutdown_with_epitaph(status)
8365    }
8366
8367    fn is_closed(&self) -> bool {
8368        self.inner.channel().is_closed()
8369    }
8370    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
8371        self.inner.channel().on_closed()
8372    }
8373
8374    #[cfg(target_os = "fuchsia")]
8375    fn signal_peer(
8376        &self,
8377        clear_mask: zx::Signals,
8378        set_mask: zx::Signals,
8379    ) -> Result<(), zx_status::Status> {
8380        use fidl::Peered;
8381        self.inner.channel().signal_peer(clear_mask, set_mask)
8382    }
8383}
8384
8385impl DirConnectorRouterControlHandle {}
8386
8387#[must_use = "FIDL methods require a response to be sent"]
8388#[derive(Debug)]
8389pub struct DirConnectorRouterRouteResponder {
8390    control_handle: std::mem::ManuallyDrop<DirConnectorRouterControlHandle>,
8391    tx_id: u32,
8392}
8393
8394/// Set the the channel to be shutdown (see [`DirConnectorRouterControlHandle::shutdown`])
8395/// if the responder is dropped without sending a response, so that the client
8396/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8397impl std::ops::Drop for DirConnectorRouterRouteResponder {
8398    fn drop(&mut self) {
8399        self.control_handle.shutdown();
8400        // Safety: drops once, never accessed again
8401        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8402    }
8403}
8404
8405impl fidl::endpoints::Responder for DirConnectorRouterRouteResponder {
8406    type ControlHandle = DirConnectorRouterControlHandle;
8407
8408    fn control_handle(&self) -> &DirConnectorRouterControlHandle {
8409        &self.control_handle
8410    }
8411
8412    fn drop_without_shutdown(mut self) {
8413        // Safety: drops once, never accessed again due to mem::forget
8414        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8415        // Prevent Drop from running (which would shut down the channel)
8416        std::mem::forget(self);
8417    }
8418}
8419
8420impl DirConnectorRouterRouteResponder {
8421    /// Sends a response to the FIDL transaction.
8422    ///
8423    /// Sets the channel to shutdown if an error occurs.
8424    pub fn send(
8425        self,
8426        mut result: Result<DirConnectorRouterRouteResponse, RouterError>,
8427    ) -> Result<(), fidl::Error> {
8428        let _result = self.send_raw(result);
8429        if _result.is_err() {
8430            self.control_handle.shutdown();
8431        }
8432        self.drop_without_shutdown();
8433        _result
8434    }
8435
8436    /// Similar to "send" but does not shutdown the channel if an error occurs.
8437    pub fn send_no_shutdown_on_err(
8438        self,
8439        mut result: Result<DirConnectorRouterRouteResponse, RouterError>,
8440    ) -> Result<(), fidl::Error> {
8441        let _result = self.send_raw(result);
8442        self.drop_without_shutdown();
8443        _result
8444    }
8445
8446    fn send_raw(
8447        &self,
8448        mut result: Result<DirConnectorRouterRouteResponse, RouterError>,
8449    ) -> Result<(), fidl::Error> {
8450        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
8451            DirConnectorRouterRouteResponse,
8452            RouterError,
8453        >>(
8454            fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
8455            self.tx_id,
8456            0xd7e0f01da2c8e40,
8457            fidl::encoding::DynamicFlags::FLEXIBLE,
8458        )
8459    }
8460}
8461
8462#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
8463pub struct DirEntryRouterMarker;
8464
8465impl fidl::endpoints::ProtocolMarker for DirEntryRouterMarker {
8466    type Proxy = DirEntryRouterProxy;
8467    type RequestStream = DirEntryRouterRequestStream;
8468    #[cfg(target_os = "fuchsia")]
8469    type SynchronousProxy = DirEntryRouterSynchronousProxy;
8470
8471    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.DirEntryRouter";
8472}
8473impl fidl::endpoints::DiscoverableProtocolMarker for DirEntryRouterMarker {}
8474pub type DirEntryRouterRouteResult = Result<DirEntryRouterRouteResponse, RouterError>;
8475
8476pub trait DirEntryRouterProxyInterface: Send + Sync {
8477    type RouteResponseFut: std::future::Future<Output = Result<DirEntryRouterRouteResult, fidl::Error>>
8478        + Send;
8479    fn r#route(&self, payload: RouteRequest) -> Self::RouteResponseFut;
8480}
8481#[derive(Debug)]
8482#[cfg(target_os = "fuchsia")]
8483pub struct DirEntryRouterSynchronousProxy {
8484    client: fidl::client::sync::Client,
8485}
8486
8487#[cfg(target_os = "fuchsia")]
8488impl fidl::endpoints::SynchronousProxy for DirEntryRouterSynchronousProxy {
8489    type Proxy = DirEntryRouterProxy;
8490    type Protocol = DirEntryRouterMarker;
8491
8492    fn from_channel(inner: fidl::Channel) -> Self {
8493        Self::new(inner)
8494    }
8495
8496    fn into_channel(self) -> fidl::Channel {
8497        self.client.into_channel()
8498    }
8499
8500    fn as_channel(&self) -> &fidl::Channel {
8501        self.client.as_channel()
8502    }
8503}
8504
8505#[cfg(target_os = "fuchsia")]
8506impl DirEntryRouterSynchronousProxy {
8507    pub fn new(channel: fidl::Channel) -> Self {
8508        let protocol_name = <DirEntryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8509        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
8510    }
8511
8512    pub fn into_channel(self) -> fidl::Channel {
8513        self.client.into_channel()
8514    }
8515
8516    /// Waits until an event arrives and returns it. It is safe for other
8517    /// threads to make concurrent requests while waiting for an event.
8518    pub fn wait_for_event(
8519        &self,
8520        deadline: zx::MonotonicInstant,
8521    ) -> Result<DirEntryRouterEvent, fidl::Error> {
8522        DirEntryRouterEvent::decode(self.client.wait_for_event(deadline)?)
8523    }
8524
8525    pub fn r#route(
8526        &self,
8527        mut payload: RouteRequest,
8528        ___deadline: zx::MonotonicInstant,
8529    ) -> Result<DirEntryRouterRouteResult, fidl::Error> {
8530        let _response = self.client.send_query::<
8531            RouteRequest,
8532            fidl::encoding::FlexibleResultType<DirEntryRouterRouteResponse, RouterError>,
8533        >(
8534            &mut payload,
8535            0x1ac694001c208bd2,
8536            fidl::encoding::DynamicFlags::FLEXIBLE,
8537            ___deadline,
8538        )?
8539        .into_result::<DirEntryRouterMarker>("route")?;
8540        Ok(_response.map(|x| x))
8541    }
8542}
8543
8544#[cfg(target_os = "fuchsia")]
8545impl From<DirEntryRouterSynchronousProxy> for zx::Handle {
8546    fn from(value: DirEntryRouterSynchronousProxy) -> Self {
8547        value.into_channel().into()
8548    }
8549}
8550
8551#[cfg(target_os = "fuchsia")]
8552impl From<fidl::Channel> for DirEntryRouterSynchronousProxy {
8553    fn from(value: fidl::Channel) -> Self {
8554        Self::new(value)
8555    }
8556}
8557
8558#[derive(Debug, Clone)]
8559pub struct DirEntryRouterProxy {
8560    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
8561}
8562
8563impl fidl::endpoints::Proxy for DirEntryRouterProxy {
8564    type Protocol = DirEntryRouterMarker;
8565
8566    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
8567        Self::new(inner)
8568    }
8569
8570    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
8571        self.client.into_channel().map_err(|client| Self { client })
8572    }
8573
8574    fn as_channel(&self) -> &::fidl::AsyncChannel {
8575        self.client.as_channel()
8576    }
8577}
8578
8579impl DirEntryRouterProxy {
8580    /// Create a new Proxy for fuchsia.component.sandbox/DirEntryRouter.
8581    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
8582        let protocol_name = <DirEntryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8583        Self { client: fidl::client::Client::new(channel, protocol_name) }
8584    }
8585
8586    /// Get a Stream of events from the remote end of the protocol.
8587    ///
8588    /// # Panics
8589    ///
8590    /// Panics if the event stream was already taken.
8591    pub fn take_event_stream(&self) -> DirEntryRouterEventStream {
8592        DirEntryRouterEventStream { event_receiver: self.client.take_event_receiver() }
8593    }
8594
8595    pub fn r#route(
8596        &self,
8597        mut payload: RouteRequest,
8598    ) -> fidl::client::QueryResponseFut<
8599        DirEntryRouterRouteResult,
8600        fidl::encoding::DefaultFuchsiaResourceDialect,
8601    > {
8602        DirEntryRouterProxyInterface::r#route(self, payload)
8603    }
8604}
8605
8606impl DirEntryRouterProxyInterface for DirEntryRouterProxy {
8607    type RouteResponseFut = fidl::client::QueryResponseFut<
8608        DirEntryRouterRouteResult,
8609        fidl::encoding::DefaultFuchsiaResourceDialect,
8610    >;
8611    fn r#route(&self, mut payload: RouteRequest) -> Self::RouteResponseFut {
8612        fn _decode(
8613            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8614        ) -> Result<DirEntryRouterRouteResult, fidl::Error> {
8615            let _response = fidl::client::decode_transaction_body::<
8616                fidl::encoding::FlexibleResultType<DirEntryRouterRouteResponse, RouterError>,
8617                fidl::encoding::DefaultFuchsiaResourceDialect,
8618                0x1ac694001c208bd2,
8619            >(_buf?)?
8620            .into_result::<DirEntryRouterMarker>("route")?;
8621            Ok(_response.map(|x| x))
8622        }
8623        self.client.send_query_and_decode::<RouteRequest, DirEntryRouterRouteResult>(
8624            &mut payload,
8625            0x1ac694001c208bd2,
8626            fidl::encoding::DynamicFlags::FLEXIBLE,
8627            _decode,
8628        )
8629    }
8630}
8631
8632pub struct DirEntryRouterEventStream {
8633    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
8634}
8635
8636impl std::marker::Unpin for DirEntryRouterEventStream {}
8637
8638impl futures::stream::FusedStream for DirEntryRouterEventStream {
8639    fn is_terminated(&self) -> bool {
8640        self.event_receiver.is_terminated()
8641    }
8642}
8643
8644impl futures::Stream for DirEntryRouterEventStream {
8645    type Item = Result<DirEntryRouterEvent, fidl::Error>;
8646
8647    fn poll_next(
8648        mut self: std::pin::Pin<&mut Self>,
8649        cx: &mut std::task::Context<'_>,
8650    ) -> std::task::Poll<Option<Self::Item>> {
8651        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
8652            &mut self.event_receiver,
8653            cx
8654        )?) {
8655            Some(buf) => std::task::Poll::Ready(Some(DirEntryRouterEvent::decode(buf))),
8656            None => std::task::Poll::Ready(None),
8657        }
8658    }
8659}
8660
8661#[derive(Debug)]
8662pub enum DirEntryRouterEvent {
8663    #[non_exhaustive]
8664    _UnknownEvent {
8665        /// Ordinal of the event that was sent.
8666        ordinal: u64,
8667    },
8668}
8669
8670impl DirEntryRouterEvent {
8671    /// Decodes a message buffer as a [`DirEntryRouterEvent`].
8672    fn decode(
8673        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
8674    ) -> Result<DirEntryRouterEvent, fidl::Error> {
8675        let (bytes, _handles) = buf.split_mut();
8676        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8677        debug_assert_eq!(tx_header.tx_id, 0);
8678        match tx_header.ordinal {
8679            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
8680                Ok(DirEntryRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
8681            }
8682            _ => Err(fidl::Error::UnknownOrdinal {
8683                ordinal: tx_header.ordinal,
8684                protocol_name:
8685                    <DirEntryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8686            }),
8687        }
8688    }
8689}
8690
8691/// A Stream of incoming requests for fuchsia.component.sandbox/DirEntryRouter.
8692pub struct DirEntryRouterRequestStream {
8693    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8694    is_terminated: bool,
8695}
8696
8697impl std::marker::Unpin for DirEntryRouterRequestStream {}
8698
8699impl futures::stream::FusedStream for DirEntryRouterRequestStream {
8700    fn is_terminated(&self) -> bool {
8701        self.is_terminated
8702    }
8703}
8704
8705impl fidl::endpoints::RequestStream for DirEntryRouterRequestStream {
8706    type Protocol = DirEntryRouterMarker;
8707    type ControlHandle = DirEntryRouterControlHandle;
8708
8709    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
8710        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
8711    }
8712
8713    fn control_handle(&self) -> Self::ControlHandle {
8714        DirEntryRouterControlHandle { inner: self.inner.clone() }
8715    }
8716
8717    fn into_inner(
8718        self,
8719    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
8720    {
8721        (self.inner, self.is_terminated)
8722    }
8723
8724    fn from_inner(
8725        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8726        is_terminated: bool,
8727    ) -> Self {
8728        Self { inner, is_terminated }
8729    }
8730}
8731
8732impl futures::Stream for DirEntryRouterRequestStream {
8733    type Item = Result<DirEntryRouterRequest, fidl::Error>;
8734
8735    fn poll_next(
8736        mut self: std::pin::Pin<&mut Self>,
8737        cx: &mut std::task::Context<'_>,
8738    ) -> std::task::Poll<Option<Self::Item>> {
8739        let this = &mut *self;
8740        if this.inner.check_shutdown(cx) {
8741            this.is_terminated = true;
8742            return std::task::Poll::Ready(None);
8743        }
8744        if this.is_terminated {
8745            panic!("polled DirEntryRouterRequestStream after completion");
8746        }
8747        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
8748            |bytes, handles| {
8749                match this.inner.channel().read_etc(cx, bytes, handles) {
8750                    std::task::Poll::Ready(Ok(())) => {}
8751                    std::task::Poll::Pending => return std::task::Poll::Pending,
8752                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
8753                        this.is_terminated = true;
8754                        return std::task::Poll::Ready(None);
8755                    }
8756                    std::task::Poll::Ready(Err(e)) => {
8757                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
8758                            e.into(),
8759                        ))))
8760                    }
8761                }
8762
8763                // A message has been received from the channel
8764                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8765
8766                std::task::Poll::Ready(Some(match header.ordinal {
8767                    0x1ac694001c208bd2 => {
8768                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
8769                        let mut req = fidl::new_empty!(
8770                            RouteRequest,
8771                            fidl::encoding::DefaultFuchsiaResourceDialect
8772                        );
8773                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RouteRequest>(&header, _body_bytes, handles, &mut req)?;
8774                        let control_handle =
8775                            DirEntryRouterControlHandle { inner: this.inner.clone() };
8776                        Ok(DirEntryRouterRequest::Route {
8777                            payload: req,
8778                            responder: DirEntryRouterRouteResponder {
8779                                control_handle: std::mem::ManuallyDrop::new(control_handle),
8780                                tx_id: header.tx_id,
8781                            },
8782                        })
8783                    }
8784                    _ if header.tx_id == 0
8785                        && header
8786                            .dynamic_flags()
8787                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
8788                    {
8789                        Ok(DirEntryRouterRequest::_UnknownMethod {
8790                            ordinal: header.ordinal,
8791                            control_handle: DirEntryRouterControlHandle {
8792                                inner: this.inner.clone(),
8793                            },
8794                            method_type: fidl::MethodType::OneWay,
8795                        })
8796                    }
8797                    _ if header
8798                        .dynamic_flags()
8799                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
8800                    {
8801                        this.inner.send_framework_err(
8802                            fidl::encoding::FrameworkErr::UnknownMethod,
8803                            header.tx_id,
8804                            header.ordinal,
8805                            header.dynamic_flags(),
8806                            (bytes, handles),
8807                        )?;
8808                        Ok(DirEntryRouterRequest::_UnknownMethod {
8809                            ordinal: header.ordinal,
8810                            control_handle: DirEntryRouterControlHandle {
8811                                inner: this.inner.clone(),
8812                            },
8813                            method_type: fidl::MethodType::TwoWay,
8814                        })
8815                    }
8816                    _ => Err(fidl::Error::UnknownOrdinal {
8817                        ordinal: header.ordinal,
8818                        protocol_name:
8819                            <DirEntryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8820                    }),
8821                }))
8822            },
8823        )
8824    }
8825}
8826
8827#[derive(Debug)]
8828pub enum DirEntryRouterRequest {
8829    Route {
8830        payload: RouteRequest,
8831        responder: DirEntryRouterRouteResponder,
8832    },
8833    /// An interaction was received which does not match any known method.
8834    #[non_exhaustive]
8835    _UnknownMethod {
8836        /// Ordinal of the method that was called.
8837        ordinal: u64,
8838        control_handle: DirEntryRouterControlHandle,
8839        method_type: fidl::MethodType,
8840    },
8841}
8842
8843impl DirEntryRouterRequest {
8844    #[allow(irrefutable_let_patterns)]
8845    pub fn into_route(self) -> Option<(RouteRequest, DirEntryRouterRouteResponder)> {
8846        if let DirEntryRouterRequest::Route { payload, responder } = self {
8847            Some((payload, responder))
8848        } else {
8849            None
8850        }
8851    }
8852
8853    /// Name of the method defined in FIDL
8854    pub fn method_name(&self) -> &'static str {
8855        match *self {
8856            DirEntryRouterRequest::Route { .. } => "route",
8857            DirEntryRouterRequest::_UnknownMethod {
8858                method_type: fidl::MethodType::OneWay, ..
8859            } => "unknown one-way method",
8860            DirEntryRouterRequest::_UnknownMethod {
8861                method_type: fidl::MethodType::TwoWay, ..
8862            } => "unknown two-way method",
8863        }
8864    }
8865}
8866
8867#[derive(Debug, Clone)]
8868pub struct DirEntryRouterControlHandle {
8869    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8870}
8871
8872impl fidl::endpoints::ControlHandle for DirEntryRouterControlHandle {
8873    fn shutdown(&self) {
8874        self.inner.shutdown()
8875    }
8876    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
8877        self.inner.shutdown_with_epitaph(status)
8878    }
8879
8880    fn is_closed(&self) -> bool {
8881        self.inner.channel().is_closed()
8882    }
8883    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
8884        self.inner.channel().on_closed()
8885    }
8886
8887    #[cfg(target_os = "fuchsia")]
8888    fn signal_peer(
8889        &self,
8890        clear_mask: zx::Signals,
8891        set_mask: zx::Signals,
8892    ) -> Result<(), zx_status::Status> {
8893        use fidl::Peered;
8894        self.inner.channel().signal_peer(clear_mask, set_mask)
8895    }
8896}
8897
8898impl DirEntryRouterControlHandle {}
8899
8900#[must_use = "FIDL methods require a response to be sent"]
8901#[derive(Debug)]
8902pub struct DirEntryRouterRouteResponder {
8903    control_handle: std::mem::ManuallyDrop<DirEntryRouterControlHandle>,
8904    tx_id: u32,
8905}
8906
8907/// Set the the channel to be shutdown (see [`DirEntryRouterControlHandle::shutdown`])
8908/// if the responder is dropped without sending a response, so that the client
8909/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8910impl std::ops::Drop for DirEntryRouterRouteResponder {
8911    fn drop(&mut self) {
8912        self.control_handle.shutdown();
8913        // Safety: drops once, never accessed again
8914        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8915    }
8916}
8917
8918impl fidl::endpoints::Responder for DirEntryRouterRouteResponder {
8919    type ControlHandle = DirEntryRouterControlHandle;
8920
8921    fn control_handle(&self) -> &DirEntryRouterControlHandle {
8922        &self.control_handle
8923    }
8924
8925    fn drop_without_shutdown(mut self) {
8926        // Safety: drops once, never accessed again due to mem::forget
8927        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8928        // Prevent Drop from running (which would shut down the channel)
8929        std::mem::forget(self);
8930    }
8931}
8932
8933impl DirEntryRouterRouteResponder {
8934    /// Sends a response to the FIDL transaction.
8935    ///
8936    /// Sets the channel to shutdown if an error occurs.
8937    pub fn send(
8938        self,
8939        mut result: Result<DirEntryRouterRouteResponse, RouterError>,
8940    ) -> Result<(), fidl::Error> {
8941        let _result = self.send_raw(result);
8942        if _result.is_err() {
8943            self.control_handle.shutdown();
8944        }
8945        self.drop_without_shutdown();
8946        _result
8947    }
8948
8949    /// Similar to "send" but does not shutdown the channel if an error occurs.
8950    pub fn send_no_shutdown_on_err(
8951        self,
8952        mut result: Result<DirEntryRouterRouteResponse, RouterError>,
8953    ) -> Result<(), fidl::Error> {
8954        let _result = self.send_raw(result);
8955        self.drop_without_shutdown();
8956        _result
8957    }
8958
8959    fn send_raw(
8960        &self,
8961        mut result: Result<DirEntryRouterRouteResponse, RouterError>,
8962    ) -> Result<(), fidl::Error> {
8963        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
8964            DirEntryRouterRouteResponse,
8965            RouterError,
8966        >>(
8967            fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
8968            self.tx_id,
8969            0x1ac694001c208bd2,
8970            fidl::encoding::DynamicFlags::FLEXIBLE,
8971        )
8972    }
8973}
8974
8975#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
8976pub struct DirReceiverMarker;
8977
8978impl fidl::endpoints::ProtocolMarker for DirReceiverMarker {
8979    type Proxy = DirReceiverProxy;
8980    type RequestStream = DirReceiverRequestStream;
8981    #[cfg(target_os = "fuchsia")]
8982    type SynchronousProxy = DirReceiverSynchronousProxy;
8983
8984    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.DirReceiver";
8985}
8986impl fidl::endpoints::DiscoverableProtocolMarker for DirReceiverMarker {}
8987
8988pub trait DirReceiverProxyInterface: Send + Sync {
8989    fn r#receive(
8990        &self,
8991        channel: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
8992    ) -> Result<(), fidl::Error>;
8993}
8994#[derive(Debug)]
8995#[cfg(target_os = "fuchsia")]
8996pub struct DirReceiverSynchronousProxy {
8997    client: fidl::client::sync::Client,
8998}
8999
9000#[cfg(target_os = "fuchsia")]
9001impl fidl::endpoints::SynchronousProxy for DirReceiverSynchronousProxy {
9002    type Proxy = DirReceiverProxy;
9003    type Protocol = DirReceiverMarker;
9004
9005    fn from_channel(inner: fidl::Channel) -> Self {
9006        Self::new(inner)
9007    }
9008
9009    fn into_channel(self) -> fidl::Channel {
9010        self.client.into_channel()
9011    }
9012
9013    fn as_channel(&self) -> &fidl::Channel {
9014        self.client.as_channel()
9015    }
9016}
9017
9018#[cfg(target_os = "fuchsia")]
9019impl DirReceiverSynchronousProxy {
9020    pub fn new(channel: fidl::Channel) -> Self {
9021        let protocol_name = <DirReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
9022        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
9023    }
9024
9025    pub fn into_channel(self) -> fidl::Channel {
9026        self.client.into_channel()
9027    }
9028
9029    /// Waits until an event arrives and returns it. It is safe for other
9030    /// threads to make concurrent requests while waiting for an event.
9031    pub fn wait_for_event(
9032        &self,
9033        deadline: zx::MonotonicInstant,
9034    ) -> Result<DirReceiverEvent, fidl::Error> {
9035        DirReceiverEvent::decode(self.client.wait_for_event(deadline)?)
9036    }
9037
9038    /// Sends a directory channel to this receiver.
9039    ///
9040    /// The server should implement this method by forwarding `channel` to a vfs instance
9041    /// of the language appropriate `vfs` library. To keep this interface decoupled from
9042    /// `fuchsia.io`, it deliberately omits `Open`/`Open3` parameters such as `flags` and
9043    /// `path`. If a client wishes to specify these, they can obtain an initial
9044    /// [fuchsia.io/Directory] channel first and then call `Open`/`Open3` on it.
9045    pub fn r#receive(
9046        &self,
9047        mut channel: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
9048    ) -> Result<(), fidl::Error> {
9049        self.client.send::<DirReceiverReceiveRequest>(
9050            (channel,),
9051            0xcdc3e9b89fe7bb4,
9052            fidl::encoding::DynamicFlags::FLEXIBLE,
9053        )
9054    }
9055}
9056
9057#[cfg(target_os = "fuchsia")]
9058impl From<DirReceiverSynchronousProxy> for zx::Handle {
9059    fn from(value: DirReceiverSynchronousProxy) -> Self {
9060        value.into_channel().into()
9061    }
9062}
9063
9064#[cfg(target_os = "fuchsia")]
9065impl From<fidl::Channel> for DirReceiverSynchronousProxy {
9066    fn from(value: fidl::Channel) -> Self {
9067        Self::new(value)
9068    }
9069}
9070
9071#[derive(Debug, Clone)]
9072pub struct DirReceiverProxy {
9073    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
9074}
9075
9076impl fidl::endpoints::Proxy for DirReceiverProxy {
9077    type Protocol = DirReceiverMarker;
9078
9079    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
9080        Self::new(inner)
9081    }
9082
9083    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
9084        self.client.into_channel().map_err(|client| Self { client })
9085    }
9086
9087    fn as_channel(&self) -> &::fidl::AsyncChannel {
9088        self.client.as_channel()
9089    }
9090}
9091
9092impl DirReceiverProxy {
9093    /// Create a new Proxy for fuchsia.component.sandbox/DirReceiver.
9094    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
9095        let protocol_name = <DirReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
9096        Self { client: fidl::client::Client::new(channel, protocol_name) }
9097    }
9098
9099    /// Get a Stream of events from the remote end of the protocol.
9100    ///
9101    /// # Panics
9102    ///
9103    /// Panics if the event stream was already taken.
9104    pub fn take_event_stream(&self) -> DirReceiverEventStream {
9105        DirReceiverEventStream { event_receiver: self.client.take_event_receiver() }
9106    }
9107
9108    /// Sends a directory channel to this receiver.
9109    ///
9110    /// The server should implement this method by forwarding `channel` to a vfs instance
9111    /// of the language appropriate `vfs` library. To keep this interface decoupled from
9112    /// `fuchsia.io`, it deliberately omits `Open`/`Open3` parameters such as `flags` and
9113    /// `path`. If a client wishes to specify these, they can obtain an initial
9114    /// [fuchsia.io/Directory] channel first and then call `Open`/`Open3` on it.
9115    pub fn r#receive(
9116        &self,
9117        mut channel: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
9118    ) -> Result<(), fidl::Error> {
9119        DirReceiverProxyInterface::r#receive(self, channel)
9120    }
9121}
9122
9123impl DirReceiverProxyInterface for DirReceiverProxy {
9124    fn r#receive(
9125        &self,
9126        mut channel: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
9127    ) -> Result<(), fidl::Error> {
9128        self.client.send::<DirReceiverReceiveRequest>(
9129            (channel,),
9130            0xcdc3e9b89fe7bb4,
9131            fidl::encoding::DynamicFlags::FLEXIBLE,
9132        )
9133    }
9134}
9135
9136pub struct DirReceiverEventStream {
9137    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
9138}
9139
9140impl std::marker::Unpin for DirReceiverEventStream {}
9141
9142impl futures::stream::FusedStream for DirReceiverEventStream {
9143    fn is_terminated(&self) -> bool {
9144        self.event_receiver.is_terminated()
9145    }
9146}
9147
9148impl futures::Stream for DirReceiverEventStream {
9149    type Item = Result<DirReceiverEvent, fidl::Error>;
9150
9151    fn poll_next(
9152        mut self: std::pin::Pin<&mut Self>,
9153        cx: &mut std::task::Context<'_>,
9154    ) -> std::task::Poll<Option<Self::Item>> {
9155        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
9156            &mut self.event_receiver,
9157            cx
9158        )?) {
9159            Some(buf) => std::task::Poll::Ready(Some(DirReceiverEvent::decode(buf))),
9160            None => std::task::Poll::Ready(None),
9161        }
9162    }
9163}
9164
9165#[derive(Debug)]
9166pub enum DirReceiverEvent {
9167    #[non_exhaustive]
9168    _UnknownEvent {
9169        /// Ordinal of the event that was sent.
9170        ordinal: u64,
9171    },
9172}
9173
9174impl DirReceiverEvent {
9175    /// Decodes a message buffer as a [`DirReceiverEvent`].
9176    fn decode(
9177        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
9178    ) -> Result<DirReceiverEvent, fidl::Error> {
9179        let (bytes, _handles) = buf.split_mut();
9180        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9181        debug_assert_eq!(tx_header.tx_id, 0);
9182        match tx_header.ordinal {
9183            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
9184                Ok(DirReceiverEvent::_UnknownEvent { ordinal: tx_header.ordinal })
9185            }
9186            _ => Err(fidl::Error::UnknownOrdinal {
9187                ordinal: tx_header.ordinal,
9188                protocol_name: <DirReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9189            }),
9190        }
9191    }
9192}
9193
9194/// A Stream of incoming requests for fuchsia.component.sandbox/DirReceiver.
9195pub struct DirReceiverRequestStream {
9196    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9197    is_terminated: bool,
9198}
9199
9200impl std::marker::Unpin for DirReceiverRequestStream {}
9201
9202impl futures::stream::FusedStream for DirReceiverRequestStream {
9203    fn is_terminated(&self) -> bool {
9204        self.is_terminated
9205    }
9206}
9207
9208impl fidl::endpoints::RequestStream for DirReceiverRequestStream {
9209    type Protocol = DirReceiverMarker;
9210    type ControlHandle = DirReceiverControlHandle;
9211
9212    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
9213        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
9214    }
9215
9216    fn control_handle(&self) -> Self::ControlHandle {
9217        DirReceiverControlHandle { inner: self.inner.clone() }
9218    }
9219
9220    fn into_inner(
9221        self,
9222    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
9223    {
9224        (self.inner, self.is_terminated)
9225    }
9226
9227    fn from_inner(
9228        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9229        is_terminated: bool,
9230    ) -> Self {
9231        Self { inner, is_terminated }
9232    }
9233}
9234
9235impl futures::Stream for DirReceiverRequestStream {
9236    type Item = Result<DirReceiverRequest, fidl::Error>;
9237
9238    fn poll_next(
9239        mut self: std::pin::Pin<&mut Self>,
9240        cx: &mut std::task::Context<'_>,
9241    ) -> std::task::Poll<Option<Self::Item>> {
9242        let this = &mut *self;
9243        if this.inner.check_shutdown(cx) {
9244            this.is_terminated = true;
9245            return std::task::Poll::Ready(None);
9246        }
9247        if this.is_terminated {
9248            panic!("polled DirReceiverRequestStream after completion");
9249        }
9250        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
9251            |bytes, handles| {
9252                match this.inner.channel().read_etc(cx, bytes, handles) {
9253                    std::task::Poll::Ready(Ok(())) => {}
9254                    std::task::Poll::Pending => return std::task::Poll::Pending,
9255                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
9256                        this.is_terminated = true;
9257                        return std::task::Poll::Ready(None);
9258                    }
9259                    std::task::Poll::Ready(Err(e)) => {
9260                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
9261                            e.into(),
9262                        ))))
9263                    }
9264                }
9265
9266                // A message has been received from the channel
9267                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9268
9269                std::task::Poll::Ready(Some(match header.ordinal {
9270                    0xcdc3e9b89fe7bb4 => {
9271                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
9272                        let mut req = fidl::new_empty!(
9273                            DirReceiverReceiveRequest,
9274                            fidl::encoding::DefaultFuchsiaResourceDialect
9275                        );
9276                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirReceiverReceiveRequest>(&header, _body_bytes, handles, &mut req)?;
9277                        let control_handle = DirReceiverControlHandle { inner: this.inner.clone() };
9278                        Ok(DirReceiverRequest::Receive { channel: req.channel, control_handle })
9279                    }
9280                    _ if header.tx_id == 0
9281                        && header
9282                            .dynamic_flags()
9283                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
9284                    {
9285                        Ok(DirReceiverRequest::_UnknownMethod {
9286                            ordinal: header.ordinal,
9287                            control_handle: DirReceiverControlHandle { inner: this.inner.clone() },
9288                            method_type: fidl::MethodType::OneWay,
9289                        })
9290                    }
9291                    _ if header
9292                        .dynamic_flags()
9293                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
9294                    {
9295                        this.inner.send_framework_err(
9296                            fidl::encoding::FrameworkErr::UnknownMethod,
9297                            header.tx_id,
9298                            header.ordinal,
9299                            header.dynamic_flags(),
9300                            (bytes, handles),
9301                        )?;
9302                        Ok(DirReceiverRequest::_UnknownMethod {
9303                            ordinal: header.ordinal,
9304                            control_handle: DirReceiverControlHandle { inner: this.inner.clone() },
9305                            method_type: fidl::MethodType::TwoWay,
9306                        })
9307                    }
9308                    _ => Err(fidl::Error::UnknownOrdinal {
9309                        ordinal: header.ordinal,
9310                        protocol_name:
9311                            <DirReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9312                    }),
9313                }))
9314            },
9315        )
9316    }
9317}
9318
9319/// A receiver is served by components and allows them to receive directory channels
9320/// framework.
9321#[derive(Debug)]
9322pub enum DirReceiverRequest {
9323    /// Sends a directory channel to this receiver.
9324    ///
9325    /// The server should implement this method by forwarding `channel` to a vfs instance
9326    /// of the language appropriate `vfs` library. To keep this interface decoupled from
9327    /// `fuchsia.io`, it deliberately omits `Open`/`Open3` parameters such as `flags` and
9328    /// `path`. If a client wishes to specify these, they can obtain an initial
9329    /// [fuchsia.io/Directory] channel first and then call `Open`/`Open3` on it.
9330    Receive {
9331        channel: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
9332        control_handle: DirReceiverControlHandle,
9333    },
9334    /// An interaction was received which does not match any known method.
9335    #[non_exhaustive]
9336    _UnknownMethod {
9337        /// Ordinal of the method that was called.
9338        ordinal: u64,
9339        control_handle: DirReceiverControlHandle,
9340        method_type: fidl::MethodType,
9341    },
9342}
9343
9344impl DirReceiverRequest {
9345    #[allow(irrefutable_let_patterns)]
9346    pub fn into_receive(
9347        self,
9348    ) -> Option<(
9349        fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
9350        DirReceiverControlHandle,
9351    )> {
9352        if let DirReceiverRequest::Receive { channel, control_handle } = self {
9353            Some((channel, control_handle))
9354        } else {
9355            None
9356        }
9357    }
9358
9359    /// Name of the method defined in FIDL
9360    pub fn method_name(&self) -> &'static str {
9361        match *self {
9362            DirReceiverRequest::Receive { .. } => "receive",
9363            DirReceiverRequest::_UnknownMethod {
9364                method_type: fidl::MethodType::OneWay, ..
9365            } => "unknown one-way method",
9366            DirReceiverRequest::_UnknownMethod {
9367                method_type: fidl::MethodType::TwoWay, ..
9368            } => "unknown two-way method",
9369        }
9370    }
9371}
9372
9373#[derive(Debug, Clone)]
9374pub struct DirReceiverControlHandle {
9375    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9376}
9377
9378impl fidl::endpoints::ControlHandle for DirReceiverControlHandle {
9379    fn shutdown(&self) {
9380        self.inner.shutdown()
9381    }
9382    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
9383        self.inner.shutdown_with_epitaph(status)
9384    }
9385
9386    fn is_closed(&self) -> bool {
9387        self.inner.channel().is_closed()
9388    }
9389    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
9390        self.inner.channel().on_closed()
9391    }
9392
9393    #[cfg(target_os = "fuchsia")]
9394    fn signal_peer(
9395        &self,
9396        clear_mask: zx::Signals,
9397        set_mask: zx::Signals,
9398    ) -> Result<(), zx_status::Status> {
9399        use fidl::Peered;
9400        self.inner.channel().signal_peer(clear_mask, set_mask)
9401    }
9402}
9403
9404impl DirReceiverControlHandle {}
9405
9406#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
9407pub struct DirectoryRouterMarker;
9408
9409impl fidl::endpoints::ProtocolMarker for DirectoryRouterMarker {
9410    type Proxy = DirectoryRouterProxy;
9411    type RequestStream = DirectoryRouterRequestStream;
9412    #[cfg(target_os = "fuchsia")]
9413    type SynchronousProxy = DirectoryRouterSynchronousProxy;
9414
9415    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.DirectoryRouter";
9416}
9417impl fidl::endpoints::DiscoverableProtocolMarker for DirectoryRouterMarker {}
9418pub type DirectoryRouterRouteResult = Result<DirectoryRouterRouteResponse, RouterError>;
9419
9420pub trait DirectoryRouterProxyInterface: Send + Sync {
9421    type RouteResponseFut: std::future::Future<Output = Result<DirectoryRouterRouteResult, fidl::Error>>
9422        + Send;
9423    fn r#route(&self, payload: RouteRequest) -> Self::RouteResponseFut;
9424}
9425#[derive(Debug)]
9426#[cfg(target_os = "fuchsia")]
9427pub struct DirectoryRouterSynchronousProxy {
9428    client: fidl::client::sync::Client,
9429}
9430
9431#[cfg(target_os = "fuchsia")]
9432impl fidl::endpoints::SynchronousProxy for DirectoryRouterSynchronousProxy {
9433    type Proxy = DirectoryRouterProxy;
9434    type Protocol = DirectoryRouterMarker;
9435
9436    fn from_channel(inner: fidl::Channel) -> Self {
9437        Self::new(inner)
9438    }
9439
9440    fn into_channel(self) -> fidl::Channel {
9441        self.client.into_channel()
9442    }
9443
9444    fn as_channel(&self) -> &fidl::Channel {
9445        self.client.as_channel()
9446    }
9447}
9448
9449#[cfg(target_os = "fuchsia")]
9450impl DirectoryRouterSynchronousProxy {
9451    pub fn new(channel: fidl::Channel) -> Self {
9452        let protocol_name = <DirectoryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
9453        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
9454    }
9455
9456    pub fn into_channel(self) -> fidl::Channel {
9457        self.client.into_channel()
9458    }
9459
9460    /// Waits until an event arrives and returns it. It is safe for other
9461    /// threads to make concurrent requests while waiting for an event.
9462    pub fn wait_for_event(
9463        &self,
9464        deadline: zx::MonotonicInstant,
9465    ) -> Result<DirectoryRouterEvent, fidl::Error> {
9466        DirectoryRouterEvent::decode(self.client.wait_for_event(deadline)?)
9467    }
9468
9469    pub fn r#route(
9470        &self,
9471        mut payload: RouteRequest,
9472        ___deadline: zx::MonotonicInstant,
9473    ) -> Result<DirectoryRouterRouteResult, fidl::Error> {
9474        let _response = self.client.send_query::<
9475            RouteRequest,
9476            fidl::encoding::FlexibleResultType<DirectoryRouterRouteResponse, RouterError>,
9477        >(
9478            &mut payload,
9479            0x683b6c6be21b0f21,
9480            fidl::encoding::DynamicFlags::FLEXIBLE,
9481            ___deadline,
9482        )?
9483        .into_result::<DirectoryRouterMarker>("route")?;
9484        Ok(_response.map(|x| x))
9485    }
9486}
9487
9488#[cfg(target_os = "fuchsia")]
9489impl From<DirectoryRouterSynchronousProxy> for zx::Handle {
9490    fn from(value: DirectoryRouterSynchronousProxy) -> Self {
9491        value.into_channel().into()
9492    }
9493}
9494
9495#[cfg(target_os = "fuchsia")]
9496impl From<fidl::Channel> for DirectoryRouterSynchronousProxy {
9497    fn from(value: fidl::Channel) -> Self {
9498        Self::new(value)
9499    }
9500}
9501
9502#[derive(Debug, Clone)]
9503pub struct DirectoryRouterProxy {
9504    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
9505}
9506
9507impl fidl::endpoints::Proxy for DirectoryRouterProxy {
9508    type Protocol = DirectoryRouterMarker;
9509
9510    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
9511        Self::new(inner)
9512    }
9513
9514    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
9515        self.client.into_channel().map_err(|client| Self { client })
9516    }
9517
9518    fn as_channel(&self) -> &::fidl::AsyncChannel {
9519        self.client.as_channel()
9520    }
9521}
9522
9523impl DirectoryRouterProxy {
9524    /// Create a new Proxy for fuchsia.component.sandbox/DirectoryRouter.
9525    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
9526        let protocol_name = <DirectoryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
9527        Self { client: fidl::client::Client::new(channel, protocol_name) }
9528    }
9529
9530    /// Get a Stream of events from the remote end of the protocol.
9531    ///
9532    /// # Panics
9533    ///
9534    /// Panics if the event stream was already taken.
9535    pub fn take_event_stream(&self) -> DirectoryRouterEventStream {
9536        DirectoryRouterEventStream { event_receiver: self.client.take_event_receiver() }
9537    }
9538
9539    pub fn r#route(
9540        &self,
9541        mut payload: RouteRequest,
9542    ) -> fidl::client::QueryResponseFut<
9543        DirectoryRouterRouteResult,
9544        fidl::encoding::DefaultFuchsiaResourceDialect,
9545    > {
9546        DirectoryRouterProxyInterface::r#route(self, payload)
9547    }
9548}
9549
9550impl DirectoryRouterProxyInterface for DirectoryRouterProxy {
9551    type RouteResponseFut = fidl::client::QueryResponseFut<
9552        DirectoryRouterRouteResult,
9553        fidl::encoding::DefaultFuchsiaResourceDialect,
9554    >;
9555    fn r#route(&self, mut payload: RouteRequest) -> Self::RouteResponseFut {
9556        fn _decode(
9557            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9558        ) -> Result<DirectoryRouterRouteResult, fidl::Error> {
9559            let _response = fidl::client::decode_transaction_body::<
9560                fidl::encoding::FlexibleResultType<DirectoryRouterRouteResponse, RouterError>,
9561                fidl::encoding::DefaultFuchsiaResourceDialect,
9562                0x683b6c6be21b0f21,
9563            >(_buf?)?
9564            .into_result::<DirectoryRouterMarker>("route")?;
9565            Ok(_response.map(|x| x))
9566        }
9567        self.client.send_query_and_decode::<RouteRequest, DirectoryRouterRouteResult>(
9568            &mut payload,
9569            0x683b6c6be21b0f21,
9570            fidl::encoding::DynamicFlags::FLEXIBLE,
9571            _decode,
9572        )
9573    }
9574}
9575
9576pub struct DirectoryRouterEventStream {
9577    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
9578}
9579
9580impl std::marker::Unpin for DirectoryRouterEventStream {}
9581
9582impl futures::stream::FusedStream for DirectoryRouterEventStream {
9583    fn is_terminated(&self) -> bool {
9584        self.event_receiver.is_terminated()
9585    }
9586}
9587
9588impl futures::Stream for DirectoryRouterEventStream {
9589    type Item = Result<DirectoryRouterEvent, fidl::Error>;
9590
9591    fn poll_next(
9592        mut self: std::pin::Pin<&mut Self>,
9593        cx: &mut std::task::Context<'_>,
9594    ) -> std::task::Poll<Option<Self::Item>> {
9595        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
9596            &mut self.event_receiver,
9597            cx
9598        )?) {
9599            Some(buf) => std::task::Poll::Ready(Some(DirectoryRouterEvent::decode(buf))),
9600            None => std::task::Poll::Ready(None),
9601        }
9602    }
9603}
9604
9605#[derive(Debug)]
9606pub enum DirectoryRouterEvent {
9607    #[non_exhaustive]
9608    _UnknownEvent {
9609        /// Ordinal of the event that was sent.
9610        ordinal: u64,
9611    },
9612}
9613
9614impl DirectoryRouterEvent {
9615    /// Decodes a message buffer as a [`DirectoryRouterEvent`].
9616    fn decode(
9617        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
9618    ) -> Result<DirectoryRouterEvent, fidl::Error> {
9619        let (bytes, _handles) = buf.split_mut();
9620        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9621        debug_assert_eq!(tx_header.tx_id, 0);
9622        match tx_header.ordinal {
9623            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
9624                Ok(DirectoryRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
9625            }
9626            _ => Err(fidl::Error::UnknownOrdinal {
9627                ordinal: tx_header.ordinal,
9628                protocol_name:
9629                    <DirectoryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9630            }),
9631        }
9632    }
9633}
9634
9635/// A Stream of incoming requests for fuchsia.component.sandbox/DirectoryRouter.
9636pub struct DirectoryRouterRequestStream {
9637    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9638    is_terminated: bool,
9639}
9640
9641impl std::marker::Unpin for DirectoryRouterRequestStream {}
9642
9643impl futures::stream::FusedStream for DirectoryRouterRequestStream {
9644    fn is_terminated(&self) -> bool {
9645        self.is_terminated
9646    }
9647}
9648
9649impl fidl::endpoints::RequestStream for DirectoryRouterRequestStream {
9650    type Protocol = DirectoryRouterMarker;
9651    type ControlHandle = DirectoryRouterControlHandle;
9652
9653    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
9654        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
9655    }
9656
9657    fn control_handle(&self) -> Self::ControlHandle {
9658        DirectoryRouterControlHandle { inner: self.inner.clone() }
9659    }
9660
9661    fn into_inner(
9662        self,
9663    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
9664    {
9665        (self.inner, self.is_terminated)
9666    }
9667
9668    fn from_inner(
9669        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9670        is_terminated: bool,
9671    ) -> Self {
9672        Self { inner, is_terminated }
9673    }
9674}
9675
9676impl futures::Stream for DirectoryRouterRequestStream {
9677    type Item = Result<DirectoryRouterRequest, fidl::Error>;
9678
9679    fn poll_next(
9680        mut self: std::pin::Pin<&mut Self>,
9681        cx: &mut std::task::Context<'_>,
9682    ) -> std::task::Poll<Option<Self::Item>> {
9683        let this = &mut *self;
9684        if this.inner.check_shutdown(cx) {
9685            this.is_terminated = true;
9686            return std::task::Poll::Ready(None);
9687        }
9688        if this.is_terminated {
9689            panic!("polled DirectoryRouterRequestStream after completion");
9690        }
9691        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
9692            |bytes, handles| {
9693                match this.inner.channel().read_etc(cx, bytes, handles) {
9694                    std::task::Poll::Ready(Ok(())) => {}
9695                    std::task::Poll::Pending => return std::task::Poll::Pending,
9696                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
9697                        this.is_terminated = true;
9698                        return std::task::Poll::Ready(None);
9699                    }
9700                    std::task::Poll::Ready(Err(e)) => {
9701                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
9702                            e.into(),
9703                        ))))
9704                    }
9705                }
9706
9707                // A message has been received from the channel
9708                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9709
9710                std::task::Poll::Ready(Some(match header.ordinal {
9711                    0x683b6c6be21b0f21 => {
9712                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9713                        let mut req = fidl::new_empty!(
9714                            RouteRequest,
9715                            fidl::encoding::DefaultFuchsiaResourceDialect
9716                        );
9717                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RouteRequest>(&header, _body_bytes, handles, &mut req)?;
9718                        let control_handle =
9719                            DirectoryRouterControlHandle { inner: this.inner.clone() };
9720                        Ok(DirectoryRouterRequest::Route {
9721                            payload: req,
9722                            responder: DirectoryRouterRouteResponder {
9723                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9724                                tx_id: header.tx_id,
9725                            },
9726                        })
9727                    }
9728                    _ if header.tx_id == 0
9729                        && header
9730                            .dynamic_flags()
9731                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
9732                    {
9733                        Ok(DirectoryRouterRequest::_UnknownMethod {
9734                            ordinal: header.ordinal,
9735                            control_handle: DirectoryRouterControlHandle {
9736                                inner: this.inner.clone(),
9737                            },
9738                            method_type: fidl::MethodType::OneWay,
9739                        })
9740                    }
9741                    _ if header
9742                        .dynamic_flags()
9743                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
9744                    {
9745                        this.inner.send_framework_err(
9746                            fidl::encoding::FrameworkErr::UnknownMethod,
9747                            header.tx_id,
9748                            header.ordinal,
9749                            header.dynamic_flags(),
9750                            (bytes, handles),
9751                        )?;
9752                        Ok(DirectoryRouterRequest::_UnknownMethod {
9753                            ordinal: header.ordinal,
9754                            control_handle: DirectoryRouterControlHandle {
9755                                inner: this.inner.clone(),
9756                            },
9757                            method_type: fidl::MethodType::TwoWay,
9758                        })
9759                    }
9760                    _ => Err(fidl::Error::UnknownOrdinal {
9761                        ordinal: header.ordinal,
9762                        protocol_name:
9763                            <DirectoryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9764                    }),
9765                }))
9766            },
9767        )
9768    }
9769}
9770
9771#[derive(Debug)]
9772pub enum DirectoryRouterRequest {
9773    Route {
9774        payload: RouteRequest,
9775        responder: DirectoryRouterRouteResponder,
9776    },
9777    /// An interaction was received which does not match any known method.
9778    #[non_exhaustive]
9779    _UnknownMethod {
9780        /// Ordinal of the method that was called.
9781        ordinal: u64,
9782        control_handle: DirectoryRouterControlHandle,
9783        method_type: fidl::MethodType,
9784    },
9785}
9786
9787impl DirectoryRouterRequest {
9788    #[allow(irrefutable_let_patterns)]
9789    pub fn into_route(self) -> Option<(RouteRequest, DirectoryRouterRouteResponder)> {
9790        if let DirectoryRouterRequest::Route { payload, responder } = self {
9791            Some((payload, responder))
9792        } else {
9793            None
9794        }
9795    }
9796
9797    /// Name of the method defined in FIDL
9798    pub fn method_name(&self) -> &'static str {
9799        match *self {
9800            DirectoryRouterRequest::Route { .. } => "route",
9801            DirectoryRouterRequest::_UnknownMethod {
9802                method_type: fidl::MethodType::OneWay,
9803                ..
9804            } => "unknown one-way method",
9805            DirectoryRouterRequest::_UnknownMethod {
9806                method_type: fidl::MethodType::TwoWay,
9807                ..
9808            } => "unknown two-way method",
9809        }
9810    }
9811}
9812
9813#[derive(Debug, Clone)]
9814pub struct DirectoryRouterControlHandle {
9815    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9816}
9817
9818impl fidl::endpoints::ControlHandle for DirectoryRouterControlHandle {
9819    fn shutdown(&self) {
9820        self.inner.shutdown()
9821    }
9822    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
9823        self.inner.shutdown_with_epitaph(status)
9824    }
9825
9826    fn is_closed(&self) -> bool {
9827        self.inner.channel().is_closed()
9828    }
9829    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
9830        self.inner.channel().on_closed()
9831    }
9832
9833    #[cfg(target_os = "fuchsia")]
9834    fn signal_peer(
9835        &self,
9836        clear_mask: zx::Signals,
9837        set_mask: zx::Signals,
9838    ) -> Result<(), zx_status::Status> {
9839        use fidl::Peered;
9840        self.inner.channel().signal_peer(clear_mask, set_mask)
9841    }
9842}
9843
9844impl DirectoryRouterControlHandle {}
9845
9846#[must_use = "FIDL methods require a response to be sent"]
9847#[derive(Debug)]
9848pub struct DirectoryRouterRouteResponder {
9849    control_handle: std::mem::ManuallyDrop<DirectoryRouterControlHandle>,
9850    tx_id: u32,
9851}
9852
9853/// Set the the channel to be shutdown (see [`DirectoryRouterControlHandle::shutdown`])
9854/// if the responder is dropped without sending a response, so that the client
9855/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9856impl std::ops::Drop for DirectoryRouterRouteResponder {
9857    fn drop(&mut self) {
9858        self.control_handle.shutdown();
9859        // Safety: drops once, never accessed again
9860        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9861    }
9862}
9863
9864impl fidl::endpoints::Responder for DirectoryRouterRouteResponder {
9865    type ControlHandle = DirectoryRouterControlHandle;
9866
9867    fn control_handle(&self) -> &DirectoryRouterControlHandle {
9868        &self.control_handle
9869    }
9870
9871    fn drop_without_shutdown(mut self) {
9872        // Safety: drops once, never accessed again due to mem::forget
9873        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9874        // Prevent Drop from running (which would shut down the channel)
9875        std::mem::forget(self);
9876    }
9877}
9878
9879impl DirectoryRouterRouteResponder {
9880    /// Sends a response to the FIDL transaction.
9881    ///
9882    /// Sets the channel to shutdown if an error occurs.
9883    pub fn send(
9884        self,
9885        mut result: Result<DirectoryRouterRouteResponse, RouterError>,
9886    ) -> Result<(), fidl::Error> {
9887        let _result = self.send_raw(result);
9888        if _result.is_err() {
9889            self.control_handle.shutdown();
9890        }
9891        self.drop_without_shutdown();
9892        _result
9893    }
9894
9895    /// Similar to "send" but does not shutdown the channel if an error occurs.
9896    pub fn send_no_shutdown_on_err(
9897        self,
9898        mut result: Result<DirectoryRouterRouteResponse, RouterError>,
9899    ) -> Result<(), fidl::Error> {
9900        let _result = self.send_raw(result);
9901        self.drop_without_shutdown();
9902        _result
9903    }
9904
9905    fn send_raw(
9906        &self,
9907        mut result: Result<DirectoryRouterRouteResponse, RouterError>,
9908    ) -> Result<(), fidl::Error> {
9909        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
9910            DirectoryRouterRouteResponse,
9911            RouterError,
9912        >>(
9913            fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
9914            self.tx_id,
9915            0x683b6c6be21b0f21,
9916            fidl::encoding::DynamicFlags::FLEXIBLE,
9917        )
9918    }
9919}
9920
9921#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
9922pub struct ReceiverMarker;
9923
9924impl fidl::endpoints::ProtocolMarker for ReceiverMarker {
9925    type Proxy = ReceiverProxy;
9926    type RequestStream = ReceiverRequestStream;
9927    #[cfg(target_os = "fuchsia")]
9928    type SynchronousProxy = ReceiverSynchronousProxy;
9929
9930    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.Receiver";
9931}
9932impl fidl::endpoints::DiscoverableProtocolMarker for ReceiverMarker {}
9933
9934pub trait ReceiverProxyInterface: Send + Sync {
9935    fn r#receive(&self, channel: fidl::Channel) -> Result<(), fidl::Error>;
9936}
9937#[derive(Debug)]
9938#[cfg(target_os = "fuchsia")]
9939pub struct ReceiverSynchronousProxy {
9940    client: fidl::client::sync::Client,
9941}
9942
9943#[cfg(target_os = "fuchsia")]
9944impl fidl::endpoints::SynchronousProxy for ReceiverSynchronousProxy {
9945    type Proxy = ReceiverProxy;
9946    type Protocol = ReceiverMarker;
9947
9948    fn from_channel(inner: fidl::Channel) -> Self {
9949        Self::new(inner)
9950    }
9951
9952    fn into_channel(self) -> fidl::Channel {
9953        self.client.into_channel()
9954    }
9955
9956    fn as_channel(&self) -> &fidl::Channel {
9957        self.client.as_channel()
9958    }
9959}
9960
9961#[cfg(target_os = "fuchsia")]
9962impl ReceiverSynchronousProxy {
9963    pub fn new(channel: fidl::Channel) -> Self {
9964        let protocol_name = <ReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
9965        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
9966    }
9967
9968    pub fn into_channel(self) -> fidl::Channel {
9969        self.client.into_channel()
9970    }
9971
9972    /// Waits until an event arrives and returns it. It is safe for other
9973    /// threads to make concurrent requests while waiting for an event.
9974    pub fn wait_for_event(
9975        &self,
9976        deadline: zx::MonotonicInstant,
9977    ) -> Result<ReceiverEvent, fidl::Error> {
9978        ReceiverEvent::decode(self.client.wait_for_event(deadline)?)
9979    }
9980
9981    /// Sends a channel to this receiver.
9982    pub fn r#receive(&self, mut channel: fidl::Channel) -> Result<(), fidl::Error> {
9983        self.client.send::<ProtocolPayload>(
9984            (channel,),
9985            0x4bae18ab7aa1a94,
9986            fidl::encoding::DynamicFlags::FLEXIBLE,
9987        )
9988    }
9989}
9990
9991#[cfg(target_os = "fuchsia")]
9992impl From<ReceiverSynchronousProxy> for zx::Handle {
9993    fn from(value: ReceiverSynchronousProxy) -> Self {
9994        value.into_channel().into()
9995    }
9996}
9997
9998#[cfg(target_os = "fuchsia")]
9999impl From<fidl::Channel> for ReceiverSynchronousProxy {
10000    fn from(value: fidl::Channel) -> Self {
10001        Self::new(value)
10002    }
10003}
10004
10005#[derive(Debug, Clone)]
10006pub struct ReceiverProxy {
10007    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
10008}
10009
10010impl fidl::endpoints::Proxy for ReceiverProxy {
10011    type Protocol = ReceiverMarker;
10012
10013    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
10014        Self::new(inner)
10015    }
10016
10017    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
10018        self.client.into_channel().map_err(|client| Self { client })
10019    }
10020
10021    fn as_channel(&self) -> &::fidl::AsyncChannel {
10022        self.client.as_channel()
10023    }
10024}
10025
10026impl ReceiverProxy {
10027    /// Create a new Proxy for fuchsia.component.sandbox/Receiver.
10028    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
10029        let protocol_name = <ReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
10030        Self { client: fidl::client::Client::new(channel, protocol_name) }
10031    }
10032
10033    /// Get a Stream of events from the remote end of the protocol.
10034    ///
10035    /// # Panics
10036    ///
10037    /// Panics if the event stream was already taken.
10038    pub fn take_event_stream(&self) -> ReceiverEventStream {
10039        ReceiverEventStream { event_receiver: self.client.take_event_receiver() }
10040    }
10041
10042    /// Sends a channel to this receiver.
10043    pub fn r#receive(&self, mut channel: fidl::Channel) -> Result<(), fidl::Error> {
10044        ReceiverProxyInterface::r#receive(self, channel)
10045    }
10046}
10047
10048impl ReceiverProxyInterface for ReceiverProxy {
10049    fn r#receive(&self, mut channel: fidl::Channel) -> Result<(), fidl::Error> {
10050        self.client.send::<ProtocolPayload>(
10051            (channel,),
10052            0x4bae18ab7aa1a94,
10053            fidl::encoding::DynamicFlags::FLEXIBLE,
10054        )
10055    }
10056}
10057
10058pub struct ReceiverEventStream {
10059    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
10060}
10061
10062impl std::marker::Unpin for ReceiverEventStream {}
10063
10064impl futures::stream::FusedStream for ReceiverEventStream {
10065    fn is_terminated(&self) -> bool {
10066        self.event_receiver.is_terminated()
10067    }
10068}
10069
10070impl futures::Stream for ReceiverEventStream {
10071    type Item = Result<ReceiverEvent, fidl::Error>;
10072
10073    fn poll_next(
10074        mut self: std::pin::Pin<&mut Self>,
10075        cx: &mut std::task::Context<'_>,
10076    ) -> std::task::Poll<Option<Self::Item>> {
10077        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
10078            &mut self.event_receiver,
10079            cx
10080        )?) {
10081            Some(buf) => std::task::Poll::Ready(Some(ReceiverEvent::decode(buf))),
10082            None => std::task::Poll::Ready(None),
10083        }
10084    }
10085}
10086
10087#[derive(Debug)]
10088pub enum ReceiverEvent {
10089    #[non_exhaustive]
10090    _UnknownEvent {
10091        /// Ordinal of the event that was sent.
10092        ordinal: u64,
10093    },
10094}
10095
10096impl ReceiverEvent {
10097    /// Decodes a message buffer as a [`ReceiverEvent`].
10098    fn decode(
10099        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
10100    ) -> Result<ReceiverEvent, fidl::Error> {
10101        let (bytes, _handles) = buf.split_mut();
10102        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
10103        debug_assert_eq!(tx_header.tx_id, 0);
10104        match tx_header.ordinal {
10105            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
10106                Ok(ReceiverEvent::_UnknownEvent { ordinal: tx_header.ordinal })
10107            }
10108            _ => Err(fidl::Error::UnknownOrdinal {
10109                ordinal: tx_header.ordinal,
10110                protocol_name: <ReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
10111            }),
10112        }
10113    }
10114}
10115
10116/// A Stream of incoming requests for fuchsia.component.sandbox/Receiver.
10117pub struct ReceiverRequestStream {
10118    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10119    is_terminated: bool,
10120}
10121
10122impl std::marker::Unpin for ReceiverRequestStream {}
10123
10124impl futures::stream::FusedStream for ReceiverRequestStream {
10125    fn is_terminated(&self) -> bool {
10126        self.is_terminated
10127    }
10128}
10129
10130impl fidl::endpoints::RequestStream for ReceiverRequestStream {
10131    type Protocol = ReceiverMarker;
10132    type ControlHandle = ReceiverControlHandle;
10133
10134    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
10135        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
10136    }
10137
10138    fn control_handle(&self) -> Self::ControlHandle {
10139        ReceiverControlHandle { inner: self.inner.clone() }
10140    }
10141
10142    fn into_inner(
10143        self,
10144    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
10145    {
10146        (self.inner, self.is_terminated)
10147    }
10148
10149    fn from_inner(
10150        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10151        is_terminated: bool,
10152    ) -> Self {
10153        Self { inner, is_terminated }
10154    }
10155}
10156
10157impl futures::Stream for ReceiverRequestStream {
10158    type Item = Result<ReceiverRequest, fidl::Error>;
10159
10160    fn poll_next(
10161        mut self: std::pin::Pin<&mut Self>,
10162        cx: &mut std::task::Context<'_>,
10163    ) -> std::task::Poll<Option<Self::Item>> {
10164        let this = &mut *self;
10165        if this.inner.check_shutdown(cx) {
10166            this.is_terminated = true;
10167            return std::task::Poll::Ready(None);
10168        }
10169        if this.is_terminated {
10170            panic!("polled ReceiverRequestStream after completion");
10171        }
10172        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
10173            |bytes, handles| {
10174                match this.inner.channel().read_etc(cx, bytes, handles) {
10175                    std::task::Poll::Ready(Ok(())) => {}
10176                    std::task::Poll::Pending => return std::task::Poll::Pending,
10177                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
10178                        this.is_terminated = true;
10179                        return std::task::Poll::Ready(None);
10180                    }
10181                    std::task::Poll::Ready(Err(e)) => {
10182                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
10183                            e.into(),
10184                        ))))
10185                    }
10186                }
10187
10188                // A message has been received from the channel
10189                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
10190
10191                std::task::Poll::Ready(Some(match header.ordinal {
10192                    0x4bae18ab7aa1a94 => {
10193                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
10194                        let mut req = fidl::new_empty!(
10195                            ProtocolPayload,
10196                            fidl::encoding::DefaultFuchsiaResourceDialect
10197                        );
10198                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ProtocolPayload>(&header, _body_bytes, handles, &mut req)?;
10199                        let control_handle = ReceiverControlHandle { inner: this.inner.clone() };
10200                        Ok(ReceiverRequest::Receive { channel: req.channel, control_handle })
10201                    }
10202                    _ if header.tx_id == 0
10203                        && header
10204                            .dynamic_flags()
10205                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
10206                    {
10207                        Ok(ReceiverRequest::_UnknownMethod {
10208                            ordinal: header.ordinal,
10209                            control_handle: ReceiverControlHandle { inner: this.inner.clone() },
10210                            method_type: fidl::MethodType::OneWay,
10211                        })
10212                    }
10213                    _ if header
10214                        .dynamic_flags()
10215                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
10216                    {
10217                        this.inner.send_framework_err(
10218                            fidl::encoding::FrameworkErr::UnknownMethod,
10219                            header.tx_id,
10220                            header.ordinal,
10221                            header.dynamic_flags(),
10222                            (bytes, handles),
10223                        )?;
10224                        Ok(ReceiverRequest::_UnknownMethod {
10225                            ordinal: header.ordinal,
10226                            control_handle: ReceiverControlHandle { inner: this.inner.clone() },
10227                            method_type: fidl::MethodType::TwoWay,
10228                        })
10229                    }
10230                    _ => Err(fidl::Error::UnknownOrdinal {
10231                        ordinal: header.ordinal,
10232                        protocol_name:
10233                            <ReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
10234                    }),
10235                }))
10236            },
10237        )
10238    }
10239}
10240
10241/// A receiver is served by components and allows them to receive channels
10242/// from the framework.
10243#[derive(Debug)]
10244pub enum ReceiverRequest {
10245    /// Sends a channel to this receiver.
10246    Receive { channel: fidl::Channel, control_handle: ReceiverControlHandle },
10247    /// An interaction was received which does not match any known method.
10248    #[non_exhaustive]
10249    _UnknownMethod {
10250        /// Ordinal of the method that was called.
10251        ordinal: u64,
10252        control_handle: ReceiverControlHandle,
10253        method_type: fidl::MethodType,
10254    },
10255}
10256
10257impl ReceiverRequest {
10258    #[allow(irrefutable_let_patterns)]
10259    pub fn into_receive(self) -> Option<(fidl::Channel, ReceiverControlHandle)> {
10260        if let ReceiverRequest::Receive { channel, control_handle } = self {
10261            Some((channel, control_handle))
10262        } else {
10263            None
10264        }
10265    }
10266
10267    /// Name of the method defined in FIDL
10268    pub fn method_name(&self) -> &'static str {
10269        match *self {
10270            ReceiverRequest::Receive { .. } => "receive",
10271            ReceiverRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
10272                "unknown one-way method"
10273            }
10274            ReceiverRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
10275                "unknown two-way method"
10276            }
10277        }
10278    }
10279}
10280
10281#[derive(Debug, Clone)]
10282pub struct ReceiverControlHandle {
10283    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10284}
10285
10286impl fidl::endpoints::ControlHandle for ReceiverControlHandle {
10287    fn shutdown(&self) {
10288        self.inner.shutdown()
10289    }
10290    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
10291        self.inner.shutdown_with_epitaph(status)
10292    }
10293
10294    fn is_closed(&self) -> bool {
10295        self.inner.channel().is_closed()
10296    }
10297    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
10298        self.inner.channel().on_closed()
10299    }
10300
10301    #[cfg(target_os = "fuchsia")]
10302    fn signal_peer(
10303        &self,
10304        clear_mask: zx::Signals,
10305        set_mask: zx::Signals,
10306    ) -> Result<(), zx_status::Status> {
10307        use fidl::Peered;
10308        self.inner.channel().signal_peer(clear_mask, set_mask)
10309    }
10310}
10311
10312impl ReceiverControlHandle {}
10313
10314mod internal {
10315    use super::*;
10316
10317    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreConnectorCreateRequest {
10318        type Borrowed<'a> = &'a mut Self;
10319        fn take_or_borrow<'a>(
10320            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10321        ) -> Self::Borrowed<'a> {
10322            value
10323        }
10324    }
10325
10326    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreConnectorCreateRequest {
10327        type Owned = Self;
10328
10329        #[inline(always)]
10330        fn inline_align(_context: fidl::encoding::Context) -> usize {
10331            8
10332        }
10333
10334        #[inline(always)]
10335        fn inline_size(_context: fidl::encoding::Context) -> usize {
10336            16
10337        }
10338    }
10339
10340    unsafe impl
10341        fidl::encoding::Encode<
10342            CapabilityStoreConnectorCreateRequest,
10343            fidl::encoding::DefaultFuchsiaResourceDialect,
10344        > for &mut CapabilityStoreConnectorCreateRequest
10345    {
10346        #[inline]
10347        unsafe fn encode(
10348            self,
10349            encoder: &mut fidl::encoding::Encoder<
10350                '_,
10351                fidl::encoding::DefaultFuchsiaResourceDialect,
10352            >,
10353            offset: usize,
10354            _depth: fidl::encoding::Depth,
10355        ) -> fidl::Result<()> {
10356            encoder.debug_check_bounds::<CapabilityStoreConnectorCreateRequest>(offset);
10357            // Delegate to tuple encoding.
10358            fidl::encoding::Encode::<CapabilityStoreConnectorCreateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10359                (
10360                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
10361                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ReceiverMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.receiver),
10362                ),
10363                encoder, offset, _depth
10364            )
10365        }
10366    }
10367    unsafe impl<
10368            T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
10369            T1: fidl::encoding::Encode<
10370                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ReceiverMarker>>,
10371                fidl::encoding::DefaultFuchsiaResourceDialect,
10372            >,
10373        >
10374        fidl::encoding::Encode<
10375            CapabilityStoreConnectorCreateRequest,
10376            fidl::encoding::DefaultFuchsiaResourceDialect,
10377        > for (T0, T1)
10378    {
10379        #[inline]
10380        unsafe fn encode(
10381            self,
10382            encoder: &mut fidl::encoding::Encoder<
10383                '_,
10384                fidl::encoding::DefaultFuchsiaResourceDialect,
10385            >,
10386            offset: usize,
10387            depth: fidl::encoding::Depth,
10388        ) -> fidl::Result<()> {
10389            encoder.debug_check_bounds::<CapabilityStoreConnectorCreateRequest>(offset);
10390            // Zero out padding regions. There's no need to apply masks
10391            // because the unmasked parts will be overwritten by fields.
10392            unsafe {
10393                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
10394                (ptr as *mut u64).write_unaligned(0);
10395            }
10396            // Write the fields.
10397            self.0.encode(encoder, offset + 0, depth)?;
10398            self.1.encode(encoder, offset + 8, depth)?;
10399            Ok(())
10400        }
10401    }
10402
10403    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10404        for CapabilityStoreConnectorCreateRequest
10405    {
10406        #[inline(always)]
10407        fn new_empty() -> Self {
10408            Self {
10409                id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
10410                receiver: fidl::new_empty!(
10411                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ReceiverMarker>>,
10412                    fidl::encoding::DefaultFuchsiaResourceDialect
10413                ),
10414            }
10415        }
10416
10417        #[inline]
10418        unsafe fn decode(
10419            &mut self,
10420            decoder: &mut fidl::encoding::Decoder<
10421                '_,
10422                fidl::encoding::DefaultFuchsiaResourceDialect,
10423            >,
10424            offset: usize,
10425            _depth: fidl::encoding::Depth,
10426        ) -> fidl::Result<()> {
10427            decoder.debug_check_bounds::<Self>(offset);
10428            // Verify that padding bytes are zero.
10429            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
10430            let padval = unsafe { (ptr as *const u64).read_unaligned() };
10431            let mask = 0xffffffff00000000u64;
10432            let maskedval = padval & mask;
10433            if maskedval != 0 {
10434                return Err(fidl::Error::NonZeroPadding {
10435                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
10436                });
10437            }
10438            fidl::decode!(
10439                u64,
10440                fidl::encoding::DefaultFuchsiaResourceDialect,
10441                &mut self.id,
10442                decoder,
10443                offset + 0,
10444                _depth
10445            )?;
10446            fidl::decode!(
10447                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ReceiverMarker>>,
10448                fidl::encoding::DefaultFuchsiaResourceDialect,
10449                &mut self.receiver,
10450                decoder,
10451                offset + 8,
10452                _depth
10453            )?;
10454            Ok(())
10455        }
10456    }
10457
10458    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreConnectorOpenRequest {
10459        type Borrowed<'a> = &'a mut Self;
10460        fn take_or_borrow<'a>(
10461            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10462        ) -> Self::Borrowed<'a> {
10463            value
10464        }
10465    }
10466
10467    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreConnectorOpenRequest {
10468        type Owned = Self;
10469
10470        #[inline(always)]
10471        fn inline_align(_context: fidl::encoding::Context) -> usize {
10472            8
10473        }
10474
10475        #[inline(always)]
10476        fn inline_size(_context: fidl::encoding::Context) -> usize {
10477            16
10478        }
10479    }
10480
10481    unsafe impl
10482        fidl::encoding::Encode<
10483            CapabilityStoreConnectorOpenRequest,
10484            fidl::encoding::DefaultFuchsiaResourceDialect,
10485        > for &mut CapabilityStoreConnectorOpenRequest
10486    {
10487        #[inline]
10488        unsafe fn encode(
10489            self,
10490            encoder: &mut fidl::encoding::Encoder<
10491                '_,
10492                fidl::encoding::DefaultFuchsiaResourceDialect,
10493            >,
10494            offset: usize,
10495            _depth: fidl::encoding::Depth,
10496        ) -> fidl::Result<()> {
10497            encoder.debug_check_bounds::<CapabilityStoreConnectorOpenRequest>(offset);
10498            // Delegate to tuple encoding.
10499            fidl::encoding::Encode::<
10500                CapabilityStoreConnectorOpenRequest,
10501                fidl::encoding::DefaultFuchsiaResourceDialect,
10502            >::encode(
10503                (
10504                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
10505                    <fidl::encoding::HandleType<
10506                        fidl::Channel,
10507                        { fidl::ObjectType::CHANNEL.into_raw() },
10508                        2147483648,
10509                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10510                        &mut self.server_end
10511                    ),
10512                ),
10513                encoder,
10514                offset,
10515                _depth,
10516            )
10517        }
10518    }
10519    unsafe impl<
10520            T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
10521            T1: fidl::encoding::Encode<
10522                fidl::encoding::HandleType<
10523                    fidl::Channel,
10524                    { fidl::ObjectType::CHANNEL.into_raw() },
10525                    2147483648,
10526                >,
10527                fidl::encoding::DefaultFuchsiaResourceDialect,
10528            >,
10529        >
10530        fidl::encoding::Encode<
10531            CapabilityStoreConnectorOpenRequest,
10532            fidl::encoding::DefaultFuchsiaResourceDialect,
10533        > for (T0, T1)
10534    {
10535        #[inline]
10536        unsafe fn encode(
10537            self,
10538            encoder: &mut fidl::encoding::Encoder<
10539                '_,
10540                fidl::encoding::DefaultFuchsiaResourceDialect,
10541            >,
10542            offset: usize,
10543            depth: fidl::encoding::Depth,
10544        ) -> fidl::Result<()> {
10545            encoder.debug_check_bounds::<CapabilityStoreConnectorOpenRequest>(offset);
10546            // Zero out padding regions. There's no need to apply masks
10547            // because the unmasked parts will be overwritten by fields.
10548            unsafe {
10549                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
10550                (ptr as *mut u64).write_unaligned(0);
10551            }
10552            // Write the fields.
10553            self.0.encode(encoder, offset + 0, depth)?;
10554            self.1.encode(encoder, offset + 8, depth)?;
10555            Ok(())
10556        }
10557    }
10558
10559    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10560        for CapabilityStoreConnectorOpenRequest
10561    {
10562        #[inline(always)]
10563        fn new_empty() -> Self {
10564            Self {
10565                id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
10566                server_end: fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
10567            }
10568        }
10569
10570        #[inline]
10571        unsafe fn decode(
10572            &mut self,
10573            decoder: &mut fidl::encoding::Decoder<
10574                '_,
10575                fidl::encoding::DefaultFuchsiaResourceDialect,
10576            >,
10577            offset: usize,
10578            _depth: fidl::encoding::Depth,
10579        ) -> fidl::Result<()> {
10580            decoder.debug_check_bounds::<Self>(offset);
10581            // Verify that padding bytes are zero.
10582            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
10583            let padval = unsafe { (ptr as *const u64).read_unaligned() };
10584            let mask = 0xffffffff00000000u64;
10585            let maskedval = padval & mask;
10586            if maskedval != 0 {
10587                return Err(fidl::Error::NonZeroPadding {
10588                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
10589                });
10590            }
10591            fidl::decode!(
10592                u64,
10593                fidl::encoding::DefaultFuchsiaResourceDialect,
10594                &mut self.id,
10595                decoder,
10596                offset + 0,
10597                _depth
10598            )?;
10599            fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.server_end, decoder, offset + 8, _depth)?;
10600            Ok(())
10601        }
10602    }
10603
10604    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDictionaryDrainRequest {
10605        type Borrowed<'a> = &'a mut Self;
10606        fn take_or_borrow<'a>(
10607            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10608        ) -> Self::Borrowed<'a> {
10609            value
10610        }
10611    }
10612
10613    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDictionaryDrainRequest {
10614        type Owned = Self;
10615
10616        #[inline(always)]
10617        fn inline_align(_context: fidl::encoding::Context) -> usize {
10618            8
10619        }
10620
10621        #[inline(always)]
10622        fn inline_size(_context: fidl::encoding::Context) -> usize {
10623            16
10624        }
10625    }
10626
10627    unsafe impl
10628        fidl::encoding::Encode<
10629            CapabilityStoreDictionaryDrainRequest,
10630            fidl::encoding::DefaultFuchsiaResourceDialect,
10631        > for &mut CapabilityStoreDictionaryDrainRequest
10632    {
10633        #[inline]
10634        unsafe fn encode(
10635            self,
10636            encoder: &mut fidl::encoding::Encoder<
10637                '_,
10638                fidl::encoding::DefaultFuchsiaResourceDialect,
10639            >,
10640            offset: usize,
10641            _depth: fidl::encoding::Depth,
10642        ) -> fidl::Result<()> {
10643            encoder.debug_check_bounds::<CapabilityStoreDictionaryDrainRequest>(offset);
10644            // Delegate to tuple encoding.
10645            fidl::encoding::Encode::<
10646                CapabilityStoreDictionaryDrainRequest,
10647                fidl::encoding::DefaultFuchsiaResourceDialect,
10648            >::encode(
10649                (
10650                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
10651                    <fidl::encoding::Optional<
10652                        fidl::encoding::Endpoint<
10653                            fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>,
10654                        >,
10655                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10656                        &mut self.iterator
10657                    ),
10658                ),
10659                encoder,
10660                offset,
10661                _depth,
10662            )
10663        }
10664    }
10665    unsafe impl<
10666            T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
10667            T1: fidl::encoding::Encode<
10668                fidl::encoding::Optional<
10669                    fidl::encoding::Endpoint<
10670                        fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>,
10671                    >,
10672                >,
10673                fidl::encoding::DefaultFuchsiaResourceDialect,
10674            >,
10675        >
10676        fidl::encoding::Encode<
10677            CapabilityStoreDictionaryDrainRequest,
10678            fidl::encoding::DefaultFuchsiaResourceDialect,
10679        > for (T0, T1)
10680    {
10681        #[inline]
10682        unsafe fn encode(
10683            self,
10684            encoder: &mut fidl::encoding::Encoder<
10685                '_,
10686                fidl::encoding::DefaultFuchsiaResourceDialect,
10687            >,
10688            offset: usize,
10689            depth: fidl::encoding::Depth,
10690        ) -> fidl::Result<()> {
10691            encoder.debug_check_bounds::<CapabilityStoreDictionaryDrainRequest>(offset);
10692            // Zero out padding regions. There's no need to apply masks
10693            // because the unmasked parts will be overwritten by fields.
10694            unsafe {
10695                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
10696                (ptr as *mut u64).write_unaligned(0);
10697            }
10698            // Write the fields.
10699            self.0.encode(encoder, offset + 0, depth)?;
10700            self.1.encode(encoder, offset + 8, depth)?;
10701            Ok(())
10702        }
10703    }
10704
10705    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10706        for CapabilityStoreDictionaryDrainRequest
10707    {
10708        #[inline(always)]
10709        fn new_empty() -> Self {
10710            Self {
10711                id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
10712                iterator: fidl::new_empty!(
10713                    fidl::encoding::Optional<
10714                        fidl::encoding::Endpoint<
10715                            fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>,
10716                        >,
10717                    >,
10718                    fidl::encoding::DefaultFuchsiaResourceDialect
10719                ),
10720            }
10721        }
10722
10723        #[inline]
10724        unsafe fn decode(
10725            &mut self,
10726            decoder: &mut fidl::encoding::Decoder<
10727                '_,
10728                fidl::encoding::DefaultFuchsiaResourceDialect,
10729            >,
10730            offset: usize,
10731            _depth: fidl::encoding::Depth,
10732        ) -> fidl::Result<()> {
10733            decoder.debug_check_bounds::<Self>(offset);
10734            // Verify that padding bytes are zero.
10735            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
10736            let padval = unsafe { (ptr as *const u64).read_unaligned() };
10737            let mask = 0xffffffff00000000u64;
10738            let maskedval = padval & mask;
10739            if maskedval != 0 {
10740                return Err(fidl::Error::NonZeroPadding {
10741                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
10742                });
10743            }
10744            fidl::decode!(
10745                u64,
10746                fidl::encoding::DefaultFuchsiaResourceDialect,
10747                &mut self.id,
10748                decoder,
10749                offset + 0,
10750                _depth
10751            )?;
10752            fidl::decode!(
10753                fidl::encoding::Optional<
10754                    fidl::encoding::Endpoint<
10755                        fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>,
10756                    >,
10757                >,
10758                fidl::encoding::DefaultFuchsiaResourceDialect,
10759                &mut self.iterator,
10760                decoder,
10761                offset + 8,
10762                _depth
10763            )?;
10764            Ok(())
10765        }
10766    }
10767
10768    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDictionaryEnumerateRequest {
10769        type Borrowed<'a> = &'a mut Self;
10770        fn take_or_borrow<'a>(
10771            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10772        ) -> Self::Borrowed<'a> {
10773            value
10774        }
10775    }
10776
10777    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDictionaryEnumerateRequest {
10778        type Owned = Self;
10779
10780        #[inline(always)]
10781        fn inline_align(_context: fidl::encoding::Context) -> usize {
10782            8
10783        }
10784
10785        #[inline(always)]
10786        fn inline_size(_context: fidl::encoding::Context) -> usize {
10787            16
10788        }
10789    }
10790
10791    unsafe impl
10792        fidl::encoding::Encode<
10793            CapabilityStoreDictionaryEnumerateRequest,
10794            fidl::encoding::DefaultFuchsiaResourceDialect,
10795        > for &mut CapabilityStoreDictionaryEnumerateRequest
10796    {
10797        #[inline]
10798        unsafe fn encode(
10799            self,
10800            encoder: &mut fidl::encoding::Encoder<
10801                '_,
10802                fidl::encoding::DefaultFuchsiaResourceDialect,
10803            >,
10804            offset: usize,
10805            _depth: fidl::encoding::Depth,
10806        ) -> fidl::Result<()> {
10807            encoder.debug_check_bounds::<CapabilityStoreDictionaryEnumerateRequest>(offset);
10808            // Delegate to tuple encoding.
10809            fidl::encoding::Encode::<
10810                CapabilityStoreDictionaryEnumerateRequest,
10811                fidl::encoding::DefaultFuchsiaResourceDialect,
10812            >::encode(
10813                (
10814                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
10815                    <fidl::encoding::Endpoint<
10816                        fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
10817                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10818                        &mut self.iterator
10819                    ),
10820                ),
10821                encoder,
10822                offset,
10823                _depth,
10824            )
10825        }
10826    }
10827    unsafe impl<
10828            T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
10829            T1: fidl::encoding::Encode<
10830                fidl::encoding::Endpoint<
10831                    fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
10832                >,
10833                fidl::encoding::DefaultFuchsiaResourceDialect,
10834            >,
10835        >
10836        fidl::encoding::Encode<
10837            CapabilityStoreDictionaryEnumerateRequest,
10838            fidl::encoding::DefaultFuchsiaResourceDialect,
10839        > for (T0, T1)
10840    {
10841        #[inline]
10842        unsafe fn encode(
10843            self,
10844            encoder: &mut fidl::encoding::Encoder<
10845                '_,
10846                fidl::encoding::DefaultFuchsiaResourceDialect,
10847            >,
10848            offset: usize,
10849            depth: fidl::encoding::Depth,
10850        ) -> fidl::Result<()> {
10851            encoder.debug_check_bounds::<CapabilityStoreDictionaryEnumerateRequest>(offset);
10852            // Zero out padding regions. There's no need to apply masks
10853            // because the unmasked parts will be overwritten by fields.
10854            unsafe {
10855                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
10856                (ptr as *mut u64).write_unaligned(0);
10857            }
10858            // Write the fields.
10859            self.0.encode(encoder, offset + 0, depth)?;
10860            self.1.encode(encoder, offset + 8, depth)?;
10861            Ok(())
10862        }
10863    }
10864
10865    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10866        for CapabilityStoreDictionaryEnumerateRequest
10867    {
10868        #[inline(always)]
10869        fn new_empty() -> Self {
10870            Self {
10871                id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
10872                iterator: fidl::new_empty!(
10873                    fidl::encoding::Endpoint<
10874                        fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
10875                    >,
10876                    fidl::encoding::DefaultFuchsiaResourceDialect
10877                ),
10878            }
10879        }
10880
10881        #[inline]
10882        unsafe fn decode(
10883            &mut self,
10884            decoder: &mut fidl::encoding::Decoder<
10885                '_,
10886                fidl::encoding::DefaultFuchsiaResourceDialect,
10887            >,
10888            offset: usize,
10889            _depth: fidl::encoding::Depth,
10890        ) -> fidl::Result<()> {
10891            decoder.debug_check_bounds::<Self>(offset);
10892            // Verify that padding bytes are zero.
10893            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
10894            let padval = unsafe { (ptr as *const u64).read_unaligned() };
10895            let mask = 0xffffffff00000000u64;
10896            let maskedval = padval & mask;
10897            if maskedval != 0 {
10898                return Err(fidl::Error::NonZeroPadding {
10899                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
10900                });
10901            }
10902            fidl::decode!(
10903                u64,
10904                fidl::encoding::DefaultFuchsiaResourceDialect,
10905                &mut self.id,
10906                decoder,
10907                offset + 0,
10908                _depth
10909            )?;
10910            fidl::decode!(
10911                fidl::encoding::Endpoint<
10912                    fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
10913                >,
10914                fidl::encoding::DefaultFuchsiaResourceDialect,
10915                &mut self.iterator,
10916                decoder,
10917                offset + 8,
10918                _depth
10919            )?;
10920            Ok(())
10921        }
10922    }
10923
10924    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDictionaryKeysRequest {
10925        type Borrowed<'a> = &'a mut Self;
10926        fn take_or_borrow<'a>(
10927            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10928        ) -> Self::Borrowed<'a> {
10929            value
10930        }
10931    }
10932
10933    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDictionaryKeysRequest {
10934        type Owned = Self;
10935
10936        #[inline(always)]
10937        fn inline_align(_context: fidl::encoding::Context) -> usize {
10938            8
10939        }
10940
10941        #[inline(always)]
10942        fn inline_size(_context: fidl::encoding::Context) -> usize {
10943            16
10944        }
10945    }
10946
10947    unsafe impl
10948        fidl::encoding::Encode<
10949            CapabilityStoreDictionaryKeysRequest,
10950            fidl::encoding::DefaultFuchsiaResourceDialect,
10951        > for &mut CapabilityStoreDictionaryKeysRequest
10952    {
10953        #[inline]
10954        unsafe fn encode(
10955            self,
10956            encoder: &mut fidl::encoding::Encoder<
10957                '_,
10958                fidl::encoding::DefaultFuchsiaResourceDialect,
10959            >,
10960            offset: usize,
10961            _depth: fidl::encoding::Depth,
10962        ) -> fidl::Result<()> {
10963            encoder.debug_check_bounds::<CapabilityStoreDictionaryKeysRequest>(offset);
10964            // Delegate to tuple encoding.
10965            fidl::encoding::Encode::<
10966                CapabilityStoreDictionaryKeysRequest,
10967                fidl::encoding::DefaultFuchsiaResourceDialect,
10968            >::encode(
10969                (
10970                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
10971                    <fidl::encoding::Endpoint<
10972                        fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>,
10973                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10974                        &mut self.iterator
10975                    ),
10976                ),
10977                encoder,
10978                offset,
10979                _depth,
10980            )
10981        }
10982    }
10983    unsafe impl<
10984            T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
10985            T1: fidl::encoding::Encode<
10986                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>>,
10987                fidl::encoding::DefaultFuchsiaResourceDialect,
10988            >,
10989        >
10990        fidl::encoding::Encode<
10991            CapabilityStoreDictionaryKeysRequest,
10992            fidl::encoding::DefaultFuchsiaResourceDialect,
10993        > for (T0, T1)
10994    {
10995        #[inline]
10996        unsafe fn encode(
10997            self,
10998            encoder: &mut fidl::encoding::Encoder<
10999                '_,
11000                fidl::encoding::DefaultFuchsiaResourceDialect,
11001            >,
11002            offset: usize,
11003            depth: fidl::encoding::Depth,
11004        ) -> fidl::Result<()> {
11005            encoder.debug_check_bounds::<CapabilityStoreDictionaryKeysRequest>(offset);
11006            // Zero out padding regions. There's no need to apply masks
11007            // because the unmasked parts will be overwritten by fields.
11008            unsafe {
11009                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
11010                (ptr as *mut u64).write_unaligned(0);
11011            }
11012            // Write the fields.
11013            self.0.encode(encoder, offset + 0, depth)?;
11014            self.1.encode(encoder, offset + 8, depth)?;
11015            Ok(())
11016        }
11017    }
11018
11019    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11020        for CapabilityStoreDictionaryKeysRequest
11021    {
11022        #[inline(always)]
11023        fn new_empty() -> Self {
11024            Self {
11025                id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
11026                iterator: fidl::new_empty!(
11027                    fidl::encoding::Endpoint<
11028                        fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>,
11029                    >,
11030                    fidl::encoding::DefaultFuchsiaResourceDialect
11031                ),
11032            }
11033        }
11034
11035        #[inline]
11036        unsafe fn decode(
11037            &mut self,
11038            decoder: &mut fidl::encoding::Decoder<
11039                '_,
11040                fidl::encoding::DefaultFuchsiaResourceDialect,
11041            >,
11042            offset: usize,
11043            _depth: fidl::encoding::Depth,
11044        ) -> fidl::Result<()> {
11045            decoder.debug_check_bounds::<Self>(offset);
11046            // Verify that padding bytes are zero.
11047            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
11048            let padval = unsafe { (ptr as *const u64).read_unaligned() };
11049            let mask = 0xffffffff00000000u64;
11050            let maskedval = padval & mask;
11051            if maskedval != 0 {
11052                return Err(fidl::Error::NonZeroPadding {
11053                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
11054                });
11055            }
11056            fidl::decode!(
11057                u64,
11058                fidl::encoding::DefaultFuchsiaResourceDialect,
11059                &mut self.id,
11060                decoder,
11061                offset + 0,
11062                _depth
11063            )?;
11064            fidl::decode!(
11065                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>>,
11066                fidl::encoding::DefaultFuchsiaResourceDialect,
11067                &mut self.iterator,
11068                decoder,
11069                offset + 8,
11070                _depth
11071            )?;
11072            Ok(())
11073        }
11074    }
11075
11076    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDictionaryLegacyExportRequest {
11077        type Borrowed<'a> = &'a mut Self;
11078        fn take_or_borrow<'a>(
11079            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11080        ) -> Self::Borrowed<'a> {
11081            value
11082        }
11083    }
11084
11085    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDictionaryLegacyExportRequest {
11086        type Owned = Self;
11087
11088        #[inline(always)]
11089        fn inline_align(_context: fidl::encoding::Context) -> usize {
11090            8
11091        }
11092
11093        #[inline(always)]
11094        fn inline_size(_context: fidl::encoding::Context) -> usize {
11095            16
11096        }
11097    }
11098
11099    unsafe impl
11100        fidl::encoding::Encode<
11101            CapabilityStoreDictionaryLegacyExportRequest,
11102            fidl::encoding::DefaultFuchsiaResourceDialect,
11103        > for &mut CapabilityStoreDictionaryLegacyExportRequest
11104    {
11105        #[inline]
11106        unsafe fn encode(
11107            self,
11108            encoder: &mut fidl::encoding::Encoder<
11109                '_,
11110                fidl::encoding::DefaultFuchsiaResourceDialect,
11111            >,
11112            offset: usize,
11113            _depth: fidl::encoding::Depth,
11114        ) -> fidl::Result<()> {
11115            encoder.debug_check_bounds::<CapabilityStoreDictionaryLegacyExportRequest>(offset);
11116            // Delegate to tuple encoding.
11117            fidl::encoding::Encode::<
11118                CapabilityStoreDictionaryLegacyExportRequest,
11119                fidl::encoding::DefaultFuchsiaResourceDialect,
11120            >::encode(
11121                (
11122                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
11123                    <fidl::encoding::HandleType<
11124                        fidl::Channel,
11125                        { fidl::ObjectType::CHANNEL.into_raw() },
11126                        2147483648,
11127                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11128                        &mut self.server_end
11129                    ),
11130                ),
11131                encoder,
11132                offset,
11133                _depth,
11134            )
11135        }
11136    }
11137    unsafe impl<
11138            T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
11139            T1: fidl::encoding::Encode<
11140                fidl::encoding::HandleType<
11141                    fidl::Channel,
11142                    { fidl::ObjectType::CHANNEL.into_raw() },
11143                    2147483648,
11144                >,
11145                fidl::encoding::DefaultFuchsiaResourceDialect,
11146            >,
11147        >
11148        fidl::encoding::Encode<
11149            CapabilityStoreDictionaryLegacyExportRequest,
11150            fidl::encoding::DefaultFuchsiaResourceDialect,
11151        > for (T0, T1)
11152    {
11153        #[inline]
11154        unsafe fn encode(
11155            self,
11156            encoder: &mut fidl::encoding::Encoder<
11157                '_,
11158                fidl::encoding::DefaultFuchsiaResourceDialect,
11159            >,
11160            offset: usize,
11161            depth: fidl::encoding::Depth,
11162        ) -> fidl::Result<()> {
11163            encoder.debug_check_bounds::<CapabilityStoreDictionaryLegacyExportRequest>(offset);
11164            // Zero out padding regions. There's no need to apply masks
11165            // because the unmasked parts will be overwritten by fields.
11166            unsafe {
11167                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
11168                (ptr as *mut u64).write_unaligned(0);
11169            }
11170            // Write the fields.
11171            self.0.encode(encoder, offset + 0, depth)?;
11172            self.1.encode(encoder, offset + 8, depth)?;
11173            Ok(())
11174        }
11175    }
11176
11177    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11178        for CapabilityStoreDictionaryLegacyExportRequest
11179    {
11180        #[inline(always)]
11181        fn new_empty() -> Self {
11182            Self {
11183                id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
11184                server_end: fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11185            }
11186        }
11187
11188        #[inline]
11189        unsafe fn decode(
11190            &mut self,
11191            decoder: &mut fidl::encoding::Decoder<
11192                '_,
11193                fidl::encoding::DefaultFuchsiaResourceDialect,
11194            >,
11195            offset: usize,
11196            _depth: fidl::encoding::Depth,
11197        ) -> fidl::Result<()> {
11198            decoder.debug_check_bounds::<Self>(offset);
11199            // Verify that padding bytes are zero.
11200            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
11201            let padval = unsafe { (ptr as *const u64).read_unaligned() };
11202            let mask = 0xffffffff00000000u64;
11203            let maskedval = padval & mask;
11204            if maskedval != 0 {
11205                return Err(fidl::Error::NonZeroPadding {
11206                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
11207                });
11208            }
11209            fidl::decode!(
11210                u64,
11211                fidl::encoding::DefaultFuchsiaResourceDialect,
11212                &mut self.id,
11213                decoder,
11214                offset + 0,
11215                _depth
11216            )?;
11217            fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.server_end, decoder, offset + 8, _depth)?;
11218            Ok(())
11219        }
11220    }
11221
11222    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDictionaryLegacyImportRequest {
11223        type Borrowed<'a> = &'a mut Self;
11224        fn take_or_borrow<'a>(
11225            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11226        ) -> Self::Borrowed<'a> {
11227            value
11228        }
11229    }
11230
11231    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDictionaryLegacyImportRequest {
11232        type Owned = Self;
11233
11234        #[inline(always)]
11235        fn inline_align(_context: fidl::encoding::Context) -> usize {
11236            8
11237        }
11238
11239        #[inline(always)]
11240        fn inline_size(_context: fidl::encoding::Context) -> usize {
11241            16
11242        }
11243    }
11244
11245    unsafe impl
11246        fidl::encoding::Encode<
11247            CapabilityStoreDictionaryLegacyImportRequest,
11248            fidl::encoding::DefaultFuchsiaResourceDialect,
11249        > for &mut CapabilityStoreDictionaryLegacyImportRequest
11250    {
11251        #[inline]
11252        unsafe fn encode(
11253            self,
11254            encoder: &mut fidl::encoding::Encoder<
11255                '_,
11256                fidl::encoding::DefaultFuchsiaResourceDialect,
11257            >,
11258            offset: usize,
11259            _depth: fidl::encoding::Depth,
11260        ) -> fidl::Result<()> {
11261            encoder.debug_check_bounds::<CapabilityStoreDictionaryLegacyImportRequest>(offset);
11262            // Delegate to tuple encoding.
11263            fidl::encoding::Encode::<
11264                CapabilityStoreDictionaryLegacyImportRequest,
11265                fidl::encoding::DefaultFuchsiaResourceDialect,
11266            >::encode(
11267                (
11268                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
11269                    <fidl::encoding::HandleType<
11270                        fidl::Channel,
11271                        { fidl::ObjectType::CHANNEL.into_raw() },
11272                        2147483648,
11273                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11274                        &mut self.client_end
11275                    ),
11276                ),
11277                encoder,
11278                offset,
11279                _depth,
11280            )
11281        }
11282    }
11283    unsafe impl<
11284            T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
11285            T1: fidl::encoding::Encode<
11286                fidl::encoding::HandleType<
11287                    fidl::Channel,
11288                    { fidl::ObjectType::CHANNEL.into_raw() },
11289                    2147483648,
11290                >,
11291                fidl::encoding::DefaultFuchsiaResourceDialect,
11292            >,
11293        >
11294        fidl::encoding::Encode<
11295            CapabilityStoreDictionaryLegacyImportRequest,
11296            fidl::encoding::DefaultFuchsiaResourceDialect,
11297        > for (T0, T1)
11298    {
11299        #[inline]
11300        unsafe fn encode(
11301            self,
11302            encoder: &mut fidl::encoding::Encoder<
11303                '_,
11304                fidl::encoding::DefaultFuchsiaResourceDialect,
11305            >,
11306            offset: usize,
11307            depth: fidl::encoding::Depth,
11308        ) -> fidl::Result<()> {
11309            encoder.debug_check_bounds::<CapabilityStoreDictionaryLegacyImportRequest>(offset);
11310            // Zero out padding regions. There's no need to apply masks
11311            // because the unmasked parts will be overwritten by fields.
11312            unsafe {
11313                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
11314                (ptr as *mut u64).write_unaligned(0);
11315            }
11316            // Write the fields.
11317            self.0.encode(encoder, offset + 0, depth)?;
11318            self.1.encode(encoder, offset + 8, depth)?;
11319            Ok(())
11320        }
11321    }
11322
11323    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11324        for CapabilityStoreDictionaryLegacyImportRequest
11325    {
11326        #[inline(always)]
11327        fn new_empty() -> Self {
11328            Self {
11329                id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
11330                client_end: fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11331            }
11332        }
11333
11334        #[inline]
11335        unsafe fn decode(
11336            &mut self,
11337            decoder: &mut fidl::encoding::Decoder<
11338                '_,
11339                fidl::encoding::DefaultFuchsiaResourceDialect,
11340            >,
11341            offset: usize,
11342            _depth: fidl::encoding::Depth,
11343        ) -> fidl::Result<()> {
11344            decoder.debug_check_bounds::<Self>(offset);
11345            // Verify that padding bytes are zero.
11346            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
11347            let padval = unsafe { (ptr as *const u64).read_unaligned() };
11348            let mask = 0xffffffff00000000u64;
11349            let maskedval = padval & mask;
11350            if maskedval != 0 {
11351                return Err(fidl::Error::NonZeroPadding {
11352                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
11353                });
11354            }
11355            fidl::decode!(
11356                u64,
11357                fidl::encoding::DefaultFuchsiaResourceDialect,
11358                &mut self.id,
11359                decoder,
11360                offset + 0,
11361                _depth
11362            )?;
11363            fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.client_end, decoder, offset + 8, _depth)?;
11364            Ok(())
11365        }
11366    }
11367
11368    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDirConnectorCreateRequest {
11369        type Borrowed<'a> = &'a mut Self;
11370        fn take_or_borrow<'a>(
11371            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11372        ) -> Self::Borrowed<'a> {
11373            value
11374        }
11375    }
11376
11377    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDirConnectorCreateRequest {
11378        type Owned = Self;
11379
11380        #[inline(always)]
11381        fn inline_align(_context: fidl::encoding::Context) -> usize {
11382            8
11383        }
11384
11385        #[inline(always)]
11386        fn inline_size(_context: fidl::encoding::Context) -> usize {
11387            16
11388        }
11389    }
11390
11391    unsafe impl
11392        fidl::encoding::Encode<
11393            CapabilityStoreDirConnectorCreateRequest,
11394            fidl::encoding::DefaultFuchsiaResourceDialect,
11395        > for &mut CapabilityStoreDirConnectorCreateRequest
11396    {
11397        #[inline]
11398        unsafe fn encode(
11399            self,
11400            encoder: &mut fidl::encoding::Encoder<
11401                '_,
11402                fidl::encoding::DefaultFuchsiaResourceDialect,
11403            >,
11404            offset: usize,
11405            _depth: fidl::encoding::Depth,
11406        ) -> fidl::Result<()> {
11407            encoder.debug_check_bounds::<CapabilityStoreDirConnectorCreateRequest>(offset);
11408            // Delegate to tuple encoding.
11409            fidl::encoding::Encode::<CapabilityStoreDirConnectorCreateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
11410                (
11411                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
11412                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirReceiverMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.receiver),
11413                ),
11414                encoder, offset, _depth
11415            )
11416        }
11417    }
11418    unsafe impl<
11419            T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
11420            T1: fidl::encoding::Encode<
11421                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirReceiverMarker>>,
11422                fidl::encoding::DefaultFuchsiaResourceDialect,
11423            >,
11424        >
11425        fidl::encoding::Encode<
11426            CapabilityStoreDirConnectorCreateRequest,
11427            fidl::encoding::DefaultFuchsiaResourceDialect,
11428        > for (T0, T1)
11429    {
11430        #[inline]
11431        unsafe fn encode(
11432            self,
11433            encoder: &mut fidl::encoding::Encoder<
11434                '_,
11435                fidl::encoding::DefaultFuchsiaResourceDialect,
11436            >,
11437            offset: usize,
11438            depth: fidl::encoding::Depth,
11439        ) -> fidl::Result<()> {
11440            encoder.debug_check_bounds::<CapabilityStoreDirConnectorCreateRequest>(offset);
11441            // Zero out padding regions. There's no need to apply masks
11442            // because the unmasked parts will be overwritten by fields.
11443            unsafe {
11444                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
11445                (ptr as *mut u64).write_unaligned(0);
11446            }
11447            // Write the fields.
11448            self.0.encode(encoder, offset + 0, depth)?;
11449            self.1.encode(encoder, offset + 8, depth)?;
11450            Ok(())
11451        }
11452    }
11453
11454    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11455        for CapabilityStoreDirConnectorCreateRequest
11456    {
11457        #[inline(always)]
11458        fn new_empty() -> Self {
11459            Self {
11460                id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
11461                receiver: fidl::new_empty!(
11462                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirReceiverMarker>>,
11463                    fidl::encoding::DefaultFuchsiaResourceDialect
11464                ),
11465            }
11466        }
11467
11468        #[inline]
11469        unsafe fn decode(
11470            &mut self,
11471            decoder: &mut fidl::encoding::Decoder<
11472                '_,
11473                fidl::encoding::DefaultFuchsiaResourceDialect,
11474            >,
11475            offset: usize,
11476            _depth: fidl::encoding::Depth,
11477        ) -> fidl::Result<()> {
11478            decoder.debug_check_bounds::<Self>(offset);
11479            // Verify that padding bytes are zero.
11480            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
11481            let padval = unsafe { (ptr as *const u64).read_unaligned() };
11482            let mask = 0xffffffff00000000u64;
11483            let maskedval = padval & mask;
11484            if maskedval != 0 {
11485                return Err(fidl::Error::NonZeroPadding {
11486                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
11487                });
11488            }
11489            fidl::decode!(
11490                u64,
11491                fidl::encoding::DefaultFuchsiaResourceDialect,
11492                &mut self.id,
11493                decoder,
11494                offset + 0,
11495                _depth
11496            )?;
11497            fidl::decode!(
11498                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirReceiverMarker>>,
11499                fidl::encoding::DefaultFuchsiaResourceDialect,
11500                &mut self.receiver,
11501                decoder,
11502                offset + 8,
11503                _depth
11504            )?;
11505            Ok(())
11506        }
11507    }
11508
11509    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDirConnectorOpenRequest {
11510        type Borrowed<'a> = &'a mut Self;
11511        fn take_or_borrow<'a>(
11512            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11513        ) -> Self::Borrowed<'a> {
11514            value
11515        }
11516    }
11517
11518    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDirConnectorOpenRequest {
11519        type Owned = Self;
11520
11521        #[inline(always)]
11522        fn inline_align(_context: fidl::encoding::Context) -> usize {
11523            8
11524        }
11525
11526        #[inline(always)]
11527        fn inline_size(_context: fidl::encoding::Context) -> usize {
11528            16
11529        }
11530    }
11531
11532    unsafe impl
11533        fidl::encoding::Encode<
11534            CapabilityStoreDirConnectorOpenRequest,
11535            fidl::encoding::DefaultFuchsiaResourceDialect,
11536        > for &mut CapabilityStoreDirConnectorOpenRequest
11537    {
11538        #[inline]
11539        unsafe fn encode(
11540            self,
11541            encoder: &mut fidl::encoding::Encoder<
11542                '_,
11543                fidl::encoding::DefaultFuchsiaResourceDialect,
11544            >,
11545            offset: usize,
11546            _depth: fidl::encoding::Depth,
11547        ) -> fidl::Result<()> {
11548            encoder.debug_check_bounds::<CapabilityStoreDirConnectorOpenRequest>(offset);
11549            // Delegate to tuple encoding.
11550            fidl::encoding::Encode::<
11551                CapabilityStoreDirConnectorOpenRequest,
11552                fidl::encoding::DefaultFuchsiaResourceDialect,
11553            >::encode(
11554                (
11555                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
11556                    <fidl::encoding::Endpoint<
11557                        fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
11558                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11559                        &mut self.server_end
11560                    ),
11561                ),
11562                encoder,
11563                offset,
11564                _depth,
11565            )
11566        }
11567    }
11568    unsafe impl<
11569            T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
11570            T1: fidl::encoding::Encode<
11571                fidl::encoding::Endpoint<
11572                    fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
11573                >,
11574                fidl::encoding::DefaultFuchsiaResourceDialect,
11575            >,
11576        >
11577        fidl::encoding::Encode<
11578            CapabilityStoreDirConnectorOpenRequest,
11579            fidl::encoding::DefaultFuchsiaResourceDialect,
11580        > for (T0, T1)
11581    {
11582        #[inline]
11583        unsafe fn encode(
11584            self,
11585            encoder: &mut fidl::encoding::Encoder<
11586                '_,
11587                fidl::encoding::DefaultFuchsiaResourceDialect,
11588            >,
11589            offset: usize,
11590            depth: fidl::encoding::Depth,
11591        ) -> fidl::Result<()> {
11592            encoder.debug_check_bounds::<CapabilityStoreDirConnectorOpenRequest>(offset);
11593            // Zero out padding regions. There's no need to apply masks
11594            // because the unmasked parts will be overwritten by fields.
11595            unsafe {
11596                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
11597                (ptr as *mut u64).write_unaligned(0);
11598            }
11599            // Write the fields.
11600            self.0.encode(encoder, offset + 0, depth)?;
11601            self.1.encode(encoder, offset + 8, depth)?;
11602            Ok(())
11603        }
11604    }
11605
11606    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11607        for CapabilityStoreDirConnectorOpenRequest
11608    {
11609        #[inline(always)]
11610        fn new_empty() -> Self {
11611            Self {
11612                id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
11613                server_end: fidl::new_empty!(
11614                    fidl::encoding::Endpoint<
11615                        fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
11616                    >,
11617                    fidl::encoding::DefaultFuchsiaResourceDialect
11618                ),
11619            }
11620        }
11621
11622        #[inline]
11623        unsafe fn decode(
11624            &mut self,
11625            decoder: &mut fidl::encoding::Decoder<
11626                '_,
11627                fidl::encoding::DefaultFuchsiaResourceDialect,
11628            >,
11629            offset: usize,
11630            _depth: fidl::encoding::Depth,
11631        ) -> fidl::Result<()> {
11632            decoder.debug_check_bounds::<Self>(offset);
11633            // Verify that padding bytes are zero.
11634            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
11635            let padval = unsafe { (ptr as *const u64).read_unaligned() };
11636            let mask = 0xffffffff00000000u64;
11637            let maskedval = padval & mask;
11638            if maskedval != 0 {
11639                return Err(fidl::Error::NonZeroPadding {
11640                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
11641                });
11642            }
11643            fidl::decode!(
11644                u64,
11645                fidl::encoding::DefaultFuchsiaResourceDialect,
11646                &mut self.id,
11647                decoder,
11648                offset + 0,
11649                _depth
11650            )?;
11651            fidl::decode!(
11652                fidl::encoding::Endpoint<
11653                    fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
11654                >,
11655                fidl::encoding::DefaultFuchsiaResourceDialect,
11656                &mut self.server_end,
11657                decoder,
11658                offset + 8,
11659                _depth
11660            )?;
11661            Ok(())
11662        }
11663    }
11664
11665    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreImportRequest {
11666        type Borrowed<'a> = &'a mut Self;
11667        fn take_or_borrow<'a>(
11668            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11669        ) -> Self::Borrowed<'a> {
11670            value
11671        }
11672    }
11673
11674    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreImportRequest {
11675        type Owned = Self;
11676
11677        #[inline(always)]
11678        fn inline_align(_context: fidl::encoding::Context) -> usize {
11679            8
11680        }
11681
11682        #[inline(always)]
11683        fn inline_size(_context: fidl::encoding::Context) -> usize {
11684            24
11685        }
11686    }
11687
11688    unsafe impl
11689        fidl::encoding::Encode<
11690            CapabilityStoreImportRequest,
11691            fidl::encoding::DefaultFuchsiaResourceDialect,
11692        > for &mut CapabilityStoreImportRequest
11693    {
11694        #[inline]
11695        unsafe fn encode(
11696            self,
11697            encoder: &mut fidl::encoding::Encoder<
11698                '_,
11699                fidl::encoding::DefaultFuchsiaResourceDialect,
11700            >,
11701            offset: usize,
11702            _depth: fidl::encoding::Depth,
11703        ) -> fidl::Result<()> {
11704            encoder.debug_check_bounds::<CapabilityStoreImportRequest>(offset);
11705            // Delegate to tuple encoding.
11706            fidl::encoding::Encode::<
11707                CapabilityStoreImportRequest,
11708                fidl::encoding::DefaultFuchsiaResourceDialect,
11709            >::encode(
11710                (
11711                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
11712                    <Capability as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11713                        &mut self.capability,
11714                    ),
11715                ),
11716                encoder,
11717                offset,
11718                _depth,
11719            )
11720        }
11721    }
11722    unsafe impl<
11723            T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
11724            T1: fidl::encoding::Encode<Capability, fidl::encoding::DefaultFuchsiaResourceDialect>,
11725        >
11726        fidl::encoding::Encode<
11727            CapabilityStoreImportRequest,
11728            fidl::encoding::DefaultFuchsiaResourceDialect,
11729        > for (T0, T1)
11730    {
11731        #[inline]
11732        unsafe fn encode(
11733            self,
11734            encoder: &mut fidl::encoding::Encoder<
11735                '_,
11736                fidl::encoding::DefaultFuchsiaResourceDialect,
11737            >,
11738            offset: usize,
11739            depth: fidl::encoding::Depth,
11740        ) -> fidl::Result<()> {
11741            encoder.debug_check_bounds::<CapabilityStoreImportRequest>(offset);
11742            // Zero out padding regions. There's no need to apply masks
11743            // because the unmasked parts will be overwritten by fields.
11744            // Write the fields.
11745            self.0.encode(encoder, offset + 0, depth)?;
11746            self.1.encode(encoder, offset + 8, depth)?;
11747            Ok(())
11748        }
11749    }
11750
11751    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11752        for CapabilityStoreImportRequest
11753    {
11754        #[inline(always)]
11755        fn new_empty() -> Self {
11756            Self {
11757                id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
11758                capability: fidl::new_empty!(
11759                    Capability,
11760                    fidl::encoding::DefaultFuchsiaResourceDialect
11761                ),
11762            }
11763        }
11764
11765        #[inline]
11766        unsafe fn decode(
11767            &mut self,
11768            decoder: &mut fidl::encoding::Decoder<
11769                '_,
11770                fidl::encoding::DefaultFuchsiaResourceDialect,
11771            >,
11772            offset: usize,
11773            _depth: fidl::encoding::Depth,
11774        ) -> fidl::Result<()> {
11775            decoder.debug_check_bounds::<Self>(offset);
11776            // Verify that padding bytes are zero.
11777            fidl::decode!(
11778                u64,
11779                fidl::encoding::DefaultFuchsiaResourceDialect,
11780                &mut self.id,
11781                decoder,
11782                offset + 0,
11783                _depth
11784            )?;
11785            fidl::decode!(
11786                Capability,
11787                fidl::encoding::DefaultFuchsiaResourceDialect,
11788                &mut self.capability,
11789                decoder,
11790                offset + 8,
11791                _depth
11792            )?;
11793            Ok(())
11794        }
11795    }
11796
11797    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreExportResponse {
11798        type Borrowed<'a> = &'a mut Self;
11799        fn take_or_borrow<'a>(
11800            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11801        ) -> Self::Borrowed<'a> {
11802            value
11803        }
11804    }
11805
11806    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreExportResponse {
11807        type Owned = Self;
11808
11809        #[inline(always)]
11810        fn inline_align(_context: fidl::encoding::Context) -> usize {
11811            8
11812        }
11813
11814        #[inline(always)]
11815        fn inline_size(_context: fidl::encoding::Context) -> usize {
11816            16
11817        }
11818    }
11819
11820    unsafe impl
11821        fidl::encoding::Encode<
11822            CapabilityStoreExportResponse,
11823            fidl::encoding::DefaultFuchsiaResourceDialect,
11824        > for &mut CapabilityStoreExportResponse
11825    {
11826        #[inline]
11827        unsafe fn encode(
11828            self,
11829            encoder: &mut fidl::encoding::Encoder<
11830                '_,
11831                fidl::encoding::DefaultFuchsiaResourceDialect,
11832            >,
11833            offset: usize,
11834            _depth: fidl::encoding::Depth,
11835        ) -> fidl::Result<()> {
11836            encoder.debug_check_bounds::<CapabilityStoreExportResponse>(offset);
11837            // Delegate to tuple encoding.
11838            fidl::encoding::Encode::<
11839                CapabilityStoreExportResponse,
11840                fidl::encoding::DefaultFuchsiaResourceDialect,
11841            >::encode(
11842                (<Capability as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11843                    &mut self.capability,
11844                ),),
11845                encoder,
11846                offset,
11847                _depth,
11848            )
11849        }
11850    }
11851    unsafe impl<T0: fidl::encoding::Encode<Capability, fidl::encoding::DefaultFuchsiaResourceDialect>>
11852        fidl::encoding::Encode<
11853            CapabilityStoreExportResponse,
11854            fidl::encoding::DefaultFuchsiaResourceDialect,
11855        > for (T0,)
11856    {
11857        #[inline]
11858        unsafe fn encode(
11859            self,
11860            encoder: &mut fidl::encoding::Encoder<
11861                '_,
11862                fidl::encoding::DefaultFuchsiaResourceDialect,
11863            >,
11864            offset: usize,
11865            depth: fidl::encoding::Depth,
11866        ) -> fidl::Result<()> {
11867            encoder.debug_check_bounds::<CapabilityStoreExportResponse>(offset);
11868            // Zero out padding regions. There's no need to apply masks
11869            // because the unmasked parts will be overwritten by fields.
11870            // Write the fields.
11871            self.0.encode(encoder, offset + 0, depth)?;
11872            Ok(())
11873        }
11874    }
11875
11876    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11877        for CapabilityStoreExportResponse
11878    {
11879        #[inline(always)]
11880        fn new_empty() -> Self {
11881            Self {
11882                capability: fidl::new_empty!(
11883                    Capability,
11884                    fidl::encoding::DefaultFuchsiaResourceDialect
11885                ),
11886            }
11887        }
11888
11889        #[inline]
11890        unsafe fn decode(
11891            &mut self,
11892            decoder: &mut fidl::encoding::Decoder<
11893                '_,
11894                fidl::encoding::DefaultFuchsiaResourceDialect,
11895            >,
11896            offset: usize,
11897            _depth: fidl::encoding::Depth,
11898        ) -> fidl::Result<()> {
11899            decoder.debug_check_bounds::<Self>(offset);
11900            // Verify that padding bytes are zero.
11901            fidl::decode!(
11902                Capability,
11903                fidl::encoding::DefaultFuchsiaResourceDialect,
11904                &mut self.capability,
11905                decoder,
11906                offset + 0,
11907                _depth
11908            )?;
11909            Ok(())
11910        }
11911    }
11912
11913    impl fidl::encoding::ResourceTypeMarker for Connector {
11914        type Borrowed<'a> = &'a mut Self;
11915        fn take_or_borrow<'a>(
11916            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11917        ) -> Self::Borrowed<'a> {
11918            value
11919        }
11920    }
11921
11922    unsafe impl fidl::encoding::TypeMarker for Connector {
11923        type Owned = Self;
11924
11925        #[inline(always)]
11926        fn inline_align(_context: fidl::encoding::Context) -> usize {
11927            4
11928        }
11929
11930        #[inline(always)]
11931        fn inline_size(_context: fidl::encoding::Context) -> usize {
11932            4
11933        }
11934    }
11935
11936    unsafe impl fidl::encoding::Encode<Connector, fidl::encoding::DefaultFuchsiaResourceDialect>
11937        for &mut Connector
11938    {
11939        #[inline]
11940        unsafe fn encode(
11941            self,
11942            encoder: &mut fidl::encoding::Encoder<
11943                '_,
11944                fidl::encoding::DefaultFuchsiaResourceDialect,
11945            >,
11946            offset: usize,
11947            _depth: fidl::encoding::Depth,
11948        ) -> fidl::Result<()> {
11949            encoder.debug_check_bounds::<Connector>(offset);
11950            // Delegate to tuple encoding.
11951            fidl::encoding::Encode::<Connector, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
11952                (
11953                    <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.token),
11954                ),
11955                encoder, offset, _depth
11956            )
11957        }
11958    }
11959    unsafe impl<
11960            T0: fidl::encoding::Encode<
11961                fidl::encoding::HandleType<
11962                    fidl::EventPair,
11963                    { fidl::ObjectType::EVENTPAIR.into_raw() },
11964                    2147483648,
11965                >,
11966                fidl::encoding::DefaultFuchsiaResourceDialect,
11967            >,
11968        > fidl::encoding::Encode<Connector, fidl::encoding::DefaultFuchsiaResourceDialect>
11969        for (T0,)
11970    {
11971        #[inline]
11972        unsafe fn encode(
11973            self,
11974            encoder: &mut fidl::encoding::Encoder<
11975                '_,
11976                fidl::encoding::DefaultFuchsiaResourceDialect,
11977            >,
11978            offset: usize,
11979            depth: fidl::encoding::Depth,
11980        ) -> fidl::Result<()> {
11981            encoder.debug_check_bounds::<Connector>(offset);
11982            // Zero out padding regions. There's no need to apply masks
11983            // because the unmasked parts will be overwritten by fields.
11984            // Write the fields.
11985            self.0.encode(encoder, offset + 0, depth)?;
11986            Ok(())
11987        }
11988    }
11989
11990    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Connector {
11991        #[inline(always)]
11992        fn new_empty() -> Self {
11993            Self {
11994                token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11995            }
11996        }
11997
11998        #[inline]
11999        unsafe fn decode(
12000            &mut self,
12001            decoder: &mut fidl::encoding::Decoder<
12002                '_,
12003                fidl::encoding::DefaultFuchsiaResourceDialect,
12004            >,
12005            offset: usize,
12006            _depth: fidl::encoding::Depth,
12007        ) -> fidl::Result<()> {
12008            decoder.debug_check_bounds::<Self>(offset);
12009            // Verify that padding bytes are zero.
12010            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.token, decoder, offset + 0, _depth)?;
12011            Ok(())
12012        }
12013    }
12014
12015    impl fidl::encoding::ResourceTypeMarker for DictionaryDrainIteratorGetNextResponse {
12016        type Borrowed<'a> = &'a mut Self;
12017        fn take_or_borrow<'a>(
12018            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12019        ) -> Self::Borrowed<'a> {
12020            value
12021        }
12022    }
12023
12024    unsafe impl fidl::encoding::TypeMarker for DictionaryDrainIteratorGetNextResponse {
12025        type Owned = Self;
12026
12027        #[inline(always)]
12028        fn inline_align(_context: fidl::encoding::Context) -> usize {
12029            8
12030        }
12031
12032        #[inline(always)]
12033        fn inline_size(_context: fidl::encoding::Context) -> usize {
12034            24
12035        }
12036    }
12037
12038    unsafe impl
12039        fidl::encoding::Encode<
12040            DictionaryDrainIteratorGetNextResponse,
12041            fidl::encoding::DefaultFuchsiaResourceDialect,
12042        > for &mut DictionaryDrainIteratorGetNextResponse
12043    {
12044        #[inline]
12045        unsafe fn encode(
12046            self,
12047            encoder: &mut fidl::encoding::Encoder<
12048                '_,
12049                fidl::encoding::DefaultFuchsiaResourceDialect,
12050            >,
12051            offset: usize,
12052            _depth: fidl::encoding::Depth,
12053        ) -> fidl::Result<()> {
12054            encoder.debug_check_bounds::<DictionaryDrainIteratorGetNextResponse>(offset);
12055            // Delegate to tuple encoding.
12056            fidl::encoding::Encode::<DictionaryDrainIteratorGetNextResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
12057                (
12058                    <fidl::encoding::Vector<DictionaryItem, 128> as fidl::encoding::ValueTypeMarker>::borrow(&self.items),
12059                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.end_id),
12060                ),
12061                encoder, offset, _depth
12062            )
12063        }
12064    }
12065    unsafe impl<
12066            T0: fidl::encoding::Encode<
12067                fidl::encoding::Vector<DictionaryItem, 128>,
12068                fidl::encoding::DefaultFuchsiaResourceDialect,
12069            >,
12070            T1: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
12071        >
12072        fidl::encoding::Encode<
12073            DictionaryDrainIteratorGetNextResponse,
12074            fidl::encoding::DefaultFuchsiaResourceDialect,
12075        > for (T0, T1)
12076    {
12077        #[inline]
12078        unsafe fn encode(
12079            self,
12080            encoder: &mut fidl::encoding::Encoder<
12081                '_,
12082                fidl::encoding::DefaultFuchsiaResourceDialect,
12083            >,
12084            offset: usize,
12085            depth: fidl::encoding::Depth,
12086        ) -> fidl::Result<()> {
12087            encoder.debug_check_bounds::<DictionaryDrainIteratorGetNextResponse>(offset);
12088            // Zero out padding regions. There's no need to apply masks
12089            // because the unmasked parts will be overwritten by fields.
12090            // Write the fields.
12091            self.0.encode(encoder, offset + 0, depth)?;
12092            self.1.encode(encoder, offset + 16, depth)?;
12093            Ok(())
12094        }
12095    }
12096
12097    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12098        for DictionaryDrainIteratorGetNextResponse
12099    {
12100        #[inline(always)]
12101        fn new_empty() -> Self {
12102            Self {
12103                items: fidl::new_empty!(fidl::encoding::Vector<DictionaryItem, 128>, fidl::encoding::DefaultFuchsiaResourceDialect),
12104                end_id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
12105            }
12106        }
12107
12108        #[inline]
12109        unsafe fn decode(
12110            &mut self,
12111            decoder: &mut fidl::encoding::Decoder<
12112                '_,
12113                fidl::encoding::DefaultFuchsiaResourceDialect,
12114            >,
12115            offset: usize,
12116            _depth: fidl::encoding::Depth,
12117        ) -> fidl::Result<()> {
12118            decoder.debug_check_bounds::<Self>(offset);
12119            // Verify that padding bytes are zero.
12120            fidl::decode!(fidl::encoding::Vector<DictionaryItem, 128>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.items, decoder, offset + 0, _depth)?;
12121            fidl::decode!(
12122                u64,
12123                fidl::encoding::DefaultFuchsiaResourceDialect,
12124                &mut self.end_id,
12125                decoder,
12126                offset + 16,
12127                _depth
12128            )?;
12129            Ok(())
12130        }
12131    }
12132
12133    impl fidl::encoding::ResourceTypeMarker for DictionaryEnumerateIteratorGetNextResponse {
12134        type Borrowed<'a> = &'a mut Self;
12135        fn take_or_borrow<'a>(
12136            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12137        ) -> Self::Borrowed<'a> {
12138            value
12139        }
12140    }
12141
12142    unsafe impl fidl::encoding::TypeMarker for DictionaryEnumerateIteratorGetNextResponse {
12143        type Owned = Self;
12144
12145        #[inline(always)]
12146        fn inline_align(_context: fidl::encoding::Context) -> usize {
12147            8
12148        }
12149
12150        #[inline(always)]
12151        fn inline_size(_context: fidl::encoding::Context) -> usize {
12152            24
12153        }
12154    }
12155
12156    unsafe impl
12157        fidl::encoding::Encode<
12158            DictionaryEnumerateIteratorGetNextResponse,
12159            fidl::encoding::DefaultFuchsiaResourceDialect,
12160        > for &mut DictionaryEnumerateIteratorGetNextResponse
12161    {
12162        #[inline]
12163        unsafe fn encode(
12164            self,
12165            encoder: &mut fidl::encoding::Encoder<
12166                '_,
12167                fidl::encoding::DefaultFuchsiaResourceDialect,
12168            >,
12169            offset: usize,
12170            _depth: fidl::encoding::Depth,
12171        ) -> fidl::Result<()> {
12172            encoder.debug_check_bounds::<DictionaryEnumerateIteratorGetNextResponse>(offset);
12173            // Delegate to tuple encoding.
12174            fidl::encoding::Encode::<DictionaryEnumerateIteratorGetNextResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
12175                (
12176                    <fidl::encoding::Vector<DictionaryOptionalItem, 128> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.items),
12177                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.end_id),
12178                ),
12179                encoder, offset, _depth
12180            )
12181        }
12182    }
12183    unsafe impl<
12184            T0: fidl::encoding::Encode<
12185                fidl::encoding::Vector<DictionaryOptionalItem, 128>,
12186                fidl::encoding::DefaultFuchsiaResourceDialect,
12187            >,
12188            T1: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
12189        >
12190        fidl::encoding::Encode<
12191            DictionaryEnumerateIteratorGetNextResponse,
12192            fidl::encoding::DefaultFuchsiaResourceDialect,
12193        > for (T0, T1)
12194    {
12195        #[inline]
12196        unsafe fn encode(
12197            self,
12198            encoder: &mut fidl::encoding::Encoder<
12199                '_,
12200                fidl::encoding::DefaultFuchsiaResourceDialect,
12201            >,
12202            offset: usize,
12203            depth: fidl::encoding::Depth,
12204        ) -> fidl::Result<()> {
12205            encoder.debug_check_bounds::<DictionaryEnumerateIteratorGetNextResponse>(offset);
12206            // Zero out padding regions. There's no need to apply masks
12207            // because the unmasked parts will be overwritten by fields.
12208            // Write the fields.
12209            self.0.encode(encoder, offset + 0, depth)?;
12210            self.1.encode(encoder, offset + 16, depth)?;
12211            Ok(())
12212        }
12213    }
12214
12215    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12216        for DictionaryEnumerateIteratorGetNextResponse
12217    {
12218        #[inline(always)]
12219        fn new_empty() -> Self {
12220            Self {
12221                items: fidl::new_empty!(fidl::encoding::Vector<DictionaryOptionalItem, 128>, fidl::encoding::DefaultFuchsiaResourceDialect),
12222                end_id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
12223            }
12224        }
12225
12226        #[inline]
12227        unsafe fn decode(
12228            &mut self,
12229            decoder: &mut fidl::encoding::Decoder<
12230                '_,
12231                fidl::encoding::DefaultFuchsiaResourceDialect,
12232            >,
12233            offset: usize,
12234            _depth: fidl::encoding::Depth,
12235        ) -> fidl::Result<()> {
12236            decoder.debug_check_bounds::<Self>(offset);
12237            // Verify that padding bytes are zero.
12238            fidl::decode!(fidl::encoding::Vector<DictionaryOptionalItem, 128>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.items, decoder, offset + 0, _depth)?;
12239            fidl::decode!(
12240                u64,
12241                fidl::encoding::DefaultFuchsiaResourceDialect,
12242                &mut self.end_id,
12243                decoder,
12244                offset + 16,
12245                _depth
12246            )?;
12247            Ok(())
12248        }
12249    }
12250
12251    impl fidl::encoding::ResourceTypeMarker for DictionaryKeysIteratorGetNextResponse {
12252        type Borrowed<'a> = &'a mut Self;
12253        fn take_or_borrow<'a>(
12254            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12255        ) -> Self::Borrowed<'a> {
12256            value
12257        }
12258    }
12259
12260    unsafe impl fidl::encoding::TypeMarker for DictionaryKeysIteratorGetNextResponse {
12261        type Owned = Self;
12262
12263        #[inline(always)]
12264        fn inline_align(_context: fidl::encoding::Context) -> usize {
12265            8
12266        }
12267
12268        #[inline(always)]
12269        fn inline_size(_context: fidl::encoding::Context) -> usize {
12270            16
12271        }
12272    }
12273
12274    unsafe impl
12275        fidl::encoding::Encode<
12276            DictionaryKeysIteratorGetNextResponse,
12277            fidl::encoding::DefaultFuchsiaResourceDialect,
12278        > for &mut DictionaryKeysIteratorGetNextResponse
12279    {
12280        #[inline]
12281        unsafe fn encode(
12282            self,
12283            encoder: &mut fidl::encoding::Encoder<
12284                '_,
12285                fidl::encoding::DefaultFuchsiaResourceDialect,
12286            >,
12287            offset: usize,
12288            _depth: fidl::encoding::Depth,
12289        ) -> fidl::Result<()> {
12290            encoder.debug_check_bounds::<DictionaryKeysIteratorGetNextResponse>(offset);
12291            // Delegate to tuple encoding.
12292            fidl::encoding::Encode::<DictionaryKeysIteratorGetNextResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
12293                (
12294                    <fidl::encoding::Vector<fidl::encoding::BoundedString<255>, 128> as fidl::encoding::ValueTypeMarker>::borrow(&self.keys),
12295                ),
12296                encoder, offset, _depth
12297            )
12298        }
12299    }
12300    unsafe impl<
12301            T0: fidl::encoding::Encode<
12302                fidl::encoding::Vector<fidl::encoding::BoundedString<255>, 128>,
12303                fidl::encoding::DefaultFuchsiaResourceDialect,
12304            >,
12305        >
12306        fidl::encoding::Encode<
12307            DictionaryKeysIteratorGetNextResponse,
12308            fidl::encoding::DefaultFuchsiaResourceDialect,
12309        > for (T0,)
12310    {
12311        #[inline]
12312        unsafe fn encode(
12313            self,
12314            encoder: &mut fidl::encoding::Encoder<
12315                '_,
12316                fidl::encoding::DefaultFuchsiaResourceDialect,
12317            >,
12318            offset: usize,
12319            depth: fidl::encoding::Depth,
12320        ) -> fidl::Result<()> {
12321            encoder.debug_check_bounds::<DictionaryKeysIteratorGetNextResponse>(offset);
12322            // Zero out padding regions. There's no need to apply masks
12323            // because the unmasked parts will be overwritten by fields.
12324            // Write the fields.
12325            self.0.encode(encoder, offset + 0, depth)?;
12326            Ok(())
12327        }
12328    }
12329
12330    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12331        for DictionaryKeysIteratorGetNextResponse
12332    {
12333        #[inline(always)]
12334        fn new_empty() -> Self {
12335            Self {
12336                keys: fidl::new_empty!(
12337                    fidl::encoding::Vector<fidl::encoding::BoundedString<255>, 128>,
12338                    fidl::encoding::DefaultFuchsiaResourceDialect
12339                ),
12340            }
12341        }
12342
12343        #[inline]
12344        unsafe fn decode(
12345            &mut self,
12346            decoder: &mut fidl::encoding::Decoder<
12347                '_,
12348                fidl::encoding::DefaultFuchsiaResourceDialect,
12349            >,
12350            offset: usize,
12351            _depth: fidl::encoding::Depth,
12352        ) -> fidl::Result<()> {
12353            decoder.debug_check_bounds::<Self>(offset);
12354            // Verify that padding bytes are zero.
12355            fidl::decode!(
12356                fidl::encoding::Vector<fidl::encoding::BoundedString<255>, 128>,
12357                fidl::encoding::DefaultFuchsiaResourceDialect,
12358                &mut self.keys,
12359                decoder,
12360                offset + 0,
12361                _depth
12362            )?;
12363            Ok(())
12364        }
12365    }
12366
12367    impl fidl::encoding::ResourceTypeMarker for DictionaryOptionalItem {
12368        type Borrowed<'a> = &'a mut Self;
12369        fn take_or_borrow<'a>(
12370            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12371        ) -> Self::Borrowed<'a> {
12372            value
12373        }
12374    }
12375
12376    unsafe impl fidl::encoding::TypeMarker for DictionaryOptionalItem {
12377        type Owned = Self;
12378
12379        #[inline(always)]
12380        fn inline_align(_context: fidl::encoding::Context) -> usize {
12381            8
12382        }
12383
12384        #[inline(always)]
12385        fn inline_size(_context: fidl::encoding::Context) -> usize {
12386            24
12387        }
12388    }
12389
12390    unsafe impl
12391        fidl::encoding::Encode<
12392            DictionaryOptionalItem,
12393            fidl::encoding::DefaultFuchsiaResourceDialect,
12394        > for &mut DictionaryOptionalItem
12395    {
12396        #[inline]
12397        unsafe fn encode(
12398            self,
12399            encoder: &mut fidl::encoding::Encoder<
12400                '_,
12401                fidl::encoding::DefaultFuchsiaResourceDialect,
12402            >,
12403            offset: usize,
12404            _depth: fidl::encoding::Depth,
12405        ) -> fidl::Result<()> {
12406            encoder.debug_check_bounds::<DictionaryOptionalItem>(offset);
12407            // Delegate to tuple encoding.
12408            fidl::encoding::Encode::<DictionaryOptionalItem, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
12409                (
12410                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(&self.key),
12411                    <fidl::encoding::Boxed<WrappedCapabilityId> as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
12412                ),
12413                encoder, offset, _depth
12414            )
12415        }
12416    }
12417    unsafe impl<
12418            T0: fidl::encoding::Encode<
12419                fidl::encoding::BoundedString<255>,
12420                fidl::encoding::DefaultFuchsiaResourceDialect,
12421            >,
12422            T1: fidl::encoding::Encode<
12423                fidl::encoding::Boxed<WrappedCapabilityId>,
12424                fidl::encoding::DefaultFuchsiaResourceDialect,
12425            >,
12426        >
12427        fidl::encoding::Encode<
12428            DictionaryOptionalItem,
12429            fidl::encoding::DefaultFuchsiaResourceDialect,
12430        > for (T0, T1)
12431    {
12432        #[inline]
12433        unsafe fn encode(
12434            self,
12435            encoder: &mut fidl::encoding::Encoder<
12436                '_,
12437                fidl::encoding::DefaultFuchsiaResourceDialect,
12438            >,
12439            offset: usize,
12440            depth: fidl::encoding::Depth,
12441        ) -> fidl::Result<()> {
12442            encoder.debug_check_bounds::<DictionaryOptionalItem>(offset);
12443            // Zero out padding regions. There's no need to apply masks
12444            // because the unmasked parts will be overwritten by fields.
12445            // Write the fields.
12446            self.0.encode(encoder, offset + 0, depth)?;
12447            self.1.encode(encoder, offset + 16, depth)?;
12448            Ok(())
12449        }
12450    }
12451
12452    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12453        for DictionaryOptionalItem
12454    {
12455        #[inline(always)]
12456        fn new_empty() -> Self {
12457            Self {
12458                key: fidl::new_empty!(
12459                    fidl::encoding::BoundedString<255>,
12460                    fidl::encoding::DefaultFuchsiaResourceDialect
12461                ),
12462                value: fidl::new_empty!(
12463                    fidl::encoding::Boxed<WrappedCapabilityId>,
12464                    fidl::encoding::DefaultFuchsiaResourceDialect
12465                ),
12466            }
12467        }
12468
12469        #[inline]
12470        unsafe fn decode(
12471            &mut self,
12472            decoder: &mut fidl::encoding::Decoder<
12473                '_,
12474                fidl::encoding::DefaultFuchsiaResourceDialect,
12475            >,
12476            offset: usize,
12477            _depth: fidl::encoding::Depth,
12478        ) -> fidl::Result<()> {
12479            decoder.debug_check_bounds::<Self>(offset);
12480            // Verify that padding bytes are zero.
12481            fidl::decode!(
12482                fidl::encoding::BoundedString<255>,
12483                fidl::encoding::DefaultFuchsiaResourceDialect,
12484                &mut self.key,
12485                decoder,
12486                offset + 0,
12487                _depth
12488            )?;
12489            fidl::decode!(
12490                fidl::encoding::Boxed<WrappedCapabilityId>,
12491                fidl::encoding::DefaultFuchsiaResourceDialect,
12492                &mut self.value,
12493                decoder,
12494                offset + 16,
12495                _depth
12496            )?;
12497            Ok(())
12498        }
12499    }
12500
12501    impl fidl::encoding::ResourceTypeMarker for DictionaryRef {
12502        type Borrowed<'a> = &'a mut Self;
12503        fn take_or_borrow<'a>(
12504            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12505        ) -> Self::Borrowed<'a> {
12506            value
12507        }
12508    }
12509
12510    unsafe impl fidl::encoding::TypeMarker for DictionaryRef {
12511        type Owned = Self;
12512
12513        #[inline(always)]
12514        fn inline_align(_context: fidl::encoding::Context) -> usize {
12515            4
12516        }
12517
12518        #[inline(always)]
12519        fn inline_size(_context: fidl::encoding::Context) -> usize {
12520            4
12521        }
12522    }
12523
12524    unsafe impl fidl::encoding::Encode<DictionaryRef, fidl::encoding::DefaultFuchsiaResourceDialect>
12525        for &mut DictionaryRef
12526    {
12527        #[inline]
12528        unsafe fn encode(
12529            self,
12530            encoder: &mut fidl::encoding::Encoder<
12531                '_,
12532                fidl::encoding::DefaultFuchsiaResourceDialect,
12533            >,
12534            offset: usize,
12535            _depth: fidl::encoding::Depth,
12536        ) -> fidl::Result<()> {
12537            encoder.debug_check_bounds::<DictionaryRef>(offset);
12538            // Delegate to tuple encoding.
12539            fidl::encoding::Encode::<DictionaryRef, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
12540                (
12541                    <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.token),
12542                ),
12543                encoder, offset, _depth
12544            )
12545        }
12546    }
12547    unsafe impl<
12548            T0: fidl::encoding::Encode<
12549                fidl::encoding::HandleType<
12550                    fidl::EventPair,
12551                    { fidl::ObjectType::EVENTPAIR.into_raw() },
12552                    2147483648,
12553                >,
12554                fidl::encoding::DefaultFuchsiaResourceDialect,
12555            >,
12556        > fidl::encoding::Encode<DictionaryRef, fidl::encoding::DefaultFuchsiaResourceDialect>
12557        for (T0,)
12558    {
12559        #[inline]
12560        unsafe fn encode(
12561            self,
12562            encoder: &mut fidl::encoding::Encoder<
12563                '_,
12564                fidl::encoding::DefaultFuchsiaResourceDialect,
12565            >,
12566            offset: usize,
12567            depth: fidl::encoding::Depth,
12568        ) -> fidl::Result<()> {
12569            encoder.debug_check_bounds::<DictionaryRef>(offset);
12570            // Zero out padding regions. There's no need to apply masks
12571            // because the unmasked parts will be overwritten by fields.
12572            // Write the fields.
12573            self.0.encode(encoder, offset + 0, depth)?;
12574            Ok(())
12575        }
12576    }
12577
12578    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for DictionaryRef {
12579        #[inline(always)]
12580        fn new_empty() -> Self {
12581            Self {
12582                token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
12583            }
12584        }
12585
12586        #[inline]
12587        unsafe fn decode(
12588            &mut self,
12589            decoder: &mut fidl::encoding::Decoder<
12590                '_,
12591                fidl::encoding::DefaultFuchsiaResourceDialect,
12592            >,
12593            offset: usize,
12594            _depth: fidl::encoding::Depth,
12595        ) -> fidl::Result<()> {
12596            decoder.debug_check_bounds::<Self>(offset);
12597            // Verify that padding bytes are zero.
12598            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.token, decoder, offset + 0, _depth)?;
12599            Ok(())
12600        }
12601    }
12602
12603    impl fidl::encoding::ResourceTypeMarker for DirConnector {
12604        type Borrowed<'a> = &'a mut Self;
12605        fn take_or_borrow<'a>(
12606            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12607        ) -> Self::Borrowed<'a> {
12608            value
12609        }
12610    }
12611
12612    unsafe impl fidl::encoding::TypeMarker for DirConnector {
12613        type Owned = Self;
12614
12615        #[inline(always)]
12616        fn inline_align(_context: fidl::encoding::Context) -> usize {
12617            4
12618        }
12619
12620        #[inline(always)]
12621        fn inline_size(_context: fidl::encoding::Context) -> usize {
12622            4
12623        }
12624    }
12625
12626    unsafe impl fidl::encoding::Encode<DirConnector, fidl::encoding::DefaultFuchsiaResourceDialect>
12627        for &mut DirConnector
12628    {
12629        #[inline]
12630        unsafe fn encode(
12631            self,
12632            encoder: &mut fidl::encoding::Encoder<
12633                '_,
12634                fidl::encoding::DefaultFuchsiaResourceDialect,
12635            >,
12636            offset: usize,
12637            _depth: fidl::encoding::Depth,
12638        ) -> fidl::Result<()> {
12639            encoder.debug_check_bounds::<DirConnector>(offset);
12640            // Delegate to tuple encoding.
12641            fidl::encoding::Encode::<DirConnector, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
12642                (
12643                    <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.token),
12644                ),
12645                encoder, offset, _depth
12646            )
12647        }
12648    }
12649    unsafe impl<
12650            T0: fidl::encoding::Encode<
12651                fidl::encoding::HandleType<
12652                    fidl::EventPair,
12653                    { fidl::ObjectType::EVENTPAIR.into_raw() },
12654                    2147483648,
12655                >,
12656                fidl::encoding::DefaultFuchsiaResourceDialect,
12657            >,
12658        > fidl::encoding::Encode<DirConnector, fidl::encoding::DefaultFuchsiaResourceDialect>
12659        for (T0,)
12660    {
12661        #[inline]
12662        unsafe fn encode(
12663            self,
12664            encoder: &mut fidl::encoding::Encoder<
12665                '_,
12666                fidl::encoding::DefaultFuchsiaResourceDialect,
12667            >,
12668            offset: usize,
12669            depth: fidl::encoding::Depth,
12670        ) -> fidl::Result<()> {
12671            encoder.debug_check_bounds::<DirConnector>(offset);
12672            // Zero out padding regions. There's no need to apply masks
12673            // because the unmasked parts will be overwritten by fields.
12674            // Write the fields.
12675            self.0.encode(encoder, offset + 0, depth)?;
12676            Ok(())
12677        }
12678    }
12679
12680    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for DirConnector {
12681        #[inline(always)]
12682        fn new_empty() -> Self {
12683            Self {
12684                token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
12685            }
12686        }
12687
12688        #[inline]
12689        unsafe fn decode(
12690            &mut self,
12691            decoder: &mut fidl::encoding::Decoder<
12692                '_,
12693                fidl::encoding::DefaultFuchsiaResourceDialect,
12694            >,
12695            offset: usize,
12696            _depth: fidl::encoding::Depth,
12697        ) -> fidl::Result<()> {
12698            decoder.debug_check_bounds::<Self>(offset);
12699            // Verify that padding bytes are zero.
12700            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.token, decoder, offset + 0, _depth)?;
12701            Ok(())
12702        }
12703    }
12704
12705    impl fidl::encoding::ResourceTypeMarker for DirEntry {
12706        type Borrowed<'a> = &'a mut Self;
12707        fn take_or_borrow<'a>(
12708            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12709        ) -> Self::Borrowed<'a> {
12710            value
12711        }
12712    }
12713
12714    unsafe impl fidl::encoding::TypeMarker for DirEntry {
12715        type Owned = Self;
12716
12717        #[inline(always)]
12718        fn inline_align(_context: fidl::encoding::Context) -> usize {
12719            4
12720        }
12721
12722        #[inline(always)]
12723        fn inline_size(_context: fidl::encoding::Context) -> usize {
12724            4
12725        }
12726    }
12727
12728    unsafe impl fidl::encoding::Encode<DirEntry, fidl::encoding::DefaultFuchsiaResourceDialect>
12729        for &mut DirEntry
12730    {
12731        #[inline]
12732        unsafe fn encode(
12733            self,
12734            encoder: &mut fidl::encoding::Encoder<
12735                '_,
12736                fidl::encoding::DefaultFuchsiaResourceDialect,
12737            >,
12738            offset: usize,
12739            _depth: fidl::encoding::Depth,
12740        ) -> fidl::Result<()> {
12741            encoder.debug_check_bounds::<DirEntry>(offset);
12742            // Delegate to tuple encoding.
12743            fidl::encoding::Encode::<DirEntry, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
12744                (
12745                    <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.token),
12746                ),
12747                encoder, offset, _depth
12748            )
12749        }
12750    }
12751    unsafe impl<
12752            T0: fidl::encoding::Encode<
12753                fidl::encoding::HandleType<
12754                    fidl::EventPair,
12755                    { fidl::ObjectType::EVENTPAIR.into_raw() },
12756                    2147483648,
12757                >,
12758                fidl::encoding::DefaultFuchsiaResourceDialect,
12759            >,
12760        > fidl::encoding::Encode<DirEntry, fidl::encoding::DefaultFuchsiaResourceDialect> for (T0,)
12761    {
12762        #[inline]
12763        unsafe fn encode(
12764            self,
12765            encoder: &mut fidl::encoding::Encoder<
12766                '_,
12767                fidl::encoding::DefaultFuchsiaResourceDialect,
12768            >,
12769            offset: usize,
12770            depth: fidl::encoding::Depth,
12771        ) -> fidl::Result<()> {
12772            encoder.debug_check_bounds::<DirEntry>(offset);
12773            // Zero out padding regions. There's no need to apply masks
12774            // because the unmasked parts will be overwritten by fields.
12775            // Write the fields.
12776            self.0.encode(encoder, offset + 0, depth)?;
12777            Ok(())
12778        }
12779    }
12780
12781    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for DirEntry {
12782        #[inline(always)]
12783        fn new_empty() -> Self {
12784            Self {
12785                token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
12786            }
12787        }
12788
12789        #[inline]
12790        unsafe fn decode(
12791            &mut self,
12792            decoder: &mut fidl::encoding::Decoder<
12793                '_,
12794                fidl::encoding::DefaultFuchsiaResourceDialect,
12795            >,
12796            offset: usize,
12797            _depth: fidl::encoding::Depth,
12798        ) -> fidl::Result<()> {
12799            decoder.debug_check_bounds::<Self>(offset);
12800            // Verify that padding bytes are zero.
12801            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.token, decoder, offset + 0, _depth)?;
12802            Ok(())
12803        }
12804    }
12805
12806    impl fidl::encoding::ResourceTypeMarker for DirReceiverReceiveRequest {
12807        type Borrowed<'a> = &'a mut Self;
12808        fn take_or_borrow<'a>(
12809            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12810        ) -> Self::Borrowed<'a> {
12811            value
12812        }
12813    }
12814
12815    unsafe impl fidl::encoding::TypeMarker for DirReceiverReceiveRequest {
12816        type Owned = Self;
12817
12818        #[inline(always)]
12819        fn inline_align(_context: fidl::encoding::Context) -> usize {
12820            4
12821        }
12822
12823        #[inline(always)]
12824        fn inline_size(_context: fidl::encoding::Context) -> usize {
12825            4
12826        }
12827    }
12828
12829    unsafe impl
12830        fidl::encoding::Encode<
12831            DirReceiverReceiveRequest,
12832            fidl::encoding::DefaultFuchsiaResourceDialect,
12833        > for &mut DirReceiverReceiveRequest
12834    {
12835        #[inline]
12836        unsafe fn encode(
12837            self,
12838            encoder: &mut fidl::encoding::Encoder<
12839                '_,
12840                fidl::encoding::DefaultFuchsiaResourceDialect,
12841            >,
12842            offset: usize,
12843            _depth: fidl::encoding::Depth,
12844        ) -> fidl::Result<()> {
12845            encoder.debug_check_bounds::<DirReceiverReceiveRequest>(offset);
12846            // Delegate to tuple encoding.
12847            fidl::encoding::Encode::<
12848                DirReceiverReceiveRequest,
12849                fidl::encoding::DefaultFuchsiaResourceDialect,
12850            >::encode(
12851                (<fidl::encoding::Endpoint<
12852                    fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
12853                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
12854                    &mut self.channel
12855                ),),
12856                encoder,
12857                offset,
12858                _depth,
12859            )
12860        }
12861    }
12862    unsafe impl<
12863            T0: fidl::encoding::Encode<
12864                fidl::encoding::Endpoint<
12865                    fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
12866                >,
12867                fidl::encoding::DefaultFuchsiaResourceDialect,
12868            >,
12869        >
12870        fidl::encoding::Encode<
12871            DirReceiverReceiveRequest,
12872            fidl::encoding::DefaultFuchsiaResourceDialect,
12873        > for (T0,)
12874    {
12875        #[inline]
12876        unsafe fn encode(
12877            self,
12878            encoder: &mut fidl::encoding::Encoder<
12879                '_,
12880                fidl::encoding::DefaultFuchsiaResourceDialect,
12881            >,
12882            offset: usize,
12883            depth: fidl::encoding::Depth,
12884        ) -> fidl::Result<()> {
12885            encoder.debug_check_bounds::<DirReceiverReceiveRequest>(offset);
12886            // Zero out padding regions. There's no need to apply masks
12887            // because the unmasked parts will be overwritten by fields.
12888            // Write the fields.
12889            self.0.encode(encoder, offset + 0, depth)?;
12890            Ok(())
12891        }
12892    }
12893
12894    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12895        for DirReceiverReceiveRequest
12896    {
12897        #[inline(always)]
12898        fn new_empty() -> Self {
12899            Self {
12900                channel: fidl::new_empty!(
12901                    fidl::encoding::Endpoint<
12902                        fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
12903                    >,
12904                    fidl::encoding::DefaultFuchsiaResourceDialect
12905                ),
12906            }
12907        }
12908
12909        #[inline]
12910        unsafe fn decode(
12911            &mut self,
12912            decoder: &mut fidl::encoding::Decoder<
12913                '_,
12914                fidl::encoding::DefaultFuchsiaResourceDialect,
12915            >,
12916            offset: usize,
12917            _depth: fidl::encoding::Depth,
12918        ) -> fidl::Result<()> {
12919            decoder.debug_check_bounds::<Self>(offset);
12920            // Verify that padding bytes are zero.
12921            fidl::decode!(
12922                fidl::encoding::Endpoint<
12923                    fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
12924                >,
12925                fidl::encoding::DefaultFuchsiaResourceDialect,
12926                &mut self.channel,
12927                decoder,
12928                offset + 0,
12929                _depth
12930            )?;
12931            Ok(())
12932        }
12933    }
12934
12935    impl fidl::encoding::ResourceTypeMarker for InstanceToken {
12936        type Borrowed<'a> = &'a mut Self;
12937        fn take_or_borrow<'a>(
12938            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12939        ) -> Self::Borrowed<'a> {
12940            value
12941        }
12942    }
12943
12944    unsafe impl fidl::encoding::TypeMarker for InstanceToken {
12945        type Owned = Self;
12946
12947        #[inline(always)]
12948        fn inline_align(_context: fidl::encoding::Context) -> usize {
12949            4
12950        }
12951
12952        #[inline(always)]
12953        fn inline_size(_context: fidl::encoding::Context) -> usize {
12954            4
12955        }
12956    }
12957
12958    unsafe impl fidl::encoding::Encode<InstanceToken, fidl::encoding::DefaultFuchsiaResourceDialect>
12959        for &mut InstanceToken
12960    {
12961        #[inline]
12962        unsafe fn encode(
12963            self,
12964            encoder: &mut fidl::encoding::Encoder<
12965                '_,
12966                fidl::encoding::DefaultFuchsiaResourceDialect,
12967            >,
12968            offset: usize,
12969            _depth: fidl::encoding::Depth,
12970        ) -> fidl::Result<()> {
12971            encoder.debug_check_bounds::<InstanceToken>(offset);
12972            // Delegate to tuple encoding.
12973            fidl::encoding::Encode::<InstanceToken, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
12974                (
12975                    <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.token),
12976                ),
12977                encoder, offset, _depth
12978            )
12979        }
12980    }
12981    unsafe impl<
12982            T0: fidl::encoding::Encode<
12983                fidl::encoding::HandleType<
12984                    fidl::EventPair,
12985                    { fidl::ObjectType::EVENTPAIR.into_raw() },
12986                    2147483648,
12987                >,
12988                fidl::encoding::DefaultFuchsiaResourceDialect,
12989            >,
12990        > fidl::encoding::Encode<InstanceToken, fidl::encoding::DefaultFuchsiaResourceDialect>
12991        for (T0,)
12992    {
12993        #[inline]
12994        unsafe fn encode(
12995            self,
12996            encoder: &mut fidl::encoding::Encoder<
12997                '_,
12998                fidl::encoding::DefaultFuchsiaResourceDialect,
12999            >,
13000            offset: usize,
13001            depth: fidl::encoding::Depth,
13002        ) -> fidl::Result<()> {
13003            encoder.debug_check_bounds::<InstanceToken>(offset);
13004            // Zero out padding regions. There's no need to apply masks
13005            // because the unmasked parts will be overwritten by fields.
13006            // Write the fields.
13007            self.0.encode(encoder, offset + 0, depth)?;
13008            Ok(())
13009        }
13010    }
13011
13012    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for InstanceToken {
13013        #[inline(always)]
13014        fn new_empty() -> Self {
13015            Self {
13016                token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
13017            }
13018        }
13019
13020        #[inline]
13021        unsafe fn decode(
13022            &mut self,
13023            decoder: &mut fidl::encoding::Decoder<
13024                '_,
13025                fidl::encoding::DefaultFuchsiaResourceDialect,
13026            >,
13027            offset: usize,
13028            _depth: fidl::encoding::Depth,
13029        ) -> fidl::Result<()> {
13030            decoder.debug_check_bounds::<Self>(offset);
13031            // Verify that padding bytes are zero.
13032            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.token, decoder, offset + 0, _depth)?;
13033            Ok(())
13034        }
13035    }
13036
13037    impl fidl::encoding::ResourceTypeMarker for ProtocolPayload {
13038        type Borrowed<'a> = &'a mut Self;
13039        fn take_or_borrow<'a>(
13040            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13041        ) -> Self::Borrowed<'a> {
13042            value
13043        }
13044    }
13045
13046    unsafe impl fidl::encoding::TypeMarker for ProtocolPayload {
13047        type Owned = Self;
13048
13049        #[inline(always)]
13050        fn inline_align(_context: fidl::encoding::Context) -> usize {
13051            4
13052        }
13053
13054        #[inline(always)]
13055        fn inline_size(_context: fidl::encoding::Context) -> usize {
13056            4
13057        }
13058    }
13059
13060    unsafe impl
13061        fidl::encoding::Encode<ProtocolPayload, fidl::encoding::DefaultFuchsiaResourceDialect>
13062        for &mut ProtocolPayload
13063    {
13064        #[inline]
13065        unsafe fn encode(
13066            self,
13067            encoder: &mut fidl::encoding::Encoder<
13068                '_,
13069                fidl::encoding::DefaultFuchsiaResourceDialect,
13070            >,
13071            offset: usize,
13072            _depth: fidl::encoding::Depth,
13073        ) -> fidl::Result<()> {
13074            encoder.debug_check_bounds::<ProtocolPayload>(offset);
13075            // Delegate to tuple encoding.
13076            fidl::encoding::Encode::<ProtocolPayload, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
13077                (
13078                    <fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.channel),
13079                ),
13080                encoder, offset, _depth
13081            )
13082        }
13083    }
13084    unsafe impl<
13085            T0: fidl::encoding::Encode<
13086                fidl::encoding::HandleType<
13087                    fidl::Channel,
13088                    { fidl::ObjectType::CHANNEL.into_raw() },
13089                    2147483648,
13090                >,
13091                fidl::encoding::DefaultFuchsiaResourceDialect,
13092            >,
13093        > fidl::encoding::Encode<ProtocolPayload, fidl::encoding::DefaultFuchsiaResourceDialect>
13094        for (T0,)
13095    {
13096        #[inline]
13097        unsafe fn encode(
13098            self,
13099            encoder: &mut fidl::encoding::Encoder<
13100                '_,
13101                fidl::encoding::DefaultFuchsiaResourceDialect,
13102            >,
13103            offset: usize,
13104            depth: fidl::encoding::Depth,
13105        ) -> fidl::Result<()> {
13106            encoder.debug_check_bounds::<ProtocolPayload>(offset);
13107            // Zero out padding regions. There's no need to apply masks
13108            // because the unmasked parts will be overwritten by fields.
13109            // Write the fields.
13110            self.0.encode(encoder, offset + 0, depth)?;
13111            Ok(())
13112        }
13113    }
13114
13115    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13116        for ProtocolPayload
13117    {
13118        #[inline(always)]
13119        fn new_empty() -> Self {
13120            Self {
13121                channel: fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
13122            }
13123        }
13124
13125        #[inline]
13126        unsafe fn decode(
13127            &mut self,
13128            decoder: &mut fidl::encoding::Decoder<
13129                '_,
13130                fidl::encoding::DefaultFuchsiaResourceDialect,
13131            >,
13132            offset: usize,
13133            _depth: fidl::encoding::Depth,
13134        ) -> fidl::Result<()> {
13135            decoder.debug_check_bounds::<Self>(offset);
13136            // Verify that padding bytes are zero.
13137            fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.channel, decoder, offset + 0, _depth)?;
13138            Ok(())
13139        }
13140    }
13141
13142    impl RouteRequest {
13143        #[inline(always)]
13144        fn max_ordinal_present(&self) -> u64 {
13145            if let Some(_) = self.metadata {
13146                return 2;
13147            }
13148            if let Some(_) = self.requesting {
13149                return 1;
13150            }
13151            0
13152        }
13153    }
13154
13155    impl fidl::encoding::ResourceTypeMarker for RouteRequest {
13156        type Borrowed<'a> = &'a mut Self;
13157        fn take_or_borrow<'a>(
13158            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13159        ) -> Self::Borrowed<'a> {
13160            value
13161        }
13162    }
13163
13164    unsafe impl fidl::encoding::TypeMarker for RouteRequest {
13165        type Owned = Self;
13166
13167        #[inline(always)]
13168        fn inline_align(_context: fidl::encoding::Context) -> usize {
13169            8
13170        }
13171
13172        #[inline(always)]
13173        fn inline_size(_context: fidl::encoding::Context) -> usize {
13174            16
13175        }
13176    }
13177
13178    unsafe impl fidl::encoding::Encode<RouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
13179        for &mut RouteRequest
13180    {
13181        unsafe fn encode(
13182            self,
13183            encoder: &mut fidl::encoding::Encoder<
13184                '_,
13185                fidl::encoding::DefaultFuchsiaResourceDialect,
13186            >,
13187            offset: usize,
13188            mut depth: fidl::encoding::Depth,
13189        ) -> fidl::Result<()> {
13190            encoder.debug_check_bounds::<RouteRequest>(offset);
13191            // Vector header
13192            let max_ordinal: u64 = self.max_ordinal_present();
13193            encoder.write_num(max_ordinal, offset);
13194            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
13195            // Calling encoder.out_of_line_offset(0) is not allowed.
13196            if max_ordinal == 0 {
13197                return Ok(());
13198            }
13199            depth.increment()?;
13200            let envelope_size = 8;
13201            let bytes_len = max_ordinal as usize * envelope_size;
13202            #[allow(unused_variables)]
13203            let offset = encoder.out_of_line_offset(bytes_len);
13204            let mut _prev_end_offset: usize = 0;
13205            if 1 > max_ordinal {
13206                return Ok(());
13207            }
13208
13209            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13210            // are envelope_size bytes.
13211            let cur_offset: usize = (1 - 1) * envelope_size;
13212
13213            // Zero reserved fields.
13214            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13215
13216            // Safety:
13217            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13218            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13219            //   envelope_size bytes, there is always sufficient room.
13220            fidl::encoding::encode_in_envelope_optional::<
13221                InstanceToken,
13222                fidl::encoding::DefaultFuchsiaResourceDialect,
13223            >(
13224                self.requesting
13225                    .as_mut()
13226                    .map(<InstanceToken as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
13227                encoder,
13228                offset + cur_offset,
13229                depth,
13230            )?;
13231
13232            _prev_end_offset = cur_offset + envelope_size;
13233            if 2 > max_ordinal {
13234                return Ok(());
13235            }
13236
13237            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13238            // are envelope_size bytes.
13239            let cur_offset: usize = (2 - 1) * envelope_size;
13240
13241            // Zero reserved fields.
13242            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13243
13244            // Safety:
13245            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13246            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13247            //   envelope_size bytes, there is always sufficient room.
13248            fidl::encoding::encode_in_envelope_optional::<
13249                DictionaryRef,
13250                fidl::encoding::DefaultFuchsiaResourceDialect,
13251            >(
13252                self.metadata
13253                    .as_mut()
13254                    .map(<DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
13255                encoder,
13256                offset + cur_offset,
13257                depth,
13258            )?;
13259
13260            _prev_end_offset = cur_offset + envelope_size;
13261
13262            Ok(())
13263        }
13264    }
13265
13266    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for RouteRequest {
13267        #[inline(always)]
13268        fn new_empty() -> Self {
13269            Self::default()
13270        }
13271
13272        unsafe fn decode(
13273            &mut self,
13274            decoder: &mut fidl::encoding::Decoder<
13275                '_,
13276                fidl::encoding::DefaultFuchsiaResourceDialect,
13277            >,
13278            offset: usize,
13279            mut depth: fidl::encoding::Depth,
13280        ) -> fidl::Result<()> {
13281            decoder.debug_check_bounds::<Self>(offset);
13282            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13283                None => return Err(fidl::Error::NotNullable),
13284                Some(len) => len,
13285            };
13286            // Calling decoder.out_of_line_offset(0) is not allowed.
13287            if len == 0 {
13288                return Ok(());
13289            };
13290            depth.increment()?;
13291            let envelope_size = 8;
13292            let bytes_len = len * envelope_size;
13293            let offset = decoder.out_of_line_offset(bytes_len)?;
13294            // Decode the envelope for each type.
13295            let mut _next_ordinal_to_read = 0;
13296            let mut next_offset = offset;
13297            let end_offset = offset + bytes_len;
13298            _next_ordinal_to_read += 1;
13299            if next_offset >= end_offset {
13300                return Ok(());
13301            }
13302
13303            // Decode unknown envelopes for gaps in ordinals.
13304            while _next_ordinal_to_read < 1 {
13305                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13306                _next_ordinal_to_read += 1;
13307                next_offset += envelope_size;
13308            }
13309
13310            let next_out_of_line = decoder.next_out_of_line();
13311            let handles_before = decoder.remaining_handles();
13312            if let Some((inlined, num_bytes, num_handles)) =
13313                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13314            {
13315                let member_inline_size =
13316                    <InstanceToken as fidl::encoding::TypeMarker>::inline_size(decoder.context);
13317                if inlined != (member_inline_size <= 4) {
13318                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13319                }
13320                let inner_offset;
13321                let mut inner_depth = depth.clone();
13322                if inlined {
13323                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13324                    inner_offset = next_offset;
13325                } else {
13326                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13327                    inner_depth.increment()?;
13328                }
13329                let val_ref = self.requesting.get_or_insert_with(|| {
13330                    fidl::new_empty!(InstanceToken, fidl::encoding::DefaultFuchsiaResourceDialect)
13331                });
13332                fidl::decode!(
13333                    InstanceToken,
13334                    fidl::encoding::DefaultFuchsiaResourceDialect,
13335                    val_ref,
13336                    decoder,
13337                    inner_offset,
13338                    inner_depth
13339                )?;
13340                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13341                {
13342                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13343                }
13344                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13345                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13346                }
13347            }
13348
13349            next_offset += envelope_size;
13350            _next_ordinal_to_read += 1;
13351            if next_offset >= end_offset {
13352                return Ok(());
13353            }
13354
13355            // Decode unknown envelopes for gaps in ordinals.
13356            while _next_ordinal_to_read < 2 {
13357                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13358                _next_ordinal_to_read += 1;
13359                next_offset += envelope_size;
13360            }
13361
13362            let next_out_of_line = decoder.next_out_of_line();
13363            let handles_before = decoder.remaining_handles();
13364            if let Some((inlined, num_bytes, num_handles)) =
13365                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13366            {
13367                let member_inline_size =
13368                    <DictionaryRef as fidl::encoding::TypeMarker>::inline_size(decoder.context);
13369                if inlined != (member_inline_size <= 4) {
13370                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13371                }
13372                let inner_offset;
13373                let mut inner_depth = depth.clone();
13374                if inlined {
13375                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13376                    inner_offset = next_offset;
13377                } else {
13378                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13379                    inner_depth.increment()?;
13380                }
13381                let val_ref = self.metadata.get_or_insert_with(|| {
13382                    fidl::new_empty!(DictionaryRef, fidl::encoding::DefaultFuchsiaResourceDialect)
13383                });
13384                fidl::decode!(
13385                    DictionaryRef,
13386                    fidl::encoding::DefaultFuchsiaResourceDialect,
13387                    val_ref,
13388                    decoder,
13389                    inner_offset,
13390                    inner_depth
13391                )?;
13392                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13393                {
13394                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13395                }
13396                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13397                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13398                }
13399            }
13400
13401            next_offset += envelope_size;
13402
13403            // Decode the remaining unknown envelopes.
13404            while next_offset < end_offset {
13405                _next_ordinal_to_read += 1;
13406                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13407                next_offset += envelope_size;
13408            }
13409
13410            Ok(())
13411        }
13412    }
13413
13414    impl fidl::encoding::ResourceTypeMarker for Capability {
13415        type Borrowed<'a> = &'a mut Self;
13416        fn take_or_borrow<'a>(
13417            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13418        ) -> Self::Borrowed<'a> {
13419            value
13420        }
13421    }
13422
13423    unsafe impl fidl::encoding::TypeMarker for Capability {
13424        type Owned = Self;
13425
13426        #[inline(always)]
13427        fn inline_align(_context: fidl::encoding::Context) -> usize {
13428            8
13429        }
13430
13431        #[inline(always)]
13432        fn inline_size(_context: fidl::encoding::Context) -> usize {
13433            16
13434        }
13435    }
13436
13437    unsafe impl fidl::encoding::Encode<Capability, fidl::encoding::DefaultFuchsiaResourceDialect>
13438        for &mut Capability
13439    {
13440        #[inline]
13441        unsafe fn encode(
13442            self,
13443            encoder: &mut fidl::encoding::Encoder<
13444                '_,
13445                fidl::encoding::DefaultFuchsiaResourceDialect,
13446            >,
13447            offset: usize,
13448            _depth: fidl::encoding::Depth,
13449        ) -> fidl::Result<()> {
13450            encoder.debug_check_bounds::<Capability>(offset);
13451            encoder.write_num::<u64>(self.ordinal(), offset);
13452            match self {
13453            Capability::Unit(ref val) => {
13454                fidl::encoding::encode_in_envelope::<Unit, fidl::encoding::DefaultFuchsiaResourceDialect>(
13455                    <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
13456                    encoder, offset + 8, _depth
13457                )
13458            }
13459            Capability::Handle(ref mut val) => {
13460                fidl::encoding::encode_in_envelope::<fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect>(
13461                    <fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
13462                    encoder, offset + 8, _depth
13463                )
13464            }
13465            Capability::Data(ref val) => {
13466                fidl::encoding::encode_in_envelope::<Data, fidl::encoding::DefaultFuchsiaResourceDialect>(
13467                    <Data as fidl::encoding::ValueTypeMarker>::borrow(val),
13468                    encoder, offset + 8, _depth
13469                )
13470            }
13471            Capability::Dictionary(ref mut val) => {
13472                fidl::encoding::encode_in_envelope::<DictionaryRef, fidl::encoding::DefaultFuchsiaResourceDialect>(
13473                    <DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
13474                    encoder, offset + 8, _depth
13475                )
13476            }
13477            Capability::Connector(ref mut val) => {
13478                fidl::encoding::encode_in_envelope::<Connector, fidl::encoding::DefaultFuchsiaResourceDialect>(
13479                    <Connector as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
13480                    encoder, offset + 8, _depth
13481                )
13482            }
13483            Capability::DirConnector(ref mut val) => {
13484                fidl::encoding::encode_in_envelope::<DirConnector, fidl::encoding::DefaultFuchsiaResourceDialect>(
13485                    <DirConnector as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
13486                    encoder, offset + 8, _depth
13487                )
13488            }
13489            Capability::Directory(ref mut val) => {
13490                fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
13491                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
13492                    encoder, offset + 8, _depth
13493                )
13494            }
13495            Capability::DirEntry(ref mut val) => {
13496                fidl::encoding::encode_in_envelope::<DirEntry, fidl::encoding::DefaultFuchsiaResourceDialect>(
13497                    <DirEntry as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
13498                    encoder, offset + 8, _depth
13499                )
13500            }
13501            Capability::ConnectorRouter(ref mut val) => {
13502                fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ConnectorRouterMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
13503                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ConnectorRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
13504                    encoder, offset + 8, _depth
13505                )
13506            }
13507            Capability::DictionaryRouter(ref mut val) => {
13508                fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DictionaryRouterMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
13509                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DictionaryRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
13510                    encoder, offset + 8, _depth
13511                )
13512            }
13513            Capability::DirEntryRouter(ref mut val) => {
13514                fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirEntryRouterMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
13515                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirEntryRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
13516                    encoder, offset + 8, _depth
13517                )
13518            }
13519            Capability::DataRouter(ref mut val) => {
13520                fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DataRouterMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
13521                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DataRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
13522                    encoder, offset + 8, _depth
13523                )
13524            }
13525            Capability::DirConnectorRouter(ref mut val) => {
13526                fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirConnectorRouterMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
13527                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirConnectorRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
13528                    encoder, offset + 8, _depth
13529                )
13530            }
13531            Capability::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
13532        }
13533        }
13534    }
13535
13536    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Capability {
13537        #[inline(always)]
13538        fn new_empty() -> Self {
13539            Self::__SourceBreaking { unknown_ordinal: 0 }
13540        }
13541
13542        #[inline]
13543        unsafe fn decode(
13544            &mut self,
13545            decoder: &mut fidl::encoding::Decoder<
13546                '_,
13547                fidl::encoding::DefaultFuchsiaResourceDialect,
13548            >,
13549            offset: usize,
13550            mut depth: fidl::encoding::Depth,
13551        ) -> fidl::Result<()> {
13552            decoder.debug_check_bounds::<Self>(offset);
13553            #[allow(unused_variables)]
13554            let next_out_of_line = decoder.next_out_of_line();
13555            let handles_before = decoder.remaining_handles();
13556            let (ordinal, inlined, num_bytes, num_handles) =
13557                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
13558
13559            let member_inline_size = match ordinal {
13560            1 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13561            2 => <fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13562            3 => <Data as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13563            4 => <DictionaryRef as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13564            5 => <Connector as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13565            6 => <DirConnector as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13566            7 => <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13567            8 => <DirEntry as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13568            9 => <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ConnectorRouterMarker>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13569            10 => <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DictionaryRouterMarker>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13570            11 => <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirEntryRouterMarker>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13571            12 => <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DataRouterMarker>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13572            13 => <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirConnectorRouterMarker>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13573            0 => return Err(fidl::Error::UnknownUnionTag),
13574            _ => num_bytes as usize,
13575        };
13576
13577            if inlined != (member_inline_size <= 4) {
13578                return Err(fidl::Error::InvalidInlineBitInEnvelope);
13579            }
13580            let _inner_offset;
13581            if inlined {
13582                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
13583                _inner_offset = offset + 8;
13584            } else {
13585                depth.increment()?;
13586                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13587            }
13588            match ordinal {
13589                1 => {
13590                    #[allow(irrefutable_let_patterns)]
13591                    if let Capability::Unit(_) = self {
13592                        // Do nothing, read the value into the object
13593                    } else {
13594                        // Initialize `self` to the right variant
13595                        *self = Capability::Unit(fidl::new_empty!(
13596                            Unit,
13597                            fidl::encoding::DefaultFuchsiaResourceDialect
13598                        ));
13599                    }
13600                    #[allow(irrefutable_let_patterns)]
13601                    if let Capability::Unit(ref mut val) = self {
13602                        fidl::decode!(
13603                            Unit,
13604                            fidl::encoding::DefaultFuchsiaResourceDialect,
13605                            val,
13606                            decoder,
13607                            _inner_offset,
13608                            depth
13609                        )?;
13610                    } else {
13611                        unreachable!()
13612                    }
13613                }
13614                2 => {
13615                    #[allow(irrefutable_let_patterns)]
13616                    if let Capability::Handle(_) = self {
13617                        // Do nothing, read the value into the object
13618                    } else {
13619                        // Initialize `self` to the right variant
13620                        *self = Capability::Handle(
13621                            fidl::new_empty!(fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
13622                        );
13623                    }
13624                    #[allow(irrefutable_let_patterns)]
13625                    if let Capability::Handle(ref mut val) = self {
13626                        fidl::decode!(fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val, decoder, _inner_offset, depth)?;
13627                    } else {
13628                        unreachable!()
13629                    }
13630                }
13631                3 => {
13632                    #[allow(irrefutable_let_patterns)]
13633                    if let Capability::Data(_) = self {
13634                        // Do nothing, read the value into the object
13635                    } else {
13636                        // Initialize `self` to the right variant
13637                        *self = Capability::Data(fidl::new_empty!(
13638                            Data,
13639                            fidl::encoding::DefaultFuchsiaResourceDialect
13640                        ));
13641                    }
13642                    #[allow(irrefutable_let_patterns)]
13643                    if let Capability::Data(ref mut val) = self {
13644                        fidl::decode!(
13645                            Data,
13646                            fidl::encoding::DefaultFuchsiaResourceDialect,
13647                            val,
13648                            decoder,
13649                            _inner_offset,
13650                            depth
13651                        )?;
13652                    } else {
13653                        unreachable!()
13654                    }
13655                }
13656                4 => {
13657                    #[allow(irrefutable_let_patterns)]
13658                    if let Capability::Dictionary(_) = self {
13659                        // Do nothing, read the value into the object
13660                    } else {
13661                        // Initialize `self` to the right variant
13662                        *self = Capability::Dictionary(fidl::new_empty!(
13663                            DictionaryRef,
13664                            fidl::encoding::DefaultFuchsiaResourceDialect
13665                        ));
13666                    }
13667                    #[allow(irrefutable_let_patterns)]
13668                    if let Capability::Dictionary(ref mut val) = self {
13669                        fidl::decode!(
13670                            DictionaryRef,
13671                            fidl::encoding::DefaultFuchsiaResourceDialect,
13672                            val,
13673                            decoder,
13674                            _inner_offset,
13675                            depth
13676                        )?;
13677                    } else {
13678                        unreachable!()
13679                    }
13680                }
13681                5 => {
13682                    #[allow(irrefutable_let_patterns)]
13683                    if let Capability::Connector(_) = self {
13684                        // Do nothing, read the value into the object
13685                    } else {
13686                        // Initialize `self` to the right variant
13687                        *self = Capability::Connector(fidl::new_empty!(
13688                            Connector,
13689                            fidl::encoding::DefaultFuchsiaResourceDialect
13690                        ));
13691                    }
13692                    #[allow(irrefutable_let_patterns)]
13693                    if let Capability::Connector(ref mut val) = self {
13694                        fidl::decode!(
13695                            Connector,
13696                            fidl::encoding::DefaultFuchsiaResourceDialect,
13697                            val,
13698                            decoder,
13699                            _inner_offset,
13700                            depth
13701                        )?;
13702                    } else {
13703                        unreachable!()
13704                    }
13705                }
13706                6 => {
13707                    #[allow(irrefutable_let_patterns)]
13708                    if let Capability::DirConnector(_) = self {
13709                        // Do nothing, read the value into the object
13710                    } else {
13711                        // Initialize `self` to the right variant
13712                        *self = Capability::DirConnector(fidl::new_empty!(
13713                            DirConnector,
13714                            fidl::encoding::DefaultFuchsiaResourceDialect
13715                        ));
13716                    }
13717                    #[allow(irrefutable_let_patterns)]
13718                    if let Capability::DirConnector(ref mut val) = self {
13719                        fidl::decode!(
13720                            DirConnector,
13721                            fidl::encoding::DefaultFuchsiaResourceDialect,
13722                            val,
13723                            decoder,
13724                            _inner_offset,
13725                            depth
13726                        )?;
13727                    } else {
13728                        unreachable!()
13729                    }
13730                }
13731                7 => {
13732                    #[allow(irrefutable_let_patterns)]
13733                    if let Capability::Directory(_) = self {
13734                        // Do nothing, read the value into the object
13735                    } else {
13736                        // Initialize `self` to the right variant
13737                        *self = Capability::Directory(fidl::new_empty!(
13738                            fidl::encoding::Endpoint<
13739                                fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
13740                            >,
13741                            fidl::encoding::DefaultFuchsiaResourceDialect
13742                        ));
13743                    }
13744                    #[allow(irrefutable_let_patterns)]
13745                    if let Capability::Directory(ref mut val) = self {
13746                        fidl::decode!(
13747                            fidl::encoding::Endpoint<
13748                                fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
13749                            >,
13750                            fidl::encoding::DefaultFuchsiaResourceDialect,
13751                            val,
13752                            decoder,
13753                            _inner_offset,
13754                            depth
13755                        )?;
13756                    } else {
13757                        unreachable!()
13758                    }
13759                }
13760                8 => {
13761                    #[allow(irrefutable_let_patterns)]
13762                    if let Capability::DirEntry(_) = self {
13763                        // Do nothing, read the value into the object
13764                    } else {
13765                        // Initialize `self` to the right variant
13766                        *self = Capability::DirEntry(fidl::new_empty!(
13767                            DirEntry,
13768                            fidl::encoding::DefaultFuchsiaResourceDialect
13769                        ));
13770                    }
13771                    #[allow(irrefutable_let_patterns)]
13772                    if let Capability::DirEntry(ref mut val) = self {
13773                        fidl::decode!(
13774                            DirEntry,
13775                            fidl::encoding::DefaultFuchsiaResourceDialect,
13776                            val,
13777                            decoder,
13778                            _inner_offset,
13779                            depth
13780                        )?;
13781                    } else {
13782                        unreachable!()
13783                    }
13784                }
13785                9 => {
13786                    #[allow(irrefutable_let_patterns)]
13787                    if let Capability::ConnectorRouter(_) = self {
13788                        // Do nothing, read the value into the object
13789                    } else {
13790                        // Initialize `self` to the right variant
13791                        *self = Capability::ConnectorRouter(fidl::new_empty!(
13792                            fidl::encoding::Endpoint<
13793                                fidl::endpoints::ClientEnd<ConnectorRouterMarker>,
13794                            >,
13795                            fidl::encoding::DefaultFuchsiaResourceDialect
13796                        ));
13797                    }
13798                    #[allow(irrefutable_let_patterns)]
13799                    if let Capability::ConnectorRouter(ref mut val) = self {
13800                        fidl::decode!(
13801                            fidl::encoding::Endpoint<
13802                                fidl::endpoints::ClientEnd<ConnectorRouterMarker>,
13803                            >,
13804                            fidl::encoding::DefaultFuchsiaResourceDialect,
13805                            val,
13806                            decoder,
13807                            _inner_offset,
13808                            depth
13809                        )?;
13810                    } else {
13811                        unreachable!()
13812                    }
13813                }
13814                10 => {
13815                    #[allow(irrefutable_let_patterns)]
13816                    if let Capability::DictionaryRouter(_) = self {
13817                        // Do nothing, read the value into the object
13818                    } else {
13819                        // Initialize `self` to the right variant
13820                        *self = Capability::DictionaryRouter(fidl::new_empty!(
13821                            fidl::encoding::Endpoint<
13822                                fidl::endpoints::ClientEnd<DictionaryRouterMarker>,
13823                            >,
13824                            fidl::encoding::DefaultFuchsiaResourceDialect
13825                        ));
13826                    }
13827                    #[allow(irrefutable_let_patterns)]
13828                    if let Capability::DictionaryRouter(ref mut val) = self {
13829                        fidl::decode!(
13830                            fidl::encoding::Endpoint<
13831                                fidl::endpoints::ClientEnd<DictionaryRouterMarker>,
13832                            >,
13833                            fidl::encoding::DefaultFuchsiaResourceDialect,
13834                            val,
13835                            decoder,
13836                            _inner_offset,
13837                            depth
13838                        )?;
13839                    } else {
13840                        unreachable!()
13841                    }
13842                }
13843                11 => {
13844                    #[allow(irrefutable_let_patterns)]
13845                    if let Capability::DirEntryRouter(_) = self {
13846                        // Do nothing, read the value into the object
13847                    } else {
13848                        // Initialize `self` to the right variant
13849                        *self = Capability::DirEntryRouter(fidl::new_empty!(
13850                            fidl::encoding::Endpoint<
13851                                fidl::endpoints::ClientEnd<DirEntryRouterMarker>,
13852                            >,
13853                            fidl::encoding::DefaultFuchsiaResourceDialect
13854                        ));
13855                    }
13856                    #[allow(irrefutable_let_patterns)]
13857                    if let Capability::DirEntryRouter(ref mut val) = self {
13858                        fidl::decode!(
13859                            fidl::encoding::Endpoint<
13860                                fidl::endpoints::ClientEnd<DirEntryRouterMarker>,
13861                            >,
13862                            fidl::encoding::DefaultFuchsiaResourceDialect,
13863                            val,
13864                            decoder,
13865                            _inner_offset,
13866                            depth
13867                        )?;
13868                    } else {
13869                        unreachable!()
13870                    }
13871                }
13872                12 => {
13873                    #[allow(irrefutable_let_patterns)]
13874                    if let Capability::DataRouter(_) = self {
13875                        // Do nothing, read the value into the object
13876                    } else {
13877                        // Initialize `self` to the right variant
13878                        *self = Capability::DataRouter(fidl::new_empty!(
13879                            fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DataRouterMarker>>,
13880                            fidl::encoding::DefaultFuchsiaResourceDialect
13881                        ));
13882                    }
13883                    #[allow(irrefutable_let_patterns)]
13884                    if let Capability::DataRouter(ref mut val) = self {
13885                        fidl::decode!(
13886                            fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DataRouterMarker>>,
13887                            fidl::encoding::DefaultFuchsiaResourceDialect,
13888                            val,
13889                            decoder,
13890                            _inner_offset,
13891                            depth
13892                        )?;
13893                    } else {
13894                        unreachable!()
13895                    }
13896                }
13897                13 => {
13898                    #[allow(irrefutable_let_patterns)]
13899                    if let Capability::DirConnectorRouter(_) = self {
13900                        // Do nothing, read the value into the object
13901                    } else {
13902                        // Initialize `self` to the right variant
13903                        *self = Capability::DirConnectorRouter(fidl::new_empty!(
13904                            fidl::encoding::Endpoint<
13905                                fidl::endpoints::ClientEnd<DirConnectorRouterMarker>,
13906                            >,
13907                            fidl::encoding::DefaultFuchsiaResourceDialect
13908                        ));
13909                    }
13910                    #[allow(irrefutable_let_patterns)]
13911                    if let Capability::DirConnectorRouter(ref mut val) = self {
13912                        fidl::decode!(
13913                            fidl::encoding::Endpoint<
13914                                fidl::endpoints::ClientEnd<DirConnectorRouterMarker>,
13915                            >,
13916                            fidl::encoding::DefaultFuchsiaResourceDialect,
13917                            val,
13918                            decoder,
13919                            _inner_offset,
13920                            depth
13921                        )?;
13922                    } else {
13923                        unreachable!()
13924                    }
13925                }
13926                #[allow(deprecated)]
13927                ordinal => {
13928                    for _ in 0..num_handles {
13929                        decoder.drop_next_handle()?;
13930                    }
13931                    *self = Capability::__SourceBreaking { unknown_ordinal: ordinal };
13932                }
13933            }
13934            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
13935                return Err(fidl::Error::InvalidNumBytesInEnvelope);
13936            }
13937            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13938                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13939            }
13940            Ok(())
13941        }
13942    }
13943
13944    impl fidl::encoding::ResourceTypeMarker for ConnectorRouterRouteResponse {
13945        type Borrowed<'a> = &'a mut Self;
13946        fn take_or_borrow<'a>(
13947            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13948        ) -> Self::Borrowed<'a> {
13949            value
13950        }
13951    }
13952
13953    unsafe impl fidl::encoding::TypeMarker for ConnectorRouterRouteResponse {
13954        type Owned = Self;
13955
13956        #[inline(always)]
13957        fn inline_align(_context: fidl::encoding::Context) -> usize {
13958            8
13959        }
13960
13961        #[inline(always)]
13962        fn inline_size(_context: fidl::encoding::Context) -> usize {
13963            16
13964        }
13965    }
13966
13967    unsafe impl
13968        fidl::encoding::Encode<
13969            ConnectorRouterRouteResponse,
13970            fidl::encoding::DefaultFuchsiaResourceDialect,
13971        > for &mut ConnectorRouterRouteResponse
13972    {
13973        #[inline]
13974        unsafe fn encode(
13975            self,
13976            encoder: &mut fidl::encoding::Encoder<
13977                '_,
13978                fidl::encoding::DefaultFuchsiaResourceDialect,
13979            >,
13980            offset: usize,
13981            _depth: fidl::encoding::Depth,
13982        ) -> fidl::Result<()> {
13983            encoder.debug_check_bounds::<ConnectorRouterRouteResponse>(offset);
13984            encoder.write_num::<u64>(self.ordinal(), offset);
13985            match self {
13986                ConnectorRouterRouteResponse::Connector(ref mut val) => {
13987                    fidl::encoding::encode_in_envelope::<
13988                        Connector,
13989                        fidl::encoding::DefaultFuchsiaResourceDialect,
13990                    >(
13991                        <Connector as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
13992                        encoder,
13993                        offset + 8,
13994                        _depth,
13995                    )
13996                }
13997                ConnectorRouterRouteResponse::Unavailable(ref val) => {
13998                    fidl::encoding::encode_in_envelope::<
13999                        Unit,
14000                        fidl::encoding::DefaultFuchsiaResourceDialect,
14001                    >(
14002                        <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
14003                        encoder,
14004                        offset + 8,
14005                        _depth,
14006                    )
14007                }
14008            }
14009        }
14010    }
14011
14012    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14013        for ConnectorRouterRouteResponse
14014    {
14015        #[inline(always)]
14016        fn new_empty() -> Self {
14017            Self::Connector(fidl::new_empty!(
14018                Connector,
14019                fidl::encoding::DefaultFuchsiaResourceDialect
14020            ))
14021        }
14022
14023        #[inline]
14024        unsafe fn decode(
14025            &mut self,
14026            decoder: &mut fidl::encoding::Decoder<
14027                '_,
14028                fidl::encoding::DefaultFuchsiaResourceDialect,
14029            >,
14030            offset: usize,
14031            mut depth: fidl::encoding::Depth,
14032        ) -> fidl::Result<()> {
14033            decoder.debug_check_bounds::<Self>(offset);
14034            #[allow(unused_variables)]
14035            let next_out_of_line = decoder.next_out_of_line();
14036            let handles_before = decoder.remaining_handles();
14037            let (ordinal, inlined, num_bytes, num_handles) =
14038                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
14039
14040            let member_inline_size = match ordinal {
14041                1 => <Connector as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14042                2 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14043                _ => return Err(fidl::Error::UnknownUnionTag),
14044            };
14045
14046            if inlined != (member_inline_size <= 4) {
14047                return Err(fidl::Error::InvalidInlineBitInEnvelope);
14048            }
14049            let _inner_offset;
14050            if inlined {
14051                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
14052                _inner_offset = offset + 8;
14053            } else {
14054                depth.increment()?;
14055                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14056            }
14057            match ordinal {
14058                1 => {
14059                    #[allow(irrefutable_let_patterns)]
14060                    if let ConnectorRouterRouteResponse::Connector(_) = self {
14061                        // Do nothing, read the value into the object
14062                    } else {
14063                        // Initialize `self` to the right variant
14064                        *self = ConnectorRouterRouteResponse::Connector(fidl::new_empty!(
14065                            Connector,
14066                            fidl::encoding::DefaultFuchsiaResourceDialect
14067                        ));
14068                    }
14069                    #[allow(irrefutable_let_patterns)]
14070                    if let ConnectorRouterRouteResponse::Connector(ref mut val) = self {
14071                        fidl::decode!(
14072                            Connector,
14073                            fidl::encoding::DefaultFuchsiaResourceDialect,
14074                            val,
14075                            decoder,
14076                            _inner_offset,
14077                            depth
14078                        )?;
14079                    } else {
14080                        unreachable!()
14081                    }
14082                }
14083                2 => {
14084                    #[allow(irrefutable_let_patterns)]
14085                    if let ConnectorRouterRouteResponse::Unavailable(_) = self {
14086                        // Do nothing, read the value into the object
14087                    } else {
14088                        // Initialize `self` to the right variant
14089                        *self = ConnectorRouterRouteResponse::Unavailable(fidl::new_empty!(
14090                            Unit,
14091                            fidl::encoding::DefaultFuchsiaResourceDialect
14092                        ));
14093                    }
14094                    #[allow(irrefutable_let_patterns)]
14095                    if let ConnectorRouterRouteResponse::Unavailable(ref mut val) = self {
14096                        fidl::decode!(
14097                            Unit,
14098                            fidl::encoding::DefaultFuchsiaResourceDialect,
14099                            val,
14100                            decoder,
14101                            _inner_offset,
14102                            depth
14103                        )?;
14104                    } else {
14105                        unreachable!()
14106                    }
14107                }
14108                ordinal => panic!("unexpected ordinal {:?}", ordinal),
14109            }
14110            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
14111                return Err(fidl::Error::InvalidNumBytesInEnvelope);
14112            }
14113            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14114                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14115            }
14116            Ok(())
14117        }
14118    }
14119
14120    impl fidl::encoding::ResourceTypeMarker for DataRouterRouteResponse {
14121        type Borrowed<'a> = &'a mut Self;
14122        fn take_or_borrow<'a>(
14123            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14124        ) -> Self::Borrowed<'a> {
14125            value
14126        }
14127    }
14128
14129    unsafe impl fidl::encoding::TypeMarker for DataRouterRouteResponse {
14130        type Owned = Self;
14131
14132        #[inline(always)]
14133        fn inline_align(_context: fidl::encoding::Context) -> usize {
14134            8
14135        }
14136
14137        #[inline(always)]
14138        fn inline_size(_context: fidl::encoding::Context) -> usize {
14139            16
14140        }
14141    }
14142
14143    unsafe impl
14144        fidl::encoding::Encode<
14145            DataRouterRouteResponse,
14146            fidl::encoding::DefaultFuchsiaResourceDialect,
14147        > for &mut DataRouterRouteResponse
14148    {
14149        #[inline]
14150        unsafe fn encode(
14151            self,
14152            encoder: &mut fidl::encoding::Encoder<
14153                '_,
14154                fidl::encoding::DefaultFuchsiaResourceDialect,
14155            >,
14156            offset: usize,
14157            _depth: fidl::encoding::Depth,
14158        ) -> fidl::Result<()> {
14159            encoder.debug_check_bounds::<DataRouterRouteResponse>(offset);
14160            encoder.write_num::<u64>(self.ordinal(), offset);
14161            match self {
14162                DataRouterRouteResponse::Data(ref val) => fidl::encoding::encode_in_envelope::<
14163                    Data,
14164                    fidl::encoding::DefaultFuchsiaResourceDialect,
14165                >(
14166                    <Data as fidl::encoding::ValueTypeMarker>::borrow(val),
14167                    encoder,
14168                    offset + 8,
14169                    _depth,
14170                ),
14171                DataRouterRouteResponse::Unavailable(ref val) => {
14172                    fidl::encoding::encode_in_envelope::<
14173                        Unit,
14174                        fidl::encoding::DefaultFuchsiaResourceDialect,
14175                    >(
14176                        <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
14177                        encoder,
14178                        offset + 8,
14179                        _depth,
14180                    )
14181                }
14182            }
14183        }
14184    }
14185
14186    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14187        for DataRouterRouteResponse
14188    {
14189        #[inline(always)]
14190        fn new_empty() -> Self {
14191            Self::Data(fidl::new_empty!(Data, fidl::encoding::DefaultFuchsiaResourceDialect))
14192        }
14193
14194        #[inline]
14195        unsafe fn decode(
14196            &mut self,
14197            decoder: &mut fidl::encoding::Decoder<
14198                '_,
14199                fidl::encoding::DefaultFuchsiaResourceDialect,
14200            >,
14201            offset: usize,
14202            mut depth: fidl::encoding::Depth,
14203        ) -> fidl::Result<()> {
14204            decoder.debug_check_bounds::<Self>(offset);
14205            #[allow(unused_variables)]
14206            let next_out_of_line = decoder.next_out_of_line();
14207            let handles_before = decoder.remaining_handles();
14208            let (ordinal, inlined, num_bytes, num_handles) =
14209                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
14210
14211            let member_inline_size = match ordinal {
14212                1 => <Data as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14213                2 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14214                _ => return Err(fidl::Error::UnknownUnionTag),
14215            };
14216
14217            if inlined != (member_inline_size <= 4) {
14218                return Err(fidl::Error::InvalidInlineBitInEnvelope);
14219            }
14220            let _inner_offset;
14221            if inlined {
14222                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
14223                _inner_offset = offset + 8;
14224            } else {
14225                depth.increment()?;
14226                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14227            }
14228            match ordinal {
14229                1 => {
14230                    #[allow(irrefutable_let_patterns)]
14231                    if let DataRouterRouteResponse::Data(_) = self {
14232                        // Do nothing, read the value into the object
14233                    } else {
14234                        // Initialize `self` to the right variant
14235                        *self = DataRouterRouteResponse::Data(fidl::new_empty!(
14236                            Data,
14237                            fidl::encoding::DefaultFuchsiaResourceDialect
14238                        ));
14239                    }
14240                    #[allow(irrefutable_let_patterns)]
14241                    if let DataRouterRouteResponse::Data(ref mut val) = self {
14242                        fidl::decode!(
14243                            Data,
14244                            fidl::encoding::DefaultFuchsiaResourceDialect,
14245                            val,
14246                            decoder,
14247                            _inner_offset,
14248                            depth
14249                        )?;
14250                    } else {
14251                        unreachable!()
14252                    }
14253                }
14254                2 => {
14255                    #[allow(irrefutable_let_patterns)]
14256                    if let DataRouterRouteResponse::Unavailable(_) = self {
14257                        // Do nothing, read the value into the object
14258                    } else {
14259                        // Initialize `self` to the right variant
14260                        *self = DataRouterRouteResponse::Unavailable(fidl::new_empty!(
14261                            Unit,
14262                            fidl::encoding::DefaultFuchsiaResourceDialect
14263                        ));
14264                    }
14265                    #[allow(irrefutable_let_patterns)]
14266                    if let DataRouterRouteResponse::Unavailable(ref mut val) = self {
14267                        fidl::decode!(
14268                            Unit,
14269                            fidl::encoding::DefaultFuchsiaResourceDialect,
14270                            val,
14271                            decoder,
14272                            _inner_offset,
14273                            depth
14274                        )?;
14275                    } else {
14276                        unreachable!()
14277                    }
14278                }
14279                ordinal => panic!("unexpected ordinal {:?}", ordinal),
14280            }
14281            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
14282                return Err(fidl::Error::InvalidNumBytesInEnvelope);
14283            }
14284            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14285                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14286            }
14287            Ok(())
14288        }
14289    }
14290
14291    impl fidl::encoding::ResourceTypeMarker for DictionaryRouterRouteResponse {
14292        type Borrowed<'a> = &'a mut Self;
14293        fn take_or_borrow<'a>(
14294            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14295        ) -> Self::Borrowed<'a> {
14296            value
14297        }
14298    }
14299
14300    unsafe impl fidl::encoding::TypeMarker for DictionaryRouterRouteResponse {
14301        type Owned = Self;
14302
14303        #[inline(always)]
14304        fn inline_align(_context: fidl::encoding::Context) -> usize {
14305            8
14306        }
14307
14308        #[inline(always)]
14309        fn inline_size(_context: fidl::encoding::Context) -> usize {
14310            16
14311        }
14312    }
14313
14314    unsafe impl
14315        fidl::encoding::Encode<
14316            DictionaryRouterRouteResponse,
14317            fidl::encoding::DefaultFuchsiaResourceDialect,
14318        > for &mut DictionaryRouterRouteResponse
14319    {
14320        #[inline]
14321        unsafe fn encode(
14322            self,
14323            encoder: &mut fidl::encoding::Encoder<
14324                '_,
14325                fidl::encoding::DefaultFuchsiaResourceDialect,
14326            >,
14327            offset: usize,
14328            _depth: fidl::encoding::Depth,
14329        ) -> fidl::Result<()> {
14330            encoder.debug_check_bounds::<DictionaryRouterRouteResponse>(offset);
14331            encoder.write_num::<u64>(self.ordinal(), offset);
14332            match self {
14333                DictionaryRouterRouteResponse::Dictionary(ref mut val) => {
14334                    fidl::encoding::encode_in_envelope::<
14335                        DictionaryRef,
14336                        fidl::encoding::DefaultFuchsiaResourceDialect,
14337                    >(
14338                        <DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
14339                        encoder,
14340                        offset + 8,
14341                        _depth,
14342                    )
14343                }
14344                DictionaryRouterRouteResponse::Unavailable(ref val) => {
14345                    fidl::encoding::encode_in_envelope::<
14346                        Unit,
14347                        fidl::encoding::DefaultFuchsiaResourceDialect,
14348                    >(
14349                        <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
14350                        encoder,
14351                        offset + 8,
14352                        _depth,
14353                    )
14354                }
14355            }
14356        }
14357    }
14358
14359    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14360        for DictionaryRouterRouteResponse
14361    {
14362        #[inline(always)]
14363        fn new_empty() -> Self {
14364            Self::Dictionary(fidl::new_empty!(
14365                DictionaryRef,
14366                fidl::encoding::DefaultFuchsiaResourceDialect
14367            ))
14368        }
14369
14370        #[inline]
14371        unsafe fn decode(
14372            &mut self,
14373            decoder: &mut fidl::encoding::Decoder<
14374                '_,
14375                fidl::encoding::DefaultFuchsiaResourceDialect,
14376            >,
14377            offset: usize,
14378            mut depth: fidl::encoding::Depth,
14379        ) -> fidl::Result<()> {
14380            decoder.debug_check_bounds::<Self>(offset);
14381            #[allow(unused_variables)]
14382            let next_out_of_line = decoder.next_out_of_line();
14383            let handles_before = decoder.remaining_handles();
14384            let (ordinal, inlined, num_bytes, num_handles) =
14385                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
14386
14387            let member_inline_size = match ordinal {
14388                1 => <DictionaryRef as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14389                2 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14390                _ => return Err(fidl::Error::UnknownUnionTag),
14391            };
14392
14393            if inlined != (member_inline_size <= 4) {
14394                return Err(fidl::Error::InvalidInlineBitInEnvelope);
14395            }
14396            let _inner_offset;
14397            if inlined {
14398                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
14399                _inner_offset = offset + 8;
14400            } else {
14401                depth.increment()?;
14402                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14403            }
14404            match ordinal {
14405                1 => {
14406                    #[allow(irrefutable_let_patterns)]
14407                    if let DictionaryRouterRouteResponse::Dictionary(_) = self {
14408                        // Do nothing, read the value into the object
14409                    } else {
14410                        // Initialize `self` to the right variant
14411                        *self = DictionaryRouterRouteResponse::Dictionary(fidl::new_empty!(
14412                            DictionaryRef,
14413                            fidl::encoding::DefaultFuchsiaResourceDialect
14414                        ));
14415                    }
14416                    #[allow(irrefutable_let_patterns)]
14417                    if let DictionaryRouterRouteResponse::Dictionary(ref mut val) = self {
14418                        fidl::decode!(
14419                            DictionaryRef,
14420                            fidl::encoding::DefaultFuchsiaResourceDialect,
14421                            val,
14422                            decoder,
14423                            _inner_offset,
14424                            depth
14425                        )?;
14426                    } else {
14427                        unreachable!()
14428                    }
14429                }
14430                2 => {
14431                    #[allow(irrefutable_let_patterns)]
14432                    if let DictionaryRouterRouteResponse::Unavailable(_) = self {
14433                        // Do nothing, read the value into the object
14434                    } else {
14435                        // Initialize `self` to the right variant
14436                        *self = DictionaryRouterRouteResponse::Unavailable(fidl::new_empty!(
14437                            Unit,
14438                            fidl::encoding::DefaultFuchsiaResourceDialect
14439                        ));
14440                    }
14441                    #[allow(irrefutable_let_patterns)]
14442                    if let DictionaryRouterRouteResponse::Unavailable(ref mut val) = self {
14443                        fidl::decode!(
14444                            Unit,
14445                            fidl::encoding::DefaultFuchsiaResourceDialect,
14446                            val,
14447                            decoder,
14448                            _inner_offset,
14449                            depth
14450                        )?;
14451                    } else {
14452                        unreachable!()
14453                    }
14454                }
14455                ordinal => panic!("unexpected ordinal {:?}", ordinal),
14456            }
14457            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
14458                return Err(fidl::Error::InvalidNumBytesInEnvelope);
14459            }
14460            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14461                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14462            }
14463            Ok(())
14464        }
14465    }
14466
14467    impl fidl::encoding::ResourceTypeMarker for DirConnectorRouterRouteResponse {
14468        type Borrowed<'a> = &'a mut Self;
14469        fn take_or_borrow<'a>(
14470            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14471        ) -> Self::Borrowed<'a> {
14472            value
14473        }
14474    }
14475
14476    unsafe impl fidl::encoding::TypeMarker for DirConnectorRouterRouteResponse {
14477        type Owned = Self;
14478
14479        #[inline(always)]
14480        fn inline_align(_context: fidl::encoding::Context) -> usize {
14481            8
14482        }
14483
14484        #[inline(always)]
14485        fn inline_size(_context: fidl::encoding::Context) -> usize {
14486            16
14487        }
14488    }
14489
14490    unsafe impl
14491        fidl::encoding::Encode<
14492            DirConnectorRouterRouteResponse,
14493            fidl::encoding::DefaultFuchsiaResourceDialect,
14494        > for &mut DirConnectorRouterRouteResponse
14495    {
14496        #[inline]
14497        unsafe fn encode(
14498            self,
14499            encoder: &mut fidl::encoding::Encoder<
14500                '_,
14501                fidl::encoding::DefaultFuchsiaResourceDialect,
14502            >,
14503            offset: usize,
14504            _depth: fidl::encoding::Depth,
14505        ) -> fidl::Result<()> {
14506            encoder.debug_check_bounds::<DirConnectorRouterRouteResponse>(offset);
14507            encoder.write_num::<u64>(self.ordinal(), offset);
14508            match self {
14509                DirConnectorRouterRouteResponse::DirConnector(ref mut val) => {
14510                    fidl::encoding::encode_in_envelope::<
14511                        DirConnector,
14512                        fidl::encoding::DefaultFuchsiaResourceDialect,
14513                    >(
14514                        <DirConnector as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
14515                        encoder,
14516                        offset + 8,
14517                        _depth,
14518                    )
14519                }
14520                DirConnectorRouterRouteResponse::Unavailable(ref val) => {
14521                    fidl::encoding::encode_in_envelope::<
14522                        Unit,
14523                        fidl::encoding::DefaultFuchsiaResourceDialect,
14524                    >(
14525                        <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
14526                        encoder,
14527                        offset + 8,
14528                        _depth,
14529                    )
14530                }
14531            }
14532        }
14533    }
14534
14535    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14536        for DirConnectorRouterRouteResponse
14537    {
14538        #[inline(always)]
14539        fn new_empty() -> Self {
14540            Self::DirConnector(fidl::new_empty!(
14541                DirConnector,
14542                fidl::encoding::DefaultFuchsiaResourceDialect
14543            ))
14544        }
14545
14546        #[inline]
14547        unsafe fn decode(
14548            &mut self,
14549            decoder: &mut fidl::encoding::Decoder<
14550                '_,
14551                fidl::encoding::DefaultFuchsiaResourceDialect,
14552            >,
14553            offset: usize,
14554            mut depth: fidl::encoding::Depth,
14555        ) -> fidl::Result<()> {
14556            decoder.debug_check_bounds::<Self>(offset);
14557            #[allow(unused_variables)]
14558            let next_out_of_line = decoder.next_out_of_line();
14559            let handles_before = decoder.remaining_handles();
14560            let (ordinal, inlined, num_bytes, num_handles) =
14561                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
14562
14563            let member_inline_size = match ordinal {
14564                1 => <DirConnector as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14565                2 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14566                _ => return Err(fidl::Error::UnknownUnionTag),
14567            };
14568
14569            if inlined != (member_inline_size <= 4) {
14570                return Err(fidl::Error::InvalidInlineBitInEnvelope);
14571            }
14572            let _inner_offset;
14573            if inlined {
14574                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
14575                _inner_offset = offset + 8;
14576            } else {
14577                depth.increment()?;
14578                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14579            }
14580            match ordinal {
14581                1 => {
14582                    #[allow(irrefutable_let_patterns)]
14583                    if let DirConnectorRouterRouteResponse::DirConnector(_) = self {
14584                        // Do nothing, read the value into the object
14585                    } else {
14586                        // Initialize `self` to the right variant
14587                        *self = DirConnectorRouterRouteResponse::DirConnector(fidl::new_empty!(
14588                            DirConnector,
14589                            fidl::encoding::DefaultFuchsiaResourceDialect
14590                        ));
14591                    }
14592                    #[allow(irrefutable_let_patterns)]
14593                    if let DirConnectorRouterRouteResponse::DirConnector(ref mut val) = self {
14594                        fidl::decode!(
14595                            DirConnector,
14596                            fidl::encoding::DefaultFuchsiaResourceDialect,
14597                            val,
14598                            decoder,
14599                            _inner_offset,
14600                            depth
14601                        )?;
14602                    } else {
14603                        unreachable!()
14604                    }
14605                }
14606                2 => {
14607                    #[allow(irrefutable_let_patterns)]
14608                    if let DirConnectorRouterRouteResponse::Unavailable(_) = self {
14609                        // Do nothing, read the value into the object
14610                    } else {
14611                        // Initialize `self` to the right variant
14612                        *self = DirConnectorRouterRouteResponse::Unavailable(fidl::new_empty!(
14613                            Unit,
14614                            fidl::encoding::DefaultFuchsiaResourceDialect
14615                        ));
14616                    }
14617                    #[allow(irrefutable_let_patterns)]
14618                    if let DirConnectorRouterRouteResponse::Unavailable(ref mut val) = self {
14619                        fidl::decode!(
14620                            Unit,
14621                            fidl::encoding::DefaultFuchsiaResourceDialect,
14622                            val,
14623                            decoder,
14624                            _inner_offset,
14625                            depth
14626                        )?;
14627                    } else {
14628                        unreachable!()
14629                    }
14630                }
14631                ordinal => panic!("unexpected ordinal {:?}", ordinal),
14632            }
14633            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
14634                return Err(fidl::Error::InvalidNumBytesInEnvelope);
14635            }
14636            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14637                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14638            }
14639            Ok(())
14640        }
14641    }
14642
14643    impl fidl::encoding::ResourceTypeMarker for DirEntryRouterRouteResponse {
14644        type Borrowed<'a> = &'a mut Self;
14645        fn take_or_borrow<'a>(
14646            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14647        ) -> Self::Borrowed<'a> {
14648            value
14649        }
14650    }
14651
14652    unsafe impl fidl::encoding::TypeMarker for DirEntryRouterRouteResponse {
14653        type Owned = Self;
14654
14655        #[inline(always)]
14656        fn inline_align(_context: fidl::encoding::Context) -> usize {
14657            8
14658        }
14659
14660        #[inline(always)]
14661        fn inline_size(_context: fidl::encoding::Context) -> usize {
14662            16
14663        }
14664    }
14665
14666    unsafe impl
14667        fidl::encoding::Encode<
14668            DirEntryRouterRouteResponse,
14669            fidl::encoding::DefaultFuchsiaResourceDialect,
14670        > for &mut DirEntryRouterRouteResponse
14671    {
14672        #[inline]
14673        unsafe fn encode(
14674            self,
14675            encoder: &mut fidl::encoding::Encoder<
14676                '_,
14677                fidl::encoding::DefaultFuchsiaResourceDialect,
14678            >,
14679            offset: usize,
14680            _depth: fidl::encoding::Depth,
14681        ) -> fidl::Result<()> {
14682            encoder.debug_check_bounds::<DirEntryRouterRouteResponse>(offset);
14683            encoder.write_num::<u64>(self.ordinal(), offset);
14684            match self {
14685                DirEntryRouterRouteResponse::DirEntry(ref mut val) => {
14686                    fidl::encoding::encode_in_envelope::<
14687                        DirEntry,
14688                        fidl::encoding::DefaultFuchsiaResourceDialect,
14689                    >(
14690                        <DirEntry as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
14691                        encoder,
14692                        offset + 8,
14693                        _depth,
14694                    )
14695                }
14696                DirEntryRouterRouteResponse::Unavailable(ref val) => {
14697                    fidl::encoding::encode_in_envelope::<
14698                        Unit,
14699                        fidl::encoding::DefaultFuchsiaResourceDialect,
14700                    >(
14701                        <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
14702                        encoder,
14703                        offset + 8,
14704                        _depth,
14705                    )
14706                }
14707            }
14708        }
14709    }
14710
14711    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14712        for DirEntryRouterRouteResponse
14713    {
14714        #[inline(always)]
14715        fn new_empty() -> Self {
14716            Self::DirEntry(fidl::new_empty!(
14717                DirEntry,
14718                fidl::encoding::DefaultFuchsiaResourceDialect
14719            ))
14720        }
14721
14722        #[inline]
14723        unsafe fn decode(
14724            &mut self,
14725            decoder: &mut fidl::encoding::Decoder<
14726                '_,
14727                fidl::encoding::DefaultFuchsiaResourceDialect,
14728            >,
14729            offset: usize,
14730            mut depth: fidl::encoding::Depth,
14731        ) -> fidl::Result<()> {
14732            decoder.debug_check_bounds::<Self>(offset);
14733            #[allow(unused_variables)]
14734            let next_out_of_line = decoder.next_out_of_line();
14735            let handles_before = decoder.remaining_handles();
14736            let (ordinal, inlined, num_bytes, num_handles) =
14737                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
14738
14739            let member_inline_size = match ordinal {
14740                1 => <DirEntry as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14741                2 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14742                _ => return Err(fidl::Error::UnknownUnionTag),
14743            };
14744
14745            if inlined != (member_inline_size <= 4) {
14746                return Err(fidl::Error::InvalidInlineBitInEnvelope);
14747            }
14748            let _inner_offset;
14749            if inlined {
14750                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
14751                _inner_offset = offset + 8;
14752            } else {
14753                depth.increment()?;
14754                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14755            }
14756            match ordinal {
14757                1 => {
14758                    #[allow(irrefutable_let_patterns)]
14759                    if let DirEntryRouterRouteResponse::DirEntry(_) = self {
14760                        // Do nothing, read the value into the object
14761                    } else {
14762                        // Initialize `self` to the right variant
14763                        *self = DirEntryRouterRouteResponse::DirEntry(fidl::new_empty!(
14764                            DirEntry,
14765                            fidl::encoding::DefaultFuchsiaResourceDialect
14766                        ));
14767                    }
14768                    #[allow(irrefutable_let_patterns)]
14769                    if let DirEntryRouterRouteResponse::DirEntry(ref mut val) = self {
14770                        fidl::decode!(
14771                            DirEntry,
14772                            fidl::encoding::DefaultFuchsiaResourceDialect,
14773                            val,
14774                            decoder,
14775                            _inner_offset,
14776                            depth
14777                        )?;
14778                    } else {
14779                        unreachable!()
14780                    }
14781                }
14782                2 => {
14783                    #[allow(irrefutable_let_patterns)]
14784                    if let DirEntryRouterRouteResponse::Unavailable(_) = self {
14785                        // Do nothing, read the value into the object
14786                    } else {
14787                        // Initialize `self` to the right variant
14788                        *self = DirEntryRouterRouteResponse::Unavailable(fidl::new_empty!(
14789                            Unit,
14790                            fidl::encoding::DefaultFuchsiaResourceDialect
14791                        ));
14792                    }
14793                    #[allow(irrefutable_let_patterns)]
14794                    if let DirEntryRouterRouteResponse::Unavailable(ref mut val) = self {
14795                        fidl::decode!(
14796                            Unit,
14797                            fidl::encoding::DefaultFuchsiaResourceDialect,
14798                            val,
14799                            decoder,
14800                            _inner_offset,
14801                            depth
14802                        )?;
14803                    } else {
14804                        unreachable!()
14805                    }
14806                }
14807                ordinal => panic!("unexpected ordinal {:?}", ordinal),
14808            }
14809            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
14810                return Err(fidl::Error::InvalidNumBytesInEnvelope);
14811            }
14812            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14813                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14814            }
14815            Ok(())
14816        }
14817    }
14818
14819    impl fidl::encoding::ResourceTypeMarker for DirectoryRouterRouteResponse {
14820        type Borrowed<'a> = &'a mut Self;
14821        fn take_or_borrow<'a>(
14822            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14823        ) -> Self::Borrowed<'a> {
14824            value
14825        }
14826    }
14827
14828    unsafe impl fidl::encoding::TypeMarker for DirectoryRouterRouteResponse {
14829        type Owned = Self;
14830
14831        #[inline(always)]
14832        fn inline_align(_context: fidl::encoding::Context) -> usize {
14833            8
14834        }
14835
14836        #[inline(always)]
14837        fn inline_size(_context: fidl::encoding::Context) -> usize {
14838            16
14839        }
14840    }
14841
14842    unsafe impl
14843        fidl::encoding::Encode<
14844            DirectoryRouterRouteResponse,
14845            fidl::encoding::DefaultFuchsiaResourceDialect,
14846        > for &mut DirectoryRouterRouteResponse
14847    {
14848        #[inline]
14849        unsafe fn encode(
14850            self,
14851            encoder: &mut fidl::encoding::Encoder<
14852                '_,
14853                fidl::encoding::DefaultFuchsiaResourceDialect,
14854            >,
14855            offset: usize,
14856            _depth: fidl::encoding::Depth,
14857        ) -> fidl::Result<()> {
14858            encoder.debug_check_bounds::<DirectoryRouterRouteResponse>(offset);
14859            encoder.write_num::<u64>(self.ordinal(), offset);
14860            match self {
14861                DirectoryRouterRouteResponse::Directory(ref mut val) => {
14862                    fidl::encoding::encode_in_envelope::<
14863                        fidl::encoding::Endpoint<
14864                            fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
14865                        >,
14866                        fidl::encoding::DefaultFuchsiaResourceDialect,
14867                    >(
14868                        <fidl::encoding::Endpoint<
14869                            fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
14870                        > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
14871                            val
14872                        ),
14873                        encoder,
14874                        offset + 8,
14875                        _depth,
14876                    )
14877                }
14878                DirectoryRouterRouteResponse::Unavailable(ref val) => {
14879                    fidl::encoding::encode_in_envelope::<
14880                        Unit,
14881                        fidl::encoding::DefaultFuchsiaResourceDialect,
14882                    >(
14883                        <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
14884                        encoder,
14885                        offset + 8,
14886                        _depth,
14887                    )
14888                }
14889            }
14890        }
14891    }
14892
14893    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14894        for DirectoryRouterRouteResponse
14895    {
14896        #[inline(always)]
14897        fn new_empty() -> Self {
14898            Self::Directory(fidl::new_empty!(
14899                fidl::encoding::Endpoint<
14900                    fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
14901                >,
14902                fidl::encoding::DefaultFuchsiaResourceDialect
14903            ))
14904        }
14905
14906        #[inline]
14907        unsafe fn decode(
14908            &mut self,
14909            decoder: &mut fidl::encoding::Decoder<
14910                '_,
14911                fidl::encoding::DefaultFuchsiaResourceDialect,
14912            >,
14913            offset: usize,
14914            mut depth: fidl::encoding::Depth,
14915        ) -> fidl::Result<()> {
14916            decoder.debug_check_bounds::<Self>(offset);
14917            #[allow(unused_variables)]
14918            let next_out_of_line = decoder.next_out_of_line();
14919            let handles_before = decoder.remaining_handles();
14920            let (ordinal, inlined, num_bytes, num_handles) =
14921                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
14922
14923            let member_inline_size = match ordinal {
14924                1 => <fidl::encoding::Endpoint<
14925                    fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
14926                > as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14927                2 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14928                _ => return Err(fidl::Error::UnknownUnionTag),
14929            };
14930
14931            if inlined != (member_inline_size <= 4) {
14932                return Err(fidl::Error::InvalidInlineBitInEnvelope);
14933            }
14934            let _inner_offset;
14935            if inlined {
14936                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
14937                _inner_offset = offset + 8;
14938            } else {
14939                depth.increment()?;
14940                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14941            }
14942            match ordinal {
14943                1 => {
14944                    #[allow(irrefutable_let_patterns)]
14945                    if let DirectoryRouterRouteResponse::Directory(_) = self {
14946                        // Do nothing, read the value into the object
14947                    } else {
14948                        // Initialize `self` to the right variant
14949                        *self = DirectoryRouterRouteResponse::Directory(fidl::new_empty!(
14950                            fidl::encoding::Endpoint<
14951                                fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
14952                            >,
14953                            fidl::encoding::DefaultFuchsiaResourceDialect
14954                        ));
14955                    }
14956                    #[allow(irrefutable_let_patterns)]
14957                    if let DirectoryRouterRouteResponse::Directory(ref mut val) = self {
14958                        fidl::decode!(
14959                            fidl::encoding::Endpoint<
14960                                fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
14961                            >,
14962                            fidl::encoding::DefaultFuchsiaResourceDialect,
14963                            val,
14964                            decoder,
14965                            _inner_offset,
14966                            depth
14967                        )?;
14968                    } else {
14969                        unreachable!()
14970                    }
14971                }
14972                2 => {
14973                    #[allow(irrefutable_let_patterns)]
14974                    if let DirectoryRouterRouteResponse::Unavailable(_) = self {
14975                        // Do nothing, read the value into the object
14976                    } else {
14977                        // Initialize `self` to the right variant
14978                        *self = DirectoryRouterRouteResponse::Unavailable(fidl::new_empty!(
14979                            Unit,
14980                            fidl::encoding::DefaultFuchsiaResourceDialect
14981                        ));
14982                    }
14983                    #[allow(irrefutable_let_patterns)]
14984                    if let DirectoryRouterRouteResponse::Unavailable(ref mut val) = self {
14985                        fidl::decode!(
14986                            Unit,
14987                            fidl::encoding::DefaultFuchsiaResourceDialect,
14988                            val,
14989                            decoder,
14990                            _inner_offset,
14991                            depth
14992                        )?;
14993                    } else {
14994                        unreachable!()
14995                    }
14996                }
14997                ordinal => panic!("unexpected ordinal {:?}", ordinal),
14998            }
14999            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
15000                return Err(fidl::Error::InvalidNumBytesInEnvelope);
15001            }
15002            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15003                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15004            }
15005            Ok(())
15006        }
15007    }
15008}