Skip to main content

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, PartialEq)]
41pub struct CapabilityStoreCreateServiceAggregateRequest {
42    pub sources: Vec<AggregateSource>,
43}
44
45impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
46    for CapabilityStoreCreateServiceAggregateRequest
47{
48}
49
50#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
51pub struct CapabilityStoreDictionaryDrainRequest {
52    pub id: u64,
53    pub iterator: Option<fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>>,
54}
55
56impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
57    for CapabilityStoreDictionaryDrainRequest
58{
59}
60
61#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
62pub struct CapabilityStoreDictionaryEnumerateRequest {
63    pub id: u64,
64    pub iterator: fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
65}
66
67impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
68    for CapabilityStoreDictionaryEnumerateRequest
69{
70}
71
72#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
73pub struct CapabilityStoreDictionaryKeysRequest {
74    pub id: u64,
75    pub iterator: fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>,
76}
77
78impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
79    for CapabilityStoreDictionaryKeysRequest
80{
81}
82
83#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
84pub struct CapabilityStoreDictionaryLegacyExportRequest {
85    pub id: u64,
86    pub server_end: fidl::Channel,
87}
88
89impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
90    for CapabilityStoreDictionaryLegacyExportRequest
91{
92}
93
94#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
95pub struct CapabilityStoreDictionaryLegacyImportRequest {
96    pub id: u64,
97    pub client_end: fidl::Channel,
98}
99
100impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
101    for CapabilityStoreDictionaryLegacyImportRequest
102{
103}
104
105#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
106pub struct CapabilityStoreDirConnectorCreateRequest {
107    pub id: u64,
108    pub receiver: fidl::endpoints::ClientEnd<DirReceiverMarker>,
109}
110
111impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
112    for CapabilityStoreDirConnectorCreateRequest
113{
114}
115
116#[derive(Debug, PartialEq)]
117pub struct CapabilityStoreImportRequest {
118    pub id: u64,
119    pub capability: Capability,
120}
121
122impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
123    for CapabilityStoreImportRequest
124{
125}
126
127#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
128pub struct CapabilityStoreCreateServiceAggregateResponse {
129    pub aggregate_dir_connector: DirConnector,
130}
131
132impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
133    for CapabilityStoreCreateServiceAggregateResponse
134{
135}
136
137#[derive(Debug, PartialEq)]
138pub struct CapabilityStoreExportResponse {
139    pub capability: Capability,
140}
141
142impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
143    for CapabilityStoreExportResponse
144{
145}
146
147#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
148pub struct Connector {
149    pub token: fidl::EventPair,
150}
151
152impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Connector {}
153
154#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
155pub struct DictionaryDrainIteratorGetNextResponse {
156    pub items: Vec<DictionaryItem>,
157    pub end_id: u64,
158}
159
160impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
161    for DictionaryDrainIteratorGetNextResponse
162{
163}
164
165#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
166pub struct DictionaryEnumerateIteratorGetNextResponse {
167    pub items: Vec<DictionaryOptionalItem>,
168    pub end_id: u64,
169}
170
171impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
172    for DictionaryEnumerateIteratorGetNextResponse
173{
174}
175
176#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
177pub struct DictionaryKeysIteratorGetNextResponse {
178    pub keys: Vec<String>,
179}
180
181impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
182    for DictionaryKeysIteratorGetNextResponse
183{
184}
185
186/// A key-value pair in a [`DictionaryRef`], where the value may be elided.
187/// This is useful for APIs that may wish to omit the value, for example if it could not be
188/// duplicated.
189#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
190pub struct DictionaryOptionalItem {
191    pub key: String,
192    pub value: Option<Box<WrappedCapabilityId>>,
193}
194
195impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DictionaryOptionalItem {}
196
197#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
198pub struct DictionaryRef {
199    pub token: fidl::EventPair,
200}
201
202impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DictionaryRef {}
203
204#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
205pub struct DirConnector {
206    pub token: fidl::EventPair,
207}
208
209impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DirConnector {}
210
211#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
212pub struct DirEntry {
213    pub token: fidl::EventPair,
214}
215
216impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DirEntry {}
217
218/// Represents an instance in the component tree, either a component
219/// instance or component manager's instance.
220#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
221pub struct InstanceToken {
222    pub token: fidl::EventPair,
223}
224
225impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for InstanceToken {}
226
227/// Contains a protocol open request.
228#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
229pub struct ProtocolPayload {
230    pub channel: fidl::Channel,
231}
232
233impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ProtocolPayload {}
234
235#[derive(Debug, Default, PartialEq)]
236pub struct AggregateSource {
237    pub dir_connector: Option<DirConnector>,
238    /// (Optional) The list of allowlisted instances to be offered. Instances
239    /// of the service not in this list will not be accessible by the target
240    /// component. If this is not set that means all instances from the source
241    /// service are offered.
242    pub source_instance_filter: Option<Vec<String>>,
243    /// (Optional) The list of allowlisted instances to be offered, with
244    /// renames.
245    ///
246    /// If this is set and nonempty, the set of instances in the target service
247    /// will be restricted to the instances in this list, renaming `source_name`
248    /// to `target_name`.
249    ///
250    /// If it is set and nonempty, `source_instance_filter` will further
251    /// restrict the set of instances to those whose `target_name` appears in
252    /// that list. There is generally no reason to set both, but we support it
253    /// for compatibility.
254    pub renamed_instances: Option<Vec<fidl_fuchsia_component_decl::NameMapping>>,
255    #[doc(hidden)]
256    pub __source_breaking: fidl::marker::SourceBreaking,
257}
258
259impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for AggregateSource {}
260
261#[derive(Debug, Default, PartialEq)]
262pub struct CapabilityStoreDirConnectorOpenRequest {
263    pub id: Option<u64>,
264    pub server_end: Option<fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>>,
265    pub flags: Option<fidl_fuchsia_io::Flags>,
266    pub path: Option<String>,
267    #[doc(hidden)]
268    pub __source_breaking: fidl::marker::SourceBreaking,
269}
270
271impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
272    for CapabilityStoreDirConnectorOpenRequest
273{
274}
275
276#[derive(Debug, Default, PartialEq)]
277pub struct DirReceiverReceiveRequest {
278    pub channel: Option<fidl::Channel>,
279    pub flags: Option<fidl_fuchsia_io::Flags>,
280    pub subdir: Option<String>,
281    #[doc(hidden)]
282    pub __source_breaking: fidl::marker::SourceBreaking,
283}
284
285impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DirReceiverReceiveRequest {}
286
287/// A request for a route.
288#[derive(Debug, Default, PartialEq)]
289pub struct RouteRequest {
290    /// The component that is requesting the capability. May be omitted for a default request
291    /// (see `*Router.Route`).
292    pub requesting: Option<InstanceToken>,
293    #[doc(hidden)]
294    pub __source_breaking: fidl::marker::SourceBreaking,
295}
296
297impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for RouteRequest {}
298
299#[derive(Debug)]
300pub enum Capability {
301    Unit(Unit),
302    Handle(fidl::NullableHandle),
303    Data(Data),
304    Dictionary(DictionaryRef),
305    Connector(Connector),
306    DirConnector(DirConnector),
307    Directory(fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>),
308    DirEntry(DirEntry),
309    ConnectorRouter(fidl::endpoints::ClientEnd<ConnectorRouterMarker>),
310    DictionaryRouter(fidl::endpoints::ClientEnd<DictionaryRouterMarker>),
311    DirEntryRouter(fidl::endpoints::ClientEnd<DirEntryRouterMarker>),
312    DataRouter(fidl::endpoints::ClientEnd<DataRouterMarker>),
313    DirConnectorRouter(fidl::endpoints::ClientEnd<DirConnectorRouterMarker>),
314    #[doc(hidden)]
315    __SourceBreaking {
316        unknown_ordinal: u64,
317    },
318}
319
320/// Pattern that matches an unknown `Capability` member.
321#[macro_export]
322macro_rules! CapabilityUnknown {
323    () => {
324        _
325    };
326}
327
328// Custom PartialEq so that unknown variants are not equal to themselves.
329impl PartialEq for Capability {
330    fn eq(&self, other: &Self) -> bool {
331        match (self, other) {
332            (Self::Unit(x), Self::Unit(y)) => *x == *y,
333            (Self::Handle(x), Self::Handle(y)) => *x == *y,
334            (Self::Data(x), Self::Data(y)) => *x == *y,
335            (Self::Dictionary(x), Self::Dictionary(y)) => *x == *y,
336            (Self::Connector(x), Self::Connector(y)) => *x == *y,
337            (Self::DirConnector(x), Self::DirConnector(y)) => *x == *y,
338            (Self::Directory(x), Self::Directory(y)) => *x == *y,
339            (Self::DirEntry(x), Self::DirEntry(y)) => *x == *y,
340            (Self::ConnectorRouter(x), Self::ConnectorRouter(y)) => *x == *y,
341            (Self::DictionaryRouter(x), Self::DictionaryRouter(y)) => *x == *y,
342            (Self::DirEntryRouter(x), Self::DirEntryRouter(y)) => *x == *y,
343            (Self::DataRouter(x), Self::DataRouter(y)) => *x == *y,
344            (Self::DirConnectorRouter(x), Self::DirConnectorRouter(y)) => *x == *y,
345            _ => false,
346        }
347    }
348}
349
350impl Capability {
351    #[inline]
352    pub fn ordinal(&self) -> u64 {
353        match *self {
354            Self::Unit(_) => 1,
355            Self::Handle(_) => 2,
356            Self::Data(_) => 3,
357            Self::Dictionary(_) => 4,
358            Self::Connector(_) => 5,
359            Self::DirConnector(_) => 6,
360            Self::Directory(_) => 7,
361            Self::DirEntry(_) => 8,
362            Self::ConnectorRouter(_) => 9,
363            Self::DictionaryRouter(_) => 10,
364            Self::DirEntryRouter(_) => 11,
365            Self::DataRouter(_) => 12,
366            Self::DirConnectorRouter(_) => 13,
367            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
368        }
369    }
370
371    #[inline]
372    pub fn unknown_variant_for_testing() -> Self {
373        Self::__SourceBreaking { unknown_ordinal: 0 }
374    }
375
376    #[inline]
377    pub fn is_unknown(&self) -> bool {
378        match self {
379            Self::__SourceBreaking { .. } => true,
380            _ => false,
381        }
382    }
383}
384
385impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Capability {}
386
387#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
388pub enum ConnectorRouterRouteResponse {
389    Connector(Connector),
390    Unavailable(Unit),
391}
392
393impl ConnectorRouterRouteResponse {
394    #[inline]
395    pub fn ordinal(&self) -> u64 {
396        match *self {
397            Self::Connector(_) => 1,
398            Self::Unavailable(_) => 2,
399        }
400    }
401}
402
403impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
404    for ConnectorRouterRouteResponse
405{
406}
407
408#[derive(Debug, PartialEq)]
409pub enum DataRouterRouteResponse {
410    Data(Data),
411    Unavailable(Unit),
412}
413
414impl DataRouterRouteResponse {
415    #[inline]
416    pub fn ordinal(&self) -> u64 {
417        match *self {
418            Self::Data(_) => 1,
419            Self::Unavailable(_) => 2,
420        }
421    }
422}
423
424impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DataRouterRouteResponse {}
425
426#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
427pub enum DictionaryRouterRouteResponse {
428    Dictionary(DictionaryRef),
429    Unavailable(Unit),
430}
431
432impl DictionaryRouterRouteResponse {
433    #[inline]
434    pub fn ordinal(&self) -> u64 {
435        match *self {
436            Self::Dictionary(_) => 1,
437            Self::Unavailable(_) => 2,
438        }
439    }
440}
441
442impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
443    for DictionaryRouterRouteResponse
444{
445}
446
447#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
448pub enum DirConnectorRouterRouteResponse {
449    DirConnector(DirConnector),
450    Unavailable(Unit),
451}
452
453impl DirConnectorRouterRouteResponse {
454    #[inline]
455    pub fn ordinal(&self) -> u64 {
456        match *self {
457            Self::DirConnector(_) => 1,
458            Self::Unavailable(_) => 2,
459        }
460    }
461}
462
463impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
464    for DirConnectorRouterRouteResponse
465{
466}
467
468#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
469pub enum DirEntryRouterRouteResponse {
470    DirEntry(DirEntry),
471    Unavailable(Unit),
472}
473
474impl DirEntryRouterRouteResponse {
475    #[inline]
476    pub fn ordinal(&self) -> u64 {
477        match *self {
478            Self::DirEntry(_) => 1,
479            Self::Unavailable(_) => 2,
480        }
481    }
482}
483
484impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
485    for DirEntryRouterRouteResponse
486{
487}
488
489#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
490pub enum DirectoryRouterRouteResponse {
491    Directory(fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>),
492    Unavailable(Unit),
493}
494
495impl DirectoryRouterRouteResponse {
496    #[inline]
497    pub fn ordinal(&self) -> u64 {
498        match *self {
499            Self::Directory(_) => 1,
500            Self::Unavailable(_) => 2,
501        }
502    }
503}
504
505impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
506    for DirectoryRouterRouteResponse
507{
508}
509
510#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
511pub struct CapabilityStoreMarker;
512
513impl fidl::endpoints::ProtocolMarker for CapabilityStoreMarker {
514    type Proxy = CapabilityStoreProxy;
515    type RequestStream = CapabilityStoreRequestStream;
516    #[cfg(target_os = "fuchsia")]
517    type SynchronousProxy = CapabilityStoreSynchronousProxy;
518
519    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.CapabilityStore";
520}
521impl fidl::endpoints::DiscoverableProtocolMarker for CapabilityStoreMarker {}
522pub type CapabilityStoreDuplicateResult = Result<(), CapabilityStoreError>;
523pub type CapabilityStoreDropResult = Result<(), CapabilityStoreError>;
524pub type CapabilityStoreExportResult = Result<Capability, CapabilityStoreError>;
525pub type CapabilityStoreImportResult = Result<(), CapabilityStoreError>;
526pub type CapabilityStoreConnectorCreateResult = Result<(), CapabilityStoreError>;
527pub type CapabilityStoreConnectorOpenResult = Result<(), CapabilityStoreError>;
528pub type CapabilityStoreDirConnectorCreateResult = Result<(), CapabilityStoreError>;
529pub type CapabilityStoreDirConnectorOpenResult = Result<(), CapabilityStoreError>;
530pub type CapabilityStoreDictionaryCreateResult = Result<(), CapabilityStoreError>;
531pub type CapabilityStoreDictionaryLegacyImportResult = Result<(), CapabilityStoreError>;
532pub type CapabilityStoreDictionaryLegacyExportResult = Result<(), CapabilityStoreError>;
533pub type CapabilityStoreDictionaryInsertResult = Result<(), CapabilityStoreError>;
534pub type CapabilityStoreDictionaryGetResult = Result<(), CapabilityStoreError>;
535pub type CapabilityStoreDictionaryRemoveResult = Result<(), CapabilityStoreError>;
536pub type CapabilityStoreDictionaryCopyResult = Result<(), CapabilityStoreError>;
537pub type CapabilityStoreDictionaryKeysResult = Result<(), CapabilityStoreError>;
538pub type CapabilityStoreDictionaryEnumerateResult = Result<(), CapabilityStoreError>;
539pub type CapabilityStoreDictionaryDrainResult = Result<(), CapabilityStoreError>;
540pub type CapabilityStoreCreateServiceAggregateResult = Result<DirConnector, CapabilityStoreError>;
541
542pub trait CapabilityStoreProxyInterface: Send + Sync {
543    type DuplicateResponseFut: std::future::Future<Output = Result<CapabilityStoreDuplicateResult, fidl::Error>>
544        + Send;
545    fn r#duplicate(&self, id: u64, dest_id: u64) -> Self::DuplicateResponseFut;
546    type DropResponseFut: std::future::Future<Output = Result<CapabilityStoreDropResult, fidl::Error>>
547        + Send;
548    fn r#drop(&self, id: u64) -> Self::DropResponseFut;
549    type ExportResponseFut: std::future::Future<Output = Result<CapabilityStoreExportResult, fidl::Error>>
550        + Send;
551    fn r#export(&self, id: u64) -> Self::ExportResponseFut;
552    type ImportResponseFut: std::future::Future<Output = Result<CapabilityStoreImportResult, fidl::Error>>
553        + Send;
554    fn r#import(&self, id: u64, capability: Capability) -> Self::ImportResponseFut;
555    type ConnectorCreateResponseFut: std::future::Future<Output = Result<CapabilityStoreConnectorCreateResult, fidl::Error>>
556        + Send;
557    fn r#connector_create(
558        &self,
559        id: u64,
560        receiver: fidl::endpoints::ClientEnd<ReceiverMarker>,
561    ) -> Self::ConnectorCreateResponseFut;
562    type ConnectorOpenResponseFut: std::future::Future<Output = Result<CapabilityStoreConnectorOpenResult, fidl::Error>>
563        + Send;
564    fn r#connector_open(
565        &self,
566        id: u64,
567        server_end: fidl::Channel,
568    ) -> Self::ConnectorOpenResponseFut;
569    type DirConnectorCreateResponseFut: std::future::Future<Output = Result<CapabilityStoreDirConnectorCreateResult, fidl::Error>>
570        + Send;
571    fn r#dir_connector_create(
572        &self,
573        id: u64,
574        receiver: fidl::endpoints::ClientEnd<DirReceiverMarker>,
575    ) -> Self::DirConnectorCreateResponseFut;
576    type DirConnectorOpenResponseFut: std::future::Future<Output = Result<CapabilityStoreDirConnectorOpenResult, fidl::Error>>
577        + Send;
578    fn r#dir_connector_open(
579        &self,
580        payload: CapabilityStoreDirConnectorOpenRequest,
581    ) -> Self::DirConnectorOpenResponseFut;
582    type DictionaryCreateResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryCreateResult, fidl::Error>>
583        + Send;
584    fn r#dictionary_create(&self, id: u64) -> Self::DictionaryCreateResponseFut;
585    type DictionaryLegacyImportResponseFut: std::future::Future<
586            Output = Result<CapabilityStoreDictionaryLegacyImportResult, fidl::Error>,
587        > + Send;
588    fn r#dictionary_legacy_import(
589        &self,
590        id: u64,
591        client_end: fidl::Channel,
592    ) -> Self::DictionaryLegacyImportResponseFut;
593    type DictionaryLegacyExportResponseFut: std::future::Future<
594            Output = Result<CapabilityStoreDictionaryLegacyExportResult, fidl::Error>,
595        > + Send;
596    fn r#dictionary_legacy_export(
597        &self,
598        id: u64,
599        server_end: fidl::Channel,
600    ) -> Self::DictionaryLegacyExportResponseFut;
601    type DictionaryInsertResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryInsertResult, fidl::Error>>
602        + Send;
603    fn r#dictionary_insert(
604        &self,
605        id: u64,
606        item: &DictionaryItem,
607    ) -> Self::DictionaryInsertResponseFut;
608    type DictionaryGetResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryGetResult, fidl::Error>>
609        + Send;
610    fn r#dictionary_get(&self, id: u64, key: &str, dest_id: u64) -> Self::DictionaryGetResponseFut;
611    type DictionaryRemoveResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryRemoveResult, fidl::Error>>
612        + Send;
613    fn r#dictionary_remove(
614        &self,
615        id: u64,
616        key: &str,
617        dest_id: Option<&WrappedCapabilityId>,
618    ) -> Self::DictionaryRemoveResponseFut;
619    type DictionaryCopyResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryCopyResult, fidl::Error>>
620        + Send;
621    fn r#dictionary_copy(&self, id: u64, dest_id: u64) -> Self::DictionaryCopyResponseFut;
622    type DictionaryKeysResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryKeysResult, fidl::Error>>
623        + Send;
624    fn r#dictionary_keys(
625        &self,
626        id: u64,
627        iterator: fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>,
628    ) -> Self::DictionaryKeysResponseFut;
629    type DictionaryEnumerateResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryEnumerateResult, fidl::Error>>
630        + Send;
631    fn r#dictionary_enumerate(
632        &self,
633        id: u64,
634        iterator: fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
635    ) -> Self::DictionaryEnumerateResponseFut;
636    type DictionaryDrainResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryDrainResult, fidl::Error>>
637        + Send;
638    fn r#dictionary_drain(
639        &self,
640        id: u64,
641        iterator: Option<fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>>,
642    ) -> Self::DictionaryDrainResponseFut;
643    type CreateServiceAggregateResponseFut: std::future::Future<
644            Output = Result<CapabilityStoreCreateServiceAggregateResult, fidl::Error>,
645        > + Send;
646    fn r#create_service_aggregate(
647        &self,
648        sources: Vec<AggregateSource>,
649    ) -> Self::CreateServiceAggregateResponseFut;
650}
651#[derive(Debug)]
652#[cfg(target_os = "fuchsia")]
653pub struct CapabilityStoreSynchronousProxy {
654    client: fidl::client::sync::Client,
655}
656
657#[cfg(target_os = "fuchsia")]
658impl fidl::endpoints::SynchronousProxy for CapabilityStoreSynchronousProxy {
659    type Proxy = CapabilityStoreProxy;
660    type Protocol = CapabilityStoreMarker;
661
662    fn from_channel(inner: fidl::Channel) -> Self {
663        Self::new(inner)
664    }
665
666    fn into_channel(self) -> fidl::Channel {
667        self.client.into_channel()
668    }
669
670    fn as_channel(&self) -> &fidl::Channel {
671        self.client.as_channel()
672    }
673}
674
675#[cfg(target_os = "fuchsia")]
676impl CapabilityStoreSynchronousProxy {
677    pub fn new(channel: fidl::Channel) -> Self {
678        Self { client: fidl::client::sync::Client::new(channel) }
679    }
680
681    pub fn into_channel(self) -> fidl::Channel {
682        self.client.into_channel()
683    }
684
685    /// Waits until an event arrives and returns it. It is safe for other
686    /// threads to make concurrent requests while waiting for an event.
687    pub fn wait_for_event(
688        &self,
689        deadline: zx::MonotonicInstant,
690    ) -> Result<CapabilityStoreEvent, fidl::Error> {
691        CapabilityStoreEvent::decode(self.client.wait_for_event::<CapabilityStoreMarker>(deadline)?)
692    }
693
694    /// Duplicates the capability with `id` to `dest_id`.
695    ///
696    /// Errors:
697    ///
698    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
699    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
700    /// - `NOT_DUPLICATABLE` if `id` could not be duplicated.
701    pub fn r#duplicate(
702        &self,
703        mut id: u64,
704        mut dest_id: u64,
705        ___deadline: zx::MonotonicInstant,
706    ) -> Result<CapabilityStoreDuplicateResult, fidl::Error> {
707        let _response =
708            self.client
709                .send_query::<CapabilityStoreDuplicateRequest, fidl::encoding::FlexibleResultType<
710                    fidl::encoding::EmptyStruct,
711                    CapabilityStoreError,
712                >, CapabilityStoreMarker>(
713                    (id, dest_id),
714                    0x5d5d35d9c20a2184,
715                    fidl::encoding::DynamicFlags::FLEXIBLE,
716                    ___deadline,
717                )?
718                .into_result::<CapabilityStoreMarker>("duplicate")?;
719        Ok(_response.map(|x| x))
720    }
721
722    /// Drops the capability with `id` from this [`CapabilityStore`].
723    ///
724    /// Errors:
725    ///
726    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
727    pub fn r#drop(
728        &self,
729        mut id: u64,
730        ___deadline: zx::MonotonicInstant,
731    ) -> Result<CapabilityStoreDropResult, fidl::Error> {
732        let _response =
733            self.client
734                .send_query::<CapabilityStoreDropRequest, fidl::encoding::FlexibleResultType<
735                    fidl::encoding::EmptyStruct,
736                    CapabilityStoreError,
737                >, CapabilityStoreMarker>(
738                    (id,),
739                    0xa745c0990fc2559,
740                    fidl::encoding::DynamicFlags::FLEXIBLE,
741                    ___deadline,
742                )?
743                .into_result::<CapabilityStoreMarker>("drop")?;
744        Ok(_response.map(|x| x))
745    }
746
747    /// Exports the capability with the client-assigned identifier `id` to
748    /// `capability`. This operation removes the capability from the store. If
749    /// this is not desired, [Duplicate] the capability first.
750    ///
751    /// Errors:
752    ///
753    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
754    pub fn r#export(
755        &self,
756        mut id: u64,
757        ___deadline: zx::MonotonicInstant,
758    ) -> Result<CapabilityStoreExportResult, fidl::Error> {
759        let _response =
760            self.client
761                .send_query::<CapabilityStoreExportRequest, fidl::encoding::FlexibleResultType<
762                    CapabilityStoreExportResponse,
763                    CapabilityStoreError,
764                >, CapabilityStoreMarker>(
765                    (id,),
766                    0x3237a8f4748faff,
767                    fidl::encoding::DynamicFlags::FLEXIBLE,
768                    ___deadline,
769                )?
770                .into_result::<CapabilityStoreMarker>("export")?;
771        Ok(_response.map(|x| x.capability))
772    }
773
774    /// Imports `capability` into this store with the client-assigned `id`.
775    ///
776    /// Errors:
777    ///
778    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
779    /// - `BAD_CAPABILITY` if `capability` was not a valid [Capability].
780    pub fn r#import(
781        &self,
782        mut id: u64,
783        mut capability: Capability,
784        ___deadline: zx::MonotonicInstant,
785    ) -> Result<CapabilityStoreImportResult, fidl::Error> {
786        let _response =
787            self.client
788                .send_query::<CapabilityStoreImportRequest, fidl::encoding::FlexibleResultType<
789                    fidl::encoding::EmptyStruct,
790                    CapabilityStoreError,
791                >, CapabilityStoreMarker>(
792                    (id, &mut capability),
793                    0x1f96157a29f4539b,
794                    fidl::encoding::DynamicFlags::FLEXIBLE,
795                    ___deadline,
796                )?
797                .into_result::<CapabilityStoreMarker>("import")?;
798        Ok(_response.map(|x| x))
799    }
800
801    /// Creates a [Connector] from a [Receiver]. Incoming connections to the [Connector] will be
802    /// dispatched to this [Receiver].
803    ///
804    /// Errors:
805    ///
806    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
807    pub fn r#connector_create(
808        &self,
809        mut id: u64,
810        mut receiver: fidl::endpoints::ClientEnd<ReceiverMarker>,
811        ___deadline: zx::MonotonicInstant,
812    ) -> Result<CapabilityStoreConnectorCreateResult, fidl::Error> {
813        let _response = self.client.send_query::<
814            CapabilityStoreConnectorCreateRequest,
815            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
816            CapabilityStoreMarker,
817        >(
818            (id, receiver,),
819            0x29592c5d63e91c25,
820            fidl::encoding::DynamicFlags::FLEXIBLE,
821            ___deadline,
822        )?
823        .into_result::<CapabilityStoreMarker>("connector_create")?;
824        Ok(_response.map(|x| x))
825    }
826
827    /// Open a connection from the provided [Connector] capability that will be dispatched to
828    /// the [Receiver] on the other end.
829    ///
830    /// If there is an error, it will be reported as a zx.Status epitaph on `server_end`.
831    ///
832    /// Errors:
833    ///
834    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
835    /// - `WRONG_TYPE` if `id` was not a connector capability.
836    pub fn r#connector_open(
837        &self,
838        mut id: u64,
839        mut server_end: fidl::Channel,
840        ___deadline: zx::MonotonicInstant,
841    ) -> Result<CapabilityStoreConnectorOpenResult, fidl::Error> {
842        let _response = self.client.send_query::<
843            CapabilityStoreConnectorOpenRequest,
844            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
845            CapabilityStoreMarker,
846        >(
847            (id, server_end,),
848            0x537e69ab40563b9f,
849            fidl::encoding::DynamicFlags::FLEXIBLE,
850            ___deadline,
851        )?
852        .into_result::<CapabilityStoreMarker>("connector_open")?;
853        Ok(_response.map(|x| x))
854    }
855
856    /// Creates a [DirConnector] from a [DirReceiver]. Incoming connections to the [DirConnector]
857    /// will be dispatched to this [DirReceiver].
858    ///
859    /// Errors:
860    ///
861    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
862    pub fn r#dir_connector_create(
863        &self,
864        mut id: u64,
865        mut receiver: fidl::endpoints::ClientEnd<DirReceiverMarker>,
866        ___deadline: zx::MonotonicInstant,
867    ) -> Result<CapabilityStoreDirConnectorCreateResult, fidl::Error> {
868        let _response = self.client.send_query::<
869            CapabilityStoreDirConnectorCreateRequest,
870            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
871            CapabilityStoreMarker,
872        >(
873            (id, receiver,),
874            0x186138a11ccf19bb,
875            fidl::encoding::DynamicFlags::FLEXIBLE,
876            ___deadline,
877        )?
878        .into_result::<CapabilityStoreMarker>("dir_connector_create")?;
879        Ok(_response.map(|x| x))
880    }
881
882    /// Open a connection from the provided [DirConnector] capability that will
883    /// be dispatched to the [DirReceiver] on the other end. The `id` and
884    /// `server_end` arguments are required, and the `flags` and `path`
885    /// arguments are optional (a path of `.` will be used if one is not
886    /// otherwise set).
887    ///
888    /// If there was an error making the connection, it will be reported as a zx.Status
889    /// epitaph on `server_end`.
890    ///
891    /// Errors:
892    ///
893    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
894    /// - `WRONG_TYPE` if `id` was not a connector capability.
895    pub fn r#dir_connector_open(
896        &self,
897        mut payload: CapabilityStoreDirConnectorOpenRequest,
898        ___deadline: zx::MonotonicInstant,
899    ) -> Result<CapabilityStoreDirConnectorOpenResult, fidl::Error> {
900        let _response = self.client.send_query::<
901            CapabilityStoreDirConnectorOpenRequest,
902            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
903            CapabilityStoreMarker,
904        >(
905            &mut payload,
906            0x5650d3d6a3a13901,
907            fidl::encoding::DynamicFlags::FLEXIBLE,
908            ___deadline,
909        )?
910        .into_result::<CapabilityStoreMarker>("dir_connector_open")?;
911        Ok(_response.map(|x| x))
912    }
913
914    /// Creates a new empty dictionary in this [`CapabilityStore`] with client-assigned `id`.
915    ///
916    /// Errors:
917    ///
918    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
919    pub fn r#dictionary_create(
920        &self,
921        mut id: u64,
922        ___deadline: zx::MonotonicInstant,
923    ) -> Result<CapabilityStoreDictionaryCreateResult, fidl::Error> {
924        let _response = self.client.send_query::<
925            CapabilityStoreDictionaryCreateRequest,
926            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
927            CapabilityStoreMarker,
928        >(
929            (id,),
930            0x6997c8dfc63de093,
931            fidl::encoding::DynamicFlags::FLEXIBLE,
932            ___deadline,
933        )?
934        .into_result::<CapabilityStoreMarker>("dictionary_create")?;
935        Ok(_response.map(|x| x))
936    }
937
938    /// Imports a dictionary in the form of a channel.
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_ALREADY_EXISTS` if a capability with `id` already exists in this store.
946    /// - `BAD_CAPABILITY` if `client_end` was not a valid dictionary channel.
947    pub fn r#dictionary_legacy_import(
948        &self,
949        mut id: u64,
950        mut client_end: fidl::Channel,
951        ___deadline: zx::MonotonicInstant,
952    ) -> Result<CapabilityStoreDictionaryLegacyImportResult, fidl::Error> {
953        let _response = self.client.send_query::<
954            CapabilityStoreDictionaryLegacyImportRequest,
955            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
956            CapabilityStoreMarker,
957        >(
958            (id, client_end,),
959            0x72fd686c37b6025f,
960            fidl::encoding::DynamicFlags::FLEXIBLE,
961            ___deadline,
962        )?
963        .into_result::<CapabilityStoreMarker>("dictionary_legacy_import")?;
964        Ok(_response.map(|x| x))
965    }
966
967    /// Binds a channel to the dictionary with `id`. The channel can
968    /// be re-imported into a [CapabilityStore] with [DictionaryImportLegacy].
969    ///
970    /// This is a legacy API to support backward compatibility with APIs that take a [Dictionary]
971    /// channel.
972    ///
973    /// Errors:
974    ///
975    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
976    pub fn r#dictionary_legacy_export(
977        &self,
978        mut id: u64,
979        mut server_end: fidl::Channel,
980        ___deadline: zx::MonotonicInstant,
981    ) -> Result<CapabilityStoreDictionaryLegacyExportResult, fidl::Error> {
982        let _response = self.client.send_query::<
983            CapabilityStoreDictionaryLegacyExportRequest,
984            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
985            CapabilityStoreMarker,
986        >(
987            (id, server_end,),
988            0x407e15cc4bde5dcd,
989            fidl::encoding::DynamicFlags::FLEXIBLE,
990            ___deadline,
991        )?
992        .into_result::<CapabilityStoreMarker>("dictionary_legacy_export")?;
993        Ok(_response.map(|x| x))
994    }
995
996    /// Inserts `item` into the dictionary with `id`. `item.value` is moved into the dictionary and
997    /// its id is released if this call succeeds.
998    ///
999    /// Errors:
1000    ///
1001    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1002    /// - `WRONG_TYPE` if `id` was not a dictionary.
1003    /// - `INVALID_KEY` if `item.key` was invalid.
1004    /// - `ITEM_ALREADY_EXISTS` if the dictionary already contains an item with `item.key`.
1005    pub fn r#dictionary_insert(
1006        &self,
1007        mut id: u64,
1008        mut item: &DictionaryItem,
1009        ___deadline: zx::MonotonicInstant,
1010    ) -> Result<CapabilityStoreDictionaryInsertResult, fidl::Error> {
1011        let _response = self.client.send_query::<
1012            CapabilityStoreDictionaryInsertRequest,
1013            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
1014            CapabilityStoreMarker,
1015        >(
1016            (id, item,),
1017            0x7702183689d44c27,
1018            fidl::encoding::DynamicFlags::FLEXIBLE,
1019            ___deadline,
1020        )?
1021        .into_result::<CapabilityStoreMarker>("dictionary_insert")?;
1022        Ok(_response.map(|x| x))
1023    }
1024
1025    /// Get a duplicate of a capability from the dictionary with `id`, which is
1026    /// loaded into `dest_id`.
1027    ///
1028    /// Errors:
1029    ///
1030    /// - `ID_NOT_FOUND` if `id` was not a recognized capability id in this store.
1031    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
1032    /// - `WRONG_TYPE` if `id` was not a dictionary.
1033    /// - `INVALID_KEY` if `item.key` was invalid.
1034    /// - `ITEM_NOT_FOUND` if the dictionary does not contain `key`.
1035    /// - `NOT_DUPLICATABLE` if the capability could not be duplicated.
1036    pub fn r#dictionary_get(
1037        &self,
1038        mut id: u64,
1039        mut key: &str,
1040        mut dest_id: u64,
1041        ___deadline: zx::MonotonicInstant,
1042    ) -> Result<CapabilityStoreDictionaryGetResult, fidl::Error> {
1043        let _response = self.client.send_query::<
1044            CapabilityStoreDictionaryGetRequest,
1045            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
1046            CapabilityStoreMarker,
1047        >(
1048            (id, key, dest_id,),
1049            0x4d9e27538284add2,
1050            fidl::encoding::DynamicFlags::FLEXIBLE,
1051            ___deadline,
1052        )?
1053        .into_result::<CapabilityStoreMarker>("dictionary_get")?;
1054        Ok(_response.map(|x| x))
1055    }
1056
1057    /// Removes a key from the dictionary with `id`. If `dest_id` is present, loads the value
1058    /// into it, otherwise discards the value.
1059    ///
1060    /// Errors:
1061    ///
1062    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1063    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
1064    /// - `WRONG_TYPE` if `id` was not a dictionary.
1065    /// - `INVALID_KEY` if `key` was invalid.
1066    /// - `ITEM_NOT_FOUND` if the dictionary does not contain the key.
1067    pub fn r#dictionary_remove(
1068        &self,
1069        mut id: u64,
1070        mut key: &str,
1071        mut dest_id: Option<&WrappedCapabilityId>,
1072        ___deadline: zx::MonotonicInstant,
1073    ) -> Result<CapabilityStoreDictionaryRemoveResult, fidl::Error> {
1074        let _response = self.client.send_query::<
1075            CapabilityStoreDictionaryRemoveRequest,
1076            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
1077            CapabilityStoreMarker,
1078        >(
1079            (id, key, dest_id,),
1080            0x4c5c025ab05d4f3,
1081            fidl::encoding::DynamicFlags::FLEXIBLE,
1082            ___deadline,
1083        )?
1084        .into_result::<CapabilityStoreMarker>("dictionary_remove")?;
1085        Ok(_response.map(|x| x))
1086    }
1087
1088    /// Create a new dictionary that contains a duplicate of all the entries in
1089    /// the dictionary with `id`, assigning `dest_id` to the new dictionary.
1090    /// The runtime of this method is linear in the number of top-level entries
1091    /// in the dictionary.
1092    ///
1093    /// For example, if the dictionary contains nested dictionaries, the newly
1094    /// created dictionary will contain references to those same nested
1095    /// dictionaries because the entries are duplicated rather than deep-copied.
1096    ///
1097    /// Errors:
1098    ///
1099    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1100    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
1101    /// - `WRONG_TYPE` if `id` was not a dictionary.
1102    /// - `NOT_DUPLICATABLE` if one of the capabilities in `id` could not be duplicated.
1103    pub fn r#dictionary_copy(
1104        &self,
1105        mut id: u64,
1106        mut dest_id: u64,
1107        ___deadline: zx::MonotonicInstant,
1108    ) -> Result<CapabilityStoreDictionaryCopyResult, fidl::Error> {
1109        let _response = self.client.send_query::<
1110            CapabilityStoreDictionaryCopyRequest,
1111            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
1112            CapabilityStoreMarker,
1113        >(
1114            (id, dest_id,),
1115            0x3733ecdf4ea1b44f,
1116            fidl::encoding::DynamicFlags::FLEXIBLE,
1117            ___deadline,
1118        )?
1119        .into_result::<CapabilityStoreMarker>("dictionary_copy")?;
1120        Ok(_response.map(|x| x))
1121    }
1122
1123    /// Enumerates the keys in the dictionary with `id`.
1124    ///
1125    /// Errors:
1126    ///
1127    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1128    /// - `WRONG_TYPE` if `id` was not a dictionary.
1129    pub fn r#dictionary_keys(
1130        &self,
1131        mut id: u64,
1132        mut iterator: fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>,
1133        ___deadline: zx::MonotonicInstant,
1134    ) -> Result<CapabilityStoreDictionaryKeysResult, fidl::Error> {
1135        let _response = self.client.send_query::<
1136            CapabilityStoreDictionaryKeysRequest,
1137            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
1138            CapabilityStoreMarker,
1139        >(
1140            (id, iterator,),
1141            0x84b05577ceaec9e,
1142            fidl::encoding::DynamicFlags::FLEXIBLE,
1143            ___deadline,
1144        )?
1145        .into_result::<CapabilityStoreMarker>("dictionary_keys")?;
1146        Ok(_response.map(|x| x))
1147    }
1148
1149    /// Enumerates the items (keys and values) in the dictionary with `id`.
1150    ///
1151    /// Creates a duplicate of each value (capability). If a value could not be duplicated,
1152    /// the value will be null.
1153    ///
1154    /// Errors:
1155    ///
1156    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1157    /// - `WRONG_TYPE` if `id` was not a dictionary.
1158    pub fn r#dictionary_enumerate(
1159        &self,
1160        mut id: u64,
1161        mut iterator: fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
1162        ___deadline: zx::MonotonicInstant,
1163    ) -> Result<CapabilityStoreDictionaryEnumerateResult, fidl::Error> {
1164        let _response = self.client.send_query::<
1165            CapabilityStoreDictionaryEnumerateRequest,
1166            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
1167            CapabilityStoreMarker,
1168        >(
1169            (id, iterator,),
1170            0xd6279b6ced04641,
1171            fidl::encoding::DynamicFlags::FLEXIBLE,
1172            ___deadline,
1173        )?
1174        .into_result::<CapabilityStoreMarker>("dictionary_enumerate")?;
1175        Ok(_response.map(|x| x))
1176    }
1177
1178    /// Removes all the entries in this dictionary, returning them in `contents` if provided.
1179    /// If `contents` is not provided, all the items are discarded without enumerating them.
1180    ///
1181    /// Errors:
1182    ///
1183    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1184    /// - `WRONG_TYPE` if `id` was not a dictionary.
1185    pub fn r#dictionary_drain(
1186        &self,
1187        mut id: u64,
1188        mut iterator: Option<fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>>,
1189        ___deadline: zx::MonotonicInstant,
1190    ) -> Result<CapabilityStoreDictionaryDrainResult, fidl::Error> {
1191        let _response = self.client.send_query::<
1192            CapabilityStoreDictionaryDrainRequest,
1193            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
1194            CapabilityStoreMarker,
1195        >(
1196            (id, iterator,),
1197            0x28a3a3f84d928cd8,
1198            fidl::encoding::DynamicFlags::FLEXIBLE,
1199            ___deadline,
1200        )?
1201        .into_result::<CapabilityStoreMarker>("dictionary_drain")?;
1202        Ok(_response.map(|x| x))
1203    }
1204
1205    /// Creates a new DirConnector that forwards open requests to a set of
1206    /// sources.
1207    pub fn r#create_service_aggregate(
1208        &self,
1209        mut sources: Vec<AggregateSource>,
1210        ___deadline: zx::MonotonicInstant,
1211    ) -> Result<CapabilityStoreCreateServiceAggregateResult, fidl::Error> {
1212        let _response = self.client.send_query::<
1213            CapabilityStoreCreateServiceAggregateRequest,
1214            fidl::encoding::FlexibleResultType<CapabilityStoreCreateServiceAggregateResponse, CapabilityStoreError>,
1215            CapabilityStoreMarker,
1216        >(
1217            (sources.as_mut(),),
1218            0x4584116c8085885a,
1219            fidl::encoding::DynamicFlags::FLEXIBLE,
1220            ___deadline,
1221        )?
1222        .into_result::<CapabilityStoreMarker>("create_service_aggregate")?;
1223        Ok(_response.map(|x| x.aggregate_dir_connector))
1224    }
1225}
1226
1227#[cfg(target_os = "fuchsia")]
1228impl From<CapabilityStoreSynchronousProxy> for zx::NullableHandle {
1229    fn from(value: CapabilityStoreSynchronousProxy) -> Self {
1230        value.into_channel().into()
1231    }
1232}
1233
1234#[cfg(target_os = "fuchsia")]
1235impl From<fidl::Channel> for CapabilityStoreSynchronousProxy {
1236    fn from(value: fidl::Channel) -> Self {
1237        Self::new(value)
1238    }
1239}
1240
1241#[cfg(target_os = "fuchsia")]
1242impl fidl::endpoints::FromClient for CapabilityStoreSynchronousProxy {
1243    type Protocol = CapabilityStoreMarker;
1244
1245    fn from_client(value: fidl::endpoints::ClientEnd<CapabilityStoreMarker>) -> Self {
1246        Self::new(value.into_channel())
1247    }
1248}
1249
1250#[derive(Debug, Clone)]
1251pub struct CapabilityStoreProxy {
1252    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1253}
1254
1255impl fidl::endpoints::Proxy for CapabilityStoreProxy {
1256    type Protocol = CapabilityStoreMarker;
1257
1258    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1259        Self::new(inner)
1260    }
1261
1262    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1263        self.client.into_channel().map_err(|client| Self { client })
1264    }
1265
1266    fn as_channel(&self) -> &::fidl::AsyncChannel {
1267        self.client.as_channel()
1268    }
1269}
1270
1271impl CapabilityStoreProxy {
1272    /// Create a new Proxy for fuchsia.component.sandbox/CapabilityStore.
1273    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1274        let protocol_name = <CapabilityStoreMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1275        Self { client: fidl::client::Client::new(channel, protocol_name) }
1276    }
1277
1278    /// Get a Stream of events from the remote end of the protocol.
1279    ///
1280    /// # Panics
1281    ///
1282    /// Panics if the event stream was already taken.
1283    pub fn take_event_stream(&self) -> CapabilityStoreEventStream {
1284        CapabilityStoreEventStream { event_receiver: self.client.take_event_receiver() }
1285    }
1286
1287    /// Duplicates the capability with `id` to `dest_id`.
1288    ///
1289    /// Errors:
1290    ///
1291    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1292    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
1293    /// - `NOT_DUPLICATABLE` if `id` could not be duplicated.
1294    pub fn r#duplicate(
1295        &self,
1296        mut id: u64,
1297        mut dest_id: u64,
1298    ) -> fidl::client::QueryResponseFut<
1299        CapabilityStoreDuplicateResult,
1300        fidl::encoding::DefaultFuchsiaResourceDialect,
1301    > {
1302        CapabilityStoreProxyInterface::r#duplicate(self, id, dest_id)
1303    }
1304
1305    /// Drops the capability with `id` from this [`CapabilityStore`].
1306    ///
1307    /// Errors:
1308    ///
1309    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1310    pub fn r#drop(
1311        &self,
1312        mut id: u64,
1313    ) -> fidl::client::QueryResponseFut<
1314        CapabilityStoreDropResult,
1315        fidl::encoding::DefaultFuchsiaResourceDialect,
1316    > {
1317        CapabilityStoreProxyInterface::r#drop(self, id)
1318    }
1319
1320    /// Exports the capability with the client-assigned identifier `id` to
1321    /// `capability`. This operation removes the capability from the store. If
1322    /// this is not desired, [Duplicate] the capability first.
1323    ///
1324    /// Errors:
1325    ///
1326    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1327    pub fn r#export(
1328        &self,
1329        mut id: u64,
1330    ) -> fidl::client::QueryResponseFut<
1331        CapabilityStoreExportResult,
1332        fidl::encoding::DefaultFuchsiaResourceDialect,
1333    > {
1334        CapabilityStoreProxyInterface::r#export(self, id)
1335    }
1336
1337    /// Imports `capability` into this store with the client-assigned `id`.
1338    ///
1339    /// Errors:
1340    ///
1341    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
1342    /// - `BAD_CAPABILITY` if `capability` was not a valid [Capability].
1343    pub fn r#import(
1344        &self,
1345        mut id: u64,
1346        mut capability: Capability,
1347    ) -> fidl::client::QueryResponseFut<
1348        CapabilityStoreImportResult,
1349        fidl::encoding::DefaultFuchsiaResourceDialect,
1350    > {
1351        CapabilityStoreProxyInterface::r#import(self, id, capability)
1352    }
1353
1354    /// Creates a [Connector] from a [Receiver]. Incoming connections to the [Connector] will be
1355    /// dispatched to this [Receiver].
1356    ///
1357    /// Errors:
1358    ///
1359    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
1360    pub fn r#connector_create(
1361        &self,
1362        mut id: u64,
1363        mut receiver: fidl::endpoints::ClientEnd<ReceiverMarker>,
1364    ) -> fidl::client::QueryResponseFut<
1365        CapabilityStoreConnectorCreateResult,
1366        fidl::encoding::DefaultFuchsiaResourceDialect,
1367    > {
1368        CapabilityStoreProxyInterface::r#connector_create(self, id, receiver)
1369    }
1370
1371    /// Open a connection from the provided [Connector] capability that will be dispatched to
1372    /// the [Receiver] on the other end.
1373    ///
1374    /// If there is an error, it will be reported as a zx.Status epitaph on `server_end`.
1375    ///
1376    /// Errors:
1377    ///
1378    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1379    /// - `WRONG_TYPE` if `id` was not a connector capability.
1380    pub fn r#connector_open(
1381        &self,
1382        mut id: u64,
1383        mut server_end: fidl::Channel,
1384    ) -> fidl::client::QueryResponseFut<
1385        CapabilityStoreConnectorOpenResult,
1386        fidl::encoding::DefaultFuchsiaResourceDialect,
1387    > {
1388        CapabilityStoreProxyInterface::r#connector_open(self, id, server_end)
1389    }
1390
1391    /// Creates a [DirConnector] from a [DirReceiver]. Incoming connections to the [DirConnector]
1392    /// will be dispatched to this [DirReceiver].
1393    ///
1394    /// Errors:
1395    ///
1396    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
1397    pub fn r#dir_connector_create(
1398        &self,
1399        mut id: u64,
1400        mut receiver: fidl::endpoints::ClientEnd<DirReceiverMarker>,
1401    ) -> fidl::client::QueryResponseFut<
1402        CapabilityStoreDirConnectorCreateResult,
1403        fidl::encoding::DefaultFuchsiaResourceDialect,
1404    > {
1405        CapabilityStoreProxyInterface::r#dir_connector_create(self, id, receiver)
1406    }
1407
1408    /// Open a connection from the provided [DirConnector] capability that will
1409    /// be dispatched to the [DirReceiver] on the other end. The `id` and
1410    /// `server_end` arguments are required, and the `flags` and `path`
1411    /// arguments are optional (a path of `.` will be used if one is not
1412    /// otherwise set).
1413    ///
1414    /// If there was an error making the connection, it will be reported as a zx.Status
1415    /// epitaph on `server_end`.
1416    ///
1417    /// Errors:
1418    ///
1419    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1420    /// - `WRONG_TYPE` if `id` was not a connector capability.
1421    pub fn r#dir_connector_open(
1422        &self,
1423        mut payload: CapabilityStoreDirConnectorOpenRequest,
1424    ) -> fidl::client::QueryResponseFut<
1425        CapabilityStoreDirConnectorOpenResult,
1426        fidl::encoding::DefaultFuchsiaResourceDialect,
1427    > {
1428        CapabilityStoreProxyInterface::r#dir_connector_open(self, payload)
1429    }
1430
1431    /// Creates a new empty dictionary in this [`CapabilityStore`] with client-assigned `id`.
1432    ///
1433    /// Errors:
1434    ///
1435    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
1436    pub fn r#dictionary_create(
1437        &self,
1438        mut id: u64,
1439    ) -> fidl::client::QueryResponseFut<
1440        CapabilityStoreDictionaryCreateResult,
1441        fidl::encoding::DefaultFuchsiaResourceDialect,
1442    > {
1443        CapabilityStoreProxyInterface::r#dictionary_create(self, id)
1444    }
1445
1446    /// Imports a dictionary in the form of a channel.
1447    ///
1448    /// This is a legacy API to support backward compatibility with APIs that take a [Dictionary]
1449    /// channel.
1450    ///
1451    /// Errors:
1452    ///
1453    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
1454    /// - `BAD_CAPABILITY` if `client_end` was not a valid dictionary channel.
1455    pub fn r#dictionary_legacy_import(
1456        &self,
1457        mut id: u64,
1458        mut client_end: fidl::Channel,
1459    ) -> fidl::client::QueryResponseFut<
1460        CapabilityStoreDictionaryLegacyImportResult,
1461        fidl::encoding::DefaultFuchsiaResourceDialect,
1462    > {
1463        CapabilityStoreProxyInterface::r#dictionary_legacy_import(self, id, client_end)
1464    }
1465
1466    /// Binds a channel to the dictionary with `id`. The channel can
1467    /// be re-imported into a [CapabilityStore] with [DictionaryImportLegacy].
1468    ///
1469    /// This is a legacy API to support backward compatibility with APIs that take a [Dictionary]
1470    /// channel.
1471    ///
1472    /// Errors:
1473    ///
1474    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1475    pub fn r#dictionary_legacy_export(
1476        &self,
1477        mut id: u64,
1478        mut server_end: fidl::Channel,
1479    ) -> fidl::client::QueryResponseFut<
1480        CapabilityStoreDictionaryLegacyExportResult,
1481        fidl::encoding::DefaultFuchsiaResourceDialect,
1482    > {
1483        CapabilityStoreProxyInterface::r#dictionary_legacy_export(self, id, server_end)
1484    }
1485
1486    /// Inserts `item` into the dictionary with `id`. `item.value` is moved into the dictionary and
1487    /// its id is released if this call succeeds.
1488    ///
1489    /// Errors:
1490    ///
1491    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1492    /// - `WRONG_TYPE` if `id` was not a dictionary.
1493    /// - `INVALID_KEY` if `item.key` was invalid.
1494    /// - `ITEM_ALREADY_EXISTS` if the dictionary already contains an item with `item.key`.
1495    pub fn r#dictionary_insert(
1496        &self,
1497        mut id: u64,
1498        mut item: &DictionaryItem,
1499    ) -> fidl::client::QueryResponseFut<
1500        CapabilityStoreDictionaryInsertResult,
1501        fidl::encoding::DefaultFuchsiaResourceDialect,
1502    > {
1503        CapabilityStoreProxyInterface::r#dictionary_insert(self, id, item)
1504    }
1505
1506    /// Get a duplicate of a capability from the dictionary with `id`, which is
1507    /// loaded into `dest_id`.
1508    ///
1509    /// Errors:
1510    ///
1511    /// - `ID_NOT_FOUND` if `id` was not a recognized capability id in this store.
1512    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
1513    /// - `WRONG_TYPE` if `id` was not a dictionary.
1514    /// - `INVALID_KEY` if `item.key` was invalid.
1515    /// - `ITEM_NOT_FOUND` if the dictionary does not contain `key`.
1516    /// - `NOT_DUPLICATABLE` if the capability could not be duplicated.
1517    pub fn r#dictionary_get(
1518        &self,
1519        mut id: u64,
1520        mut key: &str,
1521        mut dest_id: u64,
1522    ) -> fidl::client::QueryResponseFut<
1523        CapabilityStoreDictionaryGetResult,
1524        fidl::encoding::DefaultFuchsiaResourceDialect,
1525    > {
1526        CapabilityStoreProxyInterface::r#dictionary_get(self, id, key, dest_id)
1527    }
1528
1529    /// Removes a key from the dictionary with `id`. If `dest_id` is present, loads the value
1530    /// into it, otherwise discards the value.
1531    ///
1532    /// Errors:
1533    ///
1534    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1535    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
1536    /// - `WRONG_TYPE` if `id` was not a dictionary.
1537    /// - `INVALID_KEY` if `key` was invalid.
1538    /// - `ITEM_NOT_FOUND` if the dictionary does not contain the key.
1539    pub fn r#dictionary_remove(
1540        &self,
1541        mut id: u64,
1542        mut key: &str,
1543        mut dest_id: Option<&WrappedCapabilityId>,
1544    ) -> fidl::client::QueryResponseFut<
1545        CapabilityStoreDictionaryRemoveResult,
1546        fidl::encoding::DefaultFuchsiaResourceDialect,
1547    > {
1548        CapabilityStoreProxyInterface::r#dictionary_remove(self, id, key, dest_id)
1549    }
1550
1551    /// Create a new dictionary that contains a duplicate of all the entries in
1552    /// the dictionary with `id`, assigning `dest_id` to the new dictionary.
1553    /// The runtime of this method is linear in the number of top-level entries
1554    /// in the dictionary.
1555    ///
1556    /// For example, if the dictionary contains nested dictionaries, the newly
1557    /// created dictionary will contain references to those same nested
1558    /// dictionaries because the entries are duplicated rather than deep-copied.
1559    ///
1560    /// Errors:
1561    ///
1562    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1563    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
1564    /// - `WRONG_TYPE` if `id` was not a dictionary.
1565    /// - `NOT_DUPLICATABLE` if one of the capabilities in `id` could not be duplicated.
1566    pub fn r#dictionary_copy(
1567        &self,
1568        mut id: u64,
1569        mut dest_id: u64,
1570    ) -> fidl::client::QueryResponseFut<
1571        CapabilityStoreDictionaryCopyResult,
1572        fidl::encoding::DefaultFuchsiaResourceDialect,
1573    > {
1574        CapabilityStoreProxyInterface::r#dictionary_copy(self, id, dest_id)
1575    }
1576
1577    /// Enumerates the keys in the dictionary with `id`.
1578    ///
1579    /// Errors:
1580    ///
1581    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1582    /// - `WRONG_TYPE` if `id` was not a dictionary.
1583    pub fn r#dictionary_keys(
1584        &self,
1585        mut id: u64,
1586        mut iterator: fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>,
1587    ) -> fidl::client::QueryResponseFut<
1588        CapabilityStoreDictionaryKeysResult,
1589        fidl::encoding::DefaultFuchsiaResourceDialect,
1590    > {
1591        CapabilityStoreProxyInterface::r#dictionary_keys(self, id, iterator)
1592    }
1593
1594    /// Enumerates the items (keys and values) in the dictionary with `id`.
1595    ///
1596    /// Creates a duplicate of each value (capability). If a value could not be duplicated,
1597    /// the value will be null.
1598    ///
1599    /// Errors:
1600    ///
1601    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1602    /// - `WRONG_TYPE` if `id` was not a dictionary.
1603    pub fn r#dictionary_enumerate(
1604        &self,
1605        mut id: u64,
1606        mut iterator: fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
1607    ) -> fidl::client::QueryResponseFut<
1608        CapabilityStoreDictionaryEnumerateResult,
1609        fidl::encoding::DefaultFuchsiaResourceDialect,
1610    > {
1611        CapabilityStoreProxyInterface::r#dictionary_enumerate(self, id, iterator)
1612    }
1613
1614    /// Removes all the entries in this dictionary, returning them in `contents` if provided.
1615    /// If `contents` is not provided, all the items are discarded without enumerating them.
1616    ///
1617    /// Errors:
1618    ///
1619    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
1620    /// - `WRONG_TYPE` if `id` was not a dictionary.
1621    pub fn r#dictionary_drain(
1622        &self,
1623        mut id: u64,
1624        mut iterator: Option<fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>>,
1625    ) -> fidl::client::QueryResponseFut<
1626        CapabilityStoreDictionaryDrainResult,
1627        fidl::encoding::DefaultFuchsiaResourceDialect,
1628    > {
1629        CapabilityStoreProxyInterface::r#dictionary_drain(self, id, iterator)
1630    }
1631
1632    /// Creates a new DirConnector that forwards open requests to a set of
1633    /// sources.
1634    pub fn r#create_service_aggregate(
1635        &self,
1636        mut sources: Vec<AggregateSource>,
1637    ) -> fidl::client::QueryResponseFut<
1638        CapabilityStoreCreateServiceAggregateResult,
1639        fidl::encoding::DefaultFuchsiaResourceDialect,
1640    > {
1641        CapabilityStoreProxyInterface::r#create_service_aggregate(self, sources)
1642    }
1643}
1644
1645impl CapabilityStoreProxyInterface for CapabilityStoreProxy {
1646    type DuplicateResponseFut = fidl::client::QueryResponseFut<
1647        CapabilityStoreDuplicateResult,
1648        fidl::encoding::DefaultFuchsiaResourceDialect,
1649    >;
1650    fn r#duplicate(&self, mut id: u64, mut dest_id: u64) -> Self::DuplicateResponseFut {
1651        fn _decode(
1652            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1653        ) -> Result<CapabilityStoreDuplicateResult, fidl::Error> {
1654            let _response = fidl::client::decode_transaction_body::<
1655                fidl::encoding::FlexibleResultType<
1656                    fidl::encoding::EmptyStruct,
1657                    CapabilityStoreError,
1658                >,
1659                fidl::encoding::DefaultFuchsiaResourceDialect,
1660                0x5d5d35d9c20a2184,
1661            >(_buf?)?
1662            .into_result::<CapabilityStoreMarker>("duplicate")?;
1663            Ok(_response.map(|x| x))
1664        }
1665        self.client.send_query_and_decode::<
1666            CapabilityStoreDuplicateRequest,
1667            CapabilityStoreDuplicateResult,
1668        >(
1669            (id, dest_id,),
1670            0x5d5d35d9c20a2184,
1671            fidl::encoding::DynamicFlags::FLEXIBLE,
1672            _decode,
1673        )
1674    }
1675
1676    type DropResponseFut = fidl::client::QueryResponseFut<
1677        CapabilityStoreDropResult,
1678        fidl::encoding::DefaultFuchsiaResourceDialect,
1679    >;
1680    fn r#drop(&self, mut id: u64) -> Self::DropResponseFut {
1681        fn _decode(
1682            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1683        ) -> Result<CapabilityStoreDropResult, fidl::Error> {
1684            let _response = fidl::client::decode_transaction_body::<
1685                fidl::encoding::FlexibleResultType<
1686                    fidl::encoding::EmptyStruct,
1687                    CapabilityStoreError,
1688                >,
1689                fidl::encoding::DefaultFuchsiaResourceDialect,
1690                0xa745c0990fc2559,
1691            >(_buf?)?
1692            .into_result::<CapabilityStoreMarker>("drop")?;
1693            Ok(_response.map(|x| x))
1694        }
1695        self.client.send_query_and_decode::<CapabilityStoreDropRequest, CapabilityStoreDropResult>(
1696            (id,),
1697            0xa745c0990fc2559,
1698            fidl::encoding::DynamicFlags::FLEXIBLE,
1699            _decode,
1700        )
1701    }
1702
1703    type ExportResponseFut = fidl::client::QueryResponseFut<
1704        CapabilityStoreExportResult,
1705        fidl::encoding::DefaultFuchsiaResourceDialect,
1706    >;
1707    fn r#export(&self, mut id: u64) -> Self::ExportResponseFut {
1708        fn _decode(
1709            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1710        ) -> Result<CapabilityStoreExportResult, fidl::Error> {
1711            let _response = fidl::client::decode_transaction_body::<
1712                fidl::encoding::FlexibleResultType<
1713                    CapabilityStoreExportResponse,
1714                    CapabilityStoreError,
1715                >,
1716                fidl::encoding::DefaultFuchsiaResourceDialect,
1717                0x3237a8f4748faff,
1718            >(_buf?)?
1719            .into_result::<CapabilityStoreMarker>("export")?;
1720            Ok(_response.map(|x| x.capability))
1721        }
1722        self.client
1723            .send_query_and_decode::<CapabilityStoreExportRequest, CapabilityStoreExportResult>(
1724                (id,),
1725                0x3237a8f4748faff,
1726                fidl::encoding::DynamicFlags::FLEXIBLE,
1727                _decode,
1728            )
1729    }
1730
1731    type ImportResponseFut = fidl::client::QueryResponseFut<
1732        CapabilityStoreImportResult,
1733        fidl::encoding::DefaultFuchsiaResourceDialect,
1734    >;
1735    fn r#import(&self, mut id: u64, mut capability: Capability) -> Self::ImportResponseFut {
1736        fn _decode(
1737            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1738        ) -> Result<CapabilityStoreImportResult, fidl::Error> {
1739            let _response = fidl::client::decode_transaction_body::<
1740                fidl::encoding::FlexibleResultType<
1741                    fidl::encoding::EmptyStruct,
1742                    CapabilityStoreError,
1743                >,
1744                fidl::encoding::DefaultFuchsiaResourceDialect,
1745                0x1f96157a29f4539b,
1746            >(_buf?)?
1747            .into_result::<CapabilityStoreMarker>("import")?;
1748            Ok(_response.map(|x| x))
1749        }
1750        self.client
1751            .send_query_and_decode::<CapabilityStoreImportRequest, CapabilityStoreImportResult>(
1752                (id, &mut capability),
1753                0x1f96157a29f4539b,
1754                fidl::encoding::DynamicFlags::FLEXIBLE,
1755                _decode,
1756            )
1757    }
1758
1759    type ConnectorCreateResponseFut = fidl::client::QueryResponseFut<
1760        CapabilityStoreConnectorCreateResult,
1761        fidl::encoding::DefaultFuchsiaResourceDialect,
1762    >;
1763    fn r#connector_create(
1764        &self,
1765        mut id: u64,
1766        mut receiver: fidl::endpoints::ClientEnd<ReceiverMarker>,
1767    ) -> Self::ConnectorCreateResponseFut {
1768        fn _decode(
1769            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1770        ) -> Result<CapabilityStoreConnectorCreateResult, fidl::Error> {
1771            let _response = fidl::client::decode_transaction_body::<
1772                fidl::encoding::FlexibleResultType<
1773                    fidl::encoding::EmptyStruct,
1774                    CapabilityStoreError,
1775                >,
1776                fidl::encoding::DefaultFuchsiaResourceDialect,
1777                0x29592c5d63e91c25,
1778            >(_buf?)?
1779            .into_result::<CapabilityStoreMarker>("connector_create")?;
1780            Ok(_response.map(|x| x))
1781        }
1782        self.client.send_query_and_decode::<
1783            CapabilityStoreConnectorCreateRequest,
1784            CapabilityStoreConnectorCreateResult,
1785        >(
1786            (id, receiver,),
1787            0x29592c5d63e91c25,
1788            fidl::encoding::DynamicFlags::FLEXIBLE,
1789            _decode,
1790        )
1791    }
1792
1793    type ConnectorOpenResponseFut = fidl::client::QueryResponseFut<
1794        CapabilityStoreConnectorOpenResult,
1795        fidl::encoding::DefaultFuchsiaResourceDialect,
1796    >;
1797    fn r#connector_open(
1798        &self,
1799        mut id: u64,
1800        mut server_end: fidl::Channel,
1801    ) -> Self::ConnectorOpenResponseFut {
1802        fn _decode(
1803            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1804        ) -> Result<CapabilityStoreConnectorOpenResult, fidl::Error> {
1805            let _response = fidl::client::decode_transaction_body::<
1806                fidl::encoding::FlexibleResultType<
1807                    fidl::encoding::EmptyStruct,
1808                    CapabilityStoreError,
1809                >,
1810                fidl::encoding::DefaultFuchsiaResourceDialect,
1811                0x537e69ab40563b9f,
1812            >(_buf?)?
1813            .into_result::<CapabilityStoreMarker>("connector_open")?;
1814            Ok(_response.map(|x| x))
1815        }
1816        self.client.send_query_and_decode::<
1817            CapabilityStoreConnectorOpenRequest,
1818            CapabilityStoreConnectorOpenResult,
1819        >(
1820            (id, server_end,),
1821            0x537e69ab40563b9f,
1822            fidl::encoding::DynamicFlags::FLEXIBLE,
1823            _decode,
1824        )
1825    }
1826
1827    type DirConnectorCreateResponseFut = fidl::client::QueryResponseFut<
1828        CapabilityStoreDirConnectorCreateResult,
1829        fidl::encoding::DefaultFuchsiaResourceDialect,
1830    >;
1831    fn r#dir_connector_create(
1832        &self,
1833        mut id: u64,
1834        mut receiver: fidl::endpoints::ClientEnd<DirReceiverMarker>,
1835    ) -> Self::DirConnectorCreateResponseFut {
1836        fn _decode(
1837            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1838        ) -> Result<CapabilityStoreDirConnectorCreateResult, fidl::Error> {
1839            let _response = fidl::client::decode_transaction_body::<
1840                fidl::encoding::FlexibleResultType<
1841                    fidl::encoding::EmptyStruct,
1842                    CapabilityStoreError,
1843                >,
1844                fidl::encoding::DefaultFuchsiaResourceDialect,
1845                0x186138a11ccf19bb,
1846            >(_buf?)?
1847            .into_result::<CapabilityStoreMarker>("dir_connector_create")?;
1848            Ok(_response.map(|x| x))
1849        }
1850        self.client.send_query_and_decode::<
1851            CapabilityStoreDirConnectorCreateRequest,
1852            CapabilityStoreDirConnectorCreateResult,
1853        >(
1854            (id, receiver,),
1855            0x186138a11ccf19bb,
1856            fidl::encoding::DynamicFlags::FLEXIBLE,
1857            _decode,
1858        )
1859    }
1860
1861    type DirConnectorOpenResponseFut = fidl::client::QueryResponseFut<
1862        CapabilityStoreDirConnectorOpenResult,
1863        fidl::encoding::DefaultFuchsiaResourceDialect,
1864    >;
1865    fn r#dir_connector_open(
1866        &self,
1867        mut payload: CapabilityStoreDirConnectorOpenRequest,
1868    ) -> Self::DirConnectorOpenResponseFut {
1869        fn _decode(
1870            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1871        ) -> Result<CapabilityStoreDirConnectorOpenResult, fidl::Error> {
1872            let _response = fidl::client::decode_transaction_body::<
1873                fidl::encoding::FlexibleResultType<
1874                    fidl::encoding::EmptyStruct,
1875                    CapabilityStoreError,
1876                >,
1877                fidl::encoding::DefaultFuchsiaResourceDialect,
1878                0x5650d3d6a3a13901,
1879            >(_buf?)?
1880            .into_result::<CapabilityStoreMarker>("dir_connector_open")?;
1881            Ok(_response.map(|x| x))
1882        }
1883        self.client.send_query_and_decode::<
1884            CapabilityStoreDirConnectorOpenRequest,
1885            CapabilityStoreDirConnectorOpenResult,
1886        >(
1887            &mut payload,
1888            0x5650d3d6a3a13901,
1889            fidl::encoding::DynamicFlags::FLEXIBLE,
1890            _decode,
1891        )
1892    }
1893
1894    type DictionaryCreateResponseFut = fidl::client::QueryResponseFut<
1895        CapabilityStoreDictionaryCreateResult,
1896        fidl::encoding::DefaultFuchsiaResourceDialect,
1897    >;
1898    fn r#dictionary_create(&self, mut id: u64) -> Self::DictionaryCreateResponseFut {
1899        fn _decode(
1900            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1901        ) -> Result<CapabilityStoreDictionaryCreateResult, fidl::Error> {
1902            let _response = fidl::client::decode_transaction_body::<
1903                fidl::encoding::FlexibleResultType<
1904                    fidl::encoding::EmptyStruct,
1905                    CapabilityStoreError,
1906                >,
1907                fidl::encoding::DefaultFuchsiaResourceDialect,
1908                0x6997c8dfc63de093,
1909            >(_buf?)?
1910            .into_result::<CapabilityStoreMarker>("dictionary_create")?;
1911            Ok(_response.map(|x| x))
1912        }
1913        self.client.send_query_and_decode::<
1914            CapabilityStoreDictionaryCreateRequest,
1915            CapabilityStoreDictionaryCreateResult,
1916        >(
1917            (id,),
1918            0x6997c8dfc63de093,
1919            fidl::encoding::DynamicFlags::FLEXIBLE,
1920            _decode,
1921        )
1922    }
1923
1924    type DictionaryLegacyImportResponseFut = fidl::client::QueryResponseFut<
1925        CapabilityStoreDictionaryLegacyImportResult,
1926        fidl::encoding::DefaultFuchsiaResourceDialect,
1927    >;
1928    fn r#dictionary_legacy_import(
1929        &self,
1930        mut id: u64,
1931        mut client_end: fidl::Channel,
1932    ) -> Self::DictionaryLegacyImportResponseFut {
1933        fn _decode(
1934            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1935        ) -> Result<CapabilityStoreDictionaryLegacyImportResult, fidl::Error> {
1936            let _response = fidl::client::decode_transaction_body::<
1937                fidl::encoding::FlexibleResultType<
1938                    fidl::encoding::EmptyStruct,
1939                    CapabilityStoreError,
1940                >,
1941                fidl::encoding::DefaultFuchsiaResourceDialect,
1942                0x72fd686c37b6025f,
1943            >(_buf?)?
1944            .into_result::<CapabilityStoreMarker>("dictionary_legacy_import")?;
1945            Ok(_response.map(|x| x))
1946        }
1947        self.client.send_query_and_decode::<
1948            CapabilityStoreDictionaryLegacyImportRequest,
1949            CapabilityStoreDictionaryLegacyImportResult,
1950        >(
1951            (id, client_end,),
1952            0x72fd686c37b6025f,
1953            fidl::encoding::DynamicFlags::FLEXIBLE,
1954            _decode,
1955        )
1956    }
1957
1958    type DictionaryLegacyExportResponseFut = fidl::client::QueryResponseFut<
1959        CapabilityStoreDictionaryLegacyExportResult,
1960        fidl::encoding::DefaultFuchsiaResourceDialect,
1961    >;
1962    fn r#dictionary_legacy_export(
1963        &self,
1964        mut id: u64,
1965        mut server_end: fidl::Channel,
1966    ) -> Self::DictionaryLegacyExportResponseFut {
1967        fn _decode(
1968            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1969        ) -> Result<CapabilityStoreDictionaryLegacyExportResult, fidl::Error> {
1970            let _response = fidl::client::decode_transaction_body::<
1971                fidl::encoding::FlexibleResultType<
1972                    fidl::encoding::EmptyStruct,
1973                    CapabilityStoreError,
1974                >,
1975                fidl::encoding::DefaultFuchsiaResourceDialect,
1976                0x407e15cc4bde5dcd,
1977            >(_buf?)?
1978            .into_result::<CapabilityStoreMarker>("dictionary_legacy_export")?;
1979            Ok(_response.map(|x| x))
1980        }
1981        self.client.send_query_and_decode::<
1982            CapabilityStoreDictionaryLegacyExportRequest,
1983            CapabilityStoreDictionaryLegacyExportResult,
1984        >(
1985            (id, server_end,),
1986            0x407e15cc4bde5dcd,
1987            fidl::encoding::DynamicFlags::FLEXIBLE,
1988            _decode,
1989        )
1990    }
1991
1992    type DictionaryInsertResponseFut = fidl::client::QueryResponseFut<
1993        CapabilityStoreDictionaryInsertResult,
1994        fidl::encoding::DefaultFuchsiaResourceDialect,
1995    >;
1996    fn r#dictionary_insert(
1997        &self,
1998        mut id: u64,
1999        mut item: &DictionaryItem,
2000    ) -> Self::DictionaryInsertResponseFut {
2001        fn _decode(
2002            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2003        ) -> Result<CapabilityStoreDictionaryInsertResult, fidl::Error> {
2004            let _response = fidl::client::decode_transaction_body::<
2005                fidl::encoding::FlexibleResultType<
2006                    fidl::encoding::EmptyStruct,
2007                    CapabilityStoreError,
2008                >,
2009                fidl::encoding::DefaultFuchsiaResourceDialect,
2010                0x7702183689d44c27,
2011            >(_buf?)?
2012            .into_result::<CapabilityStoreMarker>("dictionary_insert")?;
2013            Ok(_response.map(|x| x))
2014        }
2015        self.client.send_query_and_decode::<
2016            CapabilityStoreDictionaryInsertRequest,
2017            CapabilityStoreDictionaryInsertResult,
2018        >(
2019            (id, item,),
2020            0x7702183689d44c27,
2021            fidl::encoding::DynamicFlags::FLEXIBLE,
2022            _decode,
2023        )
2024    }
2025
2026    type DictionaryGetResponseFut = fidl::client::QueryResponseFut<
2027        CapabilityStoreDictionaryGetResult,
2028        fidl::encoding::DefaultFuchsiaResourceDialect,
2029    >;
2030    fn r#dictionary_get(
2031        &self,
2032        mut id: u64,
2033        mut key: &str,
2034        mut dest_id: u64,
2035    ) -> Self::DictionaryGetResponseFut {
2036        fn _decode(
2037            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2038        ) -> Result<CapabilityStoreDictionaryGetResult, fidl::Error> {
2039            let _response = fidl::client::decode_transaction_body::<
2040                fidl::encoding::FlexibleResultType<
2041                    fidl::encoding::EmptyStruct,
2042                    CapabilityStoreError,
2043                >,
2044                fidl::encoding::DefaultFuchsiaResourceDialect,
2045                0x4d9e27538284add2,
2046            >(_buf?)?
2047            .into_result::<CapabilityStoreMarker>("dictionary_get")?;
2048            Ok(_response.map(|x| x))
2049        }
2050        self.client.send_query_and_decode::<
2051            CapabilityStoreDictionaryGetRequest,
2052            CapabilityStoreDictionaryGetResult,
2053        >(
2054            (id, key, dest_id,),
2055            0x4d9e27538284add2,
2056            fidl::encoding::DynamicFlags::FLEXIBLE,
2057            _decode,
2058        )
2059    }
2060
2061    type DictionaryRemoveResponseFut = fidl::client::QueryResponseFut<
2062        CapabilityStoreDictionaryRemoveResult,
2063        fidl::encoding::DefaultFuchsiaResourceDialect,
2064    >;
2065    fn r#dictionary_remove(
2066        &self,
2067        mut id: u64,
2068        mut key: &str,
2069        mut dest_id: Option<&WrappedCapabilityId>,
2070    ) -> Self::DictionaryRemoveResponseFut {
2071        fn _decode(
2072            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2073        ) -> Result<CapabilityStoreDictionaryRemoveResult, fidl::Error> {
2074            let _response = fidl::client::decode_transaction_body::<
2075                fidl::encoding::FlexibleResultType<
2076                    fidl::encoding::EmptyStruct,
2077                    CapabilityStoreError,
2078                >,
2079                fidl::encoding::DefaultFuchsiaResourceDialect,
2080                0x4c5c025ab05d4f3,
2081            >(_buf?)?
2082            .into_result::<CapabilityStoreMarker>("dictionary_remove")?;
2083            Ok(_response.map(|x| x))
2084        }
2085        self.client.send_query_and_decode::<
2086            CapabilityStoreDictionaryRemoveRequest,
2087            CapabilityStoreDictionaryRemoveResult,
2088        >(
2089            (id, key, dest_id,),
2090            0x4c5c025ab05d4f3,
2091            fidl::encoding::DynamicFlags::FLEXIBLE,
2092            _decode,
2093        )
2094    }
2095
2096    type DictionaryCopyResponseFut = fidl::client::QueryResponseFut<
2097        CapabilityStoreDictionaryCopyResult,
2098        fidl::encoding::DefaultFuchsiaResourceDialect,
2099    >;
2100    fn r#dictionary_copy(&self, mut id: u64, mut dest_id: u64) -> Self::DictionaryCopyResponseFut {
2101        fn _decode(
2102            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2103        ) -> Result<CapabilityStoreDictionaryCopyResult, fidl::Error> {
2104            let _response = fidl::client::decode_transaction_body::<
2105                fidl::encoding::FlexibleResultType<
2106                    fidl::encoding::EmptyStruct,
2107                    CapabilityStoreError,
2108                >,
2109                fidl::encoding::DefaultFuchsiaResourceDialect,
2110                0x3733ecdf4ea1b44f,
2111            >(_buf?)?
2112            .into_result::<CapabilityStoreMarker>("dictionary_copy")?;
2113            Ok(_response.map(|x| x))
2114        }
2115        self.client.send_query_and_decode::<
2116            CapabilityStoreDictionaryCopyRequest,
2117            CapabilityStoreDictionaryCopyResult,
2118        >(
2119            (id, dest_id,),
2120            0x3733ecdf4ea1b44f,
2121            fidl::encoding::DynamicFlags::FLEXIBLE,
2122            _decode,
2123        )
2124    }
2125
2126    type DictionaryKeysResponseFut = fidl::client::QueryResponseFut<
2127        CapabilityStoreDictionaryKeysResult,
2128        fidl::encoding::DefaultFuchsiaResourceDialect,
2129    >;
2130    fn r#dictionary_keys(
2131        &self,
2132        mut id: u64,
2133        mut iterator: fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>,
2134    ) -> Self::DictionaryKeysResponseFut {
2135        fn _decode(
2136            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2137        ) -> Result<CapabilityStoreDictionaryKeysResult, fidl::Error> {
2138            let _response = fidl::client::decode_transaction_body::<
2139                fidl::encoding::FlexibleResultType<
2140                    fidl::encoding::EmptyStruct,
2141                    CapabilityStoreError,
2142                >,
2143                fidl::encoding::DefaultFuchsiaResourceDialect,
2144                0x84b05577ceaec9e,
2145            >(_buf?)?
2146            .into_result::<CapabilityStoreMarker>("dictionary_keys")?;
2147            Ok(_response.map(|x| x))
2148        }
2149        self.client.send_query_and_decode::<
2150            CapabilityStoreDictionaryKeysRequest,
2151            CapabilityStoreDictionaryKeysResult,
2152        >(
2153            (id, iterator,),
2154            0x84b05577ceaec9e,
2155            fidl::encoding::DynamicFlags::FLEXIBLE,
2156            _decode,
2157        )
2158    }
2159
2160    type DictionaryEnumerateResponseFut = fidl::client::QueryResponseFut<
2161        CapabilityStoreDictionaryEnumerateResult,
2162        fidl::encoding::DefaultFuchsiaResourceDialect,
2163    >;
2164    fn r#dictionary_enumerate(
2165        &self,
2166        mut id: u64,
2167        mut iterator: fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
2168    ) -> Self::DictionaryEnumerateResponseFut {
2169        fn _decode(
2170            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2171        ) -> Result<CapabilityStoreDictionaryEnumerateResult, fidl::Error> {
2172            let _response = fidl::client::decode_transaction_body::<
2173                fidl::encoding::FlexibleResultType<
2174                    fidl::encoding::EmptyStruct,
2175                    CapabilityStoreError,
2176                >,
2177                fidl::encoding::DefaultFuchsiaResourceDialect,
2178                0xd6279b6ced04641,
2179            >(_buf?)?
2180            .into_result::<CapabilityStoreMarker>("dictionary_enumerate")?;
2181            Ok(_response.map(|x| x))
2182        }
2183        self.client.send_query_and_decode::<
2184            CapabilityStoreDictionaryEnumerateRequest,
2185            CapabilityStoreDictionaryEnumerateResult,
2186        >(
2187            (id, iterator,),
2188            0xd6279b6ced04641,
2189            fidl::encoding::DynamicFlags::FLEXIBLE,
2190            _decode,
2191        )
2192    }
2193
2194    type DictionaryDrainResponseFut = fidl::client::QueryResponseFut<
2195        CapabilityStoreDictionaryDrainResult,
2196        fidl::encoding::DefaultFuchsiaResourceDialect,
2197    >;
2198    fn r#dictionary_drain(
2199        &self,
2200        mut id: u64,
2201        mut iterator: Option<fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>>,
2202    ) -> Self::DictionaryDrainResponseFut {
2203        fn _decode(
2204            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2205        ) -> Result<CapabilityStoreDictionaryDrainResult, fidl::Error> {
2206            let _response = fidl::client::decode_transaction_body::<
2207                fidl::encoding::FlexibleResultType<
2208                    fidl::encoding::EmptyStruct,
2209                    CapabilityStoreError,
2210                >,
2211                fidl::encoding::DefaultFuchsiaResourceDialect,
2212                0x28a3a3f84d928cd8,
2213            >(_buf?)?
2214            .into_result::<CapabilityStoreMarker>("dictionary_drain")?;
2215            Ok(_response.map(|x| x))
2216        }
2217        self.client.send_query_and_decode::<
2218            CapabilityStoreDictionaryDrainRequest,
2219            CapabilityStoreDictionaryDrainResult,
2220        >(
2221            (id, iterator,),
2222            0x28a3a3f84d928cd8,
2223            fidl::encoding::DynamicFlags::FLEXIBLE,
2224            _decode,
2225        )
2226    }
2227
2228    type CreateServiceAggregateResponseFut = fidl::client::QueryResponseFut<
2229        CapabilityStoreCreateServiceAggregateResult,
2230        fidl::encoding::DefaultFuchsiaResourceDialect,
2231    >;
2232    fn r#create_service_aggregate(
2233        &self,
2234        mut sources: Vec<AggregateSource>,
2235    ) -> Self::CreateServiceAggregateResponseFut {
2236        fn _decode(
2237            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2238        ) -> Result<CapabilityStoreCreateServiceAggregateResult, fidl::Error> {
2239            let _response = fidl::client::decode_transaction_body::<
2240                fidl::encoding::FlexibleResultType<
2241                    CapabilityStoreCreateServiceAggregateResponse,
2242                    CapabilityStoreError,
2243                >,
2244                fidl::encoding::DefaultFuchsiaResourceDialect,
2245                0x4584116c8085885a,
2246            >(_buf?)?
2247            .into_result::<CapabilityStoreMarker>("create_service_aggregate")?;
2248            Ok(_response.map(|x| x.aggregate_dir_connector))
2249        }
2250        self.client.send_query_and_decode::<
2251            CapabilityStoreCreateServiceAggregateRequest,
2252            CapabilityStoreCreateServiceAggregateResult,
2253        >(
2254            (sources.as_mut(),),
2255            0x4584116c8085885a,
2256            fidl::encoding::DynamicFlags::FLEXIBLE,
2257            _decode,
2258        )
2259    }
2260}
2261
2262pub struct CapabilityStoreEventStream {
2263    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2264}
2265
2266impl std::marker::Unpin for CapabilityStoreEventStream {}
2267
2268impl futures::stream::FusedStream for CapabilityStoreEventStream {
2269    fn is_terminated(&self) -> bool {
2270        self.event_receiver.is_terminated()
2271    }
2272}
2273
2274impl futures::Stream for CapabilityStoreEventStream {
2275    type Item = Result<CapabilityStoreEvent, fidl::Error>;
2276
2277    fn poll_next(
2278        mut self: std::pin::Pin<&mut Self>,
2279        cx: &mut std::task::Context<'_>,
2280    ) -> std::task::Poll<Option<Self::Item>> {
2281        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2282            &mut self.event_receiver,
2283            cx
2284        )?) {
2285            Some(buf) => std::task::Poll::Ready(Some(CapabilityStoreEvent::decode(buf))),
2286            None => std::task::Poll::Ready(None),
2287        }
2288    }
2289}
2290
2291#[derive(Debug)]
2292pub enum CapabilityStoreEvent {
2293    #[non_exhaustive]
2294    _UnknownEvent {
2295        /// Ordinal of the event that was sent.
2296        ordinal: u64,
2297    },
2298}
2299
2300impl CapabilityStoreEvent {
2301    /// Decodes a message buffer as a [`CapabilityStoreEvent`].
2302    fn decode(
2303        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2304    ) -> Result<CapabilityStoreEvent, fidl::Error> {
2305        let (bytes, _handles) = buf.split_mut();
2306        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2307        debug_assert_eq!(tx_header.tx_id, 0);
2308        match tx_header.ordinal {
2309            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2310                Ok(CapabilityStoreEvent::_UnknownEvent { ordinal: tx_header.ordinal })
2311            }
2312            _ => Err(fidl::Error::UnknownOrdinal {
2313                ordinal: tx_header.ordinal,
2314                protocol_name:
2315                    <CapabilityStoreMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2316            }),
2317        }
2318    }
2319}
2320
2321/// A Stream of incoming requests for fuchsia.component.sandbox/CapabilityStore.
2322pub struct CapabilityStoreRequestStream {
2323    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2324    is_terminated: bool,
2325}
2326
2327impl std::marker::Unpin for CapabilityStoreRequestStream {}
2328
2329impl futures::stream::FusedStream for CapabilityStoreRequestStream {
2330    fn is_terminated(&self) -> bool {
2331        self.is_terminated
2332    }
2333}
2334
2335impl fidl::endpoints::RequestStream for CapabilityStoreRequestStream {
2336    type Protocol = CapabilityStoreMarker;
2337    type ControlHandle = CapabilityStoreControlHandle;
2338
2339    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2340        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2341    }
2342
2343    fn control_handle(&self) -> Self::ControlHandle {
2344        CapabilityStoreControlHandle { inner: self.inner.clone() }
2345    }
2346
2347    fn into_inner(
2348        self,
2349    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2350    {
2351        (self.inner, self.is_terminated)
2352    }
2353
2354    fn from_inner(
2355        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2356        is_terminated: bool,
2357    ) -> Self {
2358        Self { inner, is_terminated }
2359    }
2360}
2361
2362impl futures::Stream for CapabilityStoreRequestStream {
2363    type Item = Result<CapabilityStoreRequest, fidl::Error>;
2364
2365    fn poll_next(
2366        mut self: std::pin::Pin<&mut Self>,
2367        cx: &mut std::task::Context<'_>,
2368    ) -> std::task::Poll<Option<Self::Item>> {
2369        let this = &mut *self;
2370        if this.inner.check_shutdown(cx) {
2371            this.is_terminated = true;
2372            return std::task::Poll::Ready(None);
2373        }
2374        if this.is_terminated {
2375            panic!("polled CapabilityStoreRequestStream after completion");
2376        }
2377        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2378            |bytes, handles| {
2379                match this.inner.channel().read_etc(cx, bytes, handles) {
2380                    std::task::Poll::Ready(Ok(())) => {}
2381                    std::task::Poll::Pending => return std::task::Poll::Pending,
2382                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2383                        this.is_terminated = true;
2384                        return std::task::Poll::Ready(None);
2385                    }
2386                    std::task::Poll::Ready(Err(e)) => {
2387                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2388                            e.into(),
2389                        ))));
2390                    }
2391                }
2392
2393                // A message has been received from the channel
2394                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2395
2396                std::task::Poll::Ready(Some(match header.ordinal {
2397                    0x5d5d35d9c20a2184 => {
2398                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2399                        let mut req = fidl::new_empty!(
2400                            CapabilityStoreDuplicateRequest,
2401                            fidl::encoding::DefaultFuchsiaResourceDialect
2402                        );
2403                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDuplicateRequest>(&header, _body_bytes, handles, &mut req)?;
2404                        let control_handle =
2405                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2406                        Ok(CapabilityStoreRequest::Duplicate {
2407                            id: req.id,
2408                            dest_id: req.dest_id,
2409
2410                            responder: CapabilityStoreDuplicateResponder {
2411                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2412                                tx_id: header.tx_id,
2413                            },
2414                        })
2415                    }
2416                    0xa745c0990fc2559 => {
2417                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2418                        let mut req = fidl::new_empty!(
2419                            CapabilityStoreDropRequest,
2420                            fidl::encoding::DefaultFuchsiaResourceDialect
2421                        );
2422                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDropRequest>(&header, _body_bytes, handles, &mut req)?;
2423                        let control_handle =
2424                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2425                        Ok(CapabilityStoreRequest::Drop {
2426                            id: req.id,
2427
2428                            responder: CapabilityStoreDropResponder {
2429                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2430                                tx_id: header.tx_id,
2431                            },
2432                        })
2433                    }
2434                    0x3237a8f4748faff => {
2435                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2436                        let mut req = fidl::new_empty!(
2437                            CapabilityStoreExportRequest,
2438                            fidl::encoding::DefaultFuchsiaResourceDialect
2439                        );
2440                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreExportRequest>(&header, _body_bytes, handles, &mut req)?;
2441                        let control_handle =
2442                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2443                        Ok(CapabilityStoreRequest::Export {
2444                            id: req.id,
2445
2446                            responder: CapabilityStoreExportResponder {
2447                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2448                                tx_id: header.tx_id,
2449                            },
2450                        })
2451                    }
2452                    0x1f96157a29f4539b => {
2453                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2454                        let mut req = fidl::new_empty!(
2455                            CapabilityStoreImportRequest,
2456                            fidl::encoding::DefaultFuchsiaResourceDialect
2457                        );
2458                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreImportRequest>(&header, _body_bytes, handles, &mut req)?;
2459                        let control_handle =
2460                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2461                        Ok(CapabilityStoreRequest::Import {
2462                            id: req.id,
2463                            capability: req.capability,
2464
2465                            responder: CapabilityStoreImportResponder {
2466                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2467                                tx_id: header.tx_id,
2468                            },
2469                        })
2470                    }
2471                    0x29592c5d63e91c25 => {
2472                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2473                        let mut req = fidl::new_empty!(
2474                            CapabilityStoreConnectorCreateRequest,
2475                            fidl::encoding::DefaultFuchsiaResourceDialect
2476                        );
2477                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreConnectorCreateRequest>(&header, _body_bytes, handles, &mut req)?;
2478                        let control_handle =
2479                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2480                        Ok(CapabilityStoreRequest::ConnectorCreate {
2481                            id: req.id,
2482                            receiver: req.receiver,
2483
2484                            responder: CapabilityStoreConnectorCreateResponder {
2485                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2486                                tx_id: header.tx_id,
2487                            },
2488                        })
2489                    }
2490                    0x537e69ab40563b9f => {
2491                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2492                        let mut req = fidl::new_empty!(
2493                            CapabilityStoreConnectorOpenRequest,
2494                            fidl::encoding::DefaultFuchsiaResourceDialect
2495                        );
2496                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreConnectorOpenRequest>(&header, _body_bytes, handles, &mut req)?;
2497                        let control_handle =
2498                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2499                        Ok(CapabilityStoreRequest::ConnectorOpen {
2500                            id: req.id,
2501                            server_end: req.server_end,
2502
2503                            responder: CapabilityStoreConnectorOpenResponder {
2504                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2505                                tx_id: header.tx_id,
2506                            },
2507                        })
2508                    }
2509                    0x186138a11ccf19bb => {
2510                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2511                        let mut req = fidl::new_empty!(
2512                            CapabilityStoreDirConnectorCreateRequest,
2513                            fidl::encoding::DefaultFuchsiaResourceDialect
2514                        );
2515                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDirConnectorCreateRequest>(&header, _body_bytes, handles, &mut req)?;
2516                        let control_handle =
2517                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2518                        Ok(CapabilityStoreRequest::DirConnectorCreate {
2519                            id: req.id,
2520                            receiver: req.receiver,
2521
2522                            responder: CapabilityStoreDirConnectorCreateResponder {
2523                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2524                                tx_id: header.tx_id,
2525                            },
2526                        })
2527                    }
2528                    0x5650d3d6a3a13901 => {
2529                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2530                        let mut req = fidl::new_empty!(
2531                            CapabilityStoreDirConnectorOpenRequest,
2532                            fidl::encoding::DefaultFuchsiaResourceDialect
2533                        );
2534                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDirConnectorOpenRequest>(&header, _body_bytes, handles, &mut req)?;
2535                        let control_handle =
2536                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2537                        Ok(CapabilityStoreRequest::DirConnectorOpen {
2538                            payload: req,
2539                            responder: CapabilityStoreDirConnectorOpenResponder {
2540                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2541                                tx_id: header.tx_id,
2542                            },
2543                        })
2544                    }
2545                    0x6997c8dfc63de093 => {
2546                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2547                        let mut req = fidl::new_empty!(
2548                            CapabilityStoreDictionaryCreateRequest,
2549                            fidl::encoding::DefaultFuchsiaResourceDialect
2550                        );
2551                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryCreateRequest>(&header, _body_bytes, handles, &mut req)?;
2552                        let control_handle =
2553                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2554                        Ok(CapabilityStoreRequest::DictionaryCreate {
2555                            id: req.id,
2556
2557                            responder: CapabilityStoreDictionaryCreateResponder {
2558                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2559                                tx_id: header.tx_id,
2560                            },
2561                        })
2562                    }
2563                    0x72fd686c37b6025f => {
2564                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2565                        let mut req = fidl::new_empty!(
2566                            CapabilityStoreDictionaryLegacyImportRequest,
2567                            fidl::encoding::DefaultFuchsiaResourceDialect
2568                        );
2569                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryLegacyImportRequest>(&header, _body_bytes, handles, &mut req)?;
2570                        let control_handle =
2571                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2572                        Ok(CapabilityStoreRequest::DictionaryLegacyImport {
2573                            id: req.id,
2574                            client_end: req.client_end,
2575
2576                            responder: CapabilityStoreDictionaryLegacyImportResponder {
2577                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2578                                tx_id: header.tx_id,
2579                            },
2580                        })
2581                    }
2582                    0x407e15cc4bde5dcd => {
2583                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2584                        let mut req = fidl::new_empty!(
2585                            CapabilityStoreDictionaryLegacyExportRequest,
2586                            fidl::encoding::DefaultFuchsiaResourceDialect
2587                        );
2588                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryLegacyExportRequest>(&header, _body_bytes, handles, &mut req)?;
2589                        let control_handle =
2590                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2591                        Ok(CapabilityStoreRequest::DictionaryLegacyExport {
2592                            id: req.id,
2593                            server_end: req.server_end,
2594
2595                            responder: CapabilityStoreDictionaryLegacyExportResponder {
2596                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2597                                tx_id: header.tx_id,
2598                            },
2599                        })
2600                    }
2601                    0x7702183689d44c27 => {
2602                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2603                        let mut req = fidl::new_empty!(
2604                            CapabilityStoreDictionaryInsertRequest,
2605                            fidl::encoding::DefaultFuchsiaResourceDialect
2606                        );
2607                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryInsertRequest>(&header, _body_bytes, handles, &mut req)?;
2608                        let control_handle =
2609                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2610                        Ok(CapabilityStoreRequest::DictionaryInsert {
2611                            id: req.id,
2612                            item: req.item,
2613
2614                            responder: CapabilityStoreDictionaryInsertResponder {
2615                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2616                                tx_id: header.tx_id,
2617                            },
2618                        })
2619                    }
2620                    0x4d9e27538284add2 => {
2621                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2622                        let mut req = fidl::new_empty!(
2623                            CapabilityStoreDictionaryGetRequest,
2624                            fidl::encoding::DefaultFuchsiaResourceDialect
2625                        );
2626                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryGetRequest>(&header, _body_bytes, handles, &mut req)?;
2627                        let control_handle =
2628                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2629                        Ok(CapabilityStoreRequest::DictionaryGet {
2630                            id: req.id,
2631                            key: req.key,
2632                            dest_id: req.dest_id,
2633
2634                            responder: CapabilityStoreDictionaryGetResponder {
2635                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2636                                tx_id: header.tx_id,
2637                            },
2638                        })
2639                    }
2640                    0x4c5c025ab05d4f3 => {
2641                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2642                        let mut req = fidl::new_empty!(
2643                            CapabilityStoreDictionaryRemoveRequest,
2644                            fidl::encoding::DefaultFuchsiaResourceDialect
2645                        );
2646                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryRemoveRequest>(&header, _body_bytes, handles, &mut req)?;
2647                        let control_handle =
2648                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2649                        Ok(CapabilityStoreRequest::DictionaryRemove {
2650                            id: req.id,
2651                            key: req.key,
2652                            dest_id: req.dest_id,
2653
2654                            responder: CapabilityStoreDictionaryRemoveResponder {
2655                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2656                                tx_id: header.tx_id,
2657                            },
2658                        })
2659                    }
2660                    0x3733ecdf4ea1b44f => {
2661                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2662                        let mut req = fidl::new_empty!(
2663                            CapabilityStoreDictionaryCopyRequest,
2664                            fidl::encoding::DefaultFuchsiaResourceDialect
2665                        );
2666                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryCopyRequest>(&header, _body_bytes, handles, &mut req)?;
2667                        let control_handle =
2668                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2669                        Ok(CapabilityStoreRequest::DictionaryCopy {
2670                            id: req.id,
2671                            dest_id: req.dest_id,
2672
2673                            responder: CapabilityStoreDictionaryCopyResponder {
2674                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2675                                tx_id: header.tx_id,
2676                            },
2677                        })
2678                    }
2679                    0x84b05577ceaec9e => {
2680                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2681                        let mut req = fidl::new_empty!(
2682                            CapabilityStoreDictionaryKeysRequest,
2683                            fidl::encoding::DefaultFuchsiaResourceDialect
2684                        );
2685                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryKeysRequest>(&header, _body_bytes, handles, &mut req)?;
2686                        let control_handle =
2687                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2688                        Ok(CapabilityStoreRequest::DictionaryKeys {
2689                            id: req.id,
2690                            iterator: req.iterator,
2691
2692                            responder: CapabilityStoreDictionaryKeysResponder {
2693                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2694                                tx_id: header.tx_id,
2695                            },
2696                        })
2697                    }
2698                    0xd6279b6ced04641 => {
2699                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2700                        let mut req = fidl::new_empty!(
2701                            CapabilityStoreDictionaryEnumerateRequest,
2702                            fidl::encoding::DefaultFuchsiaResourceDialect
2703                        );
2704                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryEnumerateRequest>(&header, _body_bytes, handles, &mut req)?;
2705                        let control_handle =
2706                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2707                        Ok(CapabilityStoreRequest::DictionaryEnumerate {
2708                            id: req.id,
2709                            iterator: req.iterator,
2710
2711                            responder: CapabilityStoreDictionaryEnumerateResponder {
2712                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2713                                tx_id: header.tx_id,
2714                            },
2715                        })
2716                    }
2717                    0x28a3a3f84d928cd8 => {
2718                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2719                        let mut req = fidl::new_empty!(
2720                            CapabilityStoreDictionaryDrainRequest,
2721                            fidl::encoding::DefaultFuchsiaResourceDialect
2722                        );
2723                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryDrainRequest>(&header, _body_bytes, handles, &mut req)?;
2724                        let control_handle =
2725                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2726                        Ok(CapabilityStoreRequest::DictionaryDrain {
2727                            id: req.id,
2728                            iterator: req.iterator,
2729
2730                            responder: CapabilityStoreDictionaryDrainResponder {
2731                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2732                                tx_id: header.tx_id,
2733                            },
2734                        })
2735                    }
2736                    0x4584116c8085885a => {
2737                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2738                        let mut req = fidl::new_empty!(
2739                            CapabilityStoreCreateServiceAggregateRequest,
2740                            fidl::encoding::DefaultFuchsiaResourceDialect
2741                        );
2742                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreCreateServiceAggregateRequest>(&header, _body_bytes, handles, &mut req)?;
2743                        let control_handle =
2744                            CapabilityStoreControlHandle { inner: this.inner.clone() };
2745                        Ok(CapabilityStoreRequest::CreateServiceAggregate {
2746                            sources: req.sources,
2747
2748                            responder: CapabilityStoreCreateServiceAggregateResponder {
2749                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2750                                tx_id: header.tx_id,
2751                            },
2752                        })
2753                    }
2754                    _ if header.tx_id == 0
2755                        && header
2756                            .dynamic_flags()
2757                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2758                    {
2759                        Ok(CapabilityStoreRequest::_UnknownMethod {
2760                            ordinal: header.ordinal,
2761                            control_handle: CapabilityStoreControlHandle {
2762                                inner: this.inner.clone(),
2763                            },
2764                            method_type: fidl::MethodType::OneWay,
2765                        })
2766                    }
2767                    _ if header
2768                        .dynamic_flags()
2769                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2770                    {
2771                        this.inner.send_framework_err(
2772                            fidl::encoding::FrameworkErr::UnknownMethod,
2773                            header.tx_id,
2774                            header.ordinal,
2775                            header.dynamic_flags(),
2776                            (bytes, handles),
2777                        )?;
2778                        Ok(CapabilityStoreRequest::_UnknownMethod {
2779                            ordinal: header.ordinal,
2780                            control_handle: CapabilityStoreControlHandle {
2781                                inner: this.inner.clone(),
2782                            },
2783                            method_type: fidl::MethodType::TwoWay,
2784                        })
2785                    }
2786                    _ => Err(fidl::Error::UnknownOrdinal {
2787                        ordinal: header.ordinal,
2788                        protocol_name:
2789                            <CapabilityStoreMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2790                    }),
2791                }))
2792            },
2793        )
2794    }
2795}
2796
2797/// Protocol that represents the concept of a "capability store", a repository
2798/// for [Capability]s that are held by the component framework runtime.
2799///
2800/// [CapabilityStore] serves as the main bridge between the component runtime and clients
2801/// that enables them to operate on and exchange [Capability]s. A [CapabilityStore] instance
2802/// contains a set of [Capability]s, each of which has a [CapabilityId] assigned by the client.
2803///
2804/// Normally, a program would not exchange a [CapabilityStore] or [CapabilityId] with other
2805/// programs -- a [CapabilityStore] connection and its enclosed capabilities are intended to
2806/// be "local" to a program. Instead, if a program wishes to exchange a [Capability] with other
2807/// programs, it should [Export] the [Capability] out of the store, send the [Capability] to the
2808/// target program, which can then [Import] the capability into its own store.
2809///
2810/// [CapabilityStore] is also used to manage capability lifetimes. The lifetime of a capability is
2811/// scoped to the [CapabilityStore] in which it resides; i.e. to drop the [CapabilityStore]
2812/// connections to release the capabilities instead it. In addition, [CapabilityStore] supports a
2813/// [Drop] API to drop an individual [Capability] reference. (Note that it is possible for a
2814/// some capabilities, like [DictionaryRef], to have multiple references, in which case all of
2815/// the references must be dropped for the underlying resource to be released.)
2816///
2817/// A note about semantics: the [CapabilityStore] APIs do not return [CapabilityId]s, because
2818/// [CapabilityId]s are assigned by the client. Instead, when a method would semantically return
2819/// a capability, this is expressed by taking the destination [CapabilityId] as an output parameter.
2820#[derive(Debug)]
2821pub enum CapabilityStoreRequest {
2822    /// Duplicates the capability with `id` to `dest_id`.
2823    ///
2824    /// Errors:
2825    ///
2826    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2827    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
2828    /// - `NOT_DUPLICATABLE` if `id` could not be duplicated.
2829    Duplicate { id: u64, dest_id: u64, responder: CapabilityStoreDuplicateResponder },
2830    /// Drops the capability with `id` from this [`CapabilityStore`].
2831    ///
2832    /// Errors:
2833    ///
2834    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2835    Drop { id: u64, responder: CapabilityStoreDropResponder },
2836    /// Exports the capability with the client-assigned identifier `id` to
2837    /// `capability`. This operation removes the capability from the store. If
2838    /// this is not desired, [Duplicate] the capability first.
2839    ///
2840    /// Errors:
2841    ///
2842    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2843    Export { id: u64, responder: CapabilityStoreExportResponder },
2844    /// Imports `capability` into this store with the client-assigned `id`.
2845    ///
2846    /// Errors:
2847    ///
2848    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
2849    /// - `BAD_CAPABILITY` if `capability` was not a valid [Capability].
2850    Import { id: u64, capability: Capability, responder: CapabilityStoreImportResponder },
2851    /// Creates a [Connector] from a [Receiver]. Incoming connections to the [Connector] will be
2852    /// dispatched to this [Receiver].
2853    ///
2854    /// Errors:
2855    ///
2856    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
2857    ConnectorCreate {
2858        id: u64,
2859        receiver: fidl::endpoints::ClientEnd<ReceiverMarker>,
2860        responder: CapabilityStoreConnectorCreateResponder,
2861    },
2862    /// Open a connection from the provided [Connector] capability that will be dispatched to
2863    /// the [Receiver] on the other end.
2864    ///
2865    /// If there is an error, it will be reported as a zx.Status epitaph on `server_end`.
2866    ///
2867    /// Errors:
2868    ///
2869    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2870    /// - `WRONG_TYPE` if `id` was not a connector capability.
2871    ConnectorOpen {
2872        id: u64,
2873        server_end: fidl::Channel,
2874        responder: CapabilityStoreConnectorOpenResponder,
2875    },
2876    /// Creates a [DirConnector] from a [DirReceiver]. Incoming connections to the [DirConnector]
2877    /// will be dispatched to this [DirReceiver].
2878    ///
2879    /// Errors:
2880    ///
2881    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
2882    DirConnectorCreate {
2883        id: u64,
2884        receiver: fidl::endpoints::ClientEnd<DirReceiverMarker>,
2885        responder: CapabilityStoreDirConnectorCreateResponder,
2886    },
2887    /// Open a connection from the provided [DirConnector] capability that will
2888    /// be dispatched to the [DirReceiver] on the other end. The `id` and
2889    /// `server_end` arguments are required, and the `flags` and `path`
2890    /// arguments are optional (a path of `.` will be used if one is not
2891    /// otherwise set).
2892    ///
2893    /// If there was an error making the connection, it will be reported as a zx.Status
2894    /// epitaph on `server_end`.
2895    ///
2896    /// Errors:
2897    ///
2898    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2899    /// - `WRONG_TYPE` if `id` was not a connector capability.
2900    DirConnectorOpen {
2901        payload: CapabilityStoreDirConnectorOpenRequest,
2902        responder: CapabilityStoreDirConnectorOpenResponder,
2903    },
2904    /// Creates a new empty dictionary in this [`CapabilityStore`] with client-assigned `id`.
2905    ///
2906    /// Errors:
2907    ///
2908    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
2909    DictionaryCreate { id: u64, responder: CapabilityStoreDictionaryCreateResponder },
2910    /// Imports a dictionary in the form of a channel.
2911    ///
2912    /// This is a legacy API to support backward compatibility with APIs that take a [Dictionary]
2913    /// channel.
2914    ///
2915    /// Errors:
2916    ///
2917    /// - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.
2918    /// - `BAD_CAPABILITY` if `client_end` was not a valid dictionary channel.
2919    DictionaryLegacyImport {
2920        id: u64,
2921        client_end: fidl::Channel,
2922        responder: CapabilityStoreDictionaryLegacyImportResponder,
2923    },
2924    /// Binds a channel to the dictionary with `id`. The channel can
2925    /// be re-imported into a [CapabilityStore] with [DictionaryImportLegacy].
2926    ///
2927    /// This is a legacy API to support backward compatibility with APIs that take a [Dictionary]
2928    /// channel.
2929    ///
2930    /// Errors:
2931    ///
2932    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2933    DictionaryLegacyExport {
2934        id: u64,
2935        server_end: fidl::Channel,
2936        responder: CapabilityStoreDictionaryLegacyExportResponder,
2937    },
2938    /// Inserts `item` into the dictionary with `id`. `item.value` is moved into the dictionary and
2939    /// its id is released if this call succeeds.
2940    ///
2941    /// Errors:
2942    ///
2943    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2944    /// - `WRONG_TYPE` if `id` was not a dictionary.
2945    /// - `INVALID_KEY` if `item.key` was invalid.
2946    /// - `ITEM_ALREADY_EXISTS` if the dictionary already contains an item with `item.key`.
2947    DictionaryInsert {
2948        id: u64,
2949        item: DictionaryItem,
2950        responder: CapabilityStoreDictionaryInsertResponder,
2951    },
2952    /// Get a duplicate of a capability from the dictionary with `id`, which is
2953    /// loaded into `dest_id`.
2954    ///
2955    /// Errors:
2956    ///
2957    /// - `ID_NOT_FOUND` if `id` was not a recognized capability id in this store.
2958    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
2959    /// - `WRONG_TYPE` if `id` was not a dictionary.
2960    /// - `INVALID_KEY` if `item.key` was invalid.
2961    /// - `ITEM_NOT_FOUND` if the dictionary does not contain `key`.
2962    /// - `NOT_DUPLICATABLE` if the capability could not be duplicated.
2963    DictionaryGet {
2964        id: u64,
2965        key: String,
2966        dest_id: u64,
2967        responder: CapabilityStoreDictionaryGetResponder,
2968    },
2969    /// Removes a key from the dictionary with `id`. If `dest_id` is present, loads the value
2970    /// into it, otherwise discards the value.
2971    ///
2972    /// Errors:
2973    ///
2974    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2975    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
2976    /// - `WRONG_TYPE` if `id` was not a dictionary.
2977    /// - `INVALID_KEY` if `key` was invalid.
2978    /// - `ITEM_NOT_FOUND` if the dictionary does not contain the key.
2979    DictionaryRemove {
2980        id: u64,
2981        key: String,
2982        dest_id: Option<Box<WrappedCapabilityId>>,
2983        responder: CapabilityStoreDictionaryRemoveResponder,
2984    },
2985    /// Create a new dictionary that contains a duplicate of all the entries in
2986    /// the dictionary with `id`, assigning `dest_id` to the new dictionary.
2987    /// The runtime of this method is linear in the number of top-level entries
2988    /// in the dictionary.
2989    ///
2990    /// For example, if the dictionary contains nested dictionaries, the newly
2991    /// created dictionary will contain references to those same nested
2992    /// dictionaries because the entries are duplicated rather than deep-copied.
2993    ///
2994    /// Errors:
2995    ///
2996    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
2997    /// - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.
2998    /// - `WRONG_TYPE` if `id` was not a dictionary.
2999    /// - `NOT_DUPLICATABLE` if one of the capabilities in `id` could not be duplicated.
3000    DictionaryCopy { id: u64, dest_id: u64, responder: CapabilityStoreDictionaryCopyResponder },
3001    /// Enumerates the keys in the dictionary with `id`.
3002    ///
3003    /// Errors:
3004    ///
3005    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
3006    /// - `WRONG_TYPE` if `id` was not a dictionary.
3007    DictionaryKeys {
3008        id: u64,
3009        iterator: fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>,
3010        responder: CapabilityStoreDictionaryKeysResponder,
3011    },
3012    /// Enumerates the items (keys and values) in the dictionary with `id`.
3013    ///
3014    /// Creates a duplicate of each value (capability). If a value could not be duplicated,
3015    /// the value will be null.
3016    ///
3017    /// Errors:
3018    ///
3019    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
3020    /// - `WRONG_TYPE` if `id` was not a dictionary.
3021    DictionaryEnumerate {
3022        id: u64,
3023        iterator: fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
3024        responder: CapabilityStoreDictionaryEnumerateResponder,
3025    },
3026    /// Removes all the entries in this dictionary, returning them in `contents` if provided.
3027    /// If `contents` is not provided, all the items are discarded without enumerating them.
3028    ///
3029    /// Errors:
3030    ///
3031    /// - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.
3032    /// - `WRONG_TYPE` if `id` was not a dictionary.
3033    DictionaryDrain {
3034        id: u64,
3035        iterator: Option<fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>>,
3036        responder: CapabilityStoreDictionaryDrainResponder,
3037    },
3038    /// Creates a new DirConnector that forwards open requests to a set of
3039    /// sources.
3040    CreateServiceAggregate {
3041        sources: Vec<AggregateSource>,
3042        responder: CapabilityStoreCreateServiceAggregateResponder,
3043    },
3044    /// An interaction was received which does not match any known method.
3045    #[non_exhaustive]
3046    _UnknownMethod {
3047        /// Ordinal of the method that was called.
3048        ordinal: u64,
3049        control_handle: CapabilityStoreControlHandle,
3050        method_type: fidl::MethodType,
3051    },
3052}
3053
3054impl CapabilityStoreRequest {
3055    #[allow(irrefutable_let_patterns)]
3056    pub fn into_duplicate(self) -> Option<(u64, u64, CapabilityStoreDuplicateResponder)> {
3057        if let CapabilityStoreRequest::Duplicate { id, dest_id, responder } = self {
3058            Some((id, dest_id, responder))
3059        } else {
3060            None
3061        }
3062    }
3063
3064    #[allow(irrefutable_let_patterns)]
3065    pub fn into_drop(self) -> Option<(u64, CapabilityStoreDropResponder)> {
3066        if let CapabilityStoreRequest::Drop { id, responder } = self {
3067            Some((id, responder))
3068        } else {
3069            None
3070        }
3071    }
3072
3073    #[allow(irrefutable_let_patterns)]
3074    pub fn into_export(self) -> Option<(u64, CapabilityStoreExportResponder)> {
3075        if let CapabilityStoreRequest::Export { id, responder } = self {
3076            Some((id, responder))
3077        } else {
3078            None
3079        }
3080    }
3081
3082    #[allow(irrefutable_let_patterns)]
3083    pub fn into_import(self) -> Option<(u64, Capability, CapabilityStoreImportResponder)> {
3084        if let CapabilityStoreRequest::Import { id, capability, responder } = self {
3085            Some((id, capability, responder))
3086        } else {
3087            None
3088        }
3089    }
3090
3091    #[allow(irrefutable_let_patterns)]
3092    pub fn into_connector_create(
3093        self,
3094    ) -> Option<(
3095        u64,
3096        fidl::endpoints::ClientEnd<ReceiverMarker>,
3097        CapabilityStoreConnectorCreateResponder,
3098    )> {
3099        if let CapabilityStoreRequest::ConnectorCreate { id, receiver, responder } = self {
3100            Some((id, receiver, responder))
3101        } else {
3102            None
3103        }
3104    }
3105
3106    #[allow(irrefutable_let_patterns)]
3107    pub fn into_connector_open(
3108        self,
3109    ) -> Option<(u64, fidl::Channel, CapabilityStoreConnectorOpenResponder)> {
3110        if let CapabilityStoreRequest::ConnectorOpen { id, server_end, responder } = self {
3111            Some((id, server_end, responder))
3112        } else {
3113            None
3114        }
3115    }
3116
3117    #[allow(irrefutable_let_patterns)]
3118    pub fn into_dir_connector_create(
3119        self,
3120    ) -> Option<(
3121        u64,
3122        fidl::endpoints::ClientEnd<DirReceiverMarker>,
3123        CapabilityStoreDirConnectorCreateResponder,
3124    )> {
3125        if let CapabilityStoreRequest::DirConnectorCreate { id, receiver, responder } = self {
3126            Some((id, receiver, responder))
3127        } else {
3128            None
3129        }
3130    }
3131
3132    #[allow(irrefutable_let_patterns)]
3133    pub fn into_dir_connector_open(
3134        self,
3135    ) -> Option<(CapabilityStoreDirConnectorOpenRequest, CapabilityStoreDirConnectorOpenResponder)>
3136    {
3137        if let CapabilityStoreRequest::DirConnectorOpen { payload, responder } = self {
3138            Some((payload, responder))
3139        } else {
3140            None
3141        }
3142    }
3143
3144    #[allow(irrefutable_let_patterns)]
3145    pub fn into_dictionary_create(self) -> Option<(u64, CapabilityStoreDictionaryCreateResponder)> {
3146        if let CapabilityStoreRequest::DictionaryCreate { id, responder } = self {
3147            Some((id, responder))
3148        } else {
3149            None
3150        }
3151    }
3152
3153    #[allow(irrefutable_let_patterns)]
3154    pub fn into_dictionary_legacy_import(
3155        self,
3156    ) -> Option<(u64, fidl::Channel, CapabilityStoreDictionaryLegacyImportResponder)> {
3157        if let CapabilityStoreRequest::DictionaryLegacyImport { id, client_end, responder } = self {
3158            Some((id, client_end, responder))
3159        } else {
3160            None
3161        }
3162    }
3163
3164    #[allow(irrefutable_let_patterns)]
3165    pub fn into_dictionary_legacy_export(
3166        self,
3167    ) -> Option<(u64, fidl::Channel, CapabilityStoreDictionaryLegacyExportResponder)> {
3168        if let CapabilityStoreRequest::DictionaryLegacyExport { id, server_end, responder } = self {
3169            Some((id, server_end, responder))
3170        } else {
3171            None
3172        }
3173    }
3174
3175    #[allow(irrefutable_let_patterns)]
3176    pub fn into_dictionary_insert(
3177        self,
3178    ) -> Option<(u64, DictionaryItem, CapabilityStoreDictionaryInsertResponder)> {
3179        if let CapabilityStoreRequest::DictionaryInsert { id, item, responder } = self {
3180            Some((id, item, responder))
3181        } else {
3182            None
3183        }
3184    }
3185
3186    #[allow(irrefutable_let_patterns)]
3187    pub fn into_dictionary_get(
3188        self,
3189    ) -> Option<(u64, String, u64, CapabilityStoreDictionaryGetResponder)> {
3190        if let CapabilityStoreRequest::DictionaryGet { id, key, dest_id, responder } = self {
3191            Some((id, key, dest_id, responder))
3192        } else {
3193            None
3194        }
3195    }
3196
3197    #[allow(irrefutable_let_patterns)]
3198    pub fn into_dictionary_remove(
3199        self,
3200    ) -> Option<(
3201        u64,
3202        String,
3203        Option<Box<WrappedCapabilityId>>,
3204        CapabilityStoreDictionaryRemoveResponder,
3205    )> {
3206        if let CapabilityStoreRequest::DictionaryRemove { id, key, dest_id, responder } = self {
3207            Some((id, key, dest_id, responder))
3208        } else {
3209            None
3210        }
3211    }
3212
3213    #[allow(irrefutable_let_patterns)]
3214    pub fn into_dictionary_copy(
3215        self,
3216    ) -> Option<(u64, u64, CapabilityStoreDictionaryCopyResponder)> {
3217        if let CapabilityStoreRequest::DictionaryCopy { id, dest_id, responder } = self {
3218            Some((id, dest_id, responder))
3219        } else {
3220            None
3221        }
3222    }
3223
3224    #[allow(irrefutable_let_patterns)]
3225    pub fn into_dictionary_keys(
3226        self,
3227    ) -> Option<(
3228        u64,
3229        fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>,
3230        CapabilityStoreDictionaryKeysResponder,
3231    )> {
3232        if let CapabilityStoreRequest::DictionaryKeys { id, iterator, responder } = self {
3233            Some((id, iterator, responder))
3234        } else {
3235            None
3236        }
3237    }
3238
3239    #[allow(irrefutable_let_patterns)]
3240    pub fn into_dictionary_enumerate(
3241        self,
3242    ) -> Option<(
3243        u64,
3244        fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
3245        CapabilityStoreDictionaryEnumerateResponder,
3246    )> {
3247        if let CapabilityStoreRequest::DictionaryEnumerate { id, iterator, responder } = self {
3248            Some((id, iterator, responder))
3249        } else {
3250            None
3251        }
3252    }
3253
3254    #[allow(irrefutable_let_patterns)]
3255    pub fn into_dictionary_drain(
3256        self,
3257    ) -> Option<(
3258        u64,
3259        Option<fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>>,
3260        CapabilityStoreDictionaryDrainResponder,
3261    )> {
3262        if let CapabilityStoreRequest::DictionaryDrain { id, iterator, responder } = self {
3263            Some((id, iterator, responder))
3264        } else {
3265            None
3266        }
3267    }
3268
3269    #[allow(irrefutable_let_patterns)]
3270    pub fn into_create_service_aggregate(
3271        self,
3272    ) -> Option<(Vec<AggregateSource>, CapabilityStoreCreateServiceAggregateResponder)> {
3273        if let CapabilityStoreRequest::CreateServiceAggregate { sources, responder } = self {
3274            Some((sources, responder))
3275        } else {
3276            None
3277        }
3278    }
3279
3280    /// Name of the method defined in FIDL
3281    pub fn method_name(&self) -> &'static str {
3282        match *self {
3283            CapabilityStoreRequest::Duplicate { .. } => "duplicate",
3284            CapabilityStoreRequest::Drop { .. } => "drop",
3285            CapabilityStoreRequest::Export { .. } => "export",
3286            CapabilityStoreRequest::Import { .. } => "import",
3287            CapabilityStoreRequest::ConnectorCreate { .. } => "connector_create",
3288            CapabilityStoreRequest::ConnectorOpen { .. } => "connector_open",
3289            CapabilityStoreRequest::DirConnectorCreate { .. } => "dir_connector_create",
3290            CapabilityStoreRequest::DirConnectorOpen { .. } => "dir_connector_open",
3291            CapabilityStoreRequest::DictionaryCreate { .. } => "dictionary_create",
3292            CapabilityStoreRequest::DictionaryLegacyImport { .. } => "dictionary_legacy_import",
3293            CapabilityStoreRequest::DictionaryLegacyExport { .. } => "dictionary_legacy_export",
3294            CapabilityStoreRequest::DictionaryInsert { .. } => "dictionary_insert",
3295            CapabilityStoreRequest::DictionaryGet { .. } => "dictionary_get",
3296            CapabilityStoreRequest::DictionaryRemove { .. } => "dictionary_remove",
3297            CapabilityStoreRequest::DictionaryCopy { .. } => "dictionary_copy",
3298            CapabilityStoreRequest::DictionaryKeys { .. } => "dictionary_keys",
3299            CapabilityStoreRequest::DictionaryEnumerate { .. } => "dictionary_enumerate",
3300            CapabilityStoreRequest::DictionaryDrain { .. } => "dictionary_drain",
3301            CapabilityStoreRequest::CreateServiceAggregate { .. } => "create_service_aggregate",
3302            CapabilityStoreRequest::_UnknownMethod {
3303                method_type: fidl::MethodType::OneWay,
3304                ..
3305            } => "unknown one-way method",
3306            CapabilityStoreRequest::_UnknownMethod {
3307                method_type: fidl::MethodType::TwoWay,
3308                ..
3309            } => "unknown two-way method",
3310        }
3311    }
3312}
3313
3314#[derive(Debug, Clone)]
3315pub struct CapabilityStoreControlHandle {
3316    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3317}
3318
3319impl fidl::endpoints::ControlHandle for CapabilityStoreControlHandle {
3320    fn shutdown(&self) {
3321        self.inner.shutdown()
3322    }
3323
3324    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3325        self.inner.shutdown_with_epitaph(status)
3326    }
3327
3328    fn is_closed(&self) -> bool {
3329        self.inner.channel().is_closed()
3330    }
3331    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3332        self.inner.channel().on_closed()
3333    }
3334
3335    #[cfg(target_os = "fuchsia")]
3336    fn signal_peer(
3337        &self,
3338        clear_mask: zx::Signals,
3339        set_mask: zx::Signals,
3340    ) -> Result<(), zx_status::Status> {
3341        use fidl::Peered;
3342        self.inner.channel().signal_peer(clear_mask, set_mask)
3343    }
3344}
3345
3346impl CapabilityStoreControlHandle {}
3347
3348#[must_use = "FIDL methods require a response to be sent"]
3349#[derive(Debug)]
3350pub struct CapabilityStoreDuplicateResponder {
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 CapabilityStoreDuplicateResponder {
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 CapabilityStoreDuplicateResponder {
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 CapabilityStoreDuplicateResponder {
3382    /// Sends a response to the FIDL transaction.
3383    ///
3384    /// Sets the channel to shutdown if an error occurs.
3385    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3386        let _result = self.send_raw(result);
3387        if _result.is_err() {
3388            self.control_handle.shutdown();
3389        }
3390        self.drop_without_shutdown();
3391        _result
3392    }
3393
3394    /// Similar to "send" but does not shutdown the channel if an error occurs.
3395    pub fn send_no_shutdown_on_err(
3396        self,
3397        mut result: Result<(), CapabilityStoreError>,
3398    ) -> Result<(), fidl::Error> {
3399        let _result = self.send_raw(result);
3400        self.drop_without_shutdown();
3401        _result
3402    }
3403
3404    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3405        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3406            fidl::encoding::EmptyStruct,
3407            CapabilityStoreError,
3408        >>(
3409            fidl::encoding::FlexibleResult::new(result),
3410            self.tx_id,
3411            0x5d5d35d9c20a2184,
3412            fidl::encoding::DynamicFlags::FLEXIBLE,
3413        )
3414    }
3415}
3416
3417#[must_use = "FIDL methods require a response to be sent"]
3418#[derive(Debug)]
3419pub struct CapabilityStoreDropResponder {
3420    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3421    tx_id: u32,
3422}
3423
3424/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3425/// if the responder is dropped without sending a response, so that the client
3426/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3427impl std::ops::Drop for CapabilityStoreDropResponder {
3428    fn drop(&mut self) {
3429        self.control_handle.shutdown();
3430        // Safety: drops once, never accessed again
3431        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3432    }
3433}
3434
3435impl fidl::endpoints::Responder for CapabilityStoreDropResponder {
3436    type ControlHandle = CapabilityStoreControlHandle;
3437
3438    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3439        &self.control_handle
3440    }
3441
3442    fn drop_without_shutdown(mut self) {
3443        // Safety: drops once, never accessed again due to mem::forget
3444        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3445        // Prevent Drop from running (which would shut down the channel)
3446        std::mem::forget(self);
3447    }
3448}
3449
3450impl CapabilityStoreDropResponder {
3451    /// Sends a response to the FIDL transaction.
3452    ///
3453    /// Sets the channel to shutdown if an error occurs.
3454    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3455        let _result = self.send_raw(result);
3456        if _result.is_err() {
3457            self.control_handle.shutdown();
3458        }
3459        self.drop_without_shutdown();
3460        _result
3461    }
3462
3463    /// Similar to "send" but does not shutdown the channel if an error occurs.
3464    pub fn send_no_shutdown_on_err(
3465        self,
3466        mut result: Result<(), CapabilityStoreError>,
3467    ) -> Result<(), fidl::Error> {
3468        let _result = self.send_raw(result);
3469        self.drop_without_shutdown();
3470        _result
3471    }
3472
3473    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3474        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3475            fidl::encoding::EmptyStruct,
3476            CapabilityStoreError,
3477        >>(
3478            fidl::encoding::FlexibleResult::new(result),
3479            self.tx_id,
3480            0xa745c0990fc2559,
3481            fidl::encoding::DynamicFlags::FLEXIBLE,
3482        )
3483    }
3484}
3485
3486#[must_use = "FIDL methods require a response to be sent"]
3487#[derive(Debug)]
3488pub struct CapabilityStoreExportResponder {
3489    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3490    tx_id: u32,
3491}
3492
3493/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3494/// if the responder is dropped without sending a response, so that the client
3495/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3496impl std::ops::Drop for CapabilityStoreExportResponder {
3497    fn drop(&mut self) {
3498        self.control_handle.shutdown();
3499        // Safety: drops once, never accessed again
3500        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3501    }
3502}
3503
3504impl fidl::endpoints::Responder for CapabilityStoreExportResponder {
3505    type ControlHandle = CapabilityStoreControlHandle;
3506
3507    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3508        &self.control_handle
3509    }
3510
3511    fn drop_without_shutdown(mut self) {
3512        // Safety: drops once, never accessed again due to mem::forget
3513        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3514        // Prevent Drop from running (which would shut down the channel)
3515        std::mem::forget(self);
3516    }
3517}
3518
3519impl CapabilityStoreExportResponder {
3520    /// Sends a response to the FIDL transaction.
3521    ///
3522    /// Sets the channel to shutdown if an error occurs.
3523    pub fn send(
3524        self,
3525        mut result: Result<Capability, CapabilityStoreError>,
3526    ) -> Result<(), fidl::Error> {
3527        let _result = self.send_raw(result);
3528        if _result.is_err() {
3529            self.control_handle.shutdown();
3530        }
3531        self.drop_without_shutdown();
3532        _result
3533    }
3534
3535    /// Similar to "send" but does not shutdown the channel if an error occurs.
3536    pub fn send_no_shutdown_on_err(
3537        self,
3538        mut result: Result<Capability, CapabilityStoreError>,
3539    ) -> Result<(), fidl::Error> {
3540        let _result = self.send_raw(result);
3541        self.drop_without_shutdown();
3542        _result
3543    }
3544
3545    fn send_raw(
3546        &self,
3547        mut result: Result<Capability, CapabilityStoreError>,
3548    ) -> Result<(), fidl::Error> {
3549        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3550            CapabilityStoreExportResponse,
3551            CapabilityStoreError,
3552        >>(
3553            fidl::encoding::FlexibleResult::new(
3554                result.as_mut().map_err(|e| *e).map(|capability| (capability,)),
3555            ),
3556            self.tx_id,
3557            0x3237a8f4748faff,
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 CapabilityStoreImportResponder {
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 CapabilityStoreImportResponder {
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 CapabilityStoreImportResponder {
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 CapabilityStoreImportResponder {
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            0x1f96157a29f4539b,
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 CapabilityStoreConnectorCreateResponder {
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 CapabilityStoreConnectorCreateResponder {
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 CapabilityStoreConnectorCreateResponder {
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 CapabilityStoreConnectorCreateResponder {
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            0x29592c5d63e91c25,
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 CapabilityStoreConnectorOpenResponder {
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 CapabilityStoreConnectorOpenResponder {
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 CapabilityStoreConnectorOpenResponder {
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 CapabilityStoreConnectorOpenResponder {
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            0x537e69ab40563b9f,
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 CapabilityStoreDirConnectorCreateResponder {
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 CapabilityStoreDirConnectorCreateResponder {
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 CapabilityStoreDirConnectorCreateResponder {
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 CapabilityStoreDirConnectorCreateResponder {
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            0x186138a11ccf19bb,
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 CapabilityStoreDirConnectorOpenResponder {
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 CapabilityStoreDirConnectorOpenResponder {
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 CapabilityStoreDirConnectorOpenResponder {
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 CapabilityStoreDirConnectorOpenResponder {
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            0x5650d3d6a3a13901,
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 CapabilityStoreDictionaryCreateResponder {
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 CapabilityStoreDictionaryCreateResponder {
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 CapabilityStoreDictionaryCreateResponder {
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 CapabilityStoreDictionaryCreateResponder {
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            0x6997c8dfc63de093,
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 CapabilityStoreDictionaryLegacyImportResponder {
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 CapabilityStoreDictionaryLegacyImportResponder {
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 CapabilityStoreDictionaryLegacyImportResponder {
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 CapabilityStoreDictionaryLegacyImportResponder {
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            0x72fd686c37b6025f,
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 CapabilityStoreDictionaryLegacyExportResponder {
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 CapabilityStoreDictionaryLegacyExportResponder {
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 CapabilityStoreDictionaryLegacyExportResponder {
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 CapabilityStoreDictionaryLegacyExportResponder {
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            0x407e15cc4bde5dcd,
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 CapabilityStoreDictionaryInsertResponder {
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 CapabilityStoreDictionaryInsertResponder {
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 CapabilityStoreDictionaryInsertResponder {
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 CapabilityStoreDictionaryInsertResponder {
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            0x7702183689d44c27,
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 CapabilityStoreDictionaryGetResponder {
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 CapabilityStoreDictionaryGetResponder {
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 CapabilityStoreDictionaryGetResponder {
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 CapabilityStoreDictionaryGetResponder {
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            0x4d9e27538284add2,
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 CapabilityStoreDictionaryRemoveResponder {
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 CapabilityStoreDictionaryRemoveResponder {
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 CapabilityStoreDictionaryRemoveResponder {
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 CapabilityStoreDictionaryRemoveResponder {
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            0x4c5c025ab05d4f3,
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 CapabilityStoreDictionaryCopyResponder {
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 CapabilityStoreDictionaryCopyResponder {
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 CapabilityStoreDictionaryCopyResponder {
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 CapabilityStoreDictionaryCopyResponder {
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            0x3733ecdf4ea1b44f,
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 CapabilityStoreDictionaryKeysResponder {
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 CapabilityStoreDictionaryKeysResponder {
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 CapabilityStoreDictionaryKeysResponder {
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 CapabilityStoreDictionaryKeysResponder {
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            0x84b05577ceaec9e,
4455            fidl::encoding::DynamicFlags::FLEXIBLE,
4456        )
4457    }
4458}
4459
4460#[must_use = "FIDL methods require a response to be sent"]
4461#[derive(Debug)]
4462pub struct CapabilityStoreDictionaryEnumerateResponder {
4463    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
4464    tx_id: u32,
4465}
4466
4467/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
4468/// if the responder is dropped without sending a response, so that the client
4469/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4470impl std::ops::Drop for CapabilityStoreDictionaryEnumerateResponder {
4471    fn drop(&mut self) {
4472        self.control_handle.shutdown();
4473        // Safety: drops once, never accessed again
4474        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4475    }
4476}
4477
4478impl fidl::endpoints::Responder for CapabilityStoreDictionaryEnumerateResponder {
4479    type ControlHandle = CapabilityStoreControlHandle;
4480
4481    fn control_handle(&self) -> &CapabilityStoreControlHandle {
4482        &self.control_handle
4483    }
4484
4485    fn drop_without_shutdown(mut self) {
4486        // Safety: drops once, never accessed again due to mem::forget
4487        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4488        // Prevent Drop from running (which would shut down the channel)
4489        std::mem::forget(self);
4490    }
4491}
4492
4493impl CapabilityStoreDictionaryEnumerateResponder {
4494    /// Sends a response to the FIDL transaction.
4495    ///
4496    /// Sets the channel to shutdown if an error occurs.
4497    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4498        let _result = self.send_raw(result);
4499        if _result.is_err() {
4500            self.control_handle.shutdown();
4501        }
4502        self.drop_without_shutdown();
4503        _result
4504    }
4505
4506    /// Similar to "send" but does not shutdown the channel if an error occurs.
4507    pub fn send_no_shutdown_on_err(
4508        self,
4509        mut result: Result<(), CapabilityStoreError>,
4510    ) -> Result<(), fidl::Error> {
4511        let _result = self.send_raw(result);
4512        self.drop_without_shutdown();
4513        _result
4514    }
4515
4516    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4517        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4518            fidl::encoding::EmptyStruct,
4519            CapabilityStoreError,
4520        >>(
4521            fidl::encoding::FlexibleResult::new(result),
4522            self.tx_id,
4523            0xd6279b6ced04641,
4524            fidl::encoding::DynamicFlags::FLEXIBLE,
4525        )
4526    }
4527}
4528
4529#[must_use = "FIDL methods require a response to be sent"]
4530#[derive(Debug)]
4531pub struct CapabilityStoreDictionaryDrainResponder {
4532    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
4533    tx_id: u32,
4534}
4535
4536/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
4537/// if the responder is dropped without sending a response, so that the client
4538/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4539impl std::ops::Drop for CapabilityStoreDictionaryDrainResponder {
4540    fn drop(&mut self) {
4541        self.control_handle.shutdown();
4542        // Safety: drops once, never accessed again
4543        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4544    }
4545}
4546
4547impl fidl::endpoints::Responder for CapabilityStoreDictionaryDrainResponder {
4548    type ControlHandle = CapabilityStoreControlHandle;
4549
4550    fn control_handle(&self) -> &CapabilityStoreControlHandle {
4551        &self.control_handle
4552    }
4553
4554    fn drop_without_shutdown(mut self) {
4555        // Safety: drops once, never accessed again due to mem::forget
4556        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4557        // Prevent Drop from running (which would shut down the channel)
4558        std::mem::forget(self);
4559    }
4560}
4561
4562impl CapabilityStoreDictionaryDrainResponder {
4563    /// Sends a response to the FIDL transaction.
4564    ///
4565    /// Sets the channel to shutdown if an error occurs.
4566    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4567        let _result = self.send_raw(result);
4568        if _result.is_err() {
4569            self.control_handle.shutdown();
4570        }
4571        self.drop_without_shutdown();
4572        _result
4573    }
4574
4575    /// Similar to "send" but does not shutdown the channel if an error occurs.
4576    pub fn send_no_shutdown_on_err(
4577        self,
4578        mut result: Result<(), CapabilityStoreError>,
4579    ) -> Result<(), fidl::Error> {
4580        let _result = self.send_raw(result);
4581        self.drop_without_shutdown();
4582        _result
4583    }
4584
4585    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4586        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4587            fidl::encoding::EmptyStruct,
4588            CapabilityStoreError,
4589        >>(
4590            fidl::encoding::FlexibleResult::new(result),
4591            self.tx_id,
4592            0x28a3a3f84d928cd8,
4593            fidl::encoding::DynamicFlags::FLEXIBLE,
4594        )
4595    }
4596}
4597
4598#[must_use = "FIDL methods require a response to be sent"]
4599#[derive(Debug)]
4600pub struct CapabilityStoreCreateServiceAggregateResponder {
4601    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
4602    tx_id: u32,
4603}
4604
4605/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
4606/// if the responder is dropped without sending a response, so that the client
4607/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4608impl std::ops::Drop for CapabilityStoreCreateServiceAggregateResponder {
4609    fn drop(&mut self) {
4610        self.control_handle.shutdown();
4611        // Safety: drops once, never accessed again
4612        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4613    }
4614}
4615
4616impl fidl::endpoints::Responder for CapabilityStoreCreateServiceAggregateResponder {
4617    type ControlHandle = CapabilityStoreControlHandle;
4618
4619    fn control_handle(&self) -> &CapabilityStoreControlHandle {
4620        &self.control_handle
4621    }
4622
4623    fn drop_without_shutdown(mut self) {
4624        // Safety: drops once, never accessed again due to mem::forget
4625        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4626        // Prevent Drop from running (which would shut down the channel)
4627        std::mem::forget(self);
4628    }
4629}
4630
4631impl CapabilityStoreCreateServiceAggregateResponder {
4632    /// Sends a response to the FIDL transaction.
4633    ///
4634    /// Sets the channel to shutdown if an error occurs.
4635    pub fn send(
4636        self,
4637        mut result: Result<DirConnector, CapabilityStoreError>,
4638    ) -> Result<(), fidl::Error> {
4639        let _result = self.send_raw(result);
4640        if _result.is_err() {
4641            self.control_handle.shutdown();
4642        }
4643        self.drop_without_shutdown();
4644        _result
4645    }
4646
4647    /// Similar to "send" but does not shutdown the channel if an error occurs.
4648    pub fn send_no_shutdown_on_err(
4649        self,
4650        mut result: Result<DirConnector, CapabilityStoreError>,
4651    ) -> Result<(), fidl::Error> {
4652        let _result = self.send_raw(result);
4653        self.drop_without_shutdown();
4654        _result
4655    }
4656
4657    fn send_raw(
4658        &self,
4659        mut result: Result<DirConnector, CapabilityStoreError>,
4660    ) -> Result<(), fidl::Error> {
4661        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4662            CapabilityStoreCreateServiceAggregateResponse,
4663            CapabilityStoreError,
4664        >>(
4665            fidl::encoding::FlexibleResult::new(
4666                result
4667                    .as_mut()
4668                    .map_err(|e| *e)
4669                    .map(|aggregate_dir_connector| (aggregate_dir_connector,)),
4670            ),
4671            self.tx_id,
4672            0x4584116c8085885a,
4673            fidl::encoding::DynamicFlags::FLEXIBLE,
4674        )
4675    }
4676}
4677
4678#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4679pub struct ConnectorRouterMarker;
4680
4681impl fidl::endpoints::ProtocolMarker for ConnectorRouterMarker {
4682    type Proxy = ConnectorRouterProxy;
4683    type RequestStream = ConnectorRouterRequestStream;
4684    #[cfg(target_os = "fuchsia")]
4685    type SynchronousProxy = ConnectorRouterSynchronousProxy;
4686
4687    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.ConnectorRouter";
4688}
4689impl fidl::endpoints::DiscoverableProtocolMarker for ConnectorRouterMarker {}
4690pub type ConnectorRouterRouteResult = Result<ConnectorRouterRouteResponse, RouterError>;
4691
4692pub trait ConnectorRouterProxyInterface: Send + Sync {
4693    type RouteResponseFut: std::future::Future<Output = Result<ConnectorRouterRouteResult, fidl::Error>>
4694        + Send;
4695    fn r#route(&self, payload: RouteRequest) -> Self::RouteResponseFut;
4696}
4697#[derive(Debug)]
4698#[cfg(target_os = "fuchsia")]
4699pub struct ConnectorRouterSynchronousProxy {
4700    client: fidl::client::sync::Client,
4701}
4702
4703#[cfg(target_os = "fuchsia")]
4704impl fidl::endpoints::SynchronousProxy for ConnectorRouterSynchronousProxy {
4705    type Proxy = ConnectorRouterProxy;
4706    type Protocol = ConnectorRouterMarker;
4707
4708    fn from_channel(inner: fidl::Channel) -> Self {
4709        Self::new(inner)
4710    }
4711
4712    fn into_channel(self) -> fidl::Channel {
4713        self.client.into_channel()
4714    }
4715
4716    fn as_channel(&self) -> &fidl::Channel {
4717        self.client.as_channel()
4718    }
4719}
4720
4721#[cfg(target_os = "fuchsia")]
4722impl ConnectorRouterSynchronousProxy {
4723    pub fn new(channel: fidl::Channel) -> Self {
4724        Self { client: fidl::client::sync::Client::new(channel) }
4725    }
4726
4727    pub fn into_channel(self) -> fidl::Channel {
4728        self.client.into_channel()
4729    }
4730
4731    /// Waits until an event arrives and returns it. It is safe for other
4732    /// threads to make concurrent requests while waiting for an event.
4733    pub fn wait_for_event(
4734        &self,
4735        deadline: zx::MonotonicInstant,
4736    ) -> Result<ConnectorRouterEvent, fidl::Error> {
4737        ConnectorRouterEvent::decode(self.client.wait_for_event::<ConnectorRouterMarker>(deadline)?)
4738    }
4739
4740    pub fn r#route(
4741        &self,
4742        mut payload: RouteRequest,
4743        ___deadline: zx::MonotonicInstant,
4744    ) -> Result<ConnectorRouterRouteResult, fidl::Error> {
4745        let _response = self.client.send_query::<
4746            RouteRequest,
4747            fidl::encoding::FlexibleResultType<ConnectorRouterRouteResponse, RouterError>,
4748            ConnectorRouterMarker,
4749        >(
4750            &mut payload,
4751            0x74dbb8bc13730766,
4752            fidl::encoding::DynamicFlags::FLEXIBLE,
4753            ___deadline,
4754        )?
4755        .into_result::<ConnectorRouterMarker>("route")?;
4756        Ok(_response.map(|x| x))
4757    }
4758}
4759
4760#[cfg(target_os = "fuchsia")]
4761impl From<ConnectorRouterSynchronousProxy> for zx::NullableHandle {
4762    fn from(value: ConnectorRouterSynchronousProxy) -> Self {
4763        value.into_channel().into()
4764    }
4765}
4766
4767#[cfg(target_os = "fuchsia")]
4768impl From<fidl::Channel> for ConnectorRouterSynchronousProxy {
4769    fn from(value: fidl::Channel) -> Self {
4770        Self::new(value)
4771    }
4772}
4773
4774#[cfg(target_os = "fuchsia")]
4775impl fidl::endpoints::FromClient for ConnectorRouterSynchronousProxy {
4776    type Protocol = ConnectorRouterMarker;
4777
4778    fn from_client(value: fidl::endpoints::ClientEnd<ConnectorRouterMarker>) -> Self {
4779        Self::new(value.into_channel())
4780    }
4781}
4782
4783#[derive(Debug, Clone)]
4784pub struct ConnectorRouterProxy {
4785    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
4786}
4787
4788impl fidl::endpoints::Proxy for ConnectorRouterProxy {
4789    type Protocol = ConnectorRouterMarker;
4790
4791    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
4792        Self::new(inner)
4793    }
4794
4795    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
4796        self.client.into_channel().map_err(|client| Self { client })
4797    }
4798
4799    fn as_channel(&self) -> &::fidl::AsyncChannel {
4800        self.client.as_channel()
4801    }
4802}
4803
4804impl ConnectorRouterProxy {
4805    /// Create a new Proxy for fuchsia.component.sandbox/ConnectorRouter.
4806    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
4807        let protocol_name = <ConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4808        Self { client: fidl::client::Client::new(channel, protocol_name) }
4809    }
4810
4811    /// Get a Stream of events from the remote end of the protocol.
4812    ///
4813    /// # Panics
4814    ///
4815    /// Panics if the event stream was already taken.
4816    pub fn take_event_stream(&self) -> ConnectorRouterEventStream {
4817        ConnectorRouterEventStream { event_receiver: self.client.take_event_receiver() }
4818    }
4819
4820    pub fn r#route(
4821        &self,
4822        mut payload: RouteRequest,
4823    ) -> fidl::client::QueryResponseFut<
4824        ConnectorRouterRouteResult,
4825        fidl::encoding::DefaultFuchsiaResourceDialect,
4826    > {
4827        ConnectorRouterProxyInterface::r#route(self, payload)
4828    }
4829}
4830
4831impl ConnectorRouterProxyInterface for ConnectorRouterProxy {
4832    type RouteResponseFut = fidl::client::QueryResponseFut<
4833        ConnectorRouterRouteResult,
4834        fidl::encoding::DefaultFuchsiaResourceDialect,
4835    >;
4836    fn r#route(&self, mut payload: RouteRequest) -> Self::RouteResponseFut {
4837        fn _decode(
4838            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4839        ) -> Result<ConnectorRouterRouteResult, fidl::Error> {
4840            let _response = fidl::client::decode_transaction_body::<
4841                fidl::encoding::FlexibleResultType<ConnectorRouterRouteResponse, RouterError>,
4842                fidl::encoding::DefaultFuchsiaResourceDialect,
4843                0x74dbb8bc13730766,
4844            >(_buf?)?
4845            .into_result::<ConnectorRouterMarker>("route")?;
4846            Ok(_response.map(|x| x))
4847        }
4848        self.client.send_query_and_decode::<RouteRequest, ConnectorRouterRouteResult>(
4849            &mut payload,
4850            0x74dbb8bc13730766,
4851            fidl::encoding::DynamicFlags::FLEXIBLE,
4852            _decode,
4853        )
4854    }
4855}
4856
4857pub struct ConnectorRouterEventStream {
4858    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
4859}
4860
4861impl std::marker::Unpin for ConnectorRouterEventStream {}
4862
4863impl futures::stream::FusedStream for ConnectorRouterEventStream {
4864    fn is_terminated(&self) -> bool {
4865        self.event_receiver.is_terminated()
4866    }
4867}
4868
4869impl futures::Stream for ConnectorRouterEventStream {
4870    type Item = Result<ConnectorRouterEvent, fidl::Error>;
4871
4872    fn poll_next(
4873        mut self: std::pin::Pin<&mut Self>,
4874        cx: &mut std::task::Context<'_>,
4875    ) -> std::task::Poll<Option<Self::Item>> {
4876        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4877            &mut self.event_receiver,
4878            cx
4879        )?) {
4880            Some(buf) => std::task::Poll::Ready(Some(ConnectorRouterEvent::decode(buf))),
4881            None => std::task::Poll::Ready(None),
4882        }
4883    }
4884}
4885
4886#[derive(Debug)]
4887pub enum ConnectorRouterEvent {
4888    #[non_exhaustive]
4889    _UnknownEvent {
4890        /// Ordinal of the event that was sent.
4891        ordinal: u64,
4892    },
4893}
4894
4895impl ConnectorRouterEvent {
4896    /// Decodes a message buffer as a [`ConnectorRouterEvent`].
4897    fn decode(
4898        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4899    ) -> Result<ConnectorRouterEvent, fidl::Error> {
4900        let (bytes, _handles) = buf.split_mut();
4901        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4902        debug_assert_eq!(tx_header.tx_id, 0);
4903        match tx_header.ordinal {
4904            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4905                Ok(ConnectorRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
4906            }
4907            _ => Err(fidl::Error::UnknownOrdinal {
4908                ordinal: tx_header.ordinal,
4909                protocol_name:
4910                    <ConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4911            }),
4912        }
4913    }
4914}
4915
4916/// A Stream of incoming requests for fuchsia.component.sandbox/ConnectorRouter.
4917pub struct ConnectorRouterRequestStream {
4918    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4919    is_terminated: bool,
4920}
4921
4922impl std::marker::Unpin for ConnectorRouterRequestStream {}
4923
4924impl futures::stream::FusedStream for ConnectorRouterRequestStream {
4925    fn is_terminated(&self) -> bool {
4926        self.is_terminated
4927    }
4928}
4929
4930impl fidl::endpoints::RequestStream for ConnectorRouterRequestStream {
4931    type Protocol = ConnectorRouterMarker;
4932    type ControlHandle = ConnectorRouterControlHandle;
4933
4934    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
4935        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4936    }
4937
4938    fn control_handle(&self) -> Self::ControlHandle {
4939        ConnectorRouterControlHandle { inner: self.inner.clone() }
4940    }
4941
4942    fn into_inner(
4943        self,
4944    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
4945    {
4946        (self.inner, self.is_terminated)
4947    }
4948
4949    fn from_inner(
4950        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4951        is_terminated: bool,
4952    ) -> Self {
4953        Self { inner, is_terminated }
4954    }
4955}
4956
4957impl futures::Stream for ConnectorRouterRequestStream {
4958    type Item = Result<ConnectorRouterRequest, fidl::Error>;
4959
4960    fn poll_next(
4961        mut self: std::pin::Pin<&mut Self>,
4962        cx: &mut std::task::Context<'_>,
4963    ) -> std::task::Poll<Option<Self::Item>> {
4964        let this = &mut *self;
4965        if this.inner.check_shutdown(cx) {
4966            this.is_terminated = true;
4967            return std::task::Poll::Ready(None);
4968        }
4969        if this.is_terminated {
4970            panic!("polled ConnectorRouterRequestStream after completion");
4971        }
4972        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4973            |bytes, handles| {
4974                match this.inner.channel().read_etc(cx, bytes, handles) {
4975                    std::task::Poll::Ready(Ok(())) => {}
4976                    std::task::Poll::Pending => return std::task::Poll::Pending,
4977                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4978                        this.is_terminated = true;
4979                        return std::task::Poll::Ready(None);
4980                    }
4981                    std::task::Poll::Ready(Err(e)) => {
4982                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4983                            e.into(),
4984                        ))));
4985                    }
4986                }
4987
4988                // A message has been received from the channel
4989                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4990
4991                std::task::Poll::Ready(Some(match header.ordinal {
4992                    0x74dbb8bc13730766 => {
4993                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4994                        let mut req = fidl::new_empty!(
4995                            RouteRequest,
4996                            fidl::encoding::DefaultFuchsiaResourceDialect
4997                        );
4998                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RouteRequest>(&header, _body_bytes, handles, &mut req)?;
4999                        let control_handle =
5000                            ConnectorRouterControlHandle { inner: this.inner.clone() };
5001                        Ok(ConnectorRouterRequest::Route {
5002                            payload: req,
5003                            responder: ConnectorRouterRouteResponder {
5004                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5005                                tx_id: header.tx_id,
5006                            },
5007                        })
5008                    }
5009                    _ if header.tx_id == 0
5010                        && header
5011                            .dynamic_flags()
5012                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5013                    {
5014                        Ok(ConnectorRouterRequest::_UnknownMethod {
5015                            ordinal: header.ordinal,
5016                            control_handle: ConnectorRouterControlHandle {
5017                                inner: this.inner.clone(),
5018                            },
5019                            method_type: fidl::MethodType::OneWay,
5020                        })
5021                    }
5022                    _ if header
5023                        .dynamic_flags()
5024                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5025                    {
5026                        this.inner.send_framework_err(
5027                            fidl::encoding::FrameworkErr::UnknownMethod,
5028                            header.tx_id,
5029                            header.ordinal,
5030                            header.dynamic_flags(),
5031                            (bytes, handles),
5032                        )?;
5033                        Ok(ConnectorRouterRequest::_UnknownMethod {
5034                            ordinal: header.ordinal,
5035                            control_handle: ConnectorRouterControlHandle {
5036                                inner: this.inner.clone(),
5037                            },
5038                            method_type: fidl::MethodType::TwoWay,
5039                        })
5040                    }
5041                    _ => Err(fidl::Error::UnknownOrdinal {
5042                        ordinal: header.ordinal,
5043                        protocol_name:
5044                            <ConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5045                    }),
5046                }))
5047            },
5048        )
5049    }
5050}
5051
5052#[derive(Debug)]
5053pub enum ConnectorRouterRequest {
5054    Route {
5055        payload: RouteRequest,
5056        responder: ConnectorRouterRouteResponder,
5057    },
5058    /// An interaction was received which does not match any known method.
5059    #[non_exhaustive]
5060    _UnknownMethod {
5061        /// Ordinal of the method that was called.
5062        ordinal: u64,
5063        control_handle: ConnectorRouterControlHandle,
5064        method_type: fidl::MethodType,
5065    },
5066}
5067
5068impl ConnectorRouterRequest {
5069    #[allow(irrefutable_let_patterns)]
5070    pub fn into_route(self) -> Option<(RouteRequest, ConnectorRouterRouteResponder)> {
5071        if let ConnectorRouterRequest::Route { payload, responder } = self {
5072            Some((payload, responder))
5073        } else {
5074            None
5075        }
5076    }
5077
5078    /// Name of the method defined in FIDL
5079    pub fn method_name(&self) -> &'static str {
5080        match *self {
5081            ConnectorRouterRequest::Route { .. } => "route",
5082            ConnectorRouterRequest::_UnknownMethod {
5083                method_type: fidl::MethodType::OneWay,
5084                ..
5085            } => "unknown one-way method",
5086            ConnectorRouterRequest::_UnknownMethod {
5087                method_type: fidl::MethodType::TwoWay,
5088                ..
5089            } => "unknown two-way method",
5090        }
5091    }
5092}
5093
5094#[derive(Debug, Clone)]
5095pub struct ConnectorRouterControlHandle {
5096    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5097}
5098
5099impl fidl::endpoints::ControlHandle for ConnectorRouterControlHandle {
5100    fn shutdown(&self) {
5101        self.inner.shutdown()
5102    }
5103
5104    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
5105        self.inner.shutdown_with_epitaph(status)
5106    }
5107
5108    fn is_closed(&self) -> bool {
5109        self.inner.channel().is_closed()
5110    }
5111    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
5112        self.inner.channel().on_closed()
5113    }
5114
5115    #[cfg(target_os = "fuchsia")]
5116    fn signal_peer(
5117        &self,
5118        clear_mask: zx::Signals,
5119        set_mask: zx::Signals,
5120    ) -> Result<(), zx_status::Status> {
5121        use fidl::Peered;
5122        self.inner.channel().signal_peer(clear_mask, set_mask)
5123    }
5124}
5125
5126impl ConnectorRouterControlHandle {}
5127
5128#[must_use = "FIDL methods require a response to be sent"]
5129#[derive(Debug)]
5130pub struct ConnectorRouterRouteResponder {
5131    control_handle: std::mem::ManuallyDrop<ConnectorRouterControlHandle>,
5132    tx_id: u32,
5133}
5134
5135/// Set the the channel to be shutdown (see [`ConnectorRouterControlHandle::shutdown`])
5136/// if the responder is dropped without sending a response, so that the client
5137/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5138impl std::ops::Drop for ConnectorRouterRouteResponder {
5139    fn drop(&mut self) {
5140        self.control_handle.shutdown();
5141        // Safety: drops once, never accessed again
5142        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5143    }
5144}
5145
5146impl fidl::endpoints::Responder for ConnectorRouterRouteResponder {
5147    type ControlHandle = ConnectorRouterControlHandle;
5148
5149    fn control_handle(&self) -> &ConnectorRouterControlHandle {
5150        &self.control_handle
5151    }
5152
5153    fn drop_without_shutdown(mut self) {
5154        // Safety: drops once, never accessed again due to mem::forget
5155        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5156        // Prevent Drop from running (which would shut down the channel)
5157        std::mem::forget(self);
5158    }
5159}
5160
5161impl ConnectorRouterRouteResponder {
5162    /// Sends a response to the FIDL transaction.
5163    ///
5164    /// Sets the channel to shutdown if an error occurs.
5165    pub fn send(
5166        self,
5167        mut result: Result<ConnectorRouterRouteResponse, RouterError>,
5168    ) -> Result<(), fidl::Error> {
5169        let _result = self.send_raw(result);
5170        if _result.is_err() {
5171            self.control_handle.shutdown();
5172        }
5173        self.drop_without_shutdown();
5174        _result
5175    }
5176
5177    /// Similar to "send" but does not shutdown the channel if an error occurs.
5178    pub fn send_no_shutdown_on_err(
5179        self,
5180        mut result: Result<ConnectorRouterRouteResponse, RouterError>,
5181    ) -> Result<(), fidl::Error> {
5182        let _result = self.send_raw(result);
5183        self.drop_without_shutdown();
5184        _result
5185    }
5186
5187    fn send_raw(
5188        &self,
5189        mut result: Result<ConnectorRouterRouteResponse, RouterError>,
5190    ) -> Result<(), fidl::Error> {
5191        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
5192            ConnectorRouterRouteResponse,
5193            RouterError,
5194        >>(
5195            fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
5196            self.tx_id,
5197            0x74dbb8bc13730766,
5198            fidl::encoding::DynamicFlags::FLEXIBLE,
5199        )
5200    }
5201}
5202
5203#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5204pub struct DataRouterMarker;
5205
5206impl fidl::endpoints::ProtocolMarker for DataRouterMarker {
5207    type Proxy = DataRouterProxy;
5208    type RequestStream = DataRouterRequestStream;
5209    #[cfg(target_os = "fuchsia")]
5210    type SynchronousProxy = DataRouterSynchronousProxy;
5211
5212    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.DataRouter";
5213}
5214impl fidl::endpoints::DiscoverableProtocolMarker for DataRouterMarker {}
5215pub type DataRouterRouteResult = Result<DataRouterRouteResponse, RouterError>;
5216
5217pub trait DataRouterProxyInterface: Send + Sync {
5218    type RouteResponseFut: std::future::Future<Output = Result<DataRouterRouteResult, fidl::Error>>
5219        + Send;
5220    fn r#route(&self, payload: RouteRequest) -> Self::RouteResponseFut;
5221}
5222#[derive(Debug)]
5223#[cfg(target_os = "fuchsia")]
5224pub struct DataRouterSynchronousProxy {
5225    client: fidl::client::sync::Client,
5226}
5227
5228#[cfg(target_os = "fuchsia")]
5229impl fidl::endpoints::SynchronousProxy for DataRouterSynchronousProxy {
5230    type Proxy = DataRouterProxy;
5231    type Protocol = DataRouterMarker;
5232
5233    fn from_channel(inner: fidl::Channel) -> Self {
5234        Self::new(inner)
5235    }
5236
5237    fn into_channel(self) -> fidl::Channel {
5238        self.client.into_channel()
5239    }
5240
5241    fn as_channel(&self) -> &fidl::Channel {
5242        self.client.as_channel()
5243    }
5244}
5245
5246#[cfg(target_os = "fuchsia")]
5247impl DataRouterSynchronousProxy {
5248    pub fn new(channel: fidl::Channel) -> Self {
5249        Self { client: fidl::client::sync::Client::new(channel) }
5250    }
5251
5252    pub fn into_channel(self) -> fidl::Channel {
5253        self.client.into_channel()
5254    }
5255
5256    /// Waits until an event arrives and returns it. It is safe for other
5257    /// threads to make concurrent requests while waiting for an event.
5258    pub fn wait_for_event(
5259        &self,
5260        deadline: zx::MonotonicInstant,
5261    ) -> Result<DataRouterEvent, fidl::Error> {
5262        DataRouterEvent::decode(self.client.wait_for_event::<DataRouterMarker>(deadline)?)
5263    }
5264
5265    pub fn r#route(
5266        &self,
5267        mut payload: RouteRequest,
5268        ___deadline: zx::MonotonicInstant,
5269    ) -> Result<DataRouterRouteResult, fidl::Error> {
5270        let _response = self.client.send_query::<
5271            RouteRequest,
5272            fidl::encoding::FlexibleResultType<DataRouterRouteResponse, RouterError>,
5273            DataRouterMarker,
5274        >(
5275            &mut payload,
5276            0x2e87dc44dfc53804,
5277            fidl::encoding::DynamicFlags::FLEXIBLE,
5278            ___deadline,
5279        )?
5280        .into_result::<DataRouterMarker>("route")?;
5281        Ok(_response.map(|x| x))
5282    }
5283}
5284
5285#[cfg(target_os = "fuchsia")]
5286impl From<DataRouterSynchronousProxy> for zx::NullableHandle {
5287    fn from(value: DataRouterSynchronousProxy) -> Self {
5288        value.into_channel().into()
5289    }
5290}
5291
5292#[cfg(target_os = "fuchsia")]
5293impl From<fidl::Channel> for DataRouterSynchronousProxy {
5294    fn from(value: fidl::Channel) -> Self {
5295        Self::new(value)
5296    }
5297}
5298
5299#[cfg(target_os = "fuchsia")]
5300impl fidl::endpoints::FromClient for DataRouterSynchronousProxy {
5301    type Protocol = DataRouterMarker;
5302
5303    fn from_client(value: fidl::endpoints::ClientEnd<DataRouterMarker>) -> Self {
5304        Self::new(value.into_channel())
5305    }
5306}
5307
5308#[derive(Debug, Clone)]
5309pub struct DataRouterProxy {
5310    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
5311}
5312
5313impl fidl::endpoints::Proxy for DataRouterProxy {
5314    type Protocol = DataRouterMarker;
5315
5316    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
5317        Self::new(inner)
5318    }
5319
5320    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
5321        self.client.into_channel().map_err(|client| Self { client })
5322    }
5323
5324    fn as_channel(&self) -> &::fidl::AsyncChannel {
5325        self.client.as_channel()
5326    }
5327}
5328
5329impl DataRouterProxy {
5330    /// Create a new Proxy for fuchsia.component.sandbox/DataRouter.
5331    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5332        let protocol_name = <DataRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5333        Self { client: fidl::client::Client::new(channel, protocol_name) }
5334    }
5335
5336    /// Get a Stream of events from the remote end of the protocol.
5337    ///
5338    /// # Panics
5339    ///
5340    /// Panics if the event stream was already taken.
5341    pub fn take_event_stream(&self) -> DataRouterEventStream {
5342        DataRouterEventStream { event_receiver: self.client.take_event_receiver() }
5343    }
5344
5345    pub fn r#route(
5346        &self,
5347        mut payload: RouteRequest,
5348    ) -> fidl::client::QueryResponseFut<
5349        DataRouterRouteResult,
5350        fidl::encoding::DefaultFuchsiaResourceDialect,
5351    > {
5352        DataRouterProxyInterface::r#route(self, payload)
5353    }
5354}
5355
5356impl DataRouterProxyInterface for DataRouterProxy {
5357    type RouteResponseFut = fidl::client::QueryResponseFut<
5358        DataRouterRouteResult,
5359        fidl::encoding::DefaultFuchsiaResourceDialect,
5360    >;
5361    fn r#route(&self, mut payload: RouteRequest) -> Self::RouteResponseFut {
5362        fn _decode(
5363            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5364        ) -> Result<DataRouterRouteResult, fidl::Error> {
5365            let _response = fidl::client::decode_transaction_body::<
5366                fidl::encoding::FlexibleResultType<DataRouterRouteResponse, RouterError>,
5367                fidl::encoding::DefaultFuchsiaResourceDialect,
5368                0x2e87dc44dfc53804,
5369            >(_buf?)?
5370            .into_result::<DataRouterMarker>("route")?;
5371            Ok(_response.map(|x| x))
5372        }
5373        self.client.send_query_and_decode::<RouteRequest, DataRouterRouteResult>(
5374            &mut payload,
5375            0x2e87dc44dfc53804,
5376            fidl::encoding::DynamicFlags::FLEXIBLE,
5377            _decode,
5378        )
5379    }
5380}
5381
5382pub struct DataRouterEventStream {
5383    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
5384}
5385
5386impl std::marker::Unpin for DataRouterEventStream {}
5387
5388impl futures::stream::FusedStream for DataRouterEventStream {
5389    fn is_terminated(&self) -> bool {
5390        self.event_receiver.is_terminated()
5391    }
5392}
5393
5394impl futures::Stream for DataRouterEventStream {
5395    type Item = Result<DataRouterEvent, fidl::Error>;
5396
5397    fn poll_next(
5398        mut self: std::pin::Pin<&mut Self>,
5399        cx: &mut std::task::Context<'_>,
5400    ) -> std::task::Poll<Option<Self::Item>> {
5401        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5402            &mut self.event_receiver,
5403            cx
5404        )?) {
5405            Some(buf) => std::task::Poll::Ready(Some(DataRouterEvent::decode(buf))),
5406            None => std::task::Poll::Ready(None),
5407        }
5408    }
5409}
5410
5411#[derive(Debug)]
5412pub enum DataRouterEvent {
5413    #[non_exhaustive]
5414    _UnknownEvent {
5415        /// Ordinal of the event that was sent.
5416        ordinal: u64,
5417    },
5418}
5419
5420impl DataRouterEvent {
5421    /// Decodes a message buffer as a [`DataRouterEvent`].
5422    fn decode(
5423        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5424    ) -> Result<DataRouterEvent, fidl::Error> {
5425        let (bytes, _handles) = buf.split_mut();
5426        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5427        debug_assert_eq!(tx_header.tx_id, 0);
5428        match tx_header.ordinal {
5429            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
5430                Ok(DataRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
5431            }
5432            _ => Err(fidl::Error::UnknownOrdinal {
5433                ordinal: tx_header.ordinal,
5434                protocol_name: <DataRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5435            }),
5436        }
5437    }
5438}
5439
5440/// A Stream of incoming requests for fuchsia.component.sandbox/DataRouter.
5441pub struct DataRouterRequestStream {
5442    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5443    is_terminated: bool,
5444}
5445
5446impl std::marker::Unpin for DataRouterRequestStream {}
5447
5448impl futures::stream::FusedStream for DataRouterRequestStream {
5449    fn is_terminated(&self) -> bool {
5450        self.is_terminated
5451    }
5452}
5453
5454impl fidl::endpoints::RequestStream for DataRouterRequestStream {
5455    type Protocol = DataRouterMarker;
5456    type ControlHandle = DataRouterControlHandle;
5457
5458    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5459        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5460    }
5461
5462    fn control_handle(&self) -> Self::ControlHandle {
5463        DataRouterControlHandle { inner: self.inner.clone() }
5464    }
5465
5466    fn into_inner(
5467        self,
5468    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5469    {
5470        (self.inner, self.is_terminated)
5471    }
5472
5473    fn from_inner(
5474        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5475        is_terminated: bool,
5476    ) -> Self {
5477        Self { inner, is_terminated }
5478    }
5479}
5480
5481impl futures::Stream for DataRouterRequestStream {
5482    type Item = Result<DataRouterRequest, fidl::Error>;
5483
5484    fn poll_next(
5485        mut self: std::pin::Pin<&mut Self>,
5486        cx: &mut std::task::Context<'_>,
5487    ) -> std::task::Poll<Option<Self::Item>> {
5488        let this = &mut *self;
5489        if this.inner.check_shutdown(cx) {
5490            this.is_terminated = true;
5491            return std::task::Poll::Ready(None);
5492        }
5493        if this.is_terminated {
5494            panic!("polled DataRouterRequestStream after completion");
5495        }
5496        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
5497            |bytes, handles| {
5498                match this.inner.channel().read_etc(cx, bytes, handles) {
5499                    std::task::Poll::Ready(Ok(())) => {}
5500                    std::task::Poll::Pending => return std::task::Poll::Pending,
5501                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
5502                        this.is_terminated = true;
5503                        return std::task::Poll::Ready(None);
5504                    }
5505                    std::task::Poll::Ready(Err(e)) => {
5506                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5507                            e.into(),
5508                        ))));
5509                    }
5510                }
5511
5512                // A message has been received from the channel
5513                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5514
5515                std::task::Poll::Ready(Some(match header.ordinal {
5516                    0x2e87dc44dfc53804 => {
5517                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5518                        let mut req = fidl::new_empty!(
5519                            RouteRequest,
5520                            fidl::encoding::DefaultFuchsiaResourceDialect
5521                        );
5522                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RouteRequest>(&header, _body_bytes, handles, &mut req)?;
5523                        let control_handle = DataRouterControlHandle { inner: this.inner.clone() };
5524                        Ok(DataRouterRequest::Route {
5525                            payload: req,
5526                            responder: DataRouterRouteResponder {
5527                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5528                                tx_id: header.tx_id,
5529                            },
5530                        })
5531                    }
5532                    _ if header.tx_id == 0
5533                        && header
5534                            .dynamic_flags()
5535                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5536                    {
5537                        Ok(DataRouterRequest::_UnknownMethod {
5538                            ordinal: header.ordinal,
5539                            control_handle: DataRouterControlHandle { inner: this.inner.clone() },
5540                            method_type: fidl::MethodType::OneWay,
5541                        })
5542                    }
5543                    _ if header
5544                        .dynamic_flags()
5545                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5546                    {
5547                        this.inner.send_framework_err(
5548                            fidl::encoding::FrameworkErr::UnknownMethod,
5549                            header.tx_id,
5550                            header.ordinal,
5551                            header.dynamic_flags(),
5552                            (bytes, handles),
5553                        )?;
5554                        Ok(DataRouterRequest::_UnknownMethod {
5555                            ordinal: header.ordinal,
5556                            control_handle: DataRouterControlHandle { inner: this.inner.clone() },
5557                            method_type: fidl::MethodType::TwoWay,
5558                        })
5559                    }
5560                    _ => Err(fidl::Error::UnknownOrdinal {
5561                        ordinal: header.ordinal,
5562                        protocol_name:
5563                            <DataRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5564                    }),
5565                }))
5566            },
5567        )
5568    }
5569}
5570
5571#[derive(Debug)]
5572pub enum DataRouterRequest {
5573    Route {
5574        payload: RouteRequest,
5575        responder: DataRouterRouteResponder,
5576    },
5577    /// An interaction was received which does not match any known method.
5578    #[non_exhaustive]
5579    _UnknownMethod {
5580        /// Ordinal of the method that was called.
5581        ordinal: u64,
5582        control_handle: DataRouterControlHandle,
5583        method_type: fidl::MethodType,
5584    },
5585}
5586
5587impl DataRouterRequest {
5588    #[allow(irrefutable_let_patterns)]
5589    pub fn into_route(self) -> Option<(RouteRequest, DataRouterRouteResponder)> {
5590        if let DataRouterRequest::Route { payload, responder } = self {
5591            Some((payload, responder))
5592        } else {
5593            None
5594        }
5595    }
5596
5597    /// Name of the method defined in FIDL
5598    pub fn method_name(&self) -> &'static str {
5599        match *self {
5600            DataRouterRequest::Route { .. } => "route",
5601            DataRouterRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
5602                "unknown one-way method"
5603            }
5604            DataRouterRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
5605                "unknown two-way method"
5606            }
5607        }
5608    }
5609}
5610
5611#[derive(Debug, Clone)]
5612pub struct DataRouterControlHandle {
5613    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5614}
5615
5616impl fidl::endpoints::ControlHandle for DataRouterControlHandle {
5617    fn shutdown(&self) {
5618        self.inner.shutdown()
5619    }
5620
5621    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
5622        self.inner.shutdown_with_epitaph(status)
5623    }
5624
5625    fn is_closed(&self) -> bool {
5626        self.inner.channel().is_closed()
5627    }
5628    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
5629        self.inner.channel().on_closed()
5630    }
5631
5632    #[cfg(target_os = "fuchsia")]
5633    fn signal_peer(
5634        &self,
5635        clear_mask: zx::Signals,
5636        set_mask: zx::Signals,
5637    ) -> Result<(), zx_status::Status> {
5638        use fidl::Peered;
5639        self.inner.channel().signal_peer(clear_mask, set_mask)
5640    }
5641}
5642
5643impl DataRouterControlHandle {}
5644
5645#[must_use = "FIDL methods require a response to be sent"]
5646#[derive(Debug)]
5647pub struct DataRouterRouteResponder {
5648    control_handle: std::mem::ManuallyDrop<DataRouterControlHandle>,
5649    tx_id: u32,
5650}
5651
5652/// Set the the channel to be shutdown (see [`DataRouterControlHandle::shutdown`])
5653/// if the responder is dropped without sending a response, so that the client
5654/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5655impl std::ops::Drop for DataRouterRouteResponder {
5656    fn drop(&mut self) {
5657        self.control_handle.shutdown();
5658        // Safety: drops once, never accessed again
5659        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5660    }
5661}
5662
5663impl fidl::endpoints::Responder for DataRouterRouteResponder {
5664    type ControlHandle = DataRouterControlHandle;
5665
5666    fn control_handle(&self) -> &DataRouterControlHandle {
5667        &self.control_handle
5668    }
5669
5670    fn drop_without_shutdown(mut self) {
5671        // Safety: drops once, never accessed again due to mem::forget
5672        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5673        // Prevent Drop from running (which would shut down the channel)
5674        std::mem::forget(self);
5675    }
5676}
5677
5678impl DataRouterRouteResponder {
5679    /// Sends a response to the FIDL transaction.
5680    ///
5681    /// Sets the channel to shutdown if an error occurs.
5682    pub fn send(
5683        self,
5684        mut result: Result<DataRouterRouteResponse, RouterError>,
5685    ) -> Result<(), fidl::Error> {
5686        let _result = self.send_raw(result);
5687        if _result.is_err() {
5688            self.control_handle.shutdown();
5689        }
5690        self.drop_without_shutdown();
5691        _result
5692    }
5693
5694    /// Similar to "send" but does not shutdown the channel if an error occurs.
5695    pub fn send_no_shutdown_on_err(
5696        self,
5697        mut result: Result<DataRouterRouteResponse, RouterError>,
5698    ) -> Result<(), fidl::Error> {
5699        let _result = self.send_raw(result);
5700        self.drop_without_shutdown();
5701        _result
5702    }
5703
5704    fn send_raw(
5705        &self,
5706        mut result: Result<DataRouterRouteResponse, RouterError>,
5707    ) -> Result<(), fidl::Error> {
5708        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
5709            DataRouterRouteResponse,
5710            RouterError,
5711        >>(
5712            fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
5713            self.tx_id,
5714            0x2e87dc44dfc53804,
5715            fidl::encoding::DynamicFlags::FLEXIBLE,
5716        )
5717    }
5718}
5719
5720#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5721pub struct DictionaryMarker;
5722
5723impl fidl::endpoints::ProtocolMarker for DictionaryMarker {
5724    type Proxy = DictionaryProxy;
5725    type RequestStream = DictionaryRequestStream;
5726    #[cfg(target_os = "fuchsia")]
5727    type SynchronousProxy = DictionarySynchronousProxy;
5728
5729    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.Dictionary";
5730}
5731impl fidl::endpoints::DiscoverableProtocolMarker for DictionaryMarker {}
5732
5733pub trait DictionaryProxyInterface: Send + Sync {}
5734#[derive(Debug)]
5735#[cfg(target_os = "fuchsia")]
5736pub struct DictionarySynchronousProxy {
5737    client: fidl::client::sync::Client,
5738}
5739
5740#[cfg(target_os = "fuchsia")]
5741impl fidl::endpoints::SynchronousProxy for DictionarySynchronousProxy {
5742    type Proxy = DictionaryProxy;
5743    type Protocol = DictionaryMarker;
5744
5745    fn from_channel(inner: fidl::Channel) -> Self {
5746        Self::new(inner)
5747    }
5748
5749    fn into_channel(self) -> fidl::Channel {
5750        self.client.into_channel()
5751    }
5752
5753    fn as_channel(&self) -> &fidl::Channel {
5754        self.client.as_channel()
5755    }
5756}
5757
5758#[cfg(target_os = "fuchsia")]
5759impl DictionarySynchronousProxy {
5760    pub fn new(channel: fidl::Channel) -> Self {
5761        Self { client: fidl::client::sync::Client::new(channel) }
5762    }
5763
5764    pub fn into_channel(self) -> fidl::Channel {
5765        self.client.into_channel()
5766    }
5767
5768    /// Waits until an event arrives and returns it. It is safe for other
5769    /// threads to make concurrent requests while waiting for an event.
5770    pub fn wait_for_event(
5771        &self,
5772        deadline: zx::MonotonicInstant,
5773    ) -> Result<DictionaryEvent, fidl::Error> {
5774        DictionaryEvent::decode(self.client.wait_for_event::<DictionaryMarker>(deadline)?)
5775    }
5776}
5777
5778#[cfg(target_os = "fuchsia")]
5779impl From<DictionarySynchronousProxy> for zx::NullableHandle {
5780    fn from(value: DictionarySynchronousProxy) -> Self {
5781        value.into_channel().into()
5782    }
5783}
5784
5785#[cfg(target_os = "fuchsia")]
5786impl From<fidl::Channel> for DictionarySynchronousProxy {
5787    fn from(value: fidl::Channel) -> Self {
5788        Self::new(value)
5789    }
5790}
5791
5792#[cfg(target_os = "fuchsia")]
5793impl fidl::endpoints::FromClient for DictionarySynchronousProxy {
5794    type Protocol = DictionaryMarker;
5795
5796    fn from_client(value: fidl::endpoints::ClientEnd<DictionaryMarker>) -> Self {
5797        Self::new(value.into_channel())
5798    }
5799}
5800
5801#[derive(Debug, Clone)]
5802pub struct DictionaryProxy {
5803    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
5804}
5805
5806impl fidl::endpoints::Proxy for DictionaryProxy {
5807    type Protocol = DictionaryMarker;
5808
5809    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
5810        Self::new(inner)
5811    }
5812
5813    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
5814        self.client.into_channel().map_err(|client| Self { client })
5815    }
5816
5817    fn as_channel(&self) -> &::fidl::AsyncChannel {
5818        self.client.as_channel()
5819    }
5820}
5821
5822impl DictionaryProxy {
5823    /// Create a new Proxy for fuchsia.component.sandbox/Dictionary.
5824    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5825        let protocol_name = <DictionaryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5826        Self { client: fidl::client::Client::new(channel, protocol_name) }
5827    }
5828
5829    /// Get a Stream of events from the remote end of the protocol.
5830    ///
5831    /// # Panics
5832    ///
5833    /// Panics if the event stream was already taken.
5834    pub fn take_event_stream(&self) -> DictionaryEventStream {
5835        DictionaryEventStream { event_receiver: self.client.take_event_receiver() }
5836    }
5837}
5838
5839impl DictionaryProxyInterface for DictionaryProxy {}
5840
5841pub struct DictionaryEventStream {
5842    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
5843}
5844
5845impl std::marker::Unpin for DictionaryEventStream {}
5846
5847impl futures::stream::FusedStream for DictionaryEventStream {
5848    fn is_terminated(&self) -> bool {
5849        self.event_receiver.is_terminated()
5850    }
5851}
5852
5853impl futures::Stream for DictionaryEventStream {
5854    type Item = Result<DictionaryEvent, fidl::Error>;
5855
5856    fn poll_next(
5857        mut self: std::pin::Pin<&mut Self>,
5858        cx: &mut std::task::Context<'_>,
5859    ) -> std::task::Poll<Option<Self::Item>> {
5860        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5861            &mut self.event_receiver,
5862            cx
5863        )?) {
5864            Some(buf) => std::task::Poll::Ready(Some(DictionaryEvent::decode(buf))),
5865            None => std::task::Poll::Ready(None),
5866        }
5867    }
5868}
5869
5870#[derive(Debug)]
5871pub enum DictionaryEvent {
5872    #[non_exhaustive]
5873    _UnknownEvent {
5874        /// Ordinal of the event that was sent.
5875        ordinal: u64,
5876    },
5877}
5878
5879impl DictionaryEvent {
5880    /// Decodes a message buffer as a [`DictionaryEvent`].
5881    fn decode(
5882        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5883    ) -> Result<DictionaryEvent, fidl::Error> {
5884        let (bytes, _handles) = buf.split_mut();
5885        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5886        debug_assert_eq!(tx_header.tx_id, 0);
5887        match tx_header.ordinal {
5888            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
5889                Ok(DictionaryEvent::_UnknownEvent { ordinal: tx_header.ordinal })
5890            }
5891            _ => Err(fidl::Error::UnknownOrdinal {
5892                ordinal: tx_header.ordinal,
5893                protocol_name: <DictionaryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5894            }),
5895        }
5896    }
5897}
5898
5899/// A Stream of incoming requests for fuchsia.component.sandbox/Dictionary.
5900pub struct DictionaryRequestStream {
5901    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5902    is_terminated: bool,
5903}
5904
5905impl std::marker::Unpin for DictionaryRequestStream {}
5906
5907impl futures::stream::FusedStream for DictionaryRequestStream {
5908    fn is_terminated(&self) -> bool {
5909        self.is_terminated
5910    }
5911}
5912
5913impl fidl::endpoints::RequestStream for DictionaryRequestStream {
5914    type Protocol = DictionaryMarker;
5915    type ControlHandle = DictionaryControlHandle;
5916
5917    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5918        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5919    }
5920
5921    fn control_handle(&self) -> Self::ControlHandle {
5922        DictionaryControlHandle { inner: self.inner.clone() }
5923    }
5924
5925    fn into_inner(
5926        self,
5927    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5928    {
5929        (self.inner, self.is_terminated)
5930    }
5931
5932    fn from_inner(
5933        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5934        is_terminated: bool,
5935    ) -> Self {
5936        Self { inner, is_terminated }
5937    }
5938}
5939
5940impl futures::Stream for DictionaryRequestStream {
5941    type Item = Result<DictionaryRequest, fidl::Error>;
5942
5943    fn poll_next(
5944        mut self: std::pin::Pin<&mut Self>,
5945        cx: &mut std::task::Context<'_>,
5946    ) -> std::task::Poll<Option<Self::Item>> {
5947        let this = &mut *self;
5948        if this.inner.check_shutdown(cx) {
5949            this.is_terminated = true;
5950            return std::task::Poll::Ready(None);
5951        }
5952        if this.is_terminated {
5953            panic!("polled DictionaryRequestStream after completion");
5954        }
5955        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
5956            |bytes, handles| {
5957                match this.inner.channel().read_etc(cx, bytes, handles) {
5958                    std::task::Poll::Ready(Ok(())) => {}
5959                    std::task::Poll::Pending => return std::task::Poll::Pending,
5960                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
5961                        this.is_terminated = true;
5962                        return std::task::Poll::Ready(None);
5963                    }
5964                    std::task::Poll::Ready(Err(e)) => {
5965                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5966                            e.into(),
5967                        ))));
5968                    }
5969                }
5970
5971                // A message has been received from the channel
5972                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5973
5974                std::task::Poll::Ready(Some(match header.ordinal {
5975                    _ if header.tx_id == 0
5976                        && header
5977                            .dynamic_flags()
5978                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5979                    {
5980                        Ok(DictionaryRequest::_UnknownMethod {
5981                            ordinal: header.ordinal,
5982                            control_handle: DictionaryControlHandle { inner: this.inner.clone() },
5983                            method_type: fidl::MethodType::OneWay,
5984                        })
5985                    }
5986                    _ if header
5987                        .dynamic_flags()
5988                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5989                    {
5990                        this.inner.send_framework_err(
5991                            fidl::encoding::FrameworkErr::UnknownMethod,
5992                            header.tx_id,
5993                            header.ordinal,
5994                            header.dynamic_flags(),
5995                            (bytes, handles),
5996                        )?;
5997                        Ok(DictionaryRequest::_UnknownMethod {
5998                            ordinal: header.ordinal,
5999                            control_handle: DictionaryControlHandle { inner: this.inner.clone() },
6000                            method_type: fidl::MethodType::TwoWay,
6001                        })
6002                    }
6003                    _ => Err(fidl::Error::UnknownOrdinal {
6004                        ordinal: header.ordinal,
6005                        protocol_name:
6006                            <DictionaryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6007                    }),
6008                }))
6009            },
6010        )
6011    }
6012}
6013
6014#[derive(Debug)]
6015pub enum DictionaryRequest {
6016    /// An interaction was received which does not match any known method.
6017    #[non_exhaustive]
6018    _UnknownMethod {
6019        /// Ordinal of the method that was called.
6020        ordinal: u64,
6021        control_handle: DictionaryControlHandle,
6022        method_type: fidl::MethodType,
6023    },
6024}
6025
6026impl DictionaryRequest {
6027    /// Name of the method defined in FIDL
6028    pub fn method_name(&self) -> &'static str {
6029        match *self {
6030            DictionaryRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
6031                "unknown one-way method"
6032            }
6033            DictionaryRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
6034                "unknown two-way method"
6035            }
6036        }
6037    }
6038}
6039
6040#[derive(Debug, Clone)]
6041pub struct DictionaryControlHandle {
6042    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6043}
6044
6045impl fidl::endpoints::ControlHandle for DictionaryControlHandle {
6046    fn shutdown(&self) {
6047        self.inner.shutdown()
6048    }
6049
6050    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
6051        self.inner.shutdown_with_epitaph(status)
6052    }
6053
6054    fn is_closed(&self) -> bool {
6055        self.inner.channel().is_closed()
6056    }
6057    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6058        self.inner.channel().on_closed()
6059    }
6060
6061    #[cfg(target_os = "fuchsia")]
6062    fn signal_peer(
6063        &self,
6064        clear_mask: zx::Signals,
6065        set_mask: zx::Signals,
6066    ) -> Result<(), zx_status::Status> {
6067        use fidl::Peered;
6068        self.inner.channel().signal_peer(clear_mask, set_mask)
6069    }
6070}
6071
6072impl DictionaryControlHandle {}
6073
6074#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6075pub struct DictionaryDrainIteratorMarker;
6076
6077impl fidl::endpoints::ProtocolMarker for DictionaryDrainIteratorMarker {
6078    type Proxy = DictionaryDrainIteratorProxy;
6079    type RequestStream = DictionaryDrainIteratorRequestStream;
6080    #[cfg(target_os = "fuchsia")]
6081    type SynchronousProxy = DictionaryDrainIteratorSynchronousProxy;
6082
6083    const DEBUG_NAME: &'static str = "(anonymous) DictionaryDrainIterator";
6084}
6085pub type DictionaryDrainIteratorGetNextResult =
6086    Result<(Vec<DictionaryItem>, u64), CapabilityStoreError>;
6087
6088pub trait DictionaryDrainIteratorProxyInterface: Send + Sync {
6089    type GetNextResponseFut: std::future::Future<Output = Result<DictionaryDrainIteratorGetNextResult, fidl::Error>>
6090        + Send;
6091    fn r#get_next(&self, start_id: u64, limit: u32) -> Self::GetNextResponseFut;
6092}
6093#[derive(Debug)]
6094#[cfg(target_os = "fuchsia")]
6095pub struct DictionaryDrainIteratorSynchronousProxy {
6096    client: fidl::client::sync::Client,
6097}
6098
6099#[cfg(target_os = "fuchsia")]
6100impl fidl::endpoints::SynchronousProxy for DictionaryDrainIteratorSynchronousProxy {
6101    type Proxy = DictionaryDrainIteratorProxy;
6102    type Protocol = DictionaryDrainIteratorMarker;
6103
6104    fn from_channel(inner: fidl::Channel) -> Self {
6105        Self::new(inner)
6106    }
6107
6108    fn into_channel(self) -> fidl::Channel {
6109        self.client.into_channel()
6110    }
6111
6112    fn as_channel(&self) -> &fidl::Channel {
6113        self.client.as_channel()
6114    }
6115}
6116
6117#[cfg(target_os = "fuchsia")]
6118impl DictionaryDrainIteratorSynchronousProxy {
6119    pub fn new(channel: fidl::Channel) -> Self {
6120        Self { client: fidl::client::sync::Client::new(channel) }
6121    }
6122
6123    pub fn into_channel(self) -> fidl::Channel {
6124        self.client.into_channel()
6125    }
6126
6127    /// Waits until an event arrives and returns it. It is safe for other
6128    /// threads to make concurrent requests while waiting for an event.
6129    pub fn wait_for_event(
6130        &self,
6131        deadline: zx::MonotonicInstant,
6132    ) -> Result<DictionaryDrainIteratorEvent, fidl::Error> {
6133        DictionaryDrainIteratorEvent::decode(
6134            self.client.wait_for_event::<DictionaryDrainIteratorMarker>(deadline)?,
6135        )
6136    }
6137
6138    /// Returns the next batch of results for a [Dictionary.Drain] call, returning up to
6139    /// `limit` results. `limit` can be at most [MAX_DICTIONARY_ITERATOR_CHUNK].
6140    ///
6141    /// Each returned capability will be assigned a monotonically increasing [CapabilityId] starting
6142    /// from `start_id`.
6143    ///
6144    /// In addition to the `items`, returns `end_id`, which is one more than the highest id reserved
6145    /// by [GetNext]. `end_id` can be used as the `start_id` for the next call to [GetNext].
6146    ///
6147    /// If [GetNext] returns an error, the server will also close the channel.
6148    ///
6149    /// Errors:
6150    ///
6151    /// - `ID_ALREADY_EXISTS` if some id in the range `[start_id, limit)` already exists in this
6152    ///   store.
6153    /// - `INVALID_ARGS` if `limit` was `0` or greater than `MAX_DICTIONARY_ITERATOR_CHUNK`.
6154    pub fn r#get_next(
6155        &self,
6156        mut start_id: u64,
6157        mut limit: u32,
6158        ___deadline: zx::MonotonicInstant,
6159    ) -> Result<DictionaryDrainIteratorGetNextResult, fidl::Error> {
6160        let _response = self
6161            .client
6162            .send_query::<DictionaryDrainIteratorGetNextRequest, fidl::encoding::FlexibleResultType<
6163                DictionaryDrainIteratorGetNextResponse,
6164                CapabilityStoreError,
6165            >, DictionaryDrainIteratorMarker>(
6166                (start_id, limit),
6167                0x4f8082ca1ee26061,
6168                fidl::encoding::DynamicFlags::FLEXIBLE,
6169                ___deadline,
6170            )?
6171            .into_result::<DictionaryDrainIteratorMarker>("get_next")?;
6172        Ok(_response.map(|x| (x.items, x.end_id)))
6173    }
6174}
6175
6176#[cfg(target_os = "fuchsia")]
6177impl From<DictionaryDrainIteratorSynchronousProxy> for zx::NullableHandle {
6178    fn from(value: DictionaryDrainIteratorSynchronousProxy) -> Self {
6179        value.into_channel().into()
6180    }
6181}
6182
6183#[cfg(target_os = "fuchsia")]
6184impl From<fidl::Channel> for DictionaryDrainIteratorSynchronousProxy {
6185    fn from(value: fidl::Channel) -> Self {
6186        Self::new(value)
6187    }
6188}
6189
6190#[cfg(target_os = "fuchsia")]
6191impl fidl::endpoints::FromClient for DictionaryDrainIteratorSynchronousProxy {
6192    type Protocol = DictionaryDrainIteratorMarker;
6193
6194    fn from_client(value: fidl::endpoints::ClientEnd<DictionaryDrainIteratorMarker>) -> Self {
6195        Self::new(value.into_channel())
6196    }
6197}
6198
6199#[derive(Debug, Clone)]
6200pub struct DictionaryDrainIteratorProxy {
6201    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6202}
6203
6204impl fidl::endpoints::Proxy for DictionaryDrainIteratorProxy {
6205    type Protocol = DictionaryDrainIteratorMarker;
6206
6207    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6208        Self::new(inner)
6209    }
6210
6211    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6212        self.client.into_channel().map_err(|client| Self { client })
6213    }
6214
6215    fn as_channel(&self) -> &::fidl::AsyncChannel {
6216        self.client.as_channel()
6217    }
6218}
6219
6220impl DictionaryDrainIteratorProxy {
6221    /// Create a new Proxy for fuchsia.component.sandbox/DictionaryDrainIterator.
6222    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6223        let protocol_name =
6224            <DictionaryDrainIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6225        Self { client: fidl::client::Client::new(channel, protocol_name) }
6226    }
6227
6228    /// Get a Stream of events from the remote end of the protocol.
6229    ///
6230    /// # Panics
6231    ///
6232    /// Panics if the event stream was already taken.
6233    pub fn take_event_stream(&self) -> DictionaryDrainIteratorEventStream {
6234        DictionaryDrainIteratorEventStream { event_receiver: self.client.take_event_receiver() }
6235    }
6236
6237    /// Returns the next batch of results for a [Dictionary.Drain] call, returning up to
6238    /// `limit` results. `limit` can be at most [MAX_DICTIONARY_ITERATOR_CHUNK].
6239    ///
6240    /// Each returned capability will be assigned a monotonically increasing [CapabilityId] starting
6241    /// from `start_id`.
6242    ///
6243    /// In addition to the `items`, returns `end_id`, which is one more than the highest id reserved
6244    /// by [GetNext]. `end_id` can be used as the `start_id` for the next call to [GetNext].
6245    ///
6246    /// If [GetNext] returns an error, the server will also close the channel.
6247    ///
6248    /// Errors:
6249    ///
6250    /// - `ID_ALREADY_EXISTS` if some id in the range `[start_id, limit)` already exists in this
6251    ///   store.
6252    /// - `INVALID_ARGS` if `limit` was `0` or greater than `MAX_DICTIONARY_ITERATOR_CHUNK`.
6253    pub fn r#get_next(
6254        &self,
6255        mut start_id: u64,
6256        mut limit: u32,
6257    ) -> fidl::client::QueryResponseFut<
6258        DictionaryDrainIteratorGetNextResult,
6259        fidl::encoding::DefaultFuchsiaResourceDialect,
6260    > {
6261        DictionaryDrainIteratorProxyInterface::r#get_next(self, start_id, limit)
6262    }
6263}
6264
6265impl DictionaryDrainIteratorProxyInterface for DictionaryDrainIteratorProxy {
6266    type GetNextResponseFut = fidl::client::QueryResponseFut<
6267        DictionaryDrainIteratorGetNextResult,
6268        fidl::encoding::DefaultFuchsiaResourceDialect,
6269    >;
6270    fn r#get_next(&self, mut start_id: u64, mut limit: u32) -> Self::GetNextResponseFut {
6271        fn _decode(
6272            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6273        ) -> Result<DictionaryDrainIteratorGetNextResult, fidl::Error> {
6274            let _response = fidl::client::decode_transaction_body::<
6275                fidl::encoding::FlexibleResultType<
6276                    DictionaryDrainIteratorGetNextResponse,
6277                    CapabilityStoreError,
6278                >,
6279                fidl::encoding::DefaultFuchsiaResourceDialect,
6280                0x4f8082ca1ee26061,
6281            >(_buf?)?
6282            .into_result::<DictionaryDrainIteratorMarker>("get_next")?;
6283            Ok(_response.map(|x| (x.items, x.end_id)))
6284        }
6285        self.client.send_query_and_decode::<
6286            DictionaryDrainIteratorGetNextRequest,
6287            DictionaryDrainIteratorGetNextResult,
6288        >(
6289            (start_id, limit,),
6290            0x4f8082ca1ee26061,
6291            fidl::encoding::DynamicFlags::FLEXIBLE,
6292            _decode,
6293        )
6294    }
6295}
6296
6297pub struct DictionaryDrainIteratorEventStream {
6298    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6299}
6300
6301impl std::marker::Unpin for DictionaryDrainIteratorEventStream {}
6302
6303impl futures::stream::FusedStream for DictionaryDrainIteratorEventStream {
6304    fn is_terminated(&self) -> bool {
6305        self.event_receiver.is_terminated()
6306    }
6307}
6308
6309impl futures::Stream for DictionaryDrainIteratorEventStream {
6310    type Item = Result<DictionaryDrainIteratorEvent, fidl::Error>;
6311
6312    fn poll_next(
6313        mut self: std::pin::Pin<&mut Self>,
6314        cx: &mut std::task::Context<'_>,
6315    ) -> std::task::Poll<Option<Self::Item>> {
6316        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6317            &mut self.event_receiver,
6318            cx
6319        )?) {
6320            Some(buf) => std::task::Poll::Ready(Some(DictionaryDrainIteratorEvent::decode(buf))),
6321            None => std::task::Poll::Ready(None),
6322        }
6323    }
6324}
6325
6326#[derive(Debug)]
6327pub enum DictionaryDrainIteratorEvent {
6328    #[non_exhaustive]
6329    _UnknownEvent {
6330        /// Ordinal of the event that was sent.
6331        ordinal: u64,
6332    },
6333}
6334
6335impl DictionaryDrainIteratorEvent {
6336    /// Decodes a message buffer as a [`DictionaryDrainIteratorEvent`].
6337    fn decode(
6338        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6339    ) -> Result<DictionaryDrainIteratorEvent, fidl::Error> {
6340        let (bytes, _handles) = buf.split_mut();
6341        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6342        debug_assert_eq!(tx_header.tx_id, 0);
6343        match tx_header.ordinal {
6344            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6345                Ok(DictionaryDrainIteratorEvent::_UnknownEvent { ordinal: tx_header.ordinal })
6346            }
6347            _ => Err(fidl::Error::UnknownOrdinal {
6348                ordinal: tx_header.ordinal,
6349                protocol_name:
6350                    <DictionaryDrainIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6351            }),
6352        }
6353    }
6354}
6355
6356/// A Stream of incoming requests for fuchsia.component.sandbox/DictionaryDrainIterator.
6357pub struct DictionaryDrainIteratorRequestStream {
6358    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6359    is_terminated: bool,
6360}
6361
6362impl std::marker::Unpin for DictionaryDrainIteratorRequestStream {}
6363
6364impl futures::stream::FusedStream for DictionaryDrainIteratorRequestStream {
6365    fn is_terminated(&self) -> bool {
6366        self.is_terminated
6367    }
6368}
6369
6370impl fidl::endpoints::RequestStream for DictionaryDrainIteratorRequestStream {
6371    type Protocol = DictionaryDrainIteratorMarker;
6372    type ControlHandle = DictionaryDrainIteratorControlHandle;
6373
6374    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6375        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6376    }
6377
6378    fn control_handle(&self) -> Self::ControlHandle {
6379        DictionaryDrainIteratorControlHandle { inner: self.inner.clone() }
6380    }
6381
6382    fn into_inner(
6383        self,
6384    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6385    {
6386        (self.inner, self.is_terminated)
6387    }
6388
6389    fn from_inner(
6390        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6391        is_terminated: bool,
6392    ) -> Self {
6393        Self { inner, is_terminated }
6394    }
6395}
6396
6397impl futures::Stream for DictionaryDrainIteratorRequestStream {
6398    type Item = Result<DictionaryDrainIteratorRequest, fidl::Error>;
6399
6400    fn poll_next(
6401        mut self: std::pin::Pin<&mut Self>,
6402        cx: &mut std::task::Context<'_>,
6403    ) -> std::task::Poll<Option<Self::Item>> {
6404        let this = &mut *self;
6405        if this.inner.check_shutdown(cx) {
6406            this.is_terminated = true;
6407            return std::task::Poll::Ready(None);
6408        }
6409        if this.is_terminated {
6410            panic!("polled DictionaryDrainIteratorRequestStream after completion");
6411        }
6412        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
6413            |bytes, handles| {
6414                match this.inner.channel().read_etc(cx, bytes, handles) {
6415                    std::task::Poll::Ready(Ok(())) => {}
6416                    std::task::Poll::Pending => return std::task::Poll::Pending,
6417                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
6418                        this.is_terminated = true;
6419                        return std::task::Poll::Ready(None);
6420                    }
6421                    std::task::Poll::Ready(Err(e)) => {
6422                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6423                            e.into(),
6424                        ))));
6425                    }
6426                }
6427
6428                // A message has been received from the channel
6429                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6430
6431                std::task::Poll::Ready(Some(match header.ordinal {
6432                0x4f8082ca1ee26061 => {
6433                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6434                    let mut req = fidl::new_empty!(DictionaryDrainIteratorGetNextRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
6435                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DictionaryDrainIteratorGetNextRequest>(&header, _body_bytes, handles, &mut req)?;
6436                    let control_handle = DictionaryDrainIteratorControlHandle {
6437                        inner: this.inner.clone(),
6438                    };
6439                    Ok(DictionaryDrainIteratorRequest::GetNext {start_id: req.start_id,
6440limit: req.limit,
6441
6442                        responder: DictionaryDrainIteratorGetNextResponder {
6443                            control_handle: std::mem::ManuallyDrop::new(control_handle),
6444                            tx_id: header.tx_id,
6445                        },
6446                    })
6447                }
6448                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6449                    Ok(DictionaryDrainIteratorRequest::_UnknownMethod {
6450                        ordinal: header.ordinal,
6451                        control_handle: DictionaryDrainIteratorControlHandle { inner: this.inner.clone() },
6452                        method_type: fidl::MethodType::OneWay,
6453                    })
6454                }
6455                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6456                    this.inner.send_framework_err(
6457                        fidl::encoding::FrameworkErr::UnknownMethod,
6458                        header.tx_id,
6459                        header.ordinal,
6460                        header.dynamic_flags(),
6461                        (bytes, handles),
6462                    )?;
6463                    Ok(DictionaryDrainIteratorRequest::_UnknownMethod {
6464                        ordinal: header.ordinal,
6465                        control_handle: DictionaryDrainIteratorControlHandle { inner: this.inner.clone() },
6466                        method_type: fidl::MethodType::TwoWay,
6467                    })
6468                }
6469                _ => Err(fidl::Error::UnknownOrdinal {
6470                    ordinal: header.ordinal,
6471                    protocol_name: <DictionaryDrainIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6472                }),
6473            }))
6474            },
6475        )
6476    }
6477}
6478
6479#[derive(Debug)]
6480pub enum DictionaryDrainIteratorRequest {
6481    /// Returns the next batch of results for a [Dictionary.Drain] call, returning up to
6482    /// `limit` results. `limit` can be at most [MAX_DICTIONARY_ITERATOR_CHUNK].
6483    ///
6484    /// Each returned capability will be assigned a monotonically increasing [CapabilityId] starting
6485    /// from `start_id`.
6486    ///
6487    /// In addition to the `items`, returns `end_id`, which is one more than the highest id reserved
6488    /// by [GetNext]. `end_id` can be used as the `start_id` for the next call to [GetNext].
6489    ///
6490    /// If [GetNext] returns an error, the server will also close the channel.
6491    ///
6492    /// Errors:
6493    ///
6494    /// - `ID_ALREADY_EXISTS` if some id in the range `[start_id, limit)` already exists in this
6495    ///   store.
6496    /// - `INVALID_ARGS` if `limit` was `0` or greater than `MAX_DICTIONARY_ITERATOR_CHUNK`.
6497    GetNext { start_id: u64, limit: u32, responder: DictionaryDrainIteratorGetNextResponder },
6498    /// An interaction was received which does not match any known method.
6499    #[non_exhaustive]
6500    _UnknownMethod {
6501        /// Ordinal of the method that was called.
6502        ordinal: u64,
6503        control_handle: DictionaryDrainIteratorControlHandle,
6504        method_type: fidl::MethodType,
6505    },
6506}
6507
6508impl DictionaryDrainIteratorRequest {
6509    #[allow(irrefutable_let_patterns)]
6510    pub fn into_get_next(self) -> Option<(u64, u32, DictionaryDrainIteratorGetNextResponder)> {
6511        if let DictionaryDrainIteratorRequest::GetNext { start_id, limit, responder } = self {
6512            Some((start_id, limit, responder))
6513        } else {
6514            None
6515        }
6516    }
6517
6518    /// Name of the method defined in FIDL
6519    pub fn method_name(&self) -> &'static str {
6520        match *self {
6521            DictionaryDrainIteratorRequest::GetNext { .. } => "get_next",
6522            DictionaryDrainIteratorRequest::_UnknownMethod {
6523                method_type: fidl::MethodType::OneWay,
6524                ..
6525            } => "unknown one-way method",
6526            DictionaryDrainIteratorRequest::_UnknownMethod {
6527                method_type: fidl::MethodType::TwoWay,
6528                ..
6529            } => "unknown two-way method",
6530        }
6531    }
6532}
6533
6534#[derive(Debug, Clone)]
6535pub struct DictionaryDrainIteratorControlHandle {
6536    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6537}
6538
6539impl fidl::endpoints::ControlHandle for DictionaryDrainIteratorControlHandle {
6540    fn shutdown(&self) {
6541        self.inner.shutdown()
6542    }
6543
6544    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
6545        self.inner.shutdown_with_epitaph(status)
6546    }
6547
6548    fn is_closed(&self) -> bool {
6549        self.inner.channel().is_closed()
6550    }
6551    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6552        self.inner.channel().on_closed()
6553    }
6554
6555    #[cfg(target_os = "fuchsia")]
6556    fn signal_peer(
6557        &self,
6558        clear_mask: zx::Signals,
6559        set_mask: zx::Signals,
6560    ) -> Result<(), zx_status::Status> {
6561        use fidl::Peered;
6562        self.inner.channel().signal_peer(clear_mask, set_mask)
6563    }
6564}
6565
6566impl DictionaryDrainIteratorControlHandle {}
6567
6568#[must_use = "FIDL methods require a response to be sent"]
6569#[derive(Debug)]
6570pub struct DictionaryDrainIteratorGetNextResponder {
6571    control_handle: std::mem::ManuallyDrop<DictionaryDrainIteratorControlHandle>,
6572    tx_id: u32,
6573}
6574
6575/// Set the the channel to be shutdown (see [`DictionaryDrainIteratorControlHandle::shutdown`])
6576/// if the responder is dropped without sending a response, so that the client
6577/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6578impl std::ops::Drop for DictionaryDrainIteratorGetNextResponder {
6579    fn drop(&mut self) {
6580        self.control_handle.shutdown();
6581        // Safety: drops once, never accessed again
6582        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6583    }
6584}
6585
6586impl fidl::endpoints::Responder for DictionaryDrainIteratorGetNextResponder {
6587    type ControlHandle = DictionaryDrainIteratorControlHandle;
6588
6589    fn control_handle(&self) -> &DictionaryDrainIteratorControlHandle {
6590        &self.control_handle
6591    }
6592
6593    fn drop_without_shutdown(mut self) {
6594        // Safety: drops once, never accessed again due to mem::forget
6595        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6596        // Prevent Drop from running (which would shut down the channel)
6597        std::mem::forget(self);
6598    }
6599}
6600
6601impl DictionaryDrainIteratorGetNextResponder {
6602    /// Sends a response to the FIDL transaction.
6603    ///
6604    /// Sets the channel to shutdown if an error occurs.
6605    pub fn send(
6606        self,
6607        mut result: Result<(&[DictionaryItem], u64), CapabilityStoreError>,
6608    ) -> Result<(), fidl::Error> {
6609        let _result = self.send_raw(result);
6610        if _result.is_err() {
6611            self.control_handle.shutdown();
6612        }
6613        self.drop_without_shutdown();
6614        _result
6615    }
6616
6617    /// Similar to "send" but does not shutdown the channel if an error occurs.
6618    pub fn send_no_shutdown_on_err(
6619        self,
6620        mut result: Result<(&[DictionaryItem], u64), CapabilityStoreError>,
6621    ) -> Result<(), fidl::Error> {
6622        let _result = self.send_raw(result);
6623        self.drop_without_shutdown();
6624        _result
6625    }
6626
6627    fn send_raw(
6628        &self,
6629        mut result: Result<(&[DictionaryItem], u64), CapabilityStoreError>,
6630    ) -> Result<(), fidl::Error> {
6631        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
6632            DictionaryDrainIteratorGetNextResponse,
6633            CapabilityStoreError,
6634        >>(
6635            fidl::encoding::FlexibleResult::new(result),
6636            self.tx_id,
6637            0x4f8082ca1ee26061,
6638            fidl::encoding::DynamicFlags::FLEXIBLE,
6639        )
6640    }
6641}
6642
6643#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6644pub struct DictionaryEnumerateIteratorMarker;
6645
6646impl fidl::endpoints::ProtocolMarker for DictionaryEnumerateIteratorMarker {
6647    type Proxy = DictionaryEnumerateIteratorProxy;
6648    type RequestStream = DictionaryEnumerateIteratorRequestStream;
6649    #[cfg(target_os = "fuchsia")]
6650    type SynchronousProxy = DictionaryEnumerateIteratorSynchronousProxy;
6651
6652    const DEBUG_NAME: &'static str = "(anonymous) DictionaryEnumerateIterator";
6653}
6654pub type DictionaryEnumerateIteratorGetNextResult =
6655    Result<(Vec<DictionaryOptionalItem>, u64), CapabilityStoreError>;
6656
6657pub trait DictionaryEnumerateIteratorProxyInterface: Send + Sync {
6658    type GetNextResponseFut: std::future::Future<Output = Result<DictionaryEnumerateIteratorGetNextResult, fidl::Error>>
6659        + Send;
6660    fn r#get_next(&self, start_id: u64, limit: u32) -> Self::GetNextResponseFut;
6661}
6662#[derive(Debug)]
6663#[cfg(target_os = "fuchsia")]
6664pub struct DictionaryEnumerateIteratorSynchronousProxy {
6665    client: fidl::client::sync::Client,
6666}
6667
6668#[cfg(target_os = "fuchsia")]
6669impl fidl::endpoints::SynchronousProxy for DictionaryEnumerateIteratorSynchronousProxy {
6670    type Proxy = DictionaryEnumerateIteratorProxy;
6671    type Protocol = DictionaryEnumerateIteratorMarker;
6672
6673    fn from_channel(inner: fidl::Channel) -> Self {
6674        Self::new(inner)
6675    }
6676
6677    fn into_channel(self) -> fidl::Channel {
6678        self.client.into_channel()
6679    }
6680
6681    fn as_channel(&self) -> &fidl::Channel {
6682        self.client.as_channel()
6683    }
6684}
6685
6686#[cfg(target_os = "fuchsia")]
6687impl DictionaryEnumerateIteratorSynchronousProxy {
6688    pub fn new(channel: fidl::Channel) -> Self {
6689        Self { client: fidl::client::sync::Client::new(channel) }
6690    }
6691
6692    pub fn into_channel(self) -> fidl::Channel {
6693        self.client.into_channel()
6694    }
6695
6696    /// Waits until an event arrives and returns it. It is safe for other
6697    /// threads to make concurrent requests while waiting for an event.
6698    pub fn wait_for_event(
6699        &self,
6700        deadline: zx::MonotonicInstant,
6701    ) -> Result<DictionaryEnumerateIteratorEvent, fidl::Error> {
6702        DictionaryEnumerateIteratorEvent::decode(
6703            self.client.wait_for_event::<DictionaryEnumerateIteratorMarker>(deadline)?,
6704        )
6705    }
6706
6707    /// Returns the next batch of results for a [Dictionary.Enumerate] call, returning up to
6708    /// `limit` results. `limit` can be at most [MAX_DICTIONARY_ITERATOR_CHUNK].
6709    ///
6710    /// The value of each of `items` is a duplicate of the original capability
6711    /// ([CapabilityStore.Duplicate]), unless it could not be duplicated, it which case it will
6712    /// be null.
6713    ///
6714    /// Each returned capability will be assigned a monotonically increasing [CapabilityId] starting
6715    /// from `start_id`.
6716    ///
6717    /// In addition to the `items`, returns `end_id`, which is one more than the highest id reserved
6718    /// by [GetNext]. `end_id` can be used as the `start_id` for the next call to [GetNext].
6719    ///
6720    /// If [GetNext] returns an error, the server will also close the channel.
6721    ///
6722    /// Errors:
6723    ///
6724    /// - `ID_ALREADY_EXISTS` if some id in the range `[start_id, limit)` already exists in this
6725    ///   store.
6726    /// - `INVALID_ARGS` if `limit` was `0` or greater than `MAX_DICTIONARY_ITERATOR_CHUNK`.
6727    pub fn r#get_next(
6728        &self,
6729        mut start_id: u64,
6730        mut limit: u32,
6731        ___deadline: zx::MonotonicInstant,
6732    ) -> Result<DictionaryEnumerateIteratorGetNextResult, fidl::Error> {
6733        let _response = self.client.send_query::<
6734            DictionaryEnumerateIteratorGetNextRequest,
6735            fidl::encoding::FlexibleResultType<DictionaryEnumerateIteratorGetNextResponse, CapabilityStoreError>,
6736            DictionaryEnumerateIteratorMarker,
6737        >(
6738            (start_id, limit,),
6739            0x14f8bc286512f5cf,
6740            fidl::encoding::DynamicFlags::FLEXIBLE,
6741            ___deadline,
6742        )?
6743        .into_result::<DictionaryEnumerateIteratorMarker>("get_next")?;
6744        Ok(_response.map(|x| (x.items, x.end_id)))
6745    }
6746}
6747
6748#[cfg(target_os = "fuchsia")]
6749impl From<DictionaryEnumerateIteratorSynchronousProxy> for zx::NullableHandle {
6750    fn from(value: DictionaryEnumerateIteratorSynchronousProxy) -> Self {
6751        value.into_channel().into()
6752    }
6753}
6754
6755#[cfg(target_os = "fuchsia")]
6756impl From<fidl::Channel> for DictionaryEnumerateIteratorSynchronousProxy {
6757    fn from(value: fidl::Channel) -> Self {
6758        Self::new(value)
6759    }
6760}
6761
6762#[cfg(target_os = "fuchsia")]
6763impl fidl::endpoints::FromClient for DictionaryEnumerateIteratorSynchronousProxy {
6764    type Protocol = DictionaryEnumerateIteratorMarker;
6765
6766    fn from_client(value: fidl::endpoints::ClientEnd<DictionaryEnumerateIteratorMarker>) -> Self {
6767        Self::new(value.into_channel())
6768    }
6769}
6770
6771#[derive(Debug, Clone)]
6772pub struct DictionaryEnumerateIteratorProxy {
6773    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6774}
6775
6776impl fidl::endpoints::Proxy for DictionaryEnumerateIteratorProxy {
6777    type Protocol = DictionaryEnumerateIteratorMarker;
6778
6779    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6780        Self::new(inner)
6781    }
6782
6783    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6784        self.client.into_channel().map_err(|client| Self { client })
6785    }
6786
6787    fn as_channel(&self) -> &::fidl::AsyncChannel {
6788        self.client.as_channel()
6789    }
6790}
6791
6792impl DictionaryEnumerateIteratorProxy {
6793    /// Create a new Proxy for fuchsia.component.sandbox/DictionaryEnumerateIterator.
6794    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6795        let protocol_name =
6796            <DictionaryEnumerateIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6797        Self { client: fidl::client::Client::new(channel, protocol_name) }
6798    }
6799
6800    /// Get a Stream of events from the remote end of the protocol.
6801    ///
6802    /// # Panics
6803    ///
6804    /// Panics if the event stream was already taken.
6805    pub fn take_event_stream(&self) -> DictionaryEnumerateIteratorEventStream {
6806        DictionaryEnumerateIteratorEventStream { event_receiver: self.client.take_event_receiver() }
6807    }
6808
6809    /// Returns the next batch of results for a [Dictionary.Enumerate] call, returning up to
6810    /// `limit` results. `limit` can be at most [MAX_DICTIONARY_ITERATOR_CHUNK].
6811    ///
6812    /// The value of each of `items` is a duplicate of the original capability
6813    /// ([CapabilityStore.Duplicate]), unless it could not be duplicated, it which case it will
6814    /// be null.
6815    ///
6816    /// Each returned capability will be assigned a monotonically increasing [CapabilityId] starting
6817    /// from `start_id`.
6818    ///
6819    /// In addition to the `items`, returns `end_id`, which is one more than the highest id reserved
6820    /// by [GetNext]. `end_id` can be used as the `start_id` for the next call to [GetNext].
6821    ///
6822    /// If [GetNext] returns an error, the server will also close the channel.
6823    ///
6824    /// Errors:
6825    ///
6826    /// - `ID_ALREADY_EXISTS` if some id in the range `[start_id, limit)` already exists in this
6827    ///   store.
6828    /// - `INVALID_ARGS` if `limit` was `0` or greater than `MAX_DICTIONARY_ITERATOR_CHUNK`.
6829    pub fn r#get_next(
6830        &self,
6831        mut start_id: u64,
6832        mut limit: u32,
6833    ) -> fidl::client::QueryResponseFut<
6834        DictionaryEnumerateIteratorGetNextResult,
6835        fidl::encoding::DefaultFuchsiaResourceDialect,
6836    > {
6837        DictionaryEnumerateIteratorProxyInterface::r#get_next(self, start_id, limit)
6838    }
6839}
6840
6841impl DictionaryEnumerateIteratorProxyInterface for DictionaryEnumerateIteratorProxy {
6842    type GetNextResponseFut = fidl::client::QueryResponseFut<
6843        DictionaryEnumerateIteratorGetNextResult,
6844        fidl::encoding::DefaultFuchsiaResourceDialect,
6845    >;
6846    fn r#get_next(&self, mut start_id: u64, mut limit: u32) -> Self::GetNextResponseFut {
6847        fn _decode(
6848            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6849        ) -> Result<DictionaryEnumerateIteratorGetNextResult, fidl::Error> {
6850            let _response = fidl::client::decode_transaction_body::<
6851                fidl::encoding::FlexibleResultType<
6852                    DictionaryEnumerateIteratorGetNextResponse,
6853                    CapabilityStoreError,
6854                >,
6855                fidl::encoding::DefaultFuchsiaResourceDialect,
6856                0x14f8bc286512f5cf,
6857            >(_buf?)?
6858            .into_result::<DictionaryEnumerateIteratorMarker>("get_next")?;
6859            Ok(_response.map(|x| (x.items, x.end_id)))
6860        }
6861        self.client.send_query_and_decode::<
6862            DictionaryEnumerateIteratorGetNextRequest,
6863            DictionaryEnumerateIteratorGetNextResult,
6864        >(
6865            (start_id, limit,),
6866            0x14f8bc286512f5cf,
6867            fidl::encoding::DynamicFlags::FLEXIBLE,
6868            _decode,
6869        )
6870    }
6871}
6872
6873pub struct DictionaryEnumerateIteratorEventStream {
6874    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6875}
6876
6877impl std::marker::Unpin for DictionaryEnumerateIteratorEventStream {}
6878
6879impl futures::stream::FusedStream for DictionaryEnumerateIteratorEventStream {
6880    fn is_terminated(&self) -> bool {
6881        self.event_receiver.is_terminated()
6882    }
6883}
6884
6885impl futures::Stream for DictionaryEnumerateIteratorEventStream {
6886    type Item = Result<DictionaryEnumerateIteratorEvent, fidl::Error>;
6887
6888    fn poll_next(
6889        mut self: std::pin::Pin<&mut Self>,
6890        cx: &mut std::task::Context<'_>,
6891    ) -> std::task::Poll<Option<Self::Item>> {
6892        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6893            &mut self.event_receiver,
6894            cx
6895        )?) {
6896            Some(buf) => {
6897                std::task::Poll::Ready(Some(DictionaryEnumerateIteratorEvent::decode(buf)))
6898            }
6899            None => std::task::Poll::Ready(None),
6900        }
6901    }
6902}
6903
6904#[derive(Debug)]
6905pub enum DictionaryEnumerateIteratorEvent {
6906    #[non_exhaustive]
6907    _UnknownEvent {
6908        /// Ordinal of the event that was sent.
6909        ordinal: u64,
6910    },
6911}
6912
6913impl DictionaryEnumerateIteratorEvent {
6914    /// Decodes a message buffer as a [`DictionaryEnumerateIteratorEvent`].
6915    fn decode(
6916        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6917    ) -> Result<DictionaryEnumerateIteratorEvent, fidl::Error> {
6918        let (bytes, _handles) = buf.split_mut();
6919        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6920        debug_assert_eq!(tx_header.tx_id, 0);
6921        match tx_header.ordinal {
6922            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6923                Ok(DictionaryEnumerateIteratorEvent::_UnknownEvent {
6924                    ordinal: tx_header.ordinal,
6925                })
6926            }
6927            _ => Err(fidl::Error::UnknownOrdinal {
6928                ordinal: tx_header.ordinal,
6929                protocol_name: <DictionaryEnumerateIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6930            })
6931        }
6932    }
6933}
6934
6935/// A Stream of incoming requests for fuchsia.component.sandbox/DictionaryEnumerateIterator.
6936pub struct DictionaryEnumerateIteratorRequestStream {
6937    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6938    is_terminated: bool,
6939}
6940
6941impl std::marker::Unpin for DictionaryEnumerateIteratorRequestStream {}
6942
6943impl futures::stream::FusedStream for DictionaryEnumerateIteratorRequestStream {
6944    fn is_terminated(&self) -> bool {
6945        self.is_terminated
6946    }
6947}
6948
6949impl fidl::endpoints::RequestStream for DictionaryEnumerateIteratorRequestStream {
6950    type Protocol = DictionaryEnumerateIteratorMarker;
6951    type ControlHandle = DictionaryEnumerateIteratorControlHandle;
6952
6953    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6954        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6955    }
6956
6957    fn control_handle(&self) -> Self::ControlHandle {
6958        DictionaryEnumerateIteratorControlHandle { inner: self.inner.clone() }
6959    }
6960
6961    fn into_inner(
6962        self,
6963    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6964    {
6965        (self.inner, self.is_terminated)
6966    }
6967
6968    fn from_inner(
6969        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6970        is_terminated: bool,
6971    ) -> Self {
6972        Self { inner, is_terminated }
6973    }
6974}
6975
6976impl futures::Stream for DictionaryEnumerateIteratorRequestStream {
6977    type Item = Result<DictionaryEnumerateIteratorRequest, fidl::Error>;
6978
6979    fn poll_next(
6980        mut self: std::pin::Pin<&mut Self>,
6981        cx: &mut std::task::Context<'_>,
6982    ) -> std::task::Poll<Option<Self::Item>> {
6983        let this = &mut *self;
6984        if this.inner.check_shutdown(cx) {
6985            this.is_terminated = true;
6986            return std::task::Poll::Ready(None);
6987        }
6988        if this.is_terminated {
6989            panic!("polled DictionaryEnumerateIteratorRequestStream after completion");
6990        }
6991        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
6992            |bytes, handles| {
6993                match this.inner.channel().read_etc(cx, bytes, handles) {
6994                    std::task::Poll::Ready(Ok(())) => {}
6995                    std::task::Poll::Pending => return std::task::Poll::Pending,
6996                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
6997                        this.is_terminated = true;
6998                        return std::task::Poll::Ready(None);
6999                    }
7000                    std::task::Poll::Ready(Err(e)) => {
7001                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7002                            e.into(),
7003                        ))));
7004                    }
7005                }
7006
7007                // A message has been received from the channel
7008                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7009
7010                std::task::Poll::Ready(Some(match header.ordinal {
7011                0x14f8bc286512f5cf => {
7012                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7013                    let mut req = fidl::new_empty!(DictionaryEnumerateIteratorGetNextRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
7014                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DictionaryEnumerateIteratorGetNextRequest>(&header, _body_bytes, handles, &mut req)?;
7015                    let control_handle = DictionaryEnumerateIteratorControlHandle {
7016                        inner: this.inner.clone(),
7017                    };
7018                    Ok(DictionaryEnumerateIteratorRequest::GetNext {start_id: req.start_id,
7019limit: req.limit,
7020
7021                        responder: DictionaryEnumerateIteratorGetNextResponder {
7022                            control_handle: std::mem::ManuallyDrop::new(control_handle),
7023                            tx_id: header.tx_id,
7024                        },
7025                    })
7026                }
7027                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7028                    Ok(DictionaryEnumerateIteratorRequest::_UnknownMethod {
7029                        ordinal: header.ordinal,
7030                        control_handle: DictionaryEnumerateIteratorControlHandle { inner: this.inner.clone() },
7031                        method_type: fidl::MethodType::OneWay,
7032                    })
7033                }
7034                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7035                    this.inner.send_framework_err(
7036                        fidl::encoding::FrameworkErr::UnknownMethod,
7037                        header.tx_id,
7038                        header.ordinal,
7039                        header.dynamic_flags(),
7040                        (bytes, handles),
7041                    )?;
7042                    Ok(DictionaryEnumerateIteratorRequest::_UnknownMethod {
7043                        ordinal: header.ordinal,
7044                        control_handle: DictionaryEnumerateIteratorControlHandle { inner: this.inner.clone() },
7045                        method_type: fidl::MethodType::TwoWay,
7046                    })
7047                }
7048                _ => Err(fidl::Error::UnknownOrdinal {
7049                    ordinal: header.ordinal,
7050                    protocol_name: <DictionaryEnumerateIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7051                }),
7052            }))
7053            },
7054        )
7055    }
7056}
7057
7058#[derive(Debug)]
7059pub enum DictionaryEnumerateIteratorRequest {
7060    /// Returns the next batch of results for a [Dictionary.Enumerate] call, returning up to
7061    /// `limit` results. `limit` can be at most [MAX_DICTIONARY_ITERATOR_CHUNK].
7062    ///
7063    /// The value of each of `items` is a duplicate of the original capability
7064    /// ([CapabilityStore.Duplicate]), unless it could not be duplicated, it which case it will
7065    /// be null.
7066    ///
7067    /// Each returned capability will be assigned a monotonically increasing [CapabilityId] starting
7068    /// from `start_id`.
7069    ///
7070    /// In addition to the `items`, returns `end_id`, which is one more than the highest id reserved
7071    /// by [GetNext]. `end_id` can be used as the `start_id` for the next call to [GetNext].
7072    ///
7073    /// If [GetNext] returns an error, the server will also close the channel.
7074    ///
7075    /// Errors:
7076    ///
7077    /// - `ID_ALREADY_EXISTS` if some id in the range `[start_id, limit)` already exists in this
7078    ///   store.
7079    /// - `INVALID_ARGS` if `limit` was `0` or greater than `MAX_DICTIONARY_ITERATOR_CHUNK`.
7080    GetNext { start_id: u64, limit: u32, responder: DictionaryEnumerateIteratorGetNextResponder },
7081    /// An interaction was received which does not match any known method.
7082    #[non_exhaustive]
7083    _UnknownMethod {
7084        /// Ordinal of the method that was called.
7085        ordinal: u64,
7086        control_handle: DictionaryEnumerateIteratorControlHandle,
7087        method_type: fidl::MethodType,
7088    },
7089}
7090
7091impl DictionaryEnumerateIteratorRequest {
7092    #[allow(irrefutable_let_patterns)]
7093    pub fn into_get_next(self) -> Option<(u64, u32, DictionaryEnumerateIteratorGetNextResponder)> {
7094        if let DictionaryEnumerateIteratorRequest::GetNext { start_id, limit, responder } = self {
7095            Some((start_id, limit, responder))
7096        } else {
7097            None
7098        }
7099    }
7100
7101    /// Name of the method defined in FIDL
7102    pub fn method_name(&self) -> &'static str {
7103        match *self {
7104            DictionaryEnumerateIteratorRequest::GetNext { .. } => "get_next",
7105            DictionaryEnumerateIteratorRequest::_UnknownMethod {
7106                method_type: fidl::MethodType::OneWay,
7107                ..
7108            } => "unknown one-way method",
7109            DictionaryEnumerateIteratorRequest::_UnknownMethod {
7110                method_type: fidl::MethodType::TwoWay,
7111                ..
7112            } => "unknown two-way method",
7113        }
7114    }
7115}
7116
7117#[derive(Debug, Clone)]
7118pub struct DictionaryEnumerateIteratorControlHandle {
7119    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7120}
7121
7122impl fidl::endpoints::ControlHandle for DictionaryEnumerateIteratorControlHandle {
7123    fn shutdown(&self) {
7124        self.inner.shutdown()
7125    }
7126
7127    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
7128        self.inner.shutdown_with_epitaph(status)
7129    }
7130
7131    fn is_closed(&self) -> bool {
7132        self.inner.channel().is_closed()
7133    }
7134    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
7135        self.inner.channel().on_closed()
7136    }
7137
7138    #[cfg(target_os = "fuchsia")]
7139    fn signal_peer(
7140        &self,
7141        clear_mask: zx::Signals,
7142        set_mask: zx::Signals,
7143    ) -> Result<(), zx_status::Status> {
7144        use fidl::Peered;
7145        self.inner.channel().signal_peer(clear_mask, set_mask)
7146    }
7147}
7148
7149impl DictionaryEnumerateIteratorControlHandle {}
7150
7151#[must_use = "FIDL methods require a response to be sent"]
7152#[derive(Debug)]
7153pub struct DictionaryEnumerateIteratorGetNextResponder {
7154    control_handle: std::mem::ManuallyDrop<DictionaryEnumerateIteratorControlHandle>,
7155    tx_id: u32,
7156}
7157
7158/// Set the the channel to be shutdown (see [`DictionaryEnumerateIteratorControlHandle::shutdown`])
7159/// if the responder is dropped without sending a response, so that the client
7160/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7161impl std::ops::Drop for DictionaryEnumerateIteratorGetNextResponder {
7162    fn drop(&mut self) {
7163        self.control_handle.shutdown();
7164        // Safety: drops once, never accessed again
7165        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7166    }
7167}
7168
7169impl fidl::endpoints::Responder for DictionaryEnumerateIteratorGetNextResponder {
7170    type ControlHandle = DictionaryEnumerateIteratorControlHandle;
7171
7172    fn control_handle(&self) -> &DictionaryEnumerateIteratorControlHandle {
7173        &self.control_handle
7174    }
7175
7176    fn drop_without_shutdown(mut self) {
7177        // Safety: drops once, never accessed again due to mem::forget
7178        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7179        // Prevent Drop from running (which would shut down the channel)
7180        std::mem::forget(self);
7181    }
7182}
7183
7184impl DictionaryEnumerateIteratorGetNextResponder {
7185    /// Sends a response to the FIDL transaction.
7186    ///
7187    /// Sets the channel to shutdown if an error occurs.
7188    pub fn send(
7189        self,
7190        mut result: Result<(Vec<DictionaryOptionalItem>, u64), CapabilityStoreError>,
7191    ) -> Result<(), fidl::Error> {
7192        let _result = self.send_raw(result);
7193        if _result.is_err() {
7194            self.control_handle.shutdown();
7195        }
7196        self.drop_without_shutdown();
7197        _result
7198    }
7199
7200    /// Similar to "send" but does not shutdown the channel if an error occurs.
7201    pub fn send_no_shutdown_on_err(
7202        self,
7203        mut result: Result<(Vec<DictionaryOptionalItem>, u64), CapabilityStoreError>,
7204    ) -> Result<(), fidl::Error> {
7205        let _result = self.send_raw(result);
7206        self.drop_without_shutdown();
7207        _result
7208    }
7209
7210    fn send_raw(
7211        &self,
7212        mut result: Result<(Vec<DictionaryOptionalItem>, u64), CapabilityStoreError>,
7213    ) -> Result<(), fidl::Error> {
7214        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
7215            DictionaryEnumerateIteratorGetNextResponse,
7216            CapabilityStoreError,
7217        >>(
7218            fidl::encoding::FlexibleResult::new(
7219                result
7220                    .as_mut()
7221                    .map_err(|e| *e)
7222                    .map(|(items, end_id)| (items.as_mut_slice(), *end_id)),
7223            ),
7224            self.tx_id,
7225            0x14f8bc286512f5cf,
7226            fidl::encoding::DynamicFlags::FLEXIBLE,
7227        )
7228    }
7229}
7230
7231#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
7232pub struct DictionaryKeysIteratorMarker;
7233
7234impl fidl::endpoints::ProtocolMarker for DictionaryKeysIteratorMarker {
7235    type Proxy = DictionaryKeysIteratorProxy;
7236    type RequestStream = DictionaryKeysIteratorRequestStream;
7237    #[cfg(target_os = "fuchsia")]
7238    type SynchronousProxy = DictionaryKeysIteratorSynchronousProxy;
7239
7240    const DEBUG_NAME: &'static str = "(anonymous) DictionaryKeysIterator";
7241}
7242
7243pub trait DictionaryKeysIteratorProxyInterface: Send + Sync {
7244    type GetNextResponseFut: std::future::Future<Output = Result<Vec<String>, fidl::Error>> + Send;
7245    fn r#get_next(&self) -> Self::GetNextResponseFut;
7246}
7247#[derive(Debug)]
7248#[cfg(target_os = "fuchsia")]
7249pub struct DictionaryKeysIteratorSynchronousProxy {
7250    client: fidl::client::sync::Client,
7251}
7252
7253#[cfg(target_os = "fuchsia")]
7254impl fidl::endpoints::SynchronousProxy for DictionaryKeysIteratorSynchronousProxy {
7255    type Proxy = DictionaryKeysIteratorProxy;
7256    type Protocol = DictionaryKeysIteratorMarker;
7257
7258    fn from_channel(inner: fidl::Channel) -> Self {
7259        Self::new(inner)
7260    }
7261
7262    fn into_channel(self) -> fidl::Channel {
7263        self.client.into_channel()
7264    }
7265
7266    fn as_channel(&self) -> &fidl::Channel {
7267        self.client.as_channel()
7268    }
7269}
7270
7271#[cfg(target_os = "fuchsia")]
7272impl DictionaryKeysIteratorSynchronousProxy {
7273    pub fn new(channel: fidl::Channel) -> Self {
7274        Self { client: fidl::client::sync::Client::new(channel) }
7275    }
7276
7277    pub fn into_channel(self) -> fidl::Channel {
7278        self.client.into_channel()
7279    }
7280
7281    /// Waits until an event arrives and returns it. It is safe for other
7282    /// threads to make concurrent requests while waiting for an event.
7283    pub fn wait_for_event(
7284        &self,
7285        deadline: zx::MonotonicInstant,
7286    ) -> Result<DictionaryKeysIteratorEvent, fidl::Error> {
7287        DictionaryKeysIteratorEvent::decode(
7288            self.client.wait_for_event::<DictionaryKeysIteratorMarker>(deadline)?,
7289        )
7290    }
7291
7292    pub fn r#get_next(
7293        &self,
7294        ___deadline: zx::MonotonicInstant,
7295    ) -> Result<Vec<String>, fidl::Error> {
7296        let _response = self.client.send_query::<
7297            fidl::encoding::EmptyPayload,
7298            fidl::encoding::FlexibleType<DictionaryKeysIteratorGetNextResponse>,
7299            DictionaryKeysIteratorMarker,
7300        >(
7301            (),
7302            0x453828cbacca7d53,
7303            fidl::encoding::DynamicFlags::FLEXIBLE,
7304            ___deadline,
7305        )?
7306        .into_result::<DictionaryKeysIteratorMarker>("get_next")?;
7307        Ok(_response.keys)
7308    }
7309}
7310
7311#[cfg(target_os = "fuchsia")]
7312impl From<DictionaryKeysIteratorSynchronousProxy> for zx::NullableHandle {
7313    fn from(value: DictionaryKeysIteratorSynchronousProxy) -> Self {
7314        value.into_channel().into()
7315    }
7316}
7317
7318#[cfg(target_os = "fuchsia")]
7319impl From<fidl::Channel> for DictionaryKeysIteratorSynchronousProxy {
7320    fn from(value: fidl::Channel) -> Self {
7321        Self::new(value)
7322    }
7323}
7324
7325#[cfg(target_os = "fuchsia")]
7326impl fidl::endpoints::FromClient for DictionaryKeysIteratorSynchronousProxy {
7327    type Protocol = DictionaryKeysIteratorMarker;
7328
7329    fn from_client(value: fidl::endpoints::ClientEnd<DictionaryKeysIteratorMarker>) -> Self {
7330        Self::new(value.into_channel())
7331    }
7332}
7333
7334#[derive(Debug, Clone)]
7335pub struct DictionaryKeysIteratorProxy {
7336    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
7337}
7338
7339impl fidl::endpoints::Proxy for DictionaryKeysIteratorProxy {
7340    type Protocol = DictionaryKeysIteratorMarker;
7341
7342    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
7343        Self::new(inner)
7344    }
7345
7346    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
7347        self.client.into_channel().map_err(|client| Self { client })
7348    }
7349
7350    fn as_channel(&self) -> &::fidl::AsyncChannel {
7351        self.client.as_channel()
7352    }
7353}
7354
7355impl DictionaryKeysIteratorProxy {
7356    /// Create a new Proxy for fuchsia.component.sandbox/DictionaryKeysIterator.
7357    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
7358        let protocol_name =
7359            <DictionaryKeysIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7360        Self { client: fidl::client::Client::new(channel, protocol_name) }
7361    }
7362
7363    /// Get a Stream of events from the remote end of the protocol.
7364    ///
7365    /// # Panics
7366    ///
7367    /// Panics if the event stream was already taken.
7368    pub fn take_event_stream(&self) -> DictionaryKeysIteratorEventStream {
7369        DictionaryKeysIteratorEventStream { event_receiver: self.client.take_event_receiver() }
7370    }
7371
7372    pub fn r#get_next(
7373        &self,
7374    ) -> fidl::client::QueryResponseFut<Vec<String>, fidl::encoding::DefaultFuchsiaResourceDialect>
7375    {
7376        DictionaryKeysIteratorProxyInterface::r#get_next(self)
7377    }
7378}
7379
7380impl DictionaryKeysIteratorProxyInterface for DictionaryKeysIteratorProxy {
7381    type GetNextResponseFut =
7382        fidl::client::QueryResponseFut<Vec<String>, fidl::encoding::DefaultFuchsiaResourceDialect>;
7383    fn r#get_next(&self) -> Self::GetNextResponseFut {
7384        fn _decode(
7385            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7386        ) -> Result<Vec<String>, fidl::Error> {
7387            let _response = fidl::client::decode_transaction_body::<
7388                fidl::encoding::FlexibleType<DictionaryKeysIteratorGetNextResponse>,
7389                fidl::encoding::DefaultFuchsiaResourceDialect,
7390                0x453828cbacca7d53,
7391            >(_buf?)?
7392            .into_result::<DictionaryKeysIteratorMarker>("get_next")?;
7393            Ok(_response.keys)
7394        }
7395        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<String>>(
7396            (),
7397            0x453828cbacca7d53,
7398            fidl::encoding::DynamicFlags::FLEXIBLE,
7399            _decode,
7400        )
7401    }
7402}
7403
7404pub struct DictionaryKeysIteratorEventStream {
7405    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
7406}
7407
7408impl std::marker::Unpin for DictionaryKeysIteratorEventStream {}
7409
7410impl futures::stream::FusedStream for DictionaryKeysIteratorEventStream {
7411    fn is_terminated(&self) -> bool {
7412        self.event_receiver.is_terminated()
7413    }
7414}
7415
7416impl futures::Stream for DictionaryKeysIteratorEventStream {
7417    type Item = Result<DictionaryKeysIteratorEvent, fidl::Error>;
7418
7419    fn poll_next(
7420        mut self: std::pin::Pin<&mut Self>,
7421        cx: &mut std::task::Context<'_>,
7422    ) -> std::task::Poll<Option<Self::Item>> {
7423        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7424            &mut self.event_receiver,
7425            cx
7426        )?) {
7427            Some(buf) => std::task::Poll::Ready(Some(DictionaryKeysIteratorEvent::decode(buf))),
7428            None => std::task::Poll::Ready(None),
7429        }
7430    }
7431}
7432
7433#[derive(Debug)]
7434pub enum DictionaryKeysIteratorEvent {
7435    #[non_exhaustive]
7436    _UnknownEvent {
7437        /// Ordinal of the event that was sent.
7438        ordinal: u64,
7439    },
7440}
7441
7442impl DictionaryKeysIteratorEvent {
7443    /// Decodes a message buffer as a [`DictionaryKeysIteratorEvent`].
7444    fn decode(
7445        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7446    ) -> Result<DictionaryKeysIteratorEvent, fidl::Error> {
7447        let (bytes, _handles) = buf.split_mut();
7448        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7449        debug_assert_eq!(tx_header.tx_id, 0);
7450        match tx_header.ordinal {
7451            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7452                Ok(DictionaryKeysIteratorEvent::_UnknownEvent { ordinal: tx_header.ordinal })
7453            }
7454            _ => Err(fidl::Error::UnknownOrdinal {
7455                ordinal: tx_header.ordinal,
7456                protocol_name:
7457                    <DictionaryKeysIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7458            }),
7459        }
7460    }
7461}
7462
7463/// A Stream of incoming requests for fuchsia.component.sandbox/DictionaryKeysIterator.
7464pub struct DictionaryKeysIteratorRequestStream {
7465    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7466    is_terminated: bool,
7467}
7468
7469impl std::marker::Unpin for DictionaryKeysIteratorRequestStream {}
7470
7471impl futures::stream::FusedStream for DictionaryKeysIteratorRequestStream {
7472    fn is_terminated(&self) -> bool {
7473        self.is_terminated
7474    }
7475}
7476
7477impl fidl::endpoints::RequestStream for DictionaryKeysIteratorRequestStream {
7478    type Protocol = DictionaryKeysIteratorMarker;
7479    type ControlHandle = DictionaryKeysIteratorControlHandle;
7480
7481    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
7482        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7483    }
7484
7485    fn control_handle(&self) -> Self::ControlHandle {
7486        DictionaryKeysIteratorControlHandle { inner: self.inner.clone() }
7487    }
7488
7489    fn into_inner(
7490        self,
7491    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
7492    {
7493        (self.inner, self.is_terminated)
7494    }
7495
7496    fn from_inner(
7497        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7498        is_terminated: bool,
7499    ) -> Self {
7500        Self { inner, is_terminated }
7501    }
7502}
7503
7504impl futures::Stream for DictionaryKeysIteratorRequestStream {
7505    type Item = Result<DictionaryKeysIteratorRequest, fidl::Error>;
7506
7507    fn poll_next(
7508        mut self: std::pin::Pin<&mut Self>,
7509        cx: &mut std::task::Context<'_>,
7510    ) -> std::task::Poll<Option<Self::Item>> {
7511        let this = &mut *self;
7512        if this.inner.check_shutdown(cx) {
7513            this.is_terminated = true;
7514            return std::task::Poll::Ready(None);
7515        }
7516        if this.is_terminated {
7517            panic!("polled DictionaryKeysIteratorRequestStream after completion");
7518        }
7519        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
7520            |bytes, handles| {
7521                match this.inner.channel().read_etc(cx, bytes, handles) {
7522                    std::task::Poll::Ready(Ok(())) => {}
7523                    std::task::Poll::Pending => return std::task::Poll::Pending,
7524                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
7525                        this.is_terminated = true;
7526                        return std::task::Poll::Ready(None);
7527                    }
7528                    std::task::Poll::Ready(Err(e)) => {
7529                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7530                            e.into(),
7531                        ))));
7532                    }
7533                }
7534
7535                // A message has been received from the channel
7536                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7537
7538                std::task::Poll::Ready(Some(match header.ordinal {
7539                0x453828cbacca7d53 => {
7540                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7541                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
7542                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7543                    let control_handle = DictionaryKeysIteratorControlHandle {
7544                        inner: this.inner.clone(),
7545                    };
7546                    Ok(DictionaryKeysIteratorRequest::GetNext {
7547                        responder: DictionaryKeysIteratorGetNextResponder {
7548                            control_handle: std::mem::ManuallyDrop::new(control_handle),
7549                            tx_id: header.tx_id,
7550                        },
7551                    })
7552                }
7553                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7554                    Ok(DictionaryKeysIteratorRequest::_UnknownMethod {
7555                        ordinal: header.ordinal,
7556                        control_handle: DictionaryKeysIteratorControlHandle { inner: this.inner.clone() },
7557                        method_type: fidl::MethodType::OneWay,
7558                    })
7559                }
7560                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7561                    this.inner.send_framework_err(
7562                        fidl::encoding::FrameworkErr::UnknownMethod,
7563                        header.tx_id,
7564                        header.ordinal,
7565                        header.dynamic_flags(),
7566                        (bytes, handles),
7567                    )?;
7568                    Ok(DictionaryKeysIteratorRequest::_UnknownMethod {
7569                        ordinal: header.ordinal,
7570                        control_handle: DictionaryKeysIteratorControlHandle { inner: this.inner.clone() },
7571                        method_type: fidl::MethodType::TwoWay,
7572                    })
7573                }
7574                _ => Err(fidl::Error::UnknownOrdinal {
7575                    ordinal: header.ordinal,
7576                    protocol_name: <DictionaryKeysIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7577                }),
7578            }))
7579            },
7580        )
7581    }
7582}
7583
7584#[derive(Debug)]
7585pub enum DictionaryKeysIteratorRequest {
7586    GetNext {
7587        responder: DictionaryKeysIteratorGetNextResponder,
7588    },
7589    /// An interaction was received which does not match any known method.
7590    #[non_exhaustive]
7591    _UnknownMethod {
7592        /// Ordinal of the method that was called.
7593        ordinal: u64,
7594        control_handle: DictionaryKeysIteratorControlHandle,
7595        method_type: fidl::MethodType,
7596    },
7597}
7598
7599impl DictionaryKeysIteratorRequest {
7600    #[allow(irrefutable_let_patterns)]
7601    pub fn into_get_next(self) -> Option<(DictionaryKeysIteratorGetNextResponder)> {
7602        if let DictionaryKeysIteratorRequest::GetNext { responder } = self {
7603            Some((responder))
7604        } else {
7605            None
7606        }
7607    }
7608
7609    /// Name of the method defined in FIDL
7610    pub fn method_name(&self) -> &'static str {
7611        match *self {
7612            DictionaryKeysIteratorRequest::GetNext { .. } => "get_next",
7613            DictionaryKeysIteratorRequest::_UnknownMethod {
7614                method_type: fidl::MethodType::OneWay,
7615                ..
7616            } => "unknown one-way method",
7617            DictionaryKeysIteratorRequest::_UnknownMethod {
7618                method_type: fidl::MethodType::TwoWay,
7619                ..
7620            } => "unknown two-way method",
7621        }
7622    }
7623}
7624
7625#[derive(Debug, Clone)]
7626pub struct DictionaryKeysIteratorControlHandle {
7627    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7628}
7629
7630impl fidl::endpoints::ControlHandle for DictionaryKeysIteratorControlHandle {
7631    fn shutdown(&self) {
7632        self.inner.shutdown()
7633    }
7634
7635    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
7636        self.inner.shutdown_with_epitaph(status)
7637    }
7638
7639    fn is_closed(&self) -> bool {
7640        self.inner.channel().is_closed()
7641    }
7642    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
7643        self.inner.channel().on_closed()
7644    }
7645
7646    #[cfg(target_os = "fuchsia")]
7647    fn signal_peer(
7648        &self,
7649        clear_mask: zx::Signals,
7650        set_mask: zx::Signals,
7651    ) -> Result<(), zx_status::Status> {
7652        use fidl::Peered;
7653        self.inner.channel().signal_peer(clear_mask, set_mask)
7654    }
7655}
7656
7657impl DictionaryKeysIteratorControlHandle {}
7658
7659#[must_use = "FIDL methods require a response to be sent"]
7660#[derive(Debug)]
7661pub struct DictionaryKeysIteratorGetNextResponder {
7662    control_handle: std::mem::ManuallyDrop<DictionaryKeysIteratorControlHandle>,
7663    tx_id: u32,
7664}
7665
7666/// Set the the channel to be shutdown (see [`DictionaryKeysIteratorControlHandle::shutdown`])
7667/// if the responder is dropped without sending a response, so that the client
7668/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7669impl std::ops::Drop for DictionaryKeysIteratorGetNextResponder {
7670    fn drop(&mut self) {
7671        self.control_handle.shutdown();
7672        // Safety: drops once, never accessed again
7673        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7674    }
7675}
7676
7677impl fidl::endpoints::Responder for DictionaryKeysIteratorGetNextResponder {
7678    type ControlHandle = DictionaryKeysIteratorControlHandle;
7679
7680    fn control_handle(&self) -> &DictionaryKeysIteratorControlHandle {
7681        &self.control_handle
7682    }
7683
7684    fn drop_without_shutdown(mut self) {
7685        // Safety: drops once, never accessed again due to mem::forget
7686        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7687        // Prevent Drop from running (which would shut down the channel)
7688        std::mem::forget(self);
7689    }
7690}
7691
7692impl DictionaryKeysIteratorGetNextResponder {
7693    /// Sends a response to the FIDL transaction.
7694    ///
7695    /// Sets the channel to shutdown if an error occurs.
7696    pub fn send(self, mut keys: &[String]) -> Result<(), fidl::Error> {
7697        let _result = self.send_raw(keys);
7698        if _result.is_err() {
7699            self.control_handle.shutdown();
7700        }
7701        self.drop_without_shutdown();
7702        _result
7703    }
7704
7705    /// Similar to "send" but does not shutdown the channel if an error occurs.
7706    pub fn send_no_shutdown_on_err(self, mut keys: &[String]) -> Result<(), fidl::Error> {
7707        let _result = self.send_raw(keys);
7708        self.drop_without_shutdown();
7709        _result
7710    }
7711
7712    fn send_raw(&self, mut keys: &[String]) -> Result<(), fidl::Error> {
7713        self.control_handle
7714            .inner
7715            .send::<fidl::encoding::FlexibleType<DictionaryKeysIteratorGetNextResponse>>(
7716                fidl::encoding::Flexible::new((keys,)),
7717                self.tx_id,
7718                0x453828cbacca7d53,
7719                fidl::encoding::DynamicFlags::FLEXIBLE,
7720            )
7721    }
7722}
7723
7724#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
7725pub struct DictionaryRouterMarker;
7726
7727impl fidl::endpoints::ProtocolMarker for DictionaryRouterMarker {
7728    type Proxy = DictionaryRouterProxy;
7729    type RequestStream = DictionaryRouterRequestStream;
7730    #[cfg(target_os = "fuchsia")]
7731    type SynchronousProxy = DictionaryRouterSynchronousProxy;
7732
7733    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.DictionaryRouter";
7734}
7735impl fidl::endpoints::DiscoverableProtocolMarker for DictionaryRouterMarker {}
7736pub type DictionaryRouterRouteResult = Result<DictionaryRouterRouteResponse, RouterError>;
7737
7738pub trait DictionaryRouterProxyInterface: Send + Sync {
7739    type RouteResponseFut: std::future::Future<Output = Result<DictionaryRouterRouteResult, fidl::Error>>
7740        + Send;
7741    fn r#route(&self, payload: RouteRequest) -> Self::RouteResponseFut;
7742}
7743#[derive(Debug)]
7744#[cfg(target_os = "fuchsia")]
7745pub struct DictionaryRouterSynchronousProxy {
7746    client: fidl::client::sync::Client,
7747}
7748
7749#[cfg(target_os = "fuchsia")]
7750impl fidl::endpoints::SynchronousProxy for DictionaryRouterSynchronousProxy {
7751    type Proxy = DictionaryRouterProxy;
7752    type Protocol = DictionaryRouterMarker;
7753
7754    fn from_channel(inner: fidl::Channel) -> Self {
7755        Self::new(inner)
7756    }
7757
7758    fn into_channel(self) -> fidl::Channel {
7759        self.client.into_channel()
7760    }
7761
7762    fn as_channel(&self) -> &fidl::Channel {
7763        self.client.as_channel()
7764    }
7765}
7766
7767#[cfg(target_os = "fuchsia")]
7768impl DictionaryRouterSynchronousProxy {
7769    pub fn new(channel: fidl::Channel) -> Self {
7770        Self { client: fidl::client::sync::Client::new(channel) }
7771    }
7772
7773    pub fn into_channel(self) -> fidl::Channel {
7774        self.client.into_channel()
7775    }
7776
7777    /// Waits until an event arrives and returns it. It is safe for other
7778    /// threads to make concurrent requests while waiting for an event.
7779    pub fn wait_for_event(
7780        &self,
7781        deadline: zx::MonotonicInstant,
7782    ) -> Result<DictionaryRouterEvent, fidl::Error> {
7783        DictionaryRouterEvent::decode(
7784            self.client.wait_for_event::<DictionaryRouterMarker>(deadline)?,
7785        )
7786    }
7787
7788    pub fn r#route(
7789        &self,
7790        mut payload: RouteRequest,
7791        ___deadline: zx::MonotonicInstant,
7792    ) -> Result<DictionaryRouterRouteResult, fidl::Error> {
7793        let _response = self.client.send_query::<
7794            RouteRequest,
7795            fidl::encoding::FlexibleResultType<DictionaryRouterRouteResponse, RouterError>,
7796            DictionaryRouterMarker,
7797        >(
7798            &mut payload,
7799            0x714c65bfe54bd79f,
7800            fidl::encoding::DynamicFlags::FLEXIBLE,
7801            ___deadline,
7802        )?
7803        .into_result::<DictionaryRouterMarker>("route")?;
7804        Ok(_response.map(|x| x))
7805    }
7806}
7807
7808#[cfg(target_os = "fuchsia")]
7809impl From<DictionaryRouterSynchronousProxy> for zx::NullableHandle {
7810    fn from(value: DictionaryRouterSynchronousProxy) -> Self {
7811        value.into_channel().into()
7812    }
7813}
7814
7815#[cfg(target_os = "fuchsia")]
7816impl From<fidl::Channel> for DictionaryRouterSynchronousProxy {
7817    fn from(value: fidl::Channel) -> Self {
7818        Self::new(value)
7819    }
7820}
7821
7822#[cfg(target_os = "fuchsia")]
7823impl fidl::endpoints::FromClient for DictionaryRouterSynchronousProxy {
7824    type Protocol = DictionaryRouterMarker;
7825
7826    fn from_client(value: fidl::endpoints::ClientEnd<DictionaryRouterMarker>) -> Self {
7827        Self::new(value.into_channel())
7828    }
7829}
7830
7831#[derive(Debug, Clone)]
7832pub struct DictionaryRouterProxy {
7833    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
7834}
7835
7836impl fidl::endpoints::Proxy for DictionaryRouterProxy {
7837    type Protocol = DictionaryRouterMarker;
7838
7839    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
7840        Self::new(inner)
7841    }
7842
7843    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
7844        self.client.into_channel().map_err(|client| Self { client })
7845    }
7846
7847    fn as_channel(&self) -> &::fidl::AsyncChannel {
7848        self.client.as_channel()
7849    }
7850}
7851
7852impl DictionaryRouterProxy {
7853    /// Create a new Proxy for fuchsia.component.sandbox/DictionaryRouter.
7854    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
7855        let protocol_name = <DictionaryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7856        Self { client: fidl::client::Client::new(channel, protocol_name) }
7857    }
7858
7859    /// Get a Stream of events from the remote end of the protocol.
7860    ///
7861    /// # Panics
7862    ///
7863    /// Panics if the event stream was already taken.
7864    pub fn take_event_stream(&self) -> DictionaryRouterEventStream {
7865        DictionaryRouterEventStream { event_receiver: self.client.take_event_receiver() }
7866    }
7867
7868    pub fn r#route(
7869        &self,
7870        mut payload: RouteRequest,
7871    ) -> fidl::client::QueryResponseFut<
7872        DictionaryRouterRouteResult,
7873        fidl::encoding::DefaultFuchsiaResourceDialect,
7874    > {
7875        DictionaryRouterProxyInterface::r#route(self, payload)
7876    }
7877}
7878
7879impl DictionaryRouterProxyInterface for DictionaryRouterProxy {
7880    type RouteResponseFut = fidl::client::QueryResponseFut<
7881        DictionaryRouterRouteResult,
7882        fidl::encoding::DefaultFuchsiaResourceDialect,
7883    >;
7884    fn r#route(&self, mut payload: RouteRequest) -> Self::RouteResponseFut {
7885        fn _decode(
7886            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7887        ) -> Result<DictionaryRouterRouteResult, fidl::Error> {
7888            let _response = fidl::client::decode_transaction_body::<
7889                fidl::encoding::FlexibleResultType<DictionaryRouterRouteResponse, RouterError>,
7890                fidl::encoding::DefaultFuchsiaResourceDialect,
7891                0x714c65bfe54bd79f,
7892            >(_buf?)?
7893            .into_result::<DictionaryRouterMarker>("route")?;
7894            Ok(_response.map(|x| x))
7895        }
7896        self.client.send_query_and_decode::<RouteRequest, DictionaryRouterRouteResult>(
7897            &mut payload,
7898            0x714c65bfe54bd79f,
7899            fidl::encoding::DynamicFlags::FLEXIBLE,
7900            _decode,
7901        )
7902    }
7903}
7904
7905pub struct DictionaryRouterEventStream {
7906    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
7907}
7908
7909impl std::marker::Unpin for DictionaryRouterEventStream {}
7910
7911impl futures::stream::FusedStream for DictionaryRouterEventStream {
7912    fn is_terminated(&self) -> bool {
7913        self.event_receiver.is_terminated()
7914    }
7915}
7916
7917impl futures::Stream for DictionaryRouterEventStream {
7918    type Item = Result<DictionaryRouterEvent, fidl::Error>;
7919
7920    fn poll_next(
7921        mut self: std::pin::Pin<&mut Self>,
7922        cx: &mut std::task::Context<'_>,
7923    ) -> std::task::Poll<Option<Self::Item>> {
7924        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7925            &mut self.event_receiver,
7926            cx
7927        )?) {
7928            Some(buf) => std::task::Poll::Ready(Some(DictionaryRouterEvent::decode(buf))),
7929            None => std::task::Poll::Ready(None),
7930        }
7931    }
7932}
7933
7934#[derive(Debug)]
7935pub enum DictionaryRouterEvent {
7936    #[non_exhaustive]
7937    _UnknownEvent {
7938        /// Ordinal of the event that was sent.
7939        ordinal: u64,
7940    },
7941}
7942
7943impl DictionaryRouterEvent {
7944    /// Decodes a message buffer as a [`DictionaryRouterEvent`].
7945    fn decode(
7946        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7947    ) -> Result<DictionaryRouterEvent, fidl::Error> {
7948        let (bytes, _handles) = buf.split_mut();
7949        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7950        debug_assert_eq!(tx_header.tx_id, 0);
7951        match tx_header.ordinal {
7952            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7953                Ok(DictionaryRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
7954            }
7955            _ => Err(fidl::Error::UnknownOrdinal {
7956                ordinal: tx_header.ordinal,
7957                protocol_name:
7958                    <DictionaryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7959            }),
7960        }
7961    }
7962}
7963
7964/// A Stream of incoming requests for fuchsia.component.sandbox/DictionaryRouter.
7965pub struct DictionaryRouterRequestStream {
7966    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7967    is_terminated: bool,
7968}
7969
7970impl std::marker::Unpin for DictionaryRouterRequestStream {}
7971
7972impl futures::stream::FusedStream for DictionaryRouterRequestStream {
7973    fn is_terminated(&self) -> bool {
7974        self.is_terminated
7975    }
7976}
7977
7978impl fidl::endpoints::RequestStream for DictionaryRouterRequestStream {
7979    type Protocol = DictionaryRouterMarker;
7980    type ControlHandle = DictionaryRouterControlHandle;
7981
7982    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
7983        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7984    }
7985
7986    fn control_handle(&self) -> Self::ControlHandle {
7987        DictionaryRouterControlHandle { inner: self.inner.clone() }
7988    }
7989
7990    fn into_inner(
7991        self,
7992    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
7993    {
7994        (self.inner, self.is_terminated)
7995    }
7996
7997    fn from_inner(
7998        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7999        is_terminated: bool,
8000    ) -> Self {
8001        Self { inner, is_terminated }
8002    }
8003}
8004
8005impl futures::Stream for DictionaryRouterRequestStream {
8006    type Item = Result<DictionaryRouterRequest, fidl::Error>;
8007
8008    fn poll_next(
8009        mut self: std::pin::Pin<&mut Self>,
8010        cx: &mut std::task::Context<'_>,
8011    ) -> std::task::Poll<Option<Self::Item>> {
8012        let this = &mut *self;
8013        if this.inner.check_shutdown(cx) {
8014            this.is_terminated = true;
8015            return std::task::Poll::Ready(None);
8016        }
8017        if this.is_terminated {
8018            panic!("polled DictionaryRouterRequestStream after completion");
8019        }
8020        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
8021            |bytes, handles| {
8022                match this.inner.channel().read_etc(cx, bytes, handles) {
8023                    std::task::Poll::Ready(Ok(())) => {}
8024                    std::task::Poll::Pending => return std::task::Poll::Pending,
8025                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
8026                        this.is_terminated = true;
8027                        return std::task::Poll::Ready(None);
8028                    }
8029                    std::task::Poll::Ready(Err(e)) => {
8030                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
8031                            e.into(),
8032                        ))));
8033                    }
8034                }
8035
8036                // A message has been received from the channel
8037                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8038
8039                std::task::Poll::Ready(Some(match header.ordinal {
8040                    0x714c65bfe54bd79f => {
8041                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
8042                        let mut req = fidl::new_empty!(
8043                            RouteRequest,
8044                            fidl::encoding::DefaultFuchsiaResourceDialect
8045                        );
8046                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RouteRequest>(&header, _body_bytes, handles, &mut req)?;
8047                        let control_handle =
8048                            DictionaryRouterControlHandle { inner: this.inner.clone() };
8049                        Ok(DictionaryRouterRequest::Route {
8050                            payload: req,
8051                            responder: DictionaryRouterRouteResponder {
8052                                control_handle: std::mem::ManuallyDrop::new(control_handle),
8053                                tx_id: header.tx_id,
8054                            },
8055                        })
8056                    }
8057                    _ if header.tx_id == 0
8058                        && header
8059                            .dynamic_flags()
8060                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
8061                    {
8062                        Ok(DictionaryRouterRequest::_UnknownMethod {
8063                            ordinal: header.ordinal,
8064                            control_handle: DictionaryRouterControlHandle {
8065                                inner: this.inner.clone(),
8066                            },
8067                            method_type: fidl::MethodType::OneWay,
8068                        })
8069                    }
8070                    _ if header
8071                        .dynamic_flags()
8072                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
8073                    {
8074                        this.inner.send_framework_err(
8075                            fidl::encoding::FrameworkErr::UnknownMethod,
8076                            header.tx_id,
8077                            header.ordinal,
8078                            header.dynamic_flags(),
8079                            (bytes, handles),
8080                        )?;
8081                        Ok(DictionaryRouterRequest::_UnknownMethod {
8082                            ordinal: header.ordinal,
8083                            control_handle: DictionaryRouterControlHandle {
8084                                inner: this.inner.clone(),
8085                            },
8086                            method_type: fidl::MethodType::TwoWay,
8087                        })
8088                    }
8089                    _ => Err(fidl::Error::UnknownOrdinal {
8090                        ordinal: header.ordinal,
8091                        protocol_name:
8092                            <DictionaryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8093                    }),
8094                }))
8095            },
8096        )
8097    }
8098}
8099
8100#[derive(Debug)]
8101pub enum DictionaryRouterRequest {
8102    Route {
8103        payload: RouteRequest,
8104        responder: DictionaryRouterRouteResponder,
8105    },
8106    /// An interaction was received which does not match any known method.
8107    #[non_exhaustive]
8108    _UnknownMethod {
8109        /// Ordinal of the method that was called.
8110        ordinal: u64,
8111        control_handle: DictionaryRouterControlHandle,
8112        method_type: fidl::MethodType,
8113    },
8114}
8115
8116impl DictionaryRouterRequest {
8117    #[allow(irrefutable_let_patterns)]
8118    pub fn into_route(self) -> Option<(RouteRequest, DictionaryRouterRouteResponder)> {
8119        if let DictionaryRouterRequest::Route { payload, responder } = self {
8120            Some((payload, responder))
8121        } else {
8122            None
8123        }
8124    }
8125
8126    /// Name of the method defined in FIDL
8127    pub fn method_name(&self) -> &'static str {
8128        match *self {
8129            DictionaryRouterRequest::Route { .. } => "route",
8130            DictionaryRouterRequest::_UnknownMethod {
8131                method_type: fidl::MethodType::OneWay,
8132                ..
8133            } => "unknown one-way method",
8134            DictionaryRouterRequest::_UnknownMethod {
8135                method_type: fidl::MethodType::TwoWay,
8136                ..
8137            } => "unknown two-way method",
8138        }
8139    }
8140}
8141
8142#[derive(Debug, Clone)]
8143pub struct DictionaryRouterControlHandle {
8144    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8145}
8146
8147impl fidl::endpoints::ControlHandle for DictionaryRouterControlHandle {
8148    fn shutdown(&self) {
8149        self.inner.shutdown()
8150    }
8151
8152    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
8153        self.inner.shutdown_with_epitaph(status)
8154    }
8155
8156    fn is_closed(&self) -> bool {
8157        self.inner.channel().is_closed()
8158    }
8159    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
8160        self.inner.channel().on_closed()
8161    }
8162
8163    #[cfg(target_os = "fuchsia")]
8164    fn signal_peer(
8165        &self,
8166        clear_mask: zx::Signals,
8167        set_mask: zx::Signals,
8168    ) -> Result<(), zx_status::Status> {
8169        use fidl::Peered;
8170        self.inner.channel().signal_peer(clear_mask, set_mask)
8171    }
8172}
8173
8174impl DictionaryRouterControlHandle {}
8175
8176#[must_use = "FIDL methods require a response to be sent"]
8177#[derive(Debug)]
8178pub struct DictionaryRouterRouteResponder {
8179    control_handle: std::mem::ManuallyDrop<DictionaryRouterControlHandle>,
8180    tx_id: u32,
8181}
8182
8183/// Set the the channel to be shutdown (see [`DictionaryRouterControlHandle::shutdown`])
8184/// if the responder is dropped without sending a response, so that the client
8185/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8186impl std::ops::Drop for DictionaryRouterRouteResponder {
8187    fn drop(&mut self) {
8188        self.control_handle.shutdown();
8189        // Safety: drops once, never accessed again
8190        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8191    }
8192}
8193
8194impl fidl::endpoints::Responder for DictionaryRouterRouteResponder {
8195    type ControlHandle = DictionaryRouterControlHandle;
8196
8197    fn control_handle(&self) -> &DictionaryRouterControlHandle {
8198        &self.control_handle
8199    }
8200
8201    fn drop_without_shutdown(mut self) {
8202        // Safety: drops once, never accessed again due to mem::forget
8203        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8204        // Prevent Drop from running (which would shut down the channel)
8205        std::mem::forget(self);
8206    }
8207}
8208
8209impl DictionaryRouterRouteResponder {
8210    /// Sends a response to the FIDL transaction.
8211    ///
8212    /// Sets the channel to shutdown if an error occurs.
8213    pub fn send(
8214        self,
8215        mut result: Result<DictionaryRouterRouteResponse, RouterError>,
8216    ) -> Result<(), fidl::Error> {
8217        let _result = self.send_raw(result);
8218        if _result.is_err() {
8219            self.control_handle.shutdown();
8220        }
8221        self.drop_without_shutdown();
8222        _result
8223    }
8224
8225    /// Similar to "send" but does not shutdown the channel if an error occurs.
8226    pub fn send_no_shutdown_on_err(
8227        self,
8228        mut result: Result<DictionaryRouterRouteResponse, RouterError>,
8229    ) -> Result<(), fidl::Error> {
8230        let _result = self.send_raw(result);
8231        self.drop_without_shutdown();
8232        _result
8233    }
8234
8235    fn send_raw(
8236        &self,
8237        mut result: Result<DictionaryRouterRouteResponse, RouterError>,
8238    ) -> Result<(), fidl::Error> {
8239        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
8240            DictionaryRouterRouteResponse,
8241            RouterError,
8242        >>(
8243            fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
8244            self.tx_id,
8245            0x714c65bfe54bd79f,
8246            fidl::encoding::DynamicFlags::FLEXIBLE,
8247        )
8248    }
8249}
8250
8251#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
8252pub struct DirConnectorRouterMarker;
8253
8254impl fidl::endpoints::ProtocolMarker for DirConnectorRouterMarker {
8255    type Proxy = DirConnectorRouterProxy;
8256    type RequestStream = DirConnectorRouterRequestStream;
8257    #[cfg(target_os = "fuchsia")]
8258    type SynchronousProxy = DirConnectorRouterSynchronousProxy;
8259
8260    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.DirConnectorRouter";
8261}
8262impl fidl::endpoints::DiscoverableProtocolMarker for DirConnectorRouterMarker {}
8263pub type DirConnectorRouterRouteResult = Result<DirConnectorRouterRouteResponse, RouterError>;
8264
8265pub trait DirConnectorRouterProxyInterface: Send + Sync {
8266    type RouteResponseFut: std::future::Future<Output = Result<DirConnectorRouterRouteResult, fidl::Error>>
8267        + Send;
8268    fn r#route(&self, payload: RouteRequest) -> Self::RouteResponseFut;
8269}
8270#[derive(Debug)]
8271#[cfg(target_os = "fuchsia")]
8272pub struct DirConnectorRouterSynchronousProxy {
8273    client: fidl::client::sync::Client,
8274}
8275
8276#[cfg(target_os = "fuchsia")]
8277impl fidl::endpoints::SynchronousProxy for DirConnectorRouterSynchronousProxy {
8278    type Proxy = DirConnectorRouterProxy;
8279    type Protocol = DirConnectorRouterMarker;
8280
8281    fn from_channel(inner: fidl::Channel) -> Self {
8282        Self::new(inner)
8283    }
8284
8285    fn into_channel(self) -> fidl::Channel {
8286        self.client.into_channel()
8287    }
8288
8289    fn as_channel(&self) -> &fidl::Channel {
8290        self.client.as_channel()
8291    }
8292}
8293
8294#[cfg(target_os = "fuchsia")]
8295impl DirConnectorRouterSynchronousProxy {
8296    pub fn new(channel: fidl::Channel) -> Self {
8297        Self { client: fidl::client::sync::Client::new(channel) }
8298    }
8299
8300    pub fn into_channel(self) -> fidl::Channel {
8301        self.client.into_channel()
8302    }
8303
8304    /// Waits until an event arrives and returns it. It is safe for other
8305    /// threads to make concurrent requests while waiting for an event.
8306    pub fn wait_for_event(
8307        &self,
8308        deadline: zx::MonotonicInstant,
8309    ) -> Result<DirConnectorRouterEvent, fidl::Error> {
8310        DirConnectorRouterEvent::decode(
8311            self.client.wait_for_event::<DirConnectorRouterMarker>(deadline)?,
8312        )
8313    }
8314
8315    pub fn r#route(
8316        &self,
8317        mut payload: RouteRequest,
8318        ___deadline: zx::MonotonicInstant,
8319    ) -> Result<DirConnectorRouterRouteResult, fidl::Error> {
8320        let _response = self.client.send_query::<
8321            RouteRequest,
8322            fidl::encoding::FlexibleResultType<DirConnectorRouterRouteResponse, RouterError>,
8323            DirConnectorRouterMarker,
8324        >(
8325            &mut payload,
8326            0xd7e0f01da2c8e40,
8327            fidl::encoding::DynamicFlags::FLEXIBLE,
8328            ___deadline,
8329        )?
8330        .into_result::<DirConnectorRouterMarker>("route")?;
8331        Ok(_response.map(|x| x))
8332    }
8333}
8334
8335#[cfg(target_os = "fuchsia")]
8336impl From<DirConnectorRouterSynchronousProxy> for zx::NullableHandle {
8337    fn from(value: DirConnectorRouterSynchronousProxy) -> Self {
8338        value.into_channel().into()
8339    }
8340}
8341
8342#[cfg(target_os = "fuchsia")]
8343impl From<fidl::Channel> for DirConnectorRouterSynchronousProxy {
8344    fn from(value: fidl::Channel) -> Self {
8345        Self::new(value)
8346    }
8347}
8348
8349#[cfg(target_os = "fuchsia")]
8350impl fidl::endpoints::FromClient for DirConnectorRouterSynchronousProxy {
8351    type Protocol = DirConnectorRouterMarker;
8352
8353    fn from_client(value: fidl::endpoints::ClientEnd<DirConnectorRouterMarker>) -> Self {
8354        Self::new(value.into_channel())
8355    }
8356}
8357
8358#[derive(Debug, Clone)]
8359pub struct DirConnectorRouterProxy {
8360    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
8361}
8362
8363impl fidl::endpoints::Proxy for DirConnectorRouterProxy {
8364    type Protocol = DirConnectorRouterMarker;
8365
8366    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
8367        Self::new(inner)
8368    }
8369
8370    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
8371        self.client.into_channel().map_err(|client| Self { client })
8372    }
8373
8374    fn as_channel(&self) -> &::fidl::AsyncChannel {
8375        self.client.as_channel()
8376    }
8377}
8378
8379impl DirConnectorRouterProxy {
8380    /// Create a new Proxy for fuchsia.component.sandbox/DirConnectorRouter.
8381    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
8382        let protocol_name =
8383            <DirConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8384        Self { client: fidl::client::Client::new(channel, protocol_name) }
8385    }
8386
8387    /// Get a Stream of events from the remote end of the protocol.
8388    ///
8389    /// # Panics
8390    ///
8391    /// Panics if the event stream was already taken.
8392    pub fn take_event_stream(&self) -> DirConnectorRouterEventStream {
8393        DirConnectorRouterEventStream { event_receiver: self.client.take_event_receiver() }
8394    }
8395
8396    pub fn r#route(
8397        &self,
8398        mut payload: RouteRequest,
8399    ) -> fidl::client::QueryResponseFut<
8400        DirConnectorRouterRouteResult,
8401        fidl::encoding::DefaultFuchsiaResourceDialect,
8402    > {
8403        DirConnectorRouterProxyInterface::r#route(self, payload)
8404    }
8405}
8406
8407impl DirConnectorRouterProxyInterface for DirConnectorRouterProxy {
8408    type RouteResponseFut = fidl::client::QueryResponseFut<
8409        DirConnectorRouterRouteResult,
8410        fidl::encoding::DefaultFuchsiaResourceDialect,
8411    >;
8412    fn r#route(&self, mut payload: RouteRequest) -> Self::RouteResponseFut {
8413        fn _decode(
8414            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8415        ) -> Result<DirConnectorRouterRouteResult, fidl::Error> {
8416            let _response = fidl::client::decode_transaction_body::<
8417                fidl::encoding::FlexibleResultType<DirConnectorRouterRouteResponse, RouterError>,
8418                fidl::encoding::DefaultFuchsiaResourceDialect,
8419                0xd7e0f01da2c8e40,
8420            >(_buf?)?
8421            .into_result::<DirConnectorRouterMarker>("route")?;
8422            Ok(_response.map(|x| x))
8423        }
8424        self.client.send_query_and_decode::<RouteRequest, DirConnectorRouterRouteResult>(
8425            &mut payload,
8426            0xd7e0f01da2c8e40,
8427            fidl::encoding::DynamicFlags::FLEXIBLE,
8428            _decode,
8429        )
8430    }
8431}
8432
8433pub struct DirConnectorRouterEventStream {
8434    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
8435}
8436
8437impl std::marker::Unpin for DirConnectorRouterEventStream {}
8438
8439impl futures::stream::FusedStream for DirConnectorRouterEventStream {
8440    fn is_terminated(&self) -> bool {
8441        self.event_receiver.is_terminated()
8442    }
8443}
8444
8445impl futures::Stream for DirConnectorRouterEventStream {
8446    type Item = Result<DirConnectorRouterEvent, fidl::Error>;
8447
8448    fn poll_next(
8449        mut self: std::pin::Pin<&mut Self>,
8450        cx: &mut std::task::Context<'_>,
8451    ) -> std::task::Poll<Option<Self::Item>> {
8452        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
8453            &mut self.event_receiver,
8454            cx
8455        )?) {
8456            Some(buf) => std::task::Poll::Ready(Some(DirConnectorRouterEvent::decode(buf))),
8457            None => std::task::Poll::Ready(None),
8458        }
8459    }
8460}
8461
8462#[derive(Debug)]
8463pub enum DirConnectorRouterEvent {
8464    #[non_exhaustive]
8465    _UnknownEvent {
8466        /// Ordinal of the event that was sent.
8467        ordinal: u64,
8468    },
8469}
8470
8471impl DirConnectorRouterEvent {
8472    /// Decodes a message buffer as a [`DirConnectorRouterEvent`].
8473    fn decode(
8474        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
8475    ) -> Result<DirConnectorRouterEvent, fidl::Error> {
8476        let (bytes, _handles) = buf.split_mut();
8477        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8478        debug_assert_eq!(tx_header.tx_id, 0);
8479        match tx_header.ordinal {
8480            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
8481                Ok(DirConnectorRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
8482            }
8483            _ => Err(fidl::Error::UnknownOrdinal {
8484                ordinal: tx_header.ordinal,
8485                protocol_name:
8486                    <DirConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8487            }),
8488        }
8489    }
8490}
8491
8492/// A Stream of incoming requests for fuchsia.component.sandbox/DirConnectorRouter.
8493pub struct DirConnectorRouterRequestStream {
8494    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8495    is_terminated: bool,
8496}
8497
8498impl std::marker::Unpin for DirConnectorRouterRequestStream {}
8499
8500impl futures::stream::FusedStream for DirConnectorRouterRequestStream {
8501    fn is_terminated(&self) -> bool {
8502        self.is_terminated
8503    }
8504}
8505
8506impl fidl::endpoints::RequestStream for DirConnectorRouterRequestStream {
8507    type Protocol = DirConnectorRouterMarker;
8508    type ControlHandle = DirConnectorRouterControlHandle;
8509
8510    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
8511        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
8512    }
8513
8514    fn control_handle(&self) -> Self::ControlHandle {
8515        DirConnectorRouterControlHandle { inner: self.inner.clone() }
8516    }
8517
8518    fn into_inner(
8519        self,
8520    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
8521    {
8522        (self.inner, self.is_terminated)
8523    }
8524
8525    fn from_inner(
8526        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8527        is_terminated: bool,
8528    ) -> Self {
8529        Self { inner, is_terminated }
8530    }
8531}
8532
8533impl futures::Stream for DirConnectorRouterRequestStream {
8534    type Item = Result<DirConnectorRouterRequest, fidl::Error>;
8535
8536    fn poll_next(
8537        mut self: std::pin::Pin<&mut Self>,
8538        cx: &mut std::task::Context<'_>,
8539    ) -> std::task::Poll<Option<Self::Item>> {
8540        let this = &mut *self;
8541        if this.inner.check_shutdown(cx) {
8542            this.is_terminated = true;
8543            return std::task::Poll::Ready(None);
8544        }
8545        if this.is_terminated {
8546            panic!("polled DirConnectorRouterRequestStream after completion");
8547        }
8548        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
8549            |bytes, handles| {
8550                match this.inner.channel().read_etc(cx, bytes, handles) {
8551                    std::task::Poll::Ready(Ok(())) => {}
8552                    std::task::Poll::Pending => return std::task::Poll::Pending,
8553                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
8554                        this.is_terminated = true;
8555                        return std::task::Poll::Ready(None);
8556                    }
8557                    std::task::Poll::Ready(Err(e)) => {
8558                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
8559                            e.into(),
8560                        ))));
8561                    }
8562                }
8563
8564                // A message has been received from the channel
8565                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8566
8567                std::task::Poll::Ready(Some(match header.ordinal {
8568                0xd7e0f01da2c8e40 => {
8569                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
8570                    let mut req = fidl::new_empty!(RouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
8571                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RouteRequest>(&header, _body_bytes, handles, &mut req)?;
8572                    let control_handle = DirConnectorRouterControlHandle {
8573                        inner: this.inner.clone(),
8574                    };
8575                    Ok(DirConnectorRouterRequest::Route {payload: req,
8576                        responder: DirConnectorRouterRouteResponder {
8577                            control_handle: std::mem::ManuallyDrop::new(control_handle),
8578                            tx_id: header.tx_id,
8579                        },
8580                    })
8581                }
8582                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
8583                    Ok(DirConnectorRouterRequest::_UnknownMethod {
8584                        ordinal: header.ordinal,
8585                        control_handle: DirConnectorRouterControlHandle { inner: this.inner.clone() },
8586                        method_type: fidl::MethodType::OneWay,
8587                    })
8588                }
8589                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
8590                    this.inner.send_framework_err(
8591                        fidl::encoding::FrameworkErr::UnknownMethod,
8592                        header.tx_id,
8593                        header.ordinal,
8594                        header.dynamic_flags(),
8595                        (bytes, handles),
8596                    )?;
8597                    Ok(DirConnectorRouterRequest::_UnknownMethod {
8598                        ordinal: header.ordinal,
8599                        control_handle: DirConnectorRouterControlHandle { inner: this.inner.clone() },
8600                        method_type: fidl::MethodType::TwoWay,
8601                    })
8602                }
8603                _ => Err(fidl::Error::UnknownOrdinal {
8604                    ordinal: header.ordinal,
8605                    protocol_name: <DirConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8606                }),
8607            }))
8608            },
8609        )
8610    }
8611}
8612
8613#[derive(Debug)]
8614pub enum DirConnectorRouterRequest {
8615    Route {
8616        payload: RouteRequest,
8617        responder: DirConnectorRouterRouteResponder,
8618    },
8619    /// An interaction was received which does not match any known method.
8620    #[non_exhaustive]
8621    _UnknownMethod {
8622        /// Ordinal of the method that was called.
8623        ordinal: u64,
8624        control_handle: DirConnectorRouterControlHandle,
8625        method_type: fidl::MethodType,
8626    },
8627}
8628
8629impl DirConnectorRouterRequest {
8630    #[allow(irrefutable_let_patterns)]
8631    pub fn into_route(self) -> Option<(RouteRequest, DirConnectorRouterRouteResponder)> {
8632        if let DirConnectorRouterRequest::Route { payload, responder } = self {
8633            Some((payload, responder))
8634        } else {
8635            None
8636        }
8637    }
8638
8639    /// Name of the method defined in FIDL
8640    pub fn method_name(&self) -> &'static str {
8641        match *self {
8642            DirConnectorRouterRequest::Route { .. } => "route",
8643            DirConnectorRouterRequest::_UnknownMethod {
8644                method_type: fidl::MethodType::OneWay,
8645                ..
8646            } => "unknown one-way method",
8647            DirConnectorRouterRequest::_UnknownMethod {
8648                method_type: fidl::MethodType::TwoWay,
8649                ..
8650            } => "unknown two-way method",
8651        }
8652    }
8653}
8654
8655#[derive(Debug, Clone)]
8656pub struct DirConnectorRouterControlHandle {
8657    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8658}
8659
8660impl fidl::endpoints::ControlHandle for DirConnectorRouterControlHandle {
8661    fn shutdown(&self) {
8662        self.inner.shutdown()
8663    }
8664
8665    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
8666        self.inner.shutdown_with_epitaph(status)
8667    }
8668
8669    fn is_closed(&self) -> bool {
8670        self.inner.channel().is_closed()
8671    }
8672    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
8673        self.inner.channel().on_closed()
8674    }
8675
8676    #[cfg(target_os = "fuchsia")]
8677    fn signal_peer(
8678        &self,
8679        clear_mask: zx::Signals,
8680        set_mask: zx::Signals,
8681    ) -> Result<(), zx_status::Status> {
8682        use fidl::Peered;
8683        self.inner.channel().signal_peer(clear_mask, set_mask)
8684    }
8685}
8686
8687impl DirConnectorRouterControlHandle {}
8688
8689#[must_use = "FIDL methods require a response to be sent"]
8690#[derive(Debug)]
8691pub struct DirConnectorRouterRouteResponder {
8692    control_handle: std::mem::ManuallyDrop<DirConnectorRouterControlHandle>,
8693    tx_id: u32,
8694}
8695
8696/// Set the the channel to be shutdown (see [`DirConnectorRouterControlHandle::shutdown`])
8697/// if the responder is dropped without sending a response, so that the client
8698/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8699impl std::ops::Drop for DirConnectorRouterRouteResponder {
8700    fn drop(&mut self) {
8701        self.control_handle.shutdown();
8702        // Safety: drops once, never accessed again
8703        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8704    }
8705}
8706
8707impl fidl::endpoints::Responder for DirConnectorRouterRouteResponder {
8708    type ControlHandle = DirConnectorRouterControlHandle;
8709
8710    fn control_handle(&self) -> &DirConnectorRouterControlHandle {
8711        &self.control_handle
8712    }
8713
8714    fn drop_without_shutdown(mut self) {
8715        // Safety: drops once, never accessed again due to mem::forget
8716        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8717        // Prevent Drop from running (which would shut down the channel)
8718        std::mem::forget(self);
8719    }
8720}
8721
8722impl DirConnectorRouterRouteResponder {
8723    /// Sends a response to the FIDL transaction.
8724    ///
8725    /// Sets the channel to shutdown if an error occurs.
8726    pub fn send(
8727        self,
8728        mut result: Result<DirConnectorRouterRouteResponse, RouterError>,
8729    ) -> Result<(), fidl::Error> {
8730        let _result = self.send_raw(result);
8731        if _result.is_err() {
8732            self.control_handle.shutdown();
8733        }
8734        self.drop_without_shutdown();
8735        _result
8736    }
8737
8738    /// Similar to "send" but does not shutdown the channel if an error occurs.
8739    pub fn send_no_shutdown_on_err(
8740        self,
8741        mut result: Result<DirConnectorRouterRouteResponse, RouterError>,
8742    ) -> Result<(), fidl::Error> {
8743        let _result = self.send_raw(result);
8744        self.drop_without_shutdown();
8745        _result
8746    }
8747
8748    fn send_raw(
8749        &self,
8750        mut result: Result<DirConnectorRouterRouteResponse, RouterError>,
8751    ) -> Result<(), fidl::Error> {
8752        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
8753            DirConnectorRouterRouteResponse,
8754            RouterError,
8755        >>(
8756            fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
8757            self.tx_id,
8758            0xd7e0f01da2c8e40,
8759            fidl::encoding::DynamicFlags::FLEXIBLE,
8760        )
8761    }
8762}
8763
8764#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
8765pub struct DirEntryRouterMarker;
8766
8767impl fidl::endpoints::ProtocolMarker for DirEntryRouterMarker {
8768    type Proxy = DirEntryRouterProxy;
8769    type RequestStream = DirEntryRouterRequestStream;
8770    #[cfg(target_os = "fuchsia")]
8771    type SynchronousProxy = DirEntryRouterSynchronousProxy;
8772
8773    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.DirEntryRouter";
8774}
8775impl fidl::endpoints::DiscoverableProtocolMarker for DirEntryRouterMarker {}
8776pub type DirEntryRouterRouteResult = Result<DirEntryRouterRouteResponse, RouterError>;
8777
8778pub trait DirEntryRouterProxyInterface: Send + Sync {
8779    type RouteResponseFut: std::future::Future<Output = Result<DirEntryRouterRouteResult, fidl::Error>>
8780        + Send;
8781    fn r#route(&self, payload: RouteRequest) -> Self::RouteResponseFut;
8782}
8783#[derive(Debug)]
8784#[cfg(target_os = "fuchsia")]
8785pub struct DirEntryRouterSynchronousProxy {
8786    client: fidl::client::sync::Client,
8787}
8788
8789#[cfg(target_os = "fuchsia")]
8790impl fidl::endpoints::SynchronousProxy for DirEntryRouterSynchronousProxy {
8791    type Proxy = DirEntryRouterProxy;
8792    type Protocol = DirEntryRouterMarker;
8793
8794    fn from_channel(inner: fidl::Channel) -> Self {
8795        Self::new(inner)
8796    }
8797
8798    fn into_channel(self) -> fidl::Channel {
8799        self.client.into_channel()
8800    }
8801
8802    fn as_channel(&self) -> &fidl::Channel {
8803        self.client.as_channel()
8804    }
8805}
8806
8807#[cfg(target_os = "fuchsia")]
8808impl DirEntryRouterSynchronousProxy {
8809    pub fn new(channel: fidl::Channel) -> Self {
8810        Self { client: fidl::client::sync::Client::new(channel) }
8811    }
8812
8813    pub fn into_channel(self) -> fidl::Channel {
8814        self.client.into_channel()
8815    }
8816
8817    /// Waits until an event arrives and returns it. It is safe for other
8818    /// threads to make concurrent requests while waiting for an event.
8819    pub fn wait_for_event(
8820        &self,
8821        deadline: zx::MonotonicInstant,
8822    ) -> Result<DirEntryRouterEvent, fidl::Error> {
8823        DirEntryRouterEvent::decode(self.client.wait_for_event::<DirEntryRouterMarker>(deadline)?)
8824    }
8825
8826    pub fn r#route(
8827        &self,
8828        mut payload: RouteRequest,
8829        ___deadline: zx::MonotonicInstant,
8830    ) -> Result<DirEntryRouterRouteResult, fidl::Error> {
8831        let _response = self.client.send_query::<
8832            RouteRequest,
8833            fidl::encoding::FlexibleResultType<DirEntryRouterRouteResponse, RouterError>,
8834            DirEntryRouterMarker,
8835        >(
8836            &mut payload,
8837            0x1ac694001c208bd2,
8838            fidl::encoding::DynamicFlags::FLEXIBLE,
8839            ___deadline,
8840        )?
8841        .into_result::<DirEntryRouterMarker>("route")?;
8842        Ok(_response.map(|x| x))
8843    }
8844}
8845
8846#[cfg(target_os = "fuchsia")]
8847impl From<DirEntryRouterSynchronousProxy> for zx::NullableHandle {
8848    fn from(value: DirEntryRouterSynchronousProxy) -> Self {
8849        value.into_channel().into()
8850    }
8851}
8852
8853#[cfg(target_os = "fuchsia")]
8854impl From<fidl::Channel> for DirEntryRouterSynchronousProxy {
8855    fn from(value: fidl::Channel) -> Self {
8856        Self::new(value)
8857    }
8858}
8859
8860#[cfg(target_os = "fuchsia")]
8861impl fidl::endpoints::FromClient for DirEntryRouterSynchronousProxy {
8862    type Protocol = DirEntryRouterMarker;
8863
8864    fn from_client(value: fidl::endpoints::ClientEnd<DirEntryRouterMarker>) -> Self {
8865        Self::new(value.into_channel())
8866    }
8867}
8868
8869#[derive(Debug, Clone)]
8870pub struct DirEntryRouterProxy {
8871    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
8872}
8873
8874impl fidl::endpoints::Proxy for DirEntryRouterProxy {
8875    type Protocol = DirEntryRouterMarker;
8876
8877    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
8878        Self::new(inner)
8879    }
8880
8881    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
8882        self.client.into_channel().map_err(|client| Self { client })
8883    }
8884
8885    fn as_channel(&self) -> &::fidl::AsyncChannel {
8886        self.client.as_channel()
8887    }
8888}
8889
8890impl DirEntryRouterProxy {
8891    /// Create a new Proxy for fuchsia.component.sandbox/DirEntryRouter.
8892    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
8893        let protocol_name = <DirEntryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8894        Self { client: fidl::client::Client::new(channel, protocol_name) }
8895    }
8896
8897    /// Get a Stream of events from the remote end of the protocol.
8898    ///
8899    /// # Panics
8900    ///
8901    /// Panics if the event stream was already taken.
8902    pub fn take_event_stream(&self) -> DirEntryRouterEventStream {
8903        DirEntryRouterEventStream { event_receiver: self.client.take_event_receiver() }
8904    }
8905
8906    pub fn r#route(
8907        &self,
8908        mut payload: RouteRequest,
8909    ) -> fidl::client::QueryResponseFut<
8910        DirEntryRouterRouteResult,
8911        fidl::encoding::DefaultFuchsiaResourceDialect,
8912    > {
8913        DirEntryRouterProxyInterface::r#route(self, payload)
8914    }
8915}
8916
8917impl DirEntryRouterProxyInterface for DirEntryRouterProxy {
8918    type RouteResponseFut = fidl::client::QueryResponseFut<
8919        DirEntryRouterRouteResult,
8920        fidl::encoding::DefaultFuchsiaResourceDialect,
8921    >;
8922    fn r#route(&self, mut payload: RouteRequest) -> Self::RouteResponseFut {
8923        fn _decode(
8924            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8925        ) -> Result<DirEntryRouterRouteResult, fidl::Error> {
8926            let _response = fidl::client::decode_transaction_body::<
8927                fidl::encoding::FlexibleResultType<DirEntryRouterRouteResponse, RouterError>,
8928                fidl::encoding::DefaultFuchsiaResourceDialect,
8929                0x1ac694001c208bd2,
8930            >(_buf?)?
8931            .into_result::<DirEntryRouterMarker>("route")?;
8932            Ok(_response.map(|x| x))
8933        }
8934        self.client.send_query_and_decode::<RouteRequest, DirEntryRouterRouteResult>(
8935            &mut payload,
8936            0x1ac694001c208bd2,
8937            fidl::encoding::DynamicFlags::FLEXIBLE,
8938            _decode,
8939        )
8940    }
8941}
8942
8943pub struct DirEntryRouterEventStream {
8944    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
8945}
8946
8947impl std::marker::Unpin for DirEntryRouterEventStream {}
8948
8949impl futures::stream::FusedStream for DirEntryRouterEventStream {
8950    fn is_terminated(&self) -> bool {
8951        self.event_receiver.is_terminated()
8952    }
8953}
8954
8955impl futures::Stream for DirEntryRouterEventStream {
8956    type Item = Result<DirEntryRouterEvent, fidl::Error>;
8957
8958    fn poll_next(
8959        mut self: std::pin::Pin<&mut Self>,
8960        cx: &mut std::task::Context<'_>,
8961    ) -> std::task::Poll<Option<Self::Item>> {
8962        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
8963            &mut self.event_receiver,
8964            cx
8965        )?) {
8966            Some(buf) => std::task::Poll::Ready(Some(DirEntryRouterEvent::decode(buf))),
8967            None => std::task::Poll::Ready(None),
8968        }
8969    }
8970}
8971
8972#[derive(Debug)]
8973pub enum DirEntryRouterEvent {
8974    #[non_exhaustive]
8975    _UnknownEvent {
8976        /// Ordinal of the event that was sent.
8977        ordinal: u64,
8978    },
8979}
8980
8981impl DirEntryRouterEvent {
8982    /// Decodes a message buffer as a [`DirEntryRouterEvent`].
8983    fn decode(
8984        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
8985    ) -> Result<DirEntryRouterEvent, fidl::Error> {
8986        let (bytes, _handles) = buf.split_mut();
8987        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8988        debug_assert_eq!(tx_header.tx_id, 0);
8989        match tx_header.ordinal {
8990            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
8991                Ok(DirEntryRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
8992            }
8993            _ => Err(fidl::Error::UnknownOrdinal {
8994                ordinal: tx_header.ordinal,
8995                protocol_name:
8996                    <DirEntryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8997            }),
8998        }
8999    }
9000}
9001
9002/// A Stream of incoming requests for fuchsia.component.sandbox/DirEntryRouter.
9003pub struct DirEntryRouterRequestStream {
9004    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9005    is_terminated: bool,
9006}
9007
9008impl std::marker::Unpin for DirEntryRouterRequestStream {}
9009
9010impl futures::stream::FusedStream for DirEntryRouterRequestStream {
9011    fn is_terminated(&self) -> bool {
9012        self.is_terminated
9013    }
9014}
9015
9016impl fidl::endpoints::RequestStream for DirEntryRouterRequestStream {
9017    type Protocol = DirEntryRouterMarker;
9018    type ControlHandle = DirEntryRouterControlHandle;
9019
9020    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
9021        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
9022    }
9023
9024    fn control_handle(&self) -> Self::ControlHandle {
9025        DirEntryRouterControlHandle { inner: self.inner.clone() }
9026    }
9027
9028    fn into_inner(
9029        self,
9030    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
9031    {
9032        (self.inner, self.is_terminated)
9033    }
9034
9035    fn from_inner(
9036        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9037        is_terminated: bool,
9038    ) -> Self {
9039        Self { inner, is_terminated }
9040    }
9041}
9042
9043impl futures::Stream for DirEntryRouterRequestStream {
9044    type Item = Result<DirEntryRouterRequest, fidl::Error>;
9045
9046    fn poll_next(
9047        mut self: std::pin::Pin<&mut Self>,
9048        cx: &mut std::task::Context<'_>,
9049    ) -> std::task::Poll<Option<Self::Item>> {
9050        let this = &mut *self;
9051        if this.inner.check_shutdown(cx) {
9052            this.is_terminated = true;
9053            return std::task::Poll::Ready(None);
9054        }
9055        if this.is_terminated {
9056            panic!("polled DirEntryRouterRequestStream after completion");
9057        }
9058        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
9059            |bytes, handles| {
9060                match this.inner.channel().read_etc(cx, bytes, handles) {
9061                    std::task::Poll::Ready(Ok(())) => {}
9062                    std::task::Poll::Pending => return std::task::Poll::Pending,
9063                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
9064                        this.is_terminated = true;
9065                        return std::task::Poll::Ready(None);
9066                    }
9067                    std::task::Poll::Ready(Err(e)) => {
9068                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
9069                            e.into(),
9070                        ))));
9071                    }
9072                }
9073
9074                // A message has been received from the channel
9075                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9076
9077                std::task::Poll::Ready(Some(match header.ordinal {
9078                    0x1ac694001c208bd2 => {
9079                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9080                        let mut req = fidl::new_empty!(
9081                            RouteRequest,
9082                            fidl::encoding::DefaultFuchsiaResourceDialect
9083                        );
9084                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RouteRequest>(&header, _body_bytes, handles, &mut req)?;
9085                        let control_handle =
9086                            DirEntryRouterControlHandle { inner: this.inner.clone() };
9087                        Ok(DirEntryRouterRequest::Route {
9088                            payload: req,
9089                            responder: DirEntryRouterRouteResponder {
9090                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9091                                tx_id: header.tx_id,
9092                            },
9093                        })
9094                    }
9095                    _ if header.tx_id == 0
9096                        && header
9097                            .dynamic_flags()
9098                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
9099                    {
9100                        Ok(DirEntryRouterRequest::_UnknownMethod {
9101                            ordinal: header.ordinal,
9102                            control_handle: DirEntryRouterControlHandle {
9103                                inner: this.inner.clone(),
9104                            },
9105                            method_type: fidl::MethodType::OneWay,
9106                        })
9107                    }
9108                    _ if header
9109                        .dynamic_flags()
9110                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
9111                    {
9112                        this.inner.send_framework_err(
9113                            fidl::encoding::FrameworkErr::UnknownMethod,
9114                            header.tx_id,
9115                            header.ordinal,
9116                            header.dynamic_flags(),
9117                            (bytes, handles),
9118                        )?;
9119                        Ok(DirEntryRouterRequest::_UnknownMethod {
9120                            ordinal: header.ordinal,
9121                            control_handle: DirEntryRouterControlHandle {
9122                                inner: this.inner.clone(),
9123                            },
9124                            method_type: fidl::MethodType::TwoWay,
9125                        })
9126                    }
9127                    _ => Err(fidl::Error::UnknownOrdinal {
9128                        ordinal: header.ordinal,
9129                        protocol_name:
9130                            <DirEntryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9131                    }),
9132                }))
9133            },
9134        )
9135    }
9136}
9137
9138#[derive(Debug)]
9139pub enum DirEntryRouterRequest {
9140    Route {
9141        payload: RouteRequest,
9142        responder: DirEntryRouterRouteResponder,
9143    },
9144    /// An interaction was received which does not match any known method.
9145    #[non_exhaustive]
9146    _UnknownMethod {
9147        /// Ordinal of the method that was called.
9148        ordinal: u64,
9149        control_handle: DirEntryRouterControlHandle,
9150        method_type: fidl::MethodType,
9151    },
9152}
9153
9154impl DirEntryRouterRequest {
9155    #[allow(irrefutable_let_patterns)]
9156    pub fn into_route(self) -> Option<(RouteRequest, DirEntryRouterRouteResponder)> {
9157        if let DirEntryRouterRequest::Route { payload, responder } = self {
9158            Some((payload, responder))
9159        } else {
9160            None
9161        }
9162    }
9163
9164    /// Name of the method defined in FIDL
9165    pub fn method_name(&self) -> &'static str {
9166        match *self {
9167            DirEntryRouterRequest::Route { .. } => "route",
9168            DirEntryRouterRequest::_UnknownMethod {
9169                method_type: fidl::MethodType::OneWay, ..
9170            } => "unknown one-way method",
9171            DirEntryRouterRequest::_UnknownMethod {
9172                method_type: fidl::MethodType::TwoWay, ..
9173            } => "unknown two-way method",
9174        }
9175    }
9176}
9177
9178#[derive(Debug, Clone)]
9179pub struct DirEntryRouterControlHandle {
9180    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9181}
9182
9183impl fidl::endpoints::ControlHandle for DirEntryRouterControlHandle {
9184    fn shutdown(&self) {
9185        self.inner.shutdown()
9186    }
9187
9188    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
9189        self.inner.shutdown_with_epitaph(status)
9190    }
9191
9192    fn is_closed(&self) -> bool {
9193        self.inner.channel().is_closed()
9194    }
9195    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
9196        self.inner.channel().on_closed()
9197    }
9198
9199    #[cfg(target_os = "fuchsia")]
9200    fn signal_peer(
9201        &self,
9202        clear_mask: zx::Signals,
9203        set_mask: zx::Signals,
9204    ) -> Result<(), zx_status::Status> {
9205        use fidl::Peered;
9206        self.inner.channel().signal_peer(clear_mask, set_mask)
9207    }
9208}
9209
9210impl DirEntryRouterControlHandle {}
9211
9212#[must_use = "FIDL methods require a response to be sent"]
9213#[derive(Debug)]
9214pub struct DirEntryRouterRouteResponder {
9215    control_handle: std::mem::ManuallyDrop<DirEntryRouterControlHandle>,
9216    tx_id: u32,
9217}
9218
9219/// Set the the channel to be shutdown (see [`DirEntryRouterControlHandle::shutdown`])
9220/// if the responder is dropped without sending a response, so that the client
9221/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9222impl std::ops::Drop for DirEntryRouterRouteResponder {
9223    fn drop(&mut self) {
9224        self.control_handle.shutdown();
9225        // Safety: drops once, never accessed again
9226        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9227    }
9228}
9229
9230impl fidl::endpoints::Responder for DirEntryRouterRouteResponder {
9231    type ControlHandle = DirEntryRouterControlHandle;
9232
9233    fn control_handle(&self) -> &DirEntryRouterControlHandle {
9234        &self.control_handle
9235    }
9236
9237    fn drop_without_shutdown(mut self) {
9238        // Safety: drops once, never accessed again due to mem::forget
9239        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9240        // Prevent Drop from running (which would shut down the channel)
9241        std::mem::forget(self);
9242    }
9243}
9244
9245impl DirEntryRouterRouteResponder {
9246    /// Sends a response to the FIDL transaction.
9247    ///
9248    /// Sets the channel to shutdown if an error occurs.
9249    pub fn send(
9250        self,
9251        mut result: Result<DirEntryRouterRouteResponse, RouterError>,
9252    ) -> Result<(), fidl::Error> {
9253        let _result = self.send_raw(result);
9254        if _result.is_err() {
9255            self.control_handle.shutdown();
9256        }
9257        self.drop_without_shutdown();
9258        _result
9259    }
9260
9261    /// Similar to "send" but does not shutdown the channel if an error occurs.
9262    pub fn send_no_shutdown_on_err(
9263        self,
9264        mut result: Result<DirEntryRouterRouteResponse, RouterError>,
9265    ) -> Result<(), fidl::Error> {
9266        let _result = self.send_raw(result);
9267        self.drop_without_shutdown();
9268        _result
9269    }
9270
9271    fn send_raw(
9272        &self,
9273        mut result: Result<DirEntryRouterRouteResponse, RouterError>,
9274    ) -> Result<(), fidl::Error> {
9275        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
9276            DirEntryRouterRouteResponse,
9277            RouterError,
9278        >>(
9279            fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
9280            self.tx_id,
9281            0x1ac694001c208bd2,
9282            fidl::encoding::DynamicFlags::FLEXIBLE,
9283        )
9284    }
9285}
9286
9287#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
9288pub struct DirReceiverMarker;
9289
9290impl fidl::endpoints::ProtocolMarker for DirReceiverMarker {
9291    type Proxy = DirReceiverProxy;
9292    type RequestStream = DirReceiverRequestStream;
9293    #[cfg(target_os = "fuchsia")]
9294    type SynchronousProxy = DirReceiverSynchronousProxy;
9295
9296    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.DirReceiver";
9297}
9298impl fidl::endpoints::DiscoverableProtocolMarker for DirReceiverMarker {}
9299
9300pub trait DirReceiverProxyInterface: Send + Sync {
9301    fn r#receive(&self, payload: DirReceiverReceiveRequest) -> Result<(), fidl::Error>;
9302}
9303#[derive(Debug)]
9304#[cfg(target_os = "fuchsia")]
9305pub struct DirReceiverSynchronousProxy {
9306    client: fidl::client::sync::Client,
9307}
9308
9309#[cfg(target_os = "fuchsia")]
9310impl fidl::endpoints::SynchronousProxy for DirReceiverSynchronousProxy {
9311    type Proxy = DirReceiverProxy;
9312    type Protocol = DirReceiverMarker;
9313
9314    fn from_channel(inner: fidl::Channel) -> Self {
9315        Self::new(inner)
9316    }
9317
9318    fn into_channel(self) -> fidl::Channel {
9319        self.client.into_channel()
9320    }
9321
9322    fn as_channel(&self) -> &fidl::Channel {
9323        self.client.as_channel()
9324    }
9325}
9326
9327#[cfg(target_os = "fuchsia")]
9328impl DirReceiverSynchronousProxy {
9329    pub fn new(channel: fidl::Channel) -> Self {
9330        Self { client: fidl::client::sync::Client::new(channel) }
9331    }
9332
9333    pub fn into_channel(self) -> fidl::Channel {
9334        self.client.into_channel()
9335    }
9336
9337    /// Waits until an event arrives and returns it. It is safe for other
9338    /// threads to make concurrent requests while waiting for an event.
9339    pub fn wait_for_event(
9340        &self,
9341        deadline: zx::MonotonicInstant,
9342    ) -> Result<DirReceiverEvent, fidl::Error> {
9343        DirReceiverEvent::decode(self.client.wait_for_event::<DirReceiverMarker>(deadline)?)
9344    }
9345
9346    /// Sends a directory channel to this receiver.
9347    ///
9348    /// The server should implement this method by forwarding `channel` to a vfs instance
9349    /// of the language appropriate `vfs` library.
9350    pub fn r#receive(&self, mut payload: DirReceiverReceiveRequest) -> Result<(), fidl::Error> {
9351        self.client.send::<DirReceiverReceiveRequest>(
9352            &mut payload,
9353            0xcdc3e9b89fe7bb4,
9354            fidl::encoding::DynamicFlags::FLEXIBLE,
9355        )
9356    }
9357}
9358
9359#[cfg(target_os = "fuchsia")]
9360impl From<DirReceiverSynchronousProxy> for zx::NullableHandle {
9361    fn from(value: DirReceiverSynchronousProxy) -> Self {
9362        value.into_channel().into()
9363    }
9364}
9365
9366#[cfg(target_os = "fuchsia")]
9367impl From<fidl::Channel> for DirReceiverSynchronousProxy {
9368    fn from(value: fidl::Channel) -> Self {
9369        Self::new(value)
9370    }
9371}
9372
9373#[cfg(target_os = "fuchsia")]
9374impl fidl::endpoints::FromClient for DirReceiverSynchronousProxy {
9375    type Protocol = DirReceiverMarker;
9376
9377    fn from_client(value: fidl::endpoints::ClientEnd<DirReceiverMarker>) -> Self {
9378        Self::new(value.into_channel())
9379    }
9380}
9381
9382#[derive(Debug, Clone)]
9383pub struct DirReceiverProxy {
9384    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
9385}
9386
9387impl fidl::endpoints::Proxy for DirReceiverProxy {
9388    type Protocol = DirReceiverMarker;
9389
9390    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
9391        Self::new(inner)
9392    }
9393
9394    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
9395        self.client.into_channel().map_err(|client| Self { client })
9396    }
9397
9398    fn as_channel(&self) -> &::fidl::AsyncChannel {
9399        self.client.as_channel()
9400    }
9401}
9402
9403impl DirReceiverProxy {
9404    /// Create a new Proxy for fuchsia.component.sandbox/DirReceiver.
9405    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
9406        let protocol_name = <DirReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
9407        Self { client: fidl::client::Client::new(channel, protocol_name) }
9408    }
9409
9410    /// Get a Stream of events from the remote end of the protocol.
9411    ///
9412    /// # Panics
9413    ///
9414    /// Panics if the event stream was already taken.
9415    pub fn take_event_stream(&self) -> DirReceiverEventStream {
9416        DirReceiverEventStream { event_receiver: self.client.take_event_receiver() }
9417    }
9418
9419    /// Sends a directory channel to this receiver.
9420    ///
9421    /// The server should implement this method by forwarding `channel` to a vfs instance
9422    /// of the language appropriate `vfs` library.
9423    pub fn r#receive(&self, mut payload: DirReceiverReceiveRequest) -> Result<(), fidl::Error> {
9424        DirReceiverProxyInterface::r#receive(self, payload)
9425    }
9426}
9427
9428impl DirReceiverProxyInterface for DirReceiverProxy {
9429    fn r#receive(&self, mut payload: DirReceiverReceiveRequest) -> Result<(), fidl::Error> {
9430        self.client.send::<DirReceiverReceiveRequest>(
9431            &mut payload,
9432            0xcdc3e9b89fe7bb4,
9433            fidl::encoding::DynamicFlags::FLEXIBLE,
9434        )
9435    }
9436}
9437
9438pub struct DirReceiverEventStream {
9439    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
9440}
9441
9442impl std::marker::Unpin for DirReceiverEventStream {}
9443
9444impl futures::stream::FusedStream for DirReceiverEventStream {
9445    fn is_terminated(&self) -> bool {
9446        self.event_receiver.is_terminated()
9447    }
9448}
9449
9450impl futures::Stream for DirReceiverEventStream {
9451    type Item = Result<DirReceiverEvent, fidl::Error>;
9452
9453    fn poll_next(
9454        mut self: std::pin::Pin<&mut Self>,
9455        cx: &mut std::task::Context<'_>,
9456    ) -> std::task::Poll<Option<Self::Item>> {
9457        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
9458            &mut self.event_receiver,
9459            cx
9460        )?) {
9461            Some(buf) => std::task::Poll::Ready(Some(DirReceiverEvent::decode(buf))),
9462            None => std::task::Poll::Ready(None),
9463        }
9464    }
9465}
9466
9467#[derive(Debug)]
9468pub enum DirReceiverEvent {
9469    #[non_exhaustive]
9470    _UnknownEvent {
9471        /// Ordinal of the event that was sent.
9472        ordinal: u64,
9473    },
9474}
9475
9476impl DirReceiverEvent {
9477    /// Decodes a message buffer as a [`DirReceiverEvent`].
9478    fn decode(
9479        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
9480    ) -> Result<DirReceiverEvent, fidl::Error> {
9481        let (bytes, _handles) = buf.split_mut();
9482        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9483        debug_assert_eq!(tx_header.tx_id, 0);
9484        match tx_header.ordinal {
9485            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
9486                Ok(DirReceiverEvent::_UnknownEvent { ordinal: tx_header.ordinal })
9487            }
9488            _ => Err(fidl::Error::UnknownOrdinal {
9489                ordinal: tx_header.ordinal,
9490                protocol_name: <DirReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9491            }),
9492        }
9493    }
9494}
9495
9496/// A Stream of incoming requests for fuchsia.component.sandbox/DirReceiver.
9497pub struct DirReceiverRequestStream {
9498    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9499    is_terminated: bool,
9500}
9501
9502impl std::marker::Unpin for DirReceiverRequestStream {}
9503
9504impl futures::stream::FusedStream for DirReceiverRequestStream {
9505    fn is_terminated(&self) -> bool {
9506        self.is_terminated
9507    }
9508}
9509
9510impl fidl::endpoints::RequestStream for DirReceiverRequestStream {
9511    type Protocol = DirReceiverMarker;
9512    type ControlHandle = DirReceiverControlHandle;
9513
9514    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
9515        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
9516    }
9517
9518    fn control_handle(&self) -> Self::ControlHandle {
9519        DirReceiverControlHandle { inner: self.inner.clone() }
9520    }
9521
9522    fn into_inner(
9523        self,
9524    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
9525    {
9526        (self.inner, self.is_terminated)
9527    }
9528
9529    fn from_inner(
9530        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9531        is_terminated: bool,
9532    ) -> Self {
9533        Self { inner, is_terminated }
9534    }
9535}
9536
9537impl futures::Stream for DirReceiverRequestStream {
9538    type Item = Result<DirReceiverRequest, fidl::Error>;
9539
9540    fn poll_next(
9541        mut self: std::pin::Pin<&mut Self>,
9542        cx: &mut std::task::Context<'_>,
9543    ) -> std::task::Poll<Option<Self::Item>> {
9544        let this = &mut *self;
9545        if this.inner.check_shutdown(cx) {
9546            this.is_terminated = true;
9547            return std::task::Poll::Ready(None);
9548        }
9549        if this.is_terminated {
9550            panic!("polled DirReceiverRequestStream after completion");
9551        }
9552        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
9553            |bytes, handles| {
9554                match this.inner.channel().read_etc(cx, bytes, handles) {
9555                    std::task::Poll::Ready(Ok(())) => {}
9556                    std::task::Poll::Pending => return std::task::Poll::Pending,
9557                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
9558                        this.is_terminated = true;
9559                        return std::task::Poll::Ready(None);
9560                    }
9561                    std::task::Poll::Ready(Err(e)) => {
9562                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
9563                            e.into(),
9564                        ))));
9565                    }
9566                }
9567
9568                // A message has been received from the channel
9569                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9570
9571                std::task::Poll::Ready(Some(match header.ordinal {
9572                    0xcdc3e9b89fe7bb4 => {
9573                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
9574                        let mut req = fidl::new_empty!(
9575                            DirReceiverReceiveRequest,
9576                            fidl::encoding::DefaultFuchsiaResourceDialect
9577                        );
9578                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirReceiverReceiveRequest>(&header, _body_bytes, handles, &mut req)?;
9579                        let control_handle = DirReceiverControlHandle { inner: this.inner.clone() };
9580                        Ok(DirReceiverRequest::Receive { payload: req, control_handle })
9581                    }
9582                    _ if header.tx_id == 0
9583                        && header
9584                            .dynamic_flags()
9585                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
9586                    {
9587                        Ok(DirReceiverRequest::_UnknownMethod {
9588                            ordinal: header.ordinal,
9589                            control_handle: DirReceiverControlHandle { inner: this.inner.clone() },
9590                            method_type: fidl::MethodType::OneWay,
9591                        })
9592                    }
9593                    _ if header
9594                        .dynamic_flags()
9595                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
9596                    {
9597                        this.inner.send_framework_err(
9598                            fidl::encoding::FrameworkErr::UnknownMethod,
9599                            header.tx_id,
9600                            header.ordinal,
9601                            header.dynamic_flags(),
9602                            (bytes, handles),
9603                        )?;
9604                        Ok(DirReceiverRequest::_UnknownMethod {
9605                            ordinal: header.ordinal,
9606                            control_handle: DirReceiverControlHandle { inner: this.inner.clone() },
9607                            method_type: fidl::MethodType::TwoWay,
9608                        })
9609                    }
9610                    _ => Err(fidl::Error::UnknownOrdinal {
9611                        ordinal: header.ordinal,
9612                        protocol_name:
9613                            <DirReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9614                    }),
9615                }))
9616            },
9617        )
9618    }
9619}
9620
9621/// A receiver is served by components and allows them to receive directory channels
9622/// framework.
9623#[derive(Debug)]
9624pub enum DirReceiverRequest {
9625    /// Sends a directory channel to this receiver.
9626    ///
9627    /// The server should implement this method by forwarding `channel` to a vfs instance
9628    /// of the language appropriate `vfs` library.
9629    Receive { payload: DirReceiverReceiveRequest, control_handle: DirReceiverControlHandle },
9630    /// An interaction was received which does not match any known method.
9631    #[non_exhaustive]
9632    _UnknownMethod {
9633        /// Ordinal of the method that was called.
9634        ordinal: u64,
9635        control_handle: DirReceiverControlHandle,
9636        method_type: fidl::MethodType,
9637    },
9638}
9639
9640impl DirReceiverRequest {
9641    #[allow(irrefutable_let_patterns)]
9642    pub fn into_receive(self) -> Option<(DirReceiverReceiveRequest, DirReceiverControlHandle)> {
9643        if let DirReceiverRequest::Receive { payload, control_handle } = self {
9644            Some((payload, control_handle))
9645        } else {
9646            None
9647        }
9648    }
9649
9650    /// Name of the method defined in FIDL
9651    pub fn method_name(&self) -> &'static str {
9652        match *self {
9653            DirReceiverRequest::Receive { .. } => "receive",
9654            DirReceiverRequest::_UnknownMethod {
9655                method_type: fidl::MethodType::OneWay, ..
9656            } => "unknown one-way method",
9657            DirReceiverRequest::_UnknownMethod {
9658                method_type: fidl::MethodType::TwoWay, ..
9659            } => "unknown two-way method",
9660        }
9661    }
9662}
9663
9664#[derive(Debug, Clone)]
9665pub struct DirReceiverControlHandle {
9666    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9667}
9668
9669impl fidl::endpoints::ControlHandle for DirReceiverControlHandle {
9670    fn shutdown(&self) {
9671        self.inner.shutdown()
9672    }
9673
9674    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
9675        self.inner.shutdown_with_epitaph(status)
9676    }
9677
9678    fn is_closed(&self) -> bool {
9679        self.inner.channel().is_closed()
9680    }
9681    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
9682        self.inner.channel().on_closed()
9683    }
9684
9685    #[cfg(target_os = "fuchsia")]
9686    fn signal_peer(
9687        &self,
9688        clear_mask: zx::Signals,
9689        set_mask: zx::Signals,
9690    ) -> Result<(), zx_status::Status> {
9691        use fidl::Peered;
9692        self.inner.channel().signal_peer(clear_mask, set_mask)
9693    }
9694}
9695
9696impl DirReceiverControlHandle {}
9697
9698#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
9699pub struct DirectoryRouterMarker;
9700
9701impl fidl::endpoints::ProtocolMarker for DirectoryRouterMarker {
9702    type Proxy = DirectoryRouterProxy;
9703    type RequestStream = DirectoryRouterRequestStream;
9704    #[cfg(target_os = "fuchsia")]
9705    type SynchronousProxy = DirectoryRouterSynchronousProxy;
9706
9707    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.DirectoryRouter";
9708}
9709impl fidl::endpoints::DiscoverableProtocolMarker for DirectoryRouterMarker {}
9710pub type DirectoryRouterRouteResult = Result<DirectoryRouterRouteResponse, RouterError>;
9711
9712pub trait DirectoryRouterProxyInterface: Send + Sync {
9713    type RouteResponseFut: std::future::Future<Output = Result<DirectoryRouterRouteResult, fidl::Error>>
9714        + Send;
9715    fn r#route(&self, payload: RouteRequest) -> Self::RouteResponseFut;
9716}
9717#[derive(Debug)]
9718#[cfg(target_os = "fuchsia")]
9719pub struct DirectoryRouterSynchronousProxy {
9720    client: fidl::client::sync::Client,
9721}
9722
9723#[cfg(target_os = "fuchsia")]
9724impl fidl::endpoints::SynchronousProxy for DirectoryRouterSynchronousProxy {
9725    type Proxy = DirectoryRouterProxy;
9726    type Protocol = DirectoryRouterMarker;
9727
9728    fn from_channel(inner: fidl::Channel) -> Self {
9729        Self::new(inner)
9730    }
9731
9732    fn into_channel(self) -> fidl::Channel {
9733        self.client.into_channel()
9734    }
9735
9736    fn as_channel(&self) -> &fidl::Channel {
9737        self.client.as_channel()
9738    }
9739}
9740
9741#[cfg(target_os = "fuchsia")]
9742impl DirectoryRouterSynchronousProxy {
9743    pub fn new(channel: fidl::Channel) -> Self {
9744        Self { client: fidl::client::sync::Client::new(channel) }
9745    }
9746
9747    pub fn into_channel(self) -> fidl::Channel {
9748        self.client.into_channel()
9749    }
9750
9751    /// Waits until an event arrives and returns it. It is safe for other
9752    /// threads to make concurrent requests while waiting for an event.
9753    pub fn wait_for_event(
9754        &self,
9755        deadline: zx::MonotonicInstant,
9756    ) -> Result<DirectoryRouterEvent, fidl::Error> {
9757        DirectoryRouterEvent::decode(self.client.wait_for_event::<DirectoryRouterMarker>(deadline)?)
9758    }
9759
9760    pub fn r#route(
9761        &self,
9762        mut payload: RouteRequest,
9763        ___deadline: zx::MonotonicInstant,
9764    ) -> Result<DirectoryRouterRouteResult, fidl::Error> {
9765        let _response = self.client.send_query::<
9766            RouteRequest,
9767            fidl::encoding::FlexibleResultType<DirectoryRouterRouteResponse, RouterError>,
9768            DirectoryRouterMarker,
9769        >(
9770            &mut payload,
9771            0x683b6c6be21b0f21,
9772            fidl::encoding::DynamicFlags::FLEXIBLE,
9773            ___deadline,
9774        )?
9775        .into_result::<DirectoryRouterMarker>("route")?;
9776        Ok(_response.map(|x| x))
9777    }
9778}
9779
9780#[cfg(target_os = "fuchsia")]
9781impl From<DirectoryRouterSynchronousProxy> for zx::NullableHandle {
9782    fn from(value: DirectoryRouterSynchronousProxy) -> Self {
9783        value.into_channel().into()
9784    }
9785}
9786
9787#[cfg(target_os = "fuchsia")]
9788impl From<fidl::Channel> for DirectoryRouterSynchronousProxy {
9789    fn from(value: fidl::Channel) -> Self {
9790        Self::new(value)
9791    }
9792}
9793
9794#[cfg(target_os = "fuchsia")]
9795impl fidl::endpoints::FromClient for DirectoryRouterSynchronousProxy {
9796    type Protocol = DirectoryRouterMarker;
9797
9798    fn from_client(value: fidl::endpoints::ClientEnd<DirectoryRouterMarker>) -> Self {
9799        Self::new(value.into_channel())
9800    }
9801}
9802
9803#[derive(Debug, Clone)]
9804pub struct DirectoryRouterProxy {
9805    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
9806}
9807
9808impl fidl::endpoints::Proxy for DirectoryRouterProxy {
9809    type Protocol = DirectoryRouterMarker;
9810
9811    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
9812        Self::new(inner)
9813    }
9814
9815    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
9816        self.client.into_channel().map_err(|client| Self { client })
9817    }
9818
9819    fn as_channel(&self) -> &::fidl::AsyncChannel {
9820        self.client.as_channel()
9821    }
9822}
9823
9824impl DirectoryRouterProxy {
9825    /// Create a new Proxy for fuchsia.component.sandbox/DirectoryRouter.
9826    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
9827        let protocol_name = <DirectoryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
9828        Self { client: fidl::client::Client::new(channel, protocol_name) }
9829    }
9830
9831    /// Get a Stream of events from the remote end of the protocol.
9832    ///
9833    /// # Panics
9834    ///
9835    /// Panics if the event stream was already taken.
9836    pub fn take_event_stream(&self) -> DirectoryRouterEventStream {
9837        DirectoryRouterEventStream { event_receiver: self.client.take_event_receiver() }
9838    }
9839
9840    pub fn r#route(
9841        &self,
9842        mut payload: RouteRequest,
9843    ) -> fidl::client::QueryResponseFut<
9844        DirectoryRouterRouteResult,
9845        fidl::encoding::DefaultFuchsiaResourceDialect,
9846    > {
9847        DirectoryRouterProxyInterface::r#route(self, payload)
9848    }
9849}
9850
9851impl DirectoryRouterProxyInterface for DirectoryRouterProxy {
9852    type RouteResponseFut = fidl::client::QueryResponseFut<
9853        DirectoryRouterRouteResult,
9854        fidl::encoding::DefaultFuchsiaResourceDialect,
9855    >;
9856    fn r#route(&self, mut payload: RouteRequest) -> Self::RouteResponseFut {
9857        fn _decode(
9858            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9859        ) -> Result<DirectoryRouterRouteResult, fidl::Error> {
9860            let _response = fidl::client::decode_transaction_body::<
9861                fidl::encoding::FlexibleResultType<DirectoryRouterRouteResponse, RouterError>,
9862                fidl::encoding::DefaultFuchsiaResourceDialect,
9863                0x683b6c6be21b0f21,
9864            >(_buf?)?
9865            .into_result::<DirectoryRouterMarker>("route")?;
9866            Ok(_response.map(|x| x))
9867        }
9868        self.client.send_query_and_decode::<RouteRequest, DirectoryRouterRouteResult>(
9869            &mut payload,
9870            0x683b6c6be21b0f21,
9871            fidl::encoding::DynamicFlags::FLEXIBLE,
9872            _decode,
9873        )
9874    }
9875}
9876
9877pub struct DirectoryRouterEventStream {
9878    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
9879}
9880
9881impl std::marker::Unpin for DirectoryRouterEventStream {}
9882
9883impl futures::stream::FusedStream for DirectoryRouterEventStream {
9884    fn is_terminated(&self) -> bool {
9885        self.event_receiver.is_terminated()
9886    }
9887}
9888
9889impl futures::Stream for DirectoryRouterEventStream {
9890    type Item = Result<DirectoryRouterEvent, fidl::Error>;
9891
9892    fn poll_next(
9893        mut self: std::pin::Pin<&mut Self>,
9894        cx: &mut std::task::Context<'_>,
9895    ) -> std::task::Poll<Option<Self::Item>> {
9896        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
9897            &mut self.event_receiver,
9898            cx
9899        )?) {
9900            Some(buf) => std::task::Poll::Ready(Some(DirectoryRouterEvent::decode(buf))),
9901            None => std::task::Poll::Ready(None),
9902        }
9903    }
9904}
9905
9906#[derive(Debug)]
9907pub enum DirectoryRouterEvent {
9908    #[non_exhaustive]
9909    _UnknownEvent {
9910        /// Ordinal of the event that was sent.
9911        ordinal: u64,
9912    },
9913}
9914
9915impl DirectoryRouterEvent {
9916    /// Decodes a message buffer as a [`DirectoryRouterEvent`].
9917    fn decode(
9918        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
9919    ) -> Result<DirectoryRouterEvent, fidl::Error> {
9920        let (bytes, _handles) = buf.split_mut();
9921        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9922        debug_assert_eq!(tx_header.tx_id, 0);
9923        match tx_header.ordinal {
9924            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
9925                Ok(DirectoryRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
9926            }
9927            _ => Err(fidl::Error::UnknownOrdinal {
9928                ordinal: tx_header.ordinal,
9929                protocol_name:
9930                    <DirectoryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9931            }),
9932        }
9933    }
9934}
9935
9936/// A Stream of incoming requests for fuchsia.component.sandbox/DirectoryRouter.
9937pub struct DirectoryRouterRequestStream {
9938    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9939    is_terminated: bool,
9940}
9941
9942impl std::marker::Unpin for DirectoryRouterRequestStream {}
9943
9944impl futures::stream::FusedStream for DirectoryRouterRequestStream {
9945    fn is_terminated(&self) -> bool {
9946        self.is_terminated
9947    }
9948}
9949
9950impl fidl::endpoints::RequestStream for DirectoryRouterRequestStream {
9951    type Protocol = DirectoryRouterMarker;
9952    type ControlHandle = DirectoryRouterControlHandle;
9953
9954    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
9955        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
9956    }
9957
9958    fn control_handle(&self) -> Self::ControlHandle {
9959        DirectoryRouterControlHandle { inner: self.inner.clone() }
9960    }
9961
9962    fn into_inner(
9963        self,
9964    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
9965    {
9966        (self.inner, self.is_terminated)
9967    }
9968
9969    fn from_inner(
9970        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9971        is_terminated: bool,
9972    ) -> Self {
9973        Self { inner, is_terminated }
9974    }
9975}
9976
9977impl futures::Stream for DirectoryRouterRequestStream {
9978    type Item = Result<DirectoryRouterRequest, fidl::Error>;
9979
9980    fn poll_next(
9981        mut self: std::pin::Pin<&mut Self>,
9982        cx: &mut std::task::Context<'_>,
9983    ) -> std::task::Poll<Option<Self::Item>> {
9984        let this = &mut *self;
9985        if this.inner.check_shutdown(cx) {
9986            this.is_terminated = true;
9987            return std::task::Poll::Ready(None);
9988        }
9989        if this.is_terminated {
9990            panic!("polled DirectoryRouterRequestStream after completion");
9991        }
9992        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
9993            |bytes, handles| {
9994                match this.inner.channel().read_etc(cx, bytes, handles) {
9995                    std::task::Poll::Ready(Ok(())) => {}
9996                    std::task::Poll::Pending => return std::task::Poll::Pending,
9997                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
9998                        this.is_terminated = true;
9999                        return std::task::Poll::Ready(None);
10000                    }
10001                    std::task::Poll::Ready(Err(e)) => {
10002                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
10003                            e.into(),
10004                        ))));
10005                    }
10006                }
10007
10008                // A message has been received from the channel
10009                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
10010
10011                std::task::Poll::Ready(Some(match header.ordinal {
10012                    0x683b6c6be21b0f21 => {
10013                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
10014                        let mut req = fidl::new_empty!(
10015                            RouteRequest,
10016                            fidl::encoding::DefaultFuchsiaResourceDialect
10017                        );
10018                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RouteRequest>(&header, _body_bytes, handles, &mut req)?;
10019                        let control_handle =
10020                            DirectoryRouterControlHandle { inner: this.inner.clone() };
10021                        Ok(DirectoryRouterRequest::Route {
10022                            payload: req,
10023                            responder: DirectoryRouterRouteResponder {
10024                                control_handle: std::mem::ManuallyDrop::new(control_handle),
10025                                tx_id: header.tx_id,
10026                            },
10027                        })
10028                    }
10029                    _ if header.tx_id == 0
10030                        && header
10031                            .dynamic_flags()
10032                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
10033                    {
10034                        Ok(DirectoryRouterRequest::_UnknownMethod {
10035                            ordinal: header.ordinal,
10036                            control_handle: DirectoryRouterControlHandle {
10037                                inner: this.inner.clone(),
10038                            },
10039                            method_type: fidl::MethodType::OneWay,
10040                        })
10041                    }
10042                    _ if header
10043                        .dynamic_flags()
10044                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
10045                    {
10046                        this.inner.send_framework_err(
10047                            fidl::encoding::FrameworkErr::UnknownMethod,
10048                            header.tx_id,
10049                            header.ordinal,
10050                            header.dynamic_flags(),
10051                            (bytes, handles),
10052                        )?;
10053                        Ok(DirectoryRouterRequest::_UnknownMethod {
10054                            ordinal: header.ordinal,
10055                            control_handle: DirectoryRouterControlHandle {
10056                                inner: this.inner.clone(),
10057                            },
10058                            method_type: fidl::MethodType::TwoWay,
10059                        })
10060                    }
10061                    _ => Err(fidl::Error::UnknownOrdinal {
10062                        ordinal: header.ordinal,
10063                        protocol_name:
10064                            <DirectoryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
10065                    }),
10066                }))
10067            },
10068        )
10069    }
10070}
10071
10072#[derive(Debug)]
10073pub enum DirectoryRouterRequest {
10074    Route {
10075        payload: RouteRequest,
10076        responder: DirectoryRouterRouteResponder,
10077    },
10078    /// An interaction was received which does not match any known method.
10079    #[non_exhaustive]
10080    _UnknownMethod {
10081        /// Ordinal of the method that was called.
10082        ordinal: u64,
10083        control_handle: DirectoryRouterControlHandle,
10084        method_type: fidl::MethodType,
10085    },
10086}
10087
10088impl DirectoryRouterRequest {
10089    #[allow(irrefutable_let_patterns)]
10090    pub fn into_route(self) -> Option<(RouteRequest, DirectoryRouterRouteResponder)> {
10091        if let DirectoryRouterRequest::Route { payload, responder } = self {
10092            Some((payload, responder))
10093        } else {
10094            None
10095        }
10096    }
10097
10098    /// Name of the method defined in FIDL
10099    pub fn method_name(&self) -> &'static str {
10100        match *self {
10101            DirectoryRouterRequest::Route { .. } => "route",
10102            DirectoryRouterRequest::_UnknownMethod {
10103                method_type: fidl::MethodType::OneWay,
10104                ..
10105            } => "unknown one-way method",
10106            DirectoryRouterRequest::_UnknownMethod {
10107                method_type: fidl::MethodType::TwoWay,
10108                ..
10109            } => "unknown two-way method",
10110        }
10111    }
10112}
10113
10114#[derive(Debug, Clone)]
10115pub struct DirectoryRouterControlHandle {
10116    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10117}
10118
10119impl fidl::endpoints::ControlHandle for DirectoryRouterControlHandle {
10120    fn shutdown(&self) {
10121        self.inner.shutdown()
10122    }
10123
10124    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
10125        self.inner.shutdown_with_epitaph(status)
10126    }
10127
10128    fn is_closed(&self) -> bool {
10129        self.inner.channel().is_closed()
10130    }
10131    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
10132        self.inner.channel().on_closed()
10133    }
10134
10135    #[cfg(target_os = "fuchsia")]
10136    fn signal_peer(
10137        &self,
10138        clear_mask: zx::Signals,
10139        set_mask: zx::Signals,
10140    ) -> Result<(), zx_status::Status> {
10141        use fidl::Peered;
10142        self.inner.channel().signal_peer(clear_mask, set_mask)
10143    }
10144}
10145
10146impl DirectoryRouterControlHandle {}
10147
10148#[must_use = "FIDL methods require a response to be sent"]
10149#[derive(Debug)]
10150pub struct DirectoryRouterRouteResponder {
10151    control_handle: std::mem::ManuallyDrop<DirectoryRouterControlHandle>,
10152    tx_id: u32,
10153}
10154
10155/// Set the the channel to be shutdown (see [`DirectoryRouterControlHandle::shutdown`])
10156/// if the responder is dropped without sending a response, so that the client
10157/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10158impl std::ops::Drop for DirectoryRouterRouteResponder {
10159    fn drop(&mut self) {
10160        self.control_handle.shutdown();
10161        // Safety: drops once, never accessed again
10162        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10163    }
10164}
10165
10166impl fidl::endpoints::Responder for DirectoryRouterRouteResponder {
10167    type ControlHandle = DirectoryRouterControlHandle;
10168
10169    fn control_handle(&self) -> &DirectoryRouterControlHandle {
10170        &self.control_handle
10171    }
10172
10173    fn drop_without_shutdown(mut self) {
10174        // Safety: drops once, never accessed again due to mem::forget
10175        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10176        // Prevent Drop from running (which would shut down the channel)
10177        std::mem::forget(self);
10178    }
10179}
10180
10181impl DirectoryRouterRouteResponder {
10182    /// Sends a response to the FIDL transaction.
10183    ///
10184    /// Sets the channel to shutdown if an error occurs.
10185    pub fn send(
10186        self,
10187        mut result: Result<DirectoryRouterRouteResponse, RouterError>,
10188    ) -> Result<(), fidl::Error> {
10189        let _result = self.send_raw(result);
10190        if _result.is_err() {
10191            self.control_handle.shutdown();
10192        }
10193        self.drop_without_shutdown();
10194        _result
10195    }
10196
10197    /// Similar to "send" but does not shutdown the channel if an error occurs.
10198    pub fn send_no_shutdown_on_err(
10199        self,
10200        mut result: Result<DirectoryRouterRouteResponse, RouterError>,
10201    ) -> Result<(), fidl::Error> {
10202        let _result = self.send_raw(result);
10203        self.drop_without_shutdown();
10204        _result
10205    }
10206
10207    fn send_raw(
10208        &self,
10209        mut result: Result<DirectoryRouterRouteResponse, RouterError>,
10210    ) -> Result<(), fidl::Error> {
10211        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
10212            DirectoryRouterRouteResponse,
10213            RouterError,
10214        >>(
10215            fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
10216            self.tx_id,
10217            0x683b6c6be21b0f21,
10218            fidl::encoding::DynamicFlags::FLEXIBLE,
10219        )
10220    }
10221}
10222
10223#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
10224pub struct ReceiverMarker;
10225
10226impl fidl::endpoints::ProtocolMarker for ReceiverMarker {
10227    type Proxy = ReceiverProxy;
10228    type RequestStream = ReceiverRequestStream;
10229    #[cfg(target_os = "fuchsia")]
10230    type SynchronousProxy = ReceiverSynchronousProxy;
10231
10232    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.Receiver";
10233}
10234impl fidl::endpoints::DiscoverableProtocolMarker for ReceiverMarker {}
10235
10236pub trait ReceiverProxyInterface: Send + Sync {
10237    fn r#receive(&self, channel: fidl::Channel) -> Result<(), fidl::Error>;
10238}
10239#[derive(Debug)]
10240#[cfg(target_os = "fuchsia")]
10241pub struct ReceiverSynchronousProxy {
10242    client: fidl::client::sync::Client,
10243}
10244
10245#[cfg(target_os = "fuchsia")]
10246impl fidl::endpoints::SynchronousProxy for ReceiverSynchronousProxy {
10247    type Proxy = ReceiverProxy;
10248    type Protocol = ReceiverMarker;
10249
10250    fn from_channel(inner: fidl::Channel) -> Self {
10251        Self::new(inner)
10252    }
10253
10254    fn into_channel(self) -> fidl::Channel {
10255        self.client.into_channel()
10256    }
10257
10258    fn as_channel(&self) -> &fidl::Channel {
10259        self.client.as_channel()
10260    }
10261}
10262
10263#[cfg(target_os = "fuchsia")]
10264impl ReceiverSynchronousProxy {
10265    pub fn new(channel: fidl::Channel) -> Self {
10266        Self { client: fidl::client::sync::Client::new(channel) }
10267    }
10268
10269    pub fn into_channel(self) -> fidl::Channel {
10270        self.client.into_channel()
10271    }
10272
10273    /// Waits until an event arrives and returns it. It is safe for other
10274    /// threads to make concurrent requests while waiting for an event.
10275    pub fn wait_for_event(
10276        &self,
10277        deadline: zx::MonotonicInstant,
10278    ) -> Result<ReceiverEvent, fidl::Error> {
10279        ReceiverEvent::decode(self.client.wait_for_event::<ReceiverMarker>(deadline)?)
10280    }
10281
10282    /// Sends a channel to this receiver.
10283    pub fn r#receive(&self, mut channel: fidl::Channel) -> Result<(), fidl::Error> {
10284        self.client.send::<ProtocolPayload>(
10285            (channel,),
10286            0x4bae18ab7aa1a94,
10287            fidl::encoding::DynamicFlags::FLEXIBLE,
10288        )
10289    }
10290}
10291
10292#[cfg(target_os = "fuchsia")]
10293impl From<ReceiverSynchronousProxy> for zx::NullableHandle {
10294    fn from(value: ReceiverSynchronousProxy) -> Self {
10295        value.into_channel().into()
10296    }
10297}
10298
10299#[cfg(target_os = "fuchsia")]
10300impl From<fidl::Channel> for ReceiverSynchronousProxy {
10301    fn from(value: fidl::Channel) -> Self {
10302        Self::new(value)
10303    }
10304}
10305
10306#[cfg(target_os = "fuchsia")]
10307impl fidl::endpoints::FromClient for ReceiverSynchronousProxy {
10308    type Protocol = ReceiverMarker;
10309
10310    fn from_client(value: fidl::endpoints::ClientEnd<ReceiverMarker>) -> Self {
10311        Self::new(value.into_channel())
10312    }
10313}
10314
10315#[derive(Debug, Clone)]
10316pub struct ReceiverProxy {
10317    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
10318}
10319
10320impl fidl::endpoints::Proxy for ReceiverProxy {
10321    type Protocol = ReceiverMarker;
10322
10323    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
10324        Self::new(inner)
10325    }
10326
10327    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
10328        self.client.into_channel().map_err(|client| Self { client })
10329    }
10330
10331    fn as_channel(&self) -> &::fidl::AsyncChannel {
10332        self.client.as_channel()
10333    }
10334}
10335
10336impl ReceiverProxy {
10337    /// Create a new Proxy for fuchsia.component.sandbox/Receiver.
10338    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
10339        let protocol_name = <ReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
10340        Self { client: fidl::client::Client::new(channel, protocol_name) }
10341    }
10342
10343    /// Get a Stream of events from the remote end of the protocol.
10344    ///
10345    /// # Panics
10346    ///
10347    /// Panics if the event stream was already taken.
10348    pub fn take_event_stream(&self) -> ReceiverEventStream {
10349        ReceiverEventStream { event_receiver: self.client.take_event_receiver() }
10350    }
10351
10352    /// Sends a channel to this receiver.
10353    pub fn r#receive(&self, mut channel: fidl::Channel) -> Result<(), fidl::Error> {
10354        ReceiverProxyInterface::r#receive(self, channel)
10355    }
10356}
10357
10358impl ReceiverProxyInterface for ReceiverProxy {
10359    fn r#receive(&self, mut channel: fidl::Channel) -> Result<(), fidl::Error> {
10360        self.client.send::<ProtocolPayload>(
10361            (channel,),
10362            0x4bae18ab7aa1a94,
10363            fidl::encoding::DynamicFlags::FLEXIBLE,
10364        )
10365    }
10366}
10367
10368pub struct ReceiverEventStream {
10369    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
10370}
10371
10372impl std::marker::Unpin for ReceiverEventStream {}
10373
10374impl futures::stream::FusedStream for ReceiverEventStream {
10375    fn is_terminated(&self) -> bool {
10376        self.event_receiver.is_terminated()
10377    }
10378}
10379
10380impl futures::Stream for ReceiverEventStream {
10381    type Item = Result<ReceiverEvent, fidl::Error>;
10382
10383    fn poll_next(
10384        mut self: std::pin::Pin<&mut Self>,
10385        cx: &mut std::task::Context<'_>,
10386    ) -> std::task::Poll<Option<Self::Item>> {
10387        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
10388            &mut self.event_receiver,
10389            cx
10390        )?) {
10391            Some(buf) => std::task::Poll::Ready(Some(ReceiverEvent::decode(buf))),
10392            None => std::task::Poll::Ready(None),
10393        }
10394    }
10395}
10396
10397#[derive(Debug)]
10398pub enum ReceiverEvent {
10399    #[non_exhaustive]
10400    _UnknownEvent {
10401        /// Ordinal of the event that was sent.
10402        ordinal: u64,
10403    },
10404}
10405
10406impl ReceiverEvent {
10407    /// Decodes a message buffer as a [`ReceiverEvent`].
10408    fn decode(
10409        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
10410    ) -> Result<ReceiverEvent, fidl::Error> {
10411        let (bytes, _handles) = buf.split_mut();
10412        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
10413        debug_assert_eq!(tx_header.tx_id, 0);
10414        match tx_header.ordinal {
10415            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
10416                Ok(ReceiverEvent::_UnknownEvent { ordinal: tx_header.ordinal })
10417            }
10418            _ => Err(fidl::Error::UnknownOrdinal {
10419                ordinal: tx_header.ordinal,
10420                protocol_name: <ReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
10421            }),
10422        }
10423    }
10424}
10425
10426/// A Stream of incoming requests for fuchsia.component.sandbox/Receiver.
10427pub struct ReceiverRequestStream {
10428    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10429    is_terminated: bool,
10430}
10431
10432impl std::marker::Unpin for ReceiverRequestStream {}
10433
10434impl futures::stream::FusedStream for ReceiverRequestStream {
10435    fn is_terminated(&self) -> bool {
10436        self.is_terminated
10437    }
10438}
10439
10440impl fidl::endpoints::RequestStream for ReceiverRequestStream {
10441    type Protocol = ReceiverMarker;
10442    type ControlHandle = ReceiverControlHandle;
10443
10444    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
10445        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
10446    }
10447
10448    fn control_handle(&self) -> Self::ControlHandle {
10449        ReceiverControlHandle { inner: self.inner.clone() }
10450    }
10451
10452    fn into_inner(
10453        self,
10454    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
10455    {
10456        (self.inner, self.is_terminated)
10457    }
10458
10459    fn from_inner(
10460        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10461        is_terminated: bool,
10462    ) -> Self {
10463        Self { inner, is_terminated }
10464    }
10465}
10466
10467impl futures::Stream for ReceiverRequestStream {
10468    type Item = Result<ReceiverRequest, fidl::Error>;
10469
10470    fn poll_next(
10471        mut self: std::pin::Pin<&mut Self>,
10472        cx: &mut std::task::Context<'_>,
10473    ) -> std::task::Poll<Option<Self::Item>> {
10474        let this = &mut *self;
10475        if this.inner.check_shutdown(cx) {
10476            this.is_terminated = true;
10477            return std::task::Poll::Ready(None);
10478        }
10479        if this.is_terminated {
10480            panic!("polled ReceiverRequestStream after completion");
10481        }
10482        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
10483            |bytes, handles| {
10484                match this.inner.channel().read_etc(cx, bytes, handles) {
10485                    std::task::Poll::Ready(Ok(())) => {}
10486                    std::task::Poll::Pending => return std::task::Poll::Pending,
10487                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
10488                        this.is_terminated = true;
10489                        return std::task::Poll::Ready(None);
10490                    }
10491                    std::task::Poll::Ready(Err(e)) => {
10492                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
10493                            e.into(),
10494                        ))));
10495                    }
10496                }
10497
10498                // A message has been received from the channel
10499                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
10500
10501                std::task::Poll::Ready(Some(match header.ordinal {
10502                    0x4bae18ab7aa1a94 => {
10503                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
10504                        let mut req = fidl::new_empty!(
10505                            ProtocolPayload,
10506                            fidl::encoding::DefaultFuchsiaResourceDialect
10507                        );
10508                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ProtocolPayload>(&header, _body_bytes, handles, &mut req)?;
10509                        let control_handle = ReceiverControlHandle { inner: this.inner.clone() };
10510                        Ok(ReceiverRequest::Receive { channel: req.channel, control_handle })
10511                    }
10512                    _ if header.tx_id == 0
10513                        && header
10514                            .dynamic_flags()
10515                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
10516                    {
10517                        Ok(ReceiverRequest::_UnknownMethod {
10518                            ordinal: header.ordinal,
10519                            control_handle: ReceiverControlHandle { inner: this.inner.clone() },
10520                            method_type: fidl::MethodType::OneWay,
10521                        })
10522                    }
10523                    _ if header
10524                        .dynamic_flags()
10525                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
10526                    {
10527                        this.inner.send_framework_err(
10528                            fidl::encoding::FrameworkErr::UnknownMethod,
10529                            header.tx_id,
10530                            header.ordinal,
10531                            header.dynamic_flags(),
10532                            (bytes, handles),
10533                        )?;
10534                        Ok(ReceiverRequest::_UnknownMethod {
10535                            ordinal: header.ordinal,
10536                            control_handle: ReceiverControlHandle { inner: this.inner.clone() },
10537                            method_type: fidl::MethodType::TwoWay,
10538                        })
10539                    }
10540                    _ => Err(fidl::Error::UnknownOrdinal {
10541                        ordinal: header.ordinal,
10542                        protocol_name:
10543                            <ReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
10544                    }),
10545                }))
10546            },
10547        )
10548    }
10549}
10550
10551/// A receiver is served by components and allows them to receive channels
10552/// from the framework.
10553#[derive(Debug)]
10554pub enum ReceiverRequest {
10555    /// Sends a channel to this receiver.
10556    Receive { channel: fidl::Channel, control_handle: ReceiverControlHandle },
10557    /// An interaction was received which does not match any known method.
10558    #[non_exhaustive]
10559    _UnknownMethod {
10560        /// Ordinal of the method that was called.
10561        ordinal: u64,
10562        control_handle: ReceiverControlHandle,
10563        method_type: fidl::MethodType,
10564    },
10565}
10566
10567impl ReceiverRequest {
10568    #[allow(irrefutable_let_patterns)]
10569    pub fn into_receive(self) -> Option<(fidl::Channel, ReceiverControlHandle)> {
10570        if let ReceiverRequest::Receive { channel, control_handle } = self {
10571            Some((channel, control_handle))
10572        } else {
10573            None
10574        }
10575    }
10576
10577    /// Name of the method defined in FIDL
10578    pub fn method_name(&self) -> &'static str {
10579        match *self {
10580            ReceiverRequest::Receive { .. } => "receive",
10581            ReceiverRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
10582                "unknown one-way method"
10583            }
10584            ReceiverRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
10585                "unknown two-way method"
10586            }
10587        }
10588    }
10589}
10590
10591#[derive(Debug, Clone)]
10592pub struct ReceiverControlHandle {
10593    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10594}
10595
10596impl fidl::endpoints::ControlHandle for ReceiverControlHandle {
10597    fn shutdown(&self) {
10598        self.inner.shutdown()
10599    }
10600
10601    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
10602        self.inner.shutdown_with_epitaph(status)
10603    }
10604
10605    fn is_closed(&self) -> bool {
10606        self.inner.channel().is_closed()
10607    }
10608    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
10609        self.inner.channel().on_closed()
10610    }
10611
10612    #[cfg(target_os = "fuchsia")]
10613    fn signal_peer(
10614        &self,
10615        clear_mask: zx::Signals,
10616        set_mask: zx::Signals,
10617    ) -> Result<(), zx_status::Status> {
10618        use fidl::Peered;
10619        self.inner.channel().signal_peer(clear_mask, set_mask)
10620    }
10621}
10622
10623impl ReceiverControlHandle {}
10624
10625mod internal {
10626    use super::*;
10627
10628    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreConnectorCreateRequest {
10629        type Borrowed<'a> = &'a mut Self;
10630        fn take_or_borrow<'a>(
10631            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10632        ) -> Self::Borrowed<'a> {
10633            value
10634        }
10635    }
10636
10637    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreConnectorCreateRequest {
10638        type Owned = Self;
10639
10640        #[inline(always)]
10641        fn inline_align(_context: fidl::encoding::Context) -> usize {
10642            8
10643        }
10644
10645        #[inline(always)]
10646        fn inline_size(_context: fidl::encoding::Context) -> usize {
10647            16
10648        }
10649    }
10650
10651    unsafe impl
10652        fidl::encoding::Encode<
10653            CapabilityStoreConnectorCreateRequest,
10654            fidl::encoding::DefaultFuchsiaResourceDialect,
10655        > for &mut CapabilityStoreConnectorCreateRequest
10656    {
10657        #[inline]
10658        unsafe fn encode(
10659            self,
10660            encoder: &mut fidl::encoding::Encoder<
10661                '_,
10662                fidl::encoding::DefaultFuchsiaResourceDialect,
10663            >,
10664            offset: usize,
10665            _depth: fidl::encoding::Depth,
10666        ) -> fidl::Result<()> {
10667            encoder.debug_check_bounds::<CapabilityStoreConnectorCreateRequest>(offset);
10668            // Delegate to tuple encoding.
10669            fidl::encoding::Encode::<CapabilityStoreConnectorCreateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10670                (
10671                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
10672                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ReceiverMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.receiver),
10673                ),
10674                encoder, offset, _depth
10675            )
10676        }
10677    }
10678    unsafe impl<
10679        T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
10680        T1: fidl::encoding::Encode<
10681                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ReceiverMarker>>,
10682                fidl::encoding::DefaultFuchsiaResourceDialect,
10683            >,
10684    >
10685        fidl::encoding::Encode<
10686            CapabilityStoreConnectorCreateRequest,
10687            fidl::encoding::DefaultFuchsiaResourceDialect,
10688        > for (T0, T1)
10689    {
10690        #[inline]
10691        unsafe fn encode(
10692            self,
10693            encoder: &mut fidl::encoding::Encoder<
10694                '_,
10695                fidl::encoding::DefaultFuchsiaResourceDialect,
10696            >,
10697            offset: usize,
10698            depth: fidl::encoding::Depth,
10699        ) -> fidl::Result<()> {
10700            encoder.debug_check_bounds::<CapabilityStoreConnectorCreateRequest>(offset);
10701            // Zero out padding regions. There's no need to apply masks
10702            // because the unmasked parts will be overwritten by fields.
10703            unsafe {
10704                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
10705                (ptr as *mut u64).write_unaligned(0);
10706            }
10707            // Write the fields.
10708            self.0.encode(encoder, offset + 0, depth)?;
10709            self.1.encode(encoder, offset + 8, depth)?;
10710            Ok(())
10711        }
10712    }
10713
10714    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10715        for CapabilityStoreConnectorCreateRequest
10716    {
10717        #[inline(always)]
10718        fn new_empty() -> Self {
10719            Self {
10720                id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
10721                receiver: fidl::new_empty!(
10722                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ReceiverMarker>>,
10723                    fidl::encoding::DefaultFuchsiaResourceDialect
10724                ),
10725            }
10726        }
10727
10728        #[inline]
10729        unsafe fn decode(
10730            &mut self,
10731            decoder: &mut fidl::encoding::Decoder<
10732                '_,
10733                fidl::encoding::DefaultFuchsiaResourceDialect,
10734            >,
10735            offset: usize,
10736            _depth: fidl::encoding::Depth,
10737        ) -> fidl::Result<()> {
10738            decoder.debug_check_bounds::<Self>(offset);
10739            // Verify that padding bytes are zero.
10740            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
10741            let padval = unsafe { (ptr as *const u64).read_unaligned() };
10742            let mask = 0xffffffff00000000u64;
10743            let maskedval = padval & mask;
10744            if maskedval != 0 {
10745                return Err(fidl::Error::NonZeroPadding {
10746                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
10747                });
10748            }
10749            fidl::decode!(
10750                u64,
10751                fidl::encoding::DefaultFuchsiaResourceDialect,
10752                &mut self.id,
10753                decoder,
10754                offset + 0,
10755                _depth
10756            )?;
10757            fidl::decode!(
10758                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ReceiverMarker>>,
10759                fidl::encoding::DefaultFuchsiaResourceDialect,
10760                &mut self.receiver,
10761                decoder,
10762                offset + 8,
10763                _depth
10764            )?;
10765            Ok(())
10766        }
10767    }
10768
10769    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreConnectorOpenRequest {
10770        type Borrowed<'a> = &'a mut Self;
10771        fn take_or_borrow<'a>(
10772            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10773        ) -> Self::Borrowed<'a> {
10774            value
10775        }
10776    }
10777
10778    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreConnectorOpenRequest {
10779        type Owned = Self;
10780
10781        #[inline(always)]
10782        fn inline_align(_context: fidl::encoding::Context) -> usize {
10783            8
10784        }
10785
10786        #[inline(always)]
10787        fn inline_size(_context: fidl::encoding::Context) -> usize {
10788            16
10789        }
10790    }
10791
10792    unsafe impl
10793        fidl::encoding::Encode<
10794            CapabilityStoreConnectorOpenRequest,
10795            fidl::encoding::DefaultFuchsiaResourceDialect,
10796        > for &mut CapabilityStoreConnectorOpenRequest
10797    {
10798        #[inline]
10799        unsafe fn encode(
10800            self,
10801            encoder: &mut fidl::encoding::Encoder<
10802                '_,
10803                fidl::encoding::DefaultFuchsiaResourceDialect,
10804            >,
10805            offset: usize,
10806            _depth: fidl::encoding::Depth,
10807        ) -> fidl::Result<()> {
10808            encoder.debug_check_bounds::<CapabilityStoreConnectorOpenRequest>(offset);
10809            // Delegate to tuple encoding.
10810            fidl::encoding::Encode::<
10811                CapabilityStoreConnectorOpenRequest,
10812                fidl::encoding::DefaultFuchsiaResourceDialect,
10813            >::encode(
10814                (
10815                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
10816                    <fidl::encoding::HandleType<
10817                        fidl::Channel,
10818                        { fidl::ObjectType::CHANNEL.into_raw() },
10819                        2147483648,
10820                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10821                        &mut self.server_end
10822                    ),
10823                ),
10824                encoder,
10825                offset,
10826                _depth,
10827            )
10828        }
10829    }
10830    unsafe impl<
10831        T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
10832        T1: fidl::encoding::Encode<
10833                fidl::encoding::HandleType<
10834                    fidl::Channel,
10835                    { fidl::ObjectType::CHANNEL.into_raw() },
10836                    2147483648,
10837                >,
10838                fidl::encoding::DefaultFuchsiaResourceDialect,
10839            >,
10840    >
10841        fidl::encoding::Encode<
10842            CapabilityStoreConnectorOpenRequest,
10843            fidl::encoding::DefaultFuchsiaResourceDialect,
10844        > for (T0, T1)
10845    {
10846        #[inline]
10847        unsafe fn encode(
10848            self,
10849            encoder: &mut fidl::encoding::Encoder<
10850                '_,
10851                fidl::encoding::DefaultFuchsiaResourceDialect,
10852            >,
10853            offset: usize,
10854            depth: fidl::encoding::Depth,
10855        ) -> fidl::Result<()> {
10856            encoder.debug_check_bounds::<CapabilityStoreConnectorOpenRequest>(offset);
10857            // Zero out padding regions. There's no need to apply masks
10858            // because the unmasked parts will be overwritten by fields.
10859            unsafe {
10860                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
10861                (ptr as *mut u64).write_unaligned(0);
10862            }
10863            // Write the fields.
10864            self.0.encode(encoder, offset + 0, depth)?;
10865            self.1.encode(encoder, offset + 8, depth)?;
10866            Ok(())
10867        }
10868    }
10869
10870    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10871        for CapabilityStoreConnectorOpenRequest
10872    {
10873        #[inline(always)]
10874        fn new_empty() -> Self {
10875            Self {
10876                id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
10877                server_end: fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
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!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.server_end, decoder, offset + 8, _depth)?;
10911            Ok(())
10912        }
10913    }
10914
10915    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreCreateServiceAggregateRequest {
10916        type Borrowed<'a> = &'a mut Self;
10917        fn take_or_borrow<'a>(
10918            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10919        ) -> Self::Borrowed<'a> {
10920            value
10921        }
10922    }
10923
10924    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreCreateServiceAggregateRequest {
10925        type Owned = Self;
10926
10927        #[inline(always)]
10928        fn inline_align(_context: fidl::encoding::Context) -> usize {
10929            8
10930        }
10931
10932        #[inline(always)]
10933        fn inline_size(_context: fidl::encoding::Context) -> usize {
10934            16
10935        }
10936    }
10937
10938    unsafe impl
10939        fidl::encoding::Encode<
10940            CapabilityStoreCreateServiceAggregateRequest,
10941            fidl::encoding::DefaultFuchsiaResourceDialect,
10942        > for &mut CapabilityStoreCreateServiceAggregateRequest
10943    {
10944        #[inline]
10945        unsafe fn encode(
10946            self,
10947            encoder: &mut fidl::encoding::Encoder<
10948                '_,
10949                fidl::encoding::DefaultFuchsiaResourceDialect,
10950            >,
10951            offset: usize,
10952            _depth: fidl::encoding::Depth,
10953        ) -> fidl::Result<()> {
10954            encoder.debug_check_bounds::<CapabilityStoreCreateServiceAggregateRequest>(offset);
10955            // Delegate to tuple encoding.
10956            fidl::encoding::Encode::<CapabilityStoreCreateServiceAggregateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10957                (
10958                    <fidl::encoding::UnboundedVector<AggregateSource> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.sources),
10959                ),
10960                encoder, offset, _depth
10961            )
10962        }
10963    }
10964    unsafe impl<
10965        T0: fidl::encoding::Encode<
10966                fidl::encoding::UnboundedVector<AggregateSource>,
10967                fidl::encoding::DefaultFuchsiaResourceDialect,
10968            >,
10969    >
10970        fidl::encoding::Encode<
10971            CapabilityStoreCreateServiceAggregateRequest,
10972            fidl::encoding::DefaultFuchsiaResourceDialect,
10973        > for (T0,)
10974    {
10975        #[inline]
10976        unsafe fn encode(
10977            self,
10978            encoder: &mut fidl::encoding::Encoder<
10979                '_,
10980                fidl::encoding::DefaultFuchsiaResourceDialect,
10981            >,
10982            offset: usize,
10983            depth: fidl::encoding::Depth,
10984        ) -> fidl::Result<()> {
10985            encoder.debug_check_bounds::<CapabilityStoreCreateServiceAggregateRequest>(offset);
10986            // Zero out padding regions. There's no need to apply masks
10987            // because the unmasked parts will be overwritten by fields.
10988            // Write the fields.
10989            self.0.encode(encoder, offset + 0, depth)?;
10990            Ok(())
10991        }
10992    }
10993
10994    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10995        for CapabilityStoreCreateServiceAggregateRequest
10996    {
10997        #[inline(always)]
10998        fn new_empty() -> Self {
10999            Self {
11000                sources: fidl::new_empty!(
11001                    fidl::encoding::UnboundedVector<AggregateSource>,
11002                    fidl::encoding::DefaultFuchsiaResourceDialect
11003                ),
11004            }
11005        }
11006
11007        #[inline]
11008        unsafe fn decode(
11009            &mut self,
11010            decoder: &mut fidl::encoding::Decoder<
11011                '_,
11012                fidl::encoding::DefaultFuchsiaResourceDialect,
11013            >,
11014            offset: usize,
11015            _depth: fidl::encoding::Depth,
11016        ) -> fidl::Result<()> {
11017            decoder.debug_check_bounds::<Self>(offset);
11018            // Verify that padding bytes are zero.
11019            fidl::decode!(
11020                fidl::encoding::UnboundedVector<AggregateSource>,
11021                fidl::encoding::DefaultFuchsiaResourceDialect,
11022                &mut self.sources,
11023                decoder,
11024                offset + 0,
11025                _depth
11026            )?;
11027            Ok(())
11028        }
11029    }
11030
11031    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDictionaryDrainRequest {
11032        type Borrowed<'a> = &'a mut Self;
11033        fn take_or_borrow<'a>(
11034            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11035        ) -> Self::Borrowed<'a> {
11036            value
11037        }
11038    }
11039
11040    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDictionaryDrainRequest {
11041        type Owned = Self;
11042
11043        #[inline(always)]
11044        fn inline_align(_context: fidl::encoding::Context) -> usize {
11045            8
11046        }
11047
11048        #[inline(always)]
11049        fn inline_size(_context: fidl::encoding::Context) -> usize {
11050            16
11051        }
11052    }
11053
11054    unsafe impl
11055        fidl::encoding::Encode<
11056            CapabilityStoreDictionaryDrainRequest,
11057            fidl::encoding::DefaultFuchsiaResourceDialect,
11058        > for &mut CapabilityStoreDictionaryDrainRequest
11059    {
11060        #[inline]
11061        unsafe fn encode(
11062            self,
11063            encoder: &mut fidl::encoding::Encoder<
11064                '_,
11065                fidl::encoding::DefaultFuchsiaResourceDialect,
11066            >,
11067            offset: usize,
11068            _depth: fidl::encoding::Depth,
11069        ) -> fidl::Result<()> {
11070            encoder.debug_check_bounds::<CapabilityStoreDictionaryDrainRequest>(offset);
11071            // Delegate to tuple encoding.
11072            fidl::encoding::Encode::<
11073                CapabilityStoreDictionaryDrainRequest,
11074                fidl::encoding::DefaultFuchsiaResourceDialect,
11075            >::encode(
11076                (
11077                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
11078                    <fidl::encoding::Optional<
11079                        fidl::encoding::Endpoint<
11080                            fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>,
11081                        >,
11082                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11083                        &mut self.iterator
11084                    ),
11085                ),
11086                encoder,
11087                offset,
11088                _depth,
11089            )
11090        }
11091    }
11092    unsafe impl<
11093        T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
11094        T1: fidl::encoding::Encode<
11095                fidl::encoding::Optional<
11096                    fidl::encoding::Endpoint<
11097                        fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>,
11098                    >,
11099                >,
11100                fidl::encoding::DefaultFuchsiaResourceDialect,
11101            >,
11102    >
11103        fidl::encoding::Encode<
11104            CapabilityStoreDictionaryDrainRequest,
11105            fidl::encoding::DefaultFuchsiaResourceDialect,
11106        > for (T0, T1)
11107    {
11108        #[inline]
11109        unsafe fn encode(
11110            self,
11111            encoder: &mut fidl::encoding::Encoder<
11112                '_,
11113                fidl::encoding::DefaultFuchsiaResourceDialect,
11114            >,
11115            offset: usize,
11116            depth: fidl::encoding::Depth,
11117        ) -> fidl::Result<()> {
11118            encoder.debug_check_bounds::<CapabilityStoreDictionaryDrainRequest>(offset);
11119            // Zero out padding regions. There's no need to apply masks
11120            // because the unmasked parts will be overwritten by fields.
11121            unsafe {
11122                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
11123                (ptr as *mut u64).write_unaligned(0);
11124            }
11125            // Write the fields.
11126            self.0.encode(encoder, offset + 0, depth)?;
11127            self.1.encode(encoder, offset + 8, depth)?;
11128            Ok(())
11129        }
11130    }
11131
11132    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11133        for CapabilityStoreDictionaryDrainRequest
11134    {
11135        #[inline(always)]
11136        fn new_empty() -> Self {
11137            Self {
11138                id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
11139                iterator: fidl::new_empty!(
11140                    fidl::encoding::Optional<
11141                        fidl::encoding::Endpoint<
11142                            fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>,
11143                        >,
11144                    >,
11145                    fidl::encoding::DefaultFuchsiaResourceDialect
11146                ),
11147            }
11148        }
11149
11150        #[inline]
11151        unsafe fn decode(
11152            &mut self,
11153            decoder: &mut fidl::encoding::Decoder<
11154                '_,
11155                fidl::encoding::DefaultFuchsiaResourceDialect,
11156            >,
11157            offset: usize,
11158            _depth: fidl::encoding::Depth,
11159        ) -> fidl::Result<()> {
11160            decoder.debug_check_bounds::<Self>(offset);
11161            // Verify that padding bytes are zero.
11162            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
11163            let padval = unsafe { (ptr as *const u64).read_unaligned() };
11164            let mask = 0xffffffff00000000u64;
11165            let maskedval = padval & mask;
11166            if maskedval != 0 {
11167                return Err(fidl::Error::NonZeroPadding {
11168                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
11169                });
11170            }
11171            fidl::decode!(
11172                u64,
11173                fidl::encoding::DefaultFuchsiaResourceDialect,
11174                &mut self.id,
11175                decoder,
11176                offset + 0,
11177                _depth
11178            )?;
11179            fidl::decode!(
11180                fidl::encoding::Optional<
11181                    fidl::encoding::Endpoint<
11182                        fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>,
11183                    >,
11184                >,
11185                fidl::encoding::DefaultFuchsiaResourceDialect,
11186                &mut self.iterator,
11187                decoder,
11188                offset + 8,
11189                _depth
11190            )?;
11191            Ok(())
11192        }
11193    }
11194
11195    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDictionaryEnumerateRequest {
11196        type Borrowed<'a> = &'a mut Self;
11197        fn take_or_borrow<'a>(
11198            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11199        ) -> Self::Borrowed<'a> {
11200            value
11201        }
11202    }
11203
11204    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDictionaryEnumerateRequest {
11205        type Owned = Self;
11206
11207        #[inline(always)]
11208        fn inline_align(_context: fidl::encoding::Context) -> usize {
11209            8
11210        }
11211
11212        #[inline(always)]
11213        fn inline_size(_context: fidl::encoding::Context) -> usize {
11214            16
11215        }
11216    }
11217
11218    unsafe impl
11219        fidl::encoding::Encode<
11220            CapabilityStoreDictionaryEnumerateRequest,
11221            fidl::encoding::DefaultFuchsiaResourceDialect,
11222        > for &mut CapabilityStoreDictionaryEnumerateRequest
11223    {
11224        #[inline]
11225        unsafe fn encode(
11226            self,
11227            encoder: &mut fidl::encoding::Encoder<
11228                '_,
11229                fidl::encoding::DefaultFuchsiaResourceDialect,
11230            >,
11231            offset: usize,
11232            _depth: fidl::encoding::Depth,
11233        ) -> fidl::Result<()> {
11234            encoder.debug_check_bounds::<CapabilityStoreDictionaryEnumerateRequest>(offset);
11235            // Delegate to tuple encoding.
11236            fidl::encoding::Encode::<
11237                CapabilityStoreDictionaryEnumerateRequest,
11238                fidl::encoding::DefaultFuchsiaResourceDialect,
11239            >::encode(
11240                (
11241                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
11242                    <fidl::encoding::Endpoint<
11243                        fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
11244                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11245                        &mut self.iterator
11246                    ),
11247                ),
11248                encoder,
11249                offset,
11250                _depth,
11251            )
11252        }
11253    }
11254    unsafe impl<
11255        T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
11256        T1: fidl::encoding::Encode<
11257                fidl::encoding::Endpoint<
11258                    fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
11259                >,
11260                fidl::encoding::DefaultFuchsiaResourceDialect,
11261            >,
11262    >
11263        fidl::encoding::Encode<
11264            CapabilityStoreDictionaryEnumerateRequest,
11265            fidl::encoding::DefaultFuchsiaResourceDialect,
11266        > for (T0, T1)
11267    {
11268        #[inline]
11269        unsafe fn encode(
11270            self,
11271            encoder: &mut fidl::encoding::Encoder<
11272                '_,
11273                fidl::encoding::DefaultFuchsiaResourceDialect,
11274            >,
11275            offset: usize,
11276            depth: fidl::encoding::Depth,
11277        ) -> fidl::Result<()> {
11278            encoder.debug_check_bounds::<CapabilityStoreDictionaryEnumerateRequest>(offset);
11279            // Zero out padding regions. There's no need to apply masks
11280            // because the unmasked parts will be overwritten by fields.
11281            unsafe {
11282                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
11283                (ptr as *mut u64).write_unaligned(0);
11284            }
11285            // Write the fields.
11286            self.0.encode(encoder, offset + 0, depth)?;
11287            self.1.encode(encoder, offset + 8, depth)?;
11288            Ok(())
11289        }
11290    }
11291
11292    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11293        for CapabilityStoreDictionaryEnumerateRequest
11294    {
11295        #[inline(always)]
11296        fn new_empty() -> Self {
11297            Self {
11298                id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
11299                iterator: fidl::new_empty!(
11300                    fidl::encoding::Endpoint<
11301                        fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
11302                    >,
11303                    fidl::encoding::DefaultFuchsiaResourceDialect
11304                ),
11305            }
11306        }
11307
11308        #[inline]
11309        unsafe fn decode(
11310            &mut self,
11311            decoder: &mut fidl::encoding::Decoder<
11312                '_,
11313                fidl::encoding::DefaultFuchsiaResourceDialect,
11314            >,
11315            offset: usize,
11316            _depth: fidl::encoding::Depth,
11317        ) -> fidl::Result<()> {
11318            decoder.debug_check_bounds::<Self>(offset);
11319            // Verify that padding bytes are zero.
11320            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
11321            let padval = unsafe { (ptr as *const u64).read_unaligned() };
11322            let mask = 0xffffffff00000000u64;
11323            let maskedval = padval & mask;
11324            if maskedval != 0 {
11325                return Err(fidl::Error::NonZeroPadding {
11326                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
11327                });
11328            }
11329            fidl::decode!(
11330                u64,
11331                fidl::encoding::DefaultFuchsiaResourceDialect,
11332                &mut self.id,
11333                decoder,
11334                offset + 0,
11335                _depth
11336            )?;
11337            fidl::decode!(
11338                fidl::encoding::Endpoint<
11339                    fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
11340                >,
11341                fidl::encoding::DefaultFuchsiaResourceDialect,
11342                &mut self.iterator,
11343                decoder,
11344                offset + 8,
11345                _depth
11346            )?;
11347            Ok(())
11348        }
11349    }
11350
11351    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDictionaryKeysRequest {
11352        type Borrowed<'a> = &'a mut Self;
11353        fn take_or_borrow<'a>(
11354            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11355        ) -> Self::Borrowed<'a> {
11356            value
11357        }
11358    }
11359
11360    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDictionaryKeysRequest {
11361        type Owned = Self;
11362
11363        #[inline(always)]
11364        fn inline_align(_context: fidl::encoding::Context) -> usize {
11365            8
11366        }
11367
11368        #[inline(always)]
11369        fn inline_size(_context: fidl::encoding::Context) -> usize {
11370            16
11371        }
11372    }
11373
11374    unsafe impl
11375        fidl::encoding::Encode<
11376            CapabilityStoreDictionaryKeysRequest,
11377            fidl::encoding::DefaultFuchsiaResourceDialect,
11378        > for &mut CapabilityStoreDictionaryKeysRequest
11379    {
11380        #[inline]
11381        unsafe fn encode(
11382            self,
11383            encoder: &mut fidl::encoding::Encoder<
11384                '_,
11385                fidl::encoding::DefaultFuchsiaResourceDialect,
11386            >,
11387            offset: usize,
11388            _depth: fidl::encoding::Depth,
11389        ) -> fidl::Result<()> {
11390            encoder.debug_check_bounds::<CapabilityStoreDictionaryKeysRequest>(offset);
11391            // Delegate to tuple encoding.
11392            fidl::encoding::Encode::<
11393                CapabilityStoreDictionaryKeysRequest,
11394                fidl::encoding::DefaultFuchsiaResourceDialect,
11395            >::encode(
11396                (
11397                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
11398                    <fidl::encoding::Endpoint<
11399                        fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>,
11400                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11401                        &mut self.iterator
11402                    ),
11403                ),
11404                encoder,
11405                offset,
11406                _depth,
11407            )
11408        }
11409    }
11410    unsafe impl<
11411        T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
11412        T1: fidl::encoding::Encode<
11413                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>>,
11414                fidl::encoding::DefaultFuchsiaResourceDialect,
11415            >,
11416    >
11417        fidl::encoding::Encode<
11418            CapabilityStoreDictionaryKeysRequest,
11419            fidl::encoding::DefaultFuchsiaResourceDialect,
11420        > for (T0, T1)
11421    {
11422        #[inline]
11423        unsafe fn encode(
11424            self,
11425            encoder: &mut fidl::encoding::Encoder<
11426                '_,
11427                fidl::encoding::DefaultFuchsiaResourceDialect,
11428            >,
11429            offset: usize,
11430            depth: fidl::encoding::Depth,
11431        ) -> fidl::Result<()> {
11432            encoder.debug_check_bounds::<CapabilityStoreDictionaryKeysRequest>(offset);
11433            // Zero out padding regions. There's no need to apply masks
11434            // because the unmasked parts will be overwritten by fields.
11435            unsafe {
11436                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
11437                (ptr as *mut u64).write_unaligned(0);
11438            }
11439            // Write the fields.
11440            self.0.encode(encoder, offset + 0, depth)?;
11441            self.1.encode(encoder, offset + 8, depth)?;
11442            Ok(())
11443        }
11444    }
11445
11446    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11447        for CapabilityStoreDictionaryKeysRequest
11448    {
11449        #[inline(always)]
11450        fn new_empty() -> Self {
11451            Self {
11452                id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
11453                iterator: fidl::new_empty!(
11454                    fidl::encoding::Endpoint<
11455                        fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>,
11456                    >,
11457                    fidl::encoding::DefaultFuchsiaResourceDialect
11458                ),
11459            }
11460        }
11461
11462        #[inline]
11463        unsafe fn decode(
11464            &mut self,
11465            decoder: &mut fidl::encoding::Decoder<
11466                '_,
11467                fidl::encoding::DefaultFuchsiaResourceDialect,
11468            >,
11469            offset: usize,
11470            _depth: fidl::encoding::Depth,
11471        ) -> fidl::Result<()> {
11472            decoder.debug_check_bounds::<Self>(offset);
11473            // Verify that padding bytes are zero.
11474            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
11475            let padval = unsafe { (ptr as *const u64).read_unaligned() };
11476            let mask = 0xffffffff00000000u64;
11477            let maskedval = padval & mask;
11478            if maskedval != 0 {
11479                return Err(fidl::Error::NonZeroPadding {
11480                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
11481                });
11482            }
11483            fidl::decode!(
11484                u64,
11485                fidl::encoding::DefaultFuchsiaResourceDialect,
11486                &mut self.id,
11487                decoder,
11488                offset + 0,
11489                _depth
11490            )?;
11491            fidl::decode!(
11492                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>>,
11493                fidl::encoding::DefaultFuchsiaResourceDialect,
11494                &mut self.iterator,
11495                decoder,
11496                offset + 8,
11497                _depth
11498            )?;
11499            Ok(())
11500        }
11501    }
11502
11503    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDictionaryLegacyExportRequest {
11504        type Borrowed<'a> = &'a mut Self;
11505        fn take_or_borrow<'a>(
11506            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11507        ) -> Self::Borrowed<'a> {
11508            value
11509        }
11510    }
11511
11512    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDictionaryLegacyExportRequest {
11513        type Owned = Self;
11514
11515        #[inline(always)]
11516        fn inline_align(_context: fidl::encoding::Context) -> usize {
11517            8
11518        }
11519
11520        #[inline(always)]
11521        fn inline_size(_context: fidl::encoding::Context) -> usize {
11522            16
11523        }
11524    }
11525
11526    unsafe impl
11527        fidl::encoding::Encode<
11528            CapabilityStoreDictionaryLegacyExportRequest,
11529            fidl::encoding::DefaultFuchsiaResourceDialect,
11530        > for &mut CapabilityStoreDictionaryLegacyExportRequest
11531    {
11532        #[inline]
11533        unsafe fn encode(
11534            self,
11535            encoder: &mut fidl::encoding::Encoder<
11536                '_,
11537                fidl::encoding::DefaultFuchsiaResourceDialect,
11538            >,
11539            offset: usize,
11540            _depth: fidl::encoding::Depth,
11541        ) -> fidl::Result<()> {
11542            encoder.debug_check_bounds::<CapabilityStoreDictionaryLegacyExportRequest>(offset);
11543            // Delegate to tuple encoding.
11544            fidl::encoding::Encode::<
11545                CapabilityStoreDictionaryLegacyExportRequest,
11546                fidl::encoding::DefaultFuchsiaResourceDialect,
11547            >::encode(
11548                (
11549                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
11550                    <fidl::encoding::HandleType<
11551                        fidl::Channel,
11552                        { fidl::ObjectType::CHANNEL.into_raw() },
11553                        2147483648,
11554                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11555                        &mut self.server_end
11556                    ),
11557                ),
11558                encoder,
11559                offset,
11560                _depth,
11561            )
11562        }
11563    }
11564    unsafe impl<
11565        T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
11566        T1: fidl::encoding::Encode<
11567                fidl::encoding::HandleType<
11568                    fidl::Channel,
11569                    { fidl::ObjectType::CHANNEL.into_raw() },
11570                    2147483648,
11571                >,
11572                fidl::encoding::DefaultFuchsiaResourceDialect,
11573            >,
11574    >
11575        fidl::encoding::Encode<
11576            CapabilityStoreDictionaryLegacyExportRequest,
11577            fidl::encoding::DefaultFuchsiaResourceDialect,
11578        > for (T0, T1)
11579    {
11580        #[inline]
11581        unsafe fn encode(
11582            self,
11583            encoder: &mut fidl::encoding::Encoder<
11584                '_,
11585                fidl::encoding::DefaultFuchsiaResourceDialect,
11586            >,
11587            offset: usize,
11588            depth: fidl::encoding::Depth,
11589        ) -> fidl::Result<()> {
11590            encoder.debug_check_bounds::<CapabilityStoreDictionaryLegacyExportRequest>(offset);
11591            // Zero out padding regions. There's no need to apply masks
11592            // because the unmasked parts will be overwritten by fields.
11593            unsafe {
11594                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
11595                (ptr as *mut u64).write_unaligned(0);
11596            }
11597            // Write the fields.
11598            self.0.encode(encoder, offset + 0, depth)?;
11599            self.1.encode(encoder, offset + 8, depth)?;
11600            Ok(())
11601        }
11602    }
11603
11604    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11605        for CapabilityStoreDictionaryLegacyExportRequest
11606    {
11607        #[inline(always)]
11608        fn new_empty() -> Self {
11609            Self {
11610                id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
11611                server_end: fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11612            }
11613        }
11614
11615        #[inline]
11616        unsafe fn decode(
11617            &mut self,
11618            decoder: &mut fidl::encoding::Decoder<
11619                '_,
11620                fidl::encoding::DefaultFuchsiaResourceDialect,
11621            >,
11622            offset: usize,
11623            _depth: fidl::encoding::Depth,
11624        ) -> fidl::Result<()> {
11625            decoder.debug_check_bounds::<Self>(offset);
11626            // Verify that padding bytes are zero.
11627            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
11628            let padval = unsafe { (ptr as *const u64).read_unaligned() };
11629            let mask = 0xffffffff00000000u64;
11630            let maskedval = padval & mask;
11631            if maskedval != 0 {
11632                return Err(fidl::Error::NonZeroPadding {
11633                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
11634                });
11635            }
11636            fidl::decode!(
11637                u64,
11638                fidl::encoding::DefaultFuchsiaResourceDialect,
11639                &mut self.id,
11640                decoder,
11641                offset + 0,
11642                _depth
11643            )?;
11644            fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.server_end, decoder, offset + 8, _depth)?;
11645            Ok(())
11646        }
11647    }
11648
11649    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDictionaryLegacyImportRequest {
11650        type Borrowed<'a> = &'a mut Self;
11651        fn take_or_borrow<'a>(
11652            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11653        ) -> Self::Borrowed<'a> {
11654            value
11655        }
11656    }
11657
11658    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDictionaryLegacyImportRequest {
11659        type Owned = Self;
11660
11661        #[inline(always)]
11662        fn inline_align(_context: fidl::encoding::Context) -> usize {
11663            8
11664        }
11665
11666        #[inline(always)]
11667        fn inline_size(_context: fidl::encoding::Context) -> usize {
11668            16
11669        }
11670    }
11671
11672    unsafe impl
11673        fidl::encoding::Encode<
11674            CapabilityStoreDictionaryLegacyImportRequest,
11675            fidl::encoding::DefaultFuchsiaResourceDialect,
11676        > for &mut CapabilityStoreDictionaryLegacyImportRequest
11677    {
11678        #[inline]
11679        unsafe fn encode(
11680            self,
11681            encoder: &mut fidl::encoding::Encoder<
11682                '_,
11683                fidl::encoding::DefaultFuchsiaResourceDialect,
11684            >,
11685            offset: usize,
11686            _depth: fidl::encoding::Depth,
11687        ) -> fidl::Result<()> {
11688            encoder.debug_check_bounds::<CapabilityStoreDictionaryLegacyImportRequest>(offset);
11689            // Delegate to tuple encoding.
11690            fidl::encoding::Encode::<
11691                CapabilityStoreDictionaryLegacyImportRequest,
11692                fidl::encoding::DefaultFuchsiaResourceDialect,
11693            >::encode(
11694                (
11695                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
11696                    <fidl::encoding::HandleType<
11697                        fidl::Channel,
11698                        { fidl::ObjectType::CHANNEL.into_raw() },
11699                        2147483648,
11700                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11701                        &mut self.client_end
11702                    ),
11703                ),
11704                encoder,
11705                offset,
11706                _depth,
11707            )
11708        }
11709    }
11710    unsafe impl<
11711        T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
11712        T1: fidl::encoding::Encode<
11713                fidl::encoding::HandleType<
11714                    fidl::Channel,
11715                    { fidl::ObjectType::CHANNEL.into_raw() },
11716                    2147483648,
11717                >,
11718                fidl::encoding::DefaultFuchsiaResourceDialect,
11719            >,
11720    >
11721        fidl::encoding::Encode<
11722            CapabilityStoreDictionaryLegacyImportRequest,
11723            fidl::encoding::DefaultFuchsiaResourceDialect,
11724        > for (T0, T1)
11725    {
11726        #[inline]
11727        unsafe fn encode(
11728            self,
11729            encoder: &mut fidl::encoding::Encoder<
11730                '_,
11731                fidl::encoding::DefaultFuchsiaResourceDialect,
11732            >,
11733            offset: usize,
11734            depth: fidl::encoding::Depth,
11735        ) -> fidl::Result<()> {
11736            encoder.debug_check_bounds::<CapabilityStoreDictionaryLegacyImportRequest>(offset);
11737            // Zero out padding regions. There's no need to apply masks
11738            // because the unmasked parts will be overwritten by fields.
11739            unsafe {
11740                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
11741                (ptr as *mut u64).write_unaligned(0);
11742            }
11743            // Write the fields.
11744            self.0.encode(encoder, offset + 0, depth)?;
11745            self.1.encode(encoder, offset + 8, depth)?;
11746            Ok(())
11747        }
11748    }
11749
11750    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11751        for CapabilityStoreDictionaryLegacyImportRequest
11752    {
11753        #[inline(always)]
11754        fn new_empty() -> Self {
11755            Self {
11756                id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
11757                client_end: fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11758            }
11759        }
11760
11761        #[inline]
11762        unsafe fn decode(
11763            &mut self,
11764            decoder: &mut fidl::encoding::Decoder<
11765                '_,
11766                fidl::encoding::DefaultFuchsiaResourceDialect,
11767            >,
11768            offset: usize,
11769            _depth: fidl::encoding::Depth,
11770        ) -> fidl::Result<()> {
11771            decoder.debug_check_bounds::<Self>(offset);
11772            // Verify that padding bytes are zero.
11773            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
11774            let padval = unsafe { (ptr as *const u64).read_unaligned() };
11775            let mask = 0xffffffff00000000u64;
11776            let maskedval = padval & mask;
11777            if maskedval != 0 {
11778                return Err(fidl::Error::NonZeroPadding {
11779                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
11780                });
11781            }
11782            fidl::decode!(
11783                u64,
11784                fidl::encoding::DefaultFuchsiaResourceDialect,
11785                &mut self.id,
11786                decoder,
11787                offset + 0,
11788                _depth
11789            )?;
11790            fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.client_end, decoder, offset + 8, _depth)?;
11791            Ok(())
11792        }
11793    }
11794
11795    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDirConnectorCreateRequest {
11796        type Borrowed<'a> = &'a mut Self;
11797        fn take_or_borrow<'a>(
11798            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11799        ) -> Self::Borrowed<'a> {
11800            value
11801        }
11802    }
11803
11804    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDirConnectorCreateRequest {
11805        type Owned = Self;
11806
11807        #[inline(always)]
11808        fn inline_align(_context: fidl::encoding::Context) -> usize {
11809            8
11810        }
11811
11812        #[inline(always)]
11813        fn inline_size(_context: fidl::encoding::Context) -> usize {
11814            16
11815        }
11816    }
11817
11818    unsafe impl
11819        fidl::encoding::Encode<
11820            CapabilityStoreDirConnectorCreateRequest,
11821            fidl::encoding::DefaultFuchsiaResourceDialect,
11822        > for &mut CapabilityStoreDirConnectorCreateRequest
11823    {
11824        #[inline]
11825        unsafe fn encode(
11826            self,
11827            encoder: &mut fidl::encoding::Encoder<
11828                '_,
11829                fidl::encoding::DefaultFuchsiaResourceDialect,
11830            >,
11831            offset: usize,
11832            _depth: fidl::encoding::Depth,
11833        ) -> fidl::Result<()> {
11834            encoder.debug_check_bounds::<CapabilityStoreDirConnectorCreateRequest>(offset);
11835            // Delegate to tuple encoding.
11836            fidl::encoding::Encode::<CapabilityStoreDirConnectorCreateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
11837                (
11838                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
11839                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirReceiverMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.receiver),
11840                ),
11841                encoder, offset, _depth
11842            )
11843        }
11844    }
11845    unsafe impl<
11846        T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
11847        T1: fidl::encoding::Encode<
11848                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirReceiverMarker>>,
11849                fidl::encoding::DefaultFuchsiaResourceDialect,
11850            >,
11851    >
11852        fidl::encoding::Encode<
11853            CapabilityStoreDirConnectorCreateRequest,
11854            fidl::encoding::DefaultFuchsiaResourceDialect,
11855        > for (T0, T1)
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::<CapabilityStoreDirConnectorCreateRequest>(offset);
11868            // Zero out padding regions. There's no need to apply masks
11869            // because the unmasked parts will be overwritten by fields.
11870            unsafe {
11871                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
11872                (ptr as *mut u64).write_unaligned(0);
11873            }
11874            // Write the fields.
11875            self.0.encode(encoder, offset + 0, depth)?;
11876            self.1.encode(encoder, offset + 8, depth)?;
11877            Ok(())
11878        }
11879    }
11880
11881    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11882        for CapabilityStoreDirConnectorCreateRequest
11883    {
11884        #[inline(always)]
11885        fn new_empty() -> Self {
11886            Self {
11887                id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
11888                receiver: fidl::new_empty!(
11889                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirReceiverMarker>>,
11890                    fidl::encoding::DefaultFuchsiaResourceDialect
11891                ),
11892            }
11893        }
11894
11895        #[inline]
11896        unsafe fn decode(
11897            &mut self,
11898            decoder: &mut fidl::encoding::Decoder<
11899                '_,
11900                fidl::encoding::DefaultFuchsiaResourceDialect,
11901            >,
11902            offset: usize,
11903            _depth: fidl::encoding::Depth,
11904        ) -> fidl::Result<()> {
11905            decoder.debug_check_bounds::<Self>(offset);
11906            // Verify that padding bytes are zero.
11907            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
11908            let padval = unsafe { (ptr as *const u64).read_unaligned() };
11909            let mask = 0xffffffff00000000u64;
11910            let maskedval = padval & mask;
11911            if maskedval != 0 {
11912                return Err(fidl::Error::NonZeroPadding {
11913                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
11914                });
11915            }
11916            fidl::decode!(
11917                u64,
11918                fidl::encoding::DefaultFuchsiaResourceDialect,
11919                &mut self.id,
11920                decoder,
11921                offset + 0,
11922                _depth
11923            )?;
11924            fidl::decode!(
11925                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirReceiverMarker>>,
11926                fidl::encoding::DefaultFuchsiaResourceDialect,
11927                &mut self.receiver,
11928                decoder,
11929                offset + 8,
11930                _depth
11931            )?;
11932            Ok(())
11933        }
11934    }
11935
11936    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreImportRequest {
11937        type Borrowed<'a> = &'a mut Self;
11938        fn take_or_borrow<'a>(
11939            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11940        ) -> Self::Borrowed<'a> {
11941            value
11942        }
11943    }
11944
11945    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreImportRequest {
11946        type Owned = Self;
11947
11948        #[inline(always)]
11949        fn inline_align(_context: fidl::encoding::Context) -> usize {
11950            8
11951        }
11952
11953        #[inline(always)]
11954        fn inline_size(_context: fidl::encoding::Context) -> usize {
11955            24
11956        }
11957    }
11958
11959    unsafe impl
11960        fidl::encoding::Encode<
11961            CapabilityStoreImportRequest,
11962            fidl::encoding::DefaultFuchsiaResourceDialect,
11963        > for &mut CapabilityStoreImportRequest
11964    {
11965        #[inline]
11966        unsafe fn encode(
11967            self,
11968            encoder: &mut fidl::encoding::Encoder<
11969                '_,
11970                fidl::encoding::DefaultFuchsiaResourceDialect,
11971            >,
11972            offset: usize,
11973            _depth: fidl::encoding::Depth,
11974        ) -> fidl::Result<()> {
11975            encoder.debug_check_bounds::<CapabilityStoreImportRequest>(offset);
11976            // Delegate to tuple encoding.
11977            fidl::encoding::Encode::<
11978                CapabilityStoreImportRequest,
11979                fidl::encoding::DefaultFuchsiaResourceDialect,
11980            >::encode(
11981                (
11982                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
11983                    <Capability as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11984                        &mut self.capability,
11985                    ),
11986                ),
11987                encoder,
11988                offset,
11989                _depth,
11990            )
11991        }
11992    }
11993    unsafe impl<
11994        T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
11995        T1: fidl::encoding::Encode<Capability, fidl::encoding::DefaultFuchsiaResourceDialect>,
11996    >
11997        fidl::encoding::Encode<
11998            CapabilityStoreImportRequest,
11999            fidl::encoding::DefaultFuchsiaResourceDialect,
12000        > for (T0, T1)
12001    {
12002        #[inline]
12003        unsafe fn encode(
12004            self,
12005            encoder: &mut fidl::encoding::Encoder<
12006                '_,
12007                fidl::encoding::DefaultFuchsiaResourceDialect,
12008            >,
12009            offset: usize,
12010            depth: fidl::encoding::Depth,
12011        ) -> fidl::Result<()> {
12012            encoder.debug_check_bounds::<CapabilityStoreImportRequest>(offset);
12013            // Zero out padding regions. There's no need to apply masks
12014            // because the unmasked parts will be overwritten by fields.
12015            // Write the fields.
12016            self.0.encode(encoder, offset + 0, depth)?;
12017            self.1.encode(encoder, offset + 8, depth)?;
12018            Ok(())
12019        }
12020    }
12021
12022    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12023        for CapabilityStoreImportRequest
12024    {
12025        #[inline(always)]
12026        fn new_empty() -> Self {
12027            Self {
12028                id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
12029                capability: fidl::new_empty!(
12030                    Capability,
12031                    fidl::encoding::DefaultFuchsiaResourceDialect
12032                ),
12033            }
12034        }
12035
12036        #[inline]
12037        unsafe fn decode(
12038            &mut self,
12039            decoder: &mut fidl::encoding::Decoder<
12040                '_,
12041                fidl::encoding::DefaultFuchsiaResourceDialect,
12042            >,
12043            offset: usize,
12044            _depth: fidl::encoding::Depth,
12045        ) -> fidl::Result<()> {
12046            decoder.debug_check_bounds::<Self>(offset);
12047            // Verify that padding bytes are zero.
12048            fidl::decode!(
12049                u64,
12050                fidl::encoding::DefaultFuchsiaResourceDialect,
12051                &mut self.id,
12052                decoder,
12053                offset + 0,
12054                _depth
12055            )?;
12056            fidl::decode!(
12057                Capability,
12058                fidl::encoding::DefaultFuchsiaResourceDialect,
12059                &mut self.capability,
12060                decoder,
12061                offset + 8,
12062                _depth
12063            )?;
12064            Ok(())
12065        }
12066    }
12067
12068    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreCreateServiceAggregateResponse {
12069        type Borrowed<'a> = &'a mut Self;
12070        fn take_or_borrow<'a>(
12071            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12072        ) -> Self::Borrowed<'a> {
12073            value
12074        }
12075    }
12076
12077    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreCreateServiceAggregateResponse {
12078        type Owned = Self;
12079
12080        #[inline(always)]
12081        fn inline_align(_context: fidl::encoding::Context) -> usize {
12082            4
12083        }
12084
12085        #[inline(always)]
12086        fn inline_size(_context: fidl::encoding::Context) -> usize {
12087            4
12088        }
12089    }
12090
12091    unsafe impl
12092        fidl::encoding::Encode<
12093            CapabilityStoreCreateServiceAggregateResponse,
12094            fidl::encoding::DefaultFuchsiaResourceDialect,
12095        > for &mut CapabilityStoreCreateServiceAggregateResponse
12096    {
12097        #[inline]
12098        unsafe fn encode(
12099            self,
12100            encoder: &mut fidl::encoding::Encoder<
12101                '_,
12102                fidl::encoding::DefaultFuchsiaResourceDialect,
12103            >,
12104            offset: usize,
12105            _depth: fidl::encoding::Depth,
12106        ) -> fidl::Result<()> {
12107            encoder.debug_check_bounds::<CapabilityStoreCreateServiceAggregateResponse>(offset);
12108            // Delegate to tuple encoding.
12109            fidl::encoding::Encode::<
12110                CapabilityStoreCreateServiceAggregateResponse,
12111                fidl::encoding::DefaultFuchsiaResourceDialect,
12112            >::encode(
12113                (<DirConnector as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
12114                    &mut self.aggregate_dir_connector,
12115                ),),
12116                encoder,
12117                offset,
12118                _depth,
12119            )
12120        }
12121    }
12122    unsafe impl<
12123        T0: fidl::encoding::Encode<DirConnector, fidl::encoding::DefaultFuchsiaResourceDialect>,
12124    >
12125        fidl::encoding::Encode<
12126            CapabilityStoreCreateServiceAggregateResponse,
12127            fidl::encoding::DefaultFuchsiaResourceDialect,
12128        > for (T0,)
12129    {
12130        #[inline]
12131        unsafe fn encode(
12132            self,
12133            encoder: &mut fidl::encoding::Encoder<
12134                '_,
12135                fidl::encoding::DefaultFuchsiaResourceDialect,
12136            >,
12137            offset: usize,
12138            depth: fidl::encoding::Depth,
12139        ) -> fidl::Result<()> {
12140            encoder.debug_check_bounds::<CapabilityStoreCreateServiceAggregateResponse>(offset);
12141            // Zero out padding regions. There's no need to apply masks
12142            // because the unmasked parts will be overwritten by fields.
12143            // Write the fields.
12144            self.0.encode(encoder, offset + 0, depth)?;
12145            Ok(())
12146        }
12147    }
12148
12149    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12150        for CapabilityStoreCreateServiceAggregateResponse
12151    {
12152        #[inline(always)]
12153        fn new_empty() -> Self {
12154            Self {
12155                aggregate_dir_connector: fidl::new_empty!(
12156                    DirConnector,
12157                    fidl::encoding::DefaultFuchsiaResourceDialect
12158                ),
12159            }
12160        }
12161
12162        #[inline]
12163        unsafe fn decode(
12164            &mut self,
12165            decoder: &mut fidl::encoding::Decoder<
12166                '_,
12167                fidl::encoding::DefaultFuchsiaResourceDialect,
12168            >,
12169            offset: usize,
12170            _depth: fidl::encoding::Depth,
12171        ) -> fidl::Result<()> {
12172            decoder.debug_check_bounds::<Self>(offset);
12173            // Verify that padding bytes are zero.
12174            fidl::decode!(
12175                DirConnector,
12176                fidl::encoding::DefaultFuchsiaResourceDialect,
12177                &mut self.aggregate_dir_connector,
12178                decoder,
12179                offset + 0,
12180                _depth
12181            )?;
12182            Ok(())
12183        }
12184    }
12185
12186    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreExportResponse {
12187        type Borrowed<'a> = &'a mut Self;
12188        fn take_or_borrow<'a>(
12189            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12190        ) -> Self::Borrowed<'a> {
12191            value
12192        }
12193    }
12194
12195    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreExportResponse {
12196        type Owned = Self;
12197
12198        #[inline(always)]
12199        fn inline_align(_context: fidl::encoding::Context) -> usize {
12200            8
12201        }
12202
12203        #[inline(always)]
12204        fn inline_size(_context: fidl::encoding::Context) -> usize {
12205            16
12206        }
12207    }
12208
12209    unsafe impl
12210        fidl::encoding::Encode<
12211            CapabilityStoreExportResponse,
12212            fidl::encoding::DefaultFuchsiaResourceDialect,
12213        > for &mut CapabilityStoreExportResponse
12214    {
12215        #[inline]
12216        unsafe fn encode(
12217            self,
12218            encoder: &mut fidl::encoding::Encoder<
12219                '_,
12220                fidl::encoding::DefaultFuchsiaResourceDialect,
12221            >,
12222            offset: usize,
12223            _depth: fidl::encoding::Depth,
12224        ) -> fidl::Result<()> {
12225            encoder.debug_check_bounds::<CapabilityStoreExportResponse>(offset);
12226            // Delegate to tuple encoding.
12227            fidl::encoding::Encode::<
12228                CapabilityStoreExportResponse,
12229                fidl::encoding::DefaultFuchsiaResourceDialect,
12230            >::encode(
12231                (<Capability as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
12232                    &mut self.capability,
12233                ),),
12234                encoder,
12235                offset,
12236                _depth,
12237            )
12238        }
12239    }
12240    unsafe impl<
12241        T0: fidl::encoding::Encode<Capability, fidl::encoding::DefaultFuchsiaResourceDialect>,
12242    >
12243        fidl::encoding::Encode<
12244            CapabilityStoreExportResponse,
12245            fidl::encoding::DefaultFuchsiaResourceDialect,
12246        > for (T0,)
12247    {
12248        #[inline]
12249        unsafe fn encode(
12250            self,
12251            encoder: &mut fidl::encoding::Encoder<
12252                '_,
12253                fidl::encoding::DefaultFuchsiaResourceDialect,
12254            >,
12255            offset: usize,
12256            depth: fidl::encoding::Depth,
12257        ) -> fidl::Result<()> {
12258            encoder.debug_check_bounds::<CapabilityStoreExportResponse>(offset);
12259            // Zero out padding regions. There's no need to apply masks
12260            // because the unmasked parts will be overwritten by fields.
12261            // Write the fields.
12262            self.0.encode(encoder, offset + 0, depth)?;
12263            Ok(())
12264        }
12265    }
12266
12267    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12268        for CapabilityStoreExportResponse
12269    {
12270        #[inline(always)]
12271        fn new_empty() -> Self {
12272            Self {
12273                capability: fidl::new_empty!(
12274                    Capability,
12275                    fidl::encoding::DefaultFuchsiaResourceDialect
12276                ),
12277            }
12278        }
12279
12280        #[inline]
12281        unsafe fn decode(
12282            &mut self,
12283            decoder: &mut fidl::encoding::Decoder<
12284                '_,
12285                fidl::encoding::DefaultFuchsiaResourceDialect,
12286            >,
12287            offset: usize,
12288            _depth: fidl::encoding::Depth,
12289        ) -> fidl::Result<()> {
12290            decoder.debug_check_bounds::<Self>(offset);
12291            // Verify that padding bytes are zero.
12292            fidl::decode!(
12293                Capability,
12294                fidl::encoding::DefaultFuchsiaResourceDialect,
12295                &mut self.capability,
12296                decoder,
12297                offset + 0,
12298                _depth
12299            )?;
12300            Ok(())
12301        }
12302    }
12303
12304    impl fidl::encoding::ResourceTypeMarker for Connector {
12305        type Borrowed<'a> = &'a mut Self;
12306        fn take_or_borrow<'a>(
12307            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12308        ) -> Self::Borrowed<'a> {
12309            value
12310        }
12311    }
12312
12313    unsafe impl fidl::encoding::TypeMarker for Connector {
12314        type Owned = Self;
12315
12316        #[inline(always)]
12317        fn inline_align(_context: fidl::encoding::Context) -> usize {
12318            4
12319        }
12320
12321        #[inline(always)]
12322        fn inline_size(_context: fidl::encoding::Context) -> usize {
12323            4
12324        }
12325    }
12326
12327    unsafe impl fidl::encoding::Encode<Connector, fidl::encoding::DefaultFuchsiaResourceDialect>
12328        for &mut Connector
12329    {
12330        #[inline]
12331        unsafe fn encode(
12332            self,
12333            encoder: &mut fidl::encoding::Encoder<
12334                '_,
12335                fidl::encoding::DefaultFuchsiaResourceDialect,
12336            >,
12337            offset: usize,
12338            _depth: fidl::encoding::Depth,
12339        ) -> fidl::Result<()> {
12340            encoder.debug_check_bounds::<Connector>(offset);
12341            // Delegate to tuple encoding.
12342            fidl::encoding::Encode::<Connector, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
12343                (
12344                    <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.token),
12345                ),
12346                encoder, offset, _depth
12347            )
12348        }
12349    }
12350    unsafe impl<
12351        T0: fidl::encoding::Encode<
12352                fidl::encoding::HandleType<
12353                    fidl::EventPair,
12354                    { fidl::ObjectType::EVENTPAIR.into_raw() },
12355                    2147483648,
12356                >,
12357                fidl::encoding::DefaultFuchsiaResourceDialect,
12358            >,
12359    > fidl::encoding::Encode<Connector, fidl::encoding::DefaultFuchsiaResourceDialect> for (T0,)
12360    {
12361        #[inline]
12362        unsafe fn encode(
12363            self,
12364            encoder: &mut fidl::encoding::Encoder<
12365                '_,
12366                fidl::encoding::DefaultFuchsiaResourceDialect,
12367            >,
12368            offset: usize,
12369            depth: fidl::encoding::Depth,
12370        ) -> fidl::Result<()> {
12371            encoder.debug_check_bounds::<Connector>(offset);
12372            // Zero out padding regions. There's no need to apply masks
12373            // because the unmasked parts will be overwritten by fields.
12374            // Write the fields.
12375            self.0.encode(encoder, offset + 0, depth)?;
12376            Ok(())
12377        }
12378    }
12379
12380    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Connector {
12381        #[inline(always)]
12382        fn new_empty() -> Self {
12383            Self {
12384                token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
12385            }
12386        }
12387
12388        #[inline]
12389        unsafe fn decode(
12390            &mut self,
12391            decoder: &mut fidl::encoding::Decoder<
12392                '_,
12393                fidl::encoding::DefaultFuchsiaResourceDialect,
12394            >,
12395            offset: usize,
12396            _depth: fidl::encoding::Depth,
12397        ) -> fidl::Result<()> {
12398            decoder.debug_check_bounds::<Self>(offset);
12399            // Verify that padding bytes are zero.
12400            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.token, decoder, offset + 0, _depth)?;
12401            Ok(())
12402        }
12403    }
12404
12405    impl fidl::encoding::ResourceTypeMarker for DictionaryDrainIteratorGetNextResponse {
12406        type Borrowed<'a> = &'a mut Self;
12407        fn take_or_borrow<'a>(
12408            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12409        ) -> Self::Borrowed<'a> {
12410            value
12411        }
12412    }
12413
12414    unsafe impl fidl::encoding::TypeMarker for DictionaryDrainIteratorGetNextResponse {
12415        type Owned = Self;
12416
12417        #[inline(always)]
12418        fn inline_align(_context: fidl::encoding::Context) -> usize {
12419            8
12420        }
12421
12422        #[inline(always)]
12423        fn inline_size(_context: fidl::encoding::Context) -> usize {
12424            24
12425        }
12426    }
12427
12428    unsafe impl
12429        fidl::encoding::Encode<
12430            DictionaryDrainIteratorGetNextResponse,
12431            fidl::encoding::DefaultFuchsiaResourceDialect,
12432        > for &mut DictionaryDrainIteratorGetNextResponse
12433    {
12434        #[inline]
12435        unsafe fn encode(
12436            self,
12437            encoder: &mut fidl::encoding::Encoder<
12438                '_,
12439                fidl::encoding::DefaultFuchsiaResourceDialect,
12440            >,
12441            offset: usize,
12442            _depth: fidl::encoding::Depth,
12443        ) -> fidl::Result<()> {
12444            encoder.debug_check_bounds::<DictionaryDrainIteratorGetNextResponse>(offset);
12445            // Delegate to tuple encoding.
12446            fidl::encoding::Encode::<DictionaryDrainIteratorGetNextResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
12447                (
12448                    <fidl::encoding::Vector<DictionaryItem, 128> as fidl::encoding::ValueTypeMarker>::borrow(&self.items),
12449                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.end_id),
12450                ),
12451                encoder, offset, _depth
12452            )
12453        }
12454    }
12455    unsafe impl<
12456        T0: fidl::encoding::Encode<
12457                fidl::encoding::Vector<DictionaryItem, 128>,
12458                fidl::encoding::DefaultFuchsiaResourceDialect,
12459            >,
12460        T1: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
12461    >
12462        fidl::encoding::Encode<
12463            DictionaryDrainIteratorGetNextResponse,
12464            fidl::encoding::DefaultFuchsiaResourceDialect,
12465        > for (T0, T1)
12466    {
12467        #[inline]
12468        unsafe fn encode(
12469            self,
12470            encoder: &mut fidl::encoding::Encoder<
12471                '_,
12472                fidl::encoding::DefaultFuchsiaResourceDialect,
12473            >,
12474            offset: usize,
12475            depth: fidl::encoding::Depth,
12476        ) -> fidl::Result<()> {
12477            encoder.debug_check_bounds::<DictionaryDrainIteratorGetNextResponse>(offset);
12478            // Zero out padding regions. There's no need to apply masks
12479            // because the unmasked parts will be overwritten by fields.
12480            // Write the fields.
12481            self.0.encode(encoder, offset + 0, depth)?;
12482            self.1.encode(encoder, offset + 16, depth)?;
12483            Ok(())
12484        }
12485    }
12486
12487    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12488        for DictionaryDrainIteratorGetNextResponse
12489    {
12490        #[inline(always)]
12491        fn new_empty() -> Self {
12492            Self {
12493                items: fidl::new_empty!(fidl::encoding::Vector<DictionaryItem, 128>, fidl::encoding::DefaultFuchsiaResourceDialect),
12494                end_id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
12495            }
12496        }
12497
12498        #[inline]
12499        unsafe fn decode(
12500            &mut self,
12501            decoder: &mut fidl::encoding::Decoder<
12502                '_,
12503                fidl::encoding::DefaultFuchsiaResourceDialect,
12504            >,
12505            offset: usize,
12506            _depth: fidl::encoding::Depth,
12507        ) -> fidl::Result<()> {
12508            decoder.debug_check_bounds::<Self>(offset);
12509            // Verify that padding bytes are zero.
12510            fidl::decode!(fidl::encoding::Vector<DictionaryItem, 128>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.items, decoder, offset + 0, _depth)?;
12511            fidl::decode!(
12512                u64,
12513                fidl::encoding::DefaultFuchsiaResourceDialect,
12514                &mut self.end_id,
12515                decoder,
12516                offset + 16,
12517                _depth
12518            )?;
12519            Ok(())
12520        }
12521    }
12522
12523    impl fidl::encoding::ResourceTypeMarker for DictionaryEnumerateIteratorGetNextResponse {
12524        type Borrowed<'a> = &'a mut Self;
12525        fn take_or_borrow<'a>(
12526            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12527        ) -> Self::Borrowed<'a> {
12528            value
12529        }
12530    }
12531
12532    unsafe impl fidl::encoding::TypeMarker for DictionaryEnumerateIteratorGetNextResponse {
12533        type Owned = Self;
12534
12535        #[inline(always)]
12536        fn inline_align(_context: fidl::encoding::Context) -> usize {
12537            8
12538        }
12539
12540        #[inline(always)]
12541        fn inline_size(_context: fidl::encoding::Context) -> usize {
12542            24
12543        }
12544    }
12545
12546    unsafe impl
12547        fidl::encoding::Encode<
12548            DictionaryEnumerateIteratorGetNextResponse,
12549            fidl::encoding::DefaultFuchsiaResourceDialect,
12550        > for &mut DictionaryEnumerateIteratorGetNextResponse
12551    {
12552        #[inline]
12553        unsafe fn encode(
12554            self,
12555            encoder: &mut fidl::encoding::Encoder<
12556                '_,
12557                fidl::encoding::DefaultFuchsiaResourceDialect,
12558            >,
12559            offset: usize,
12560            _depth: fidl::encoding::Depth,
12561        ) -> fidl::Result<()> {
12562            encoder.debug_check_bounds::<DictionaryEnumerateIteratorGetNextResponse>(offset);
12563            // Delegate to tuple encoding.
12564            fidl::encoding::Encode::<DictionaryEnumerateIteratorGetNextResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
12565                (
12566                    <fidl::encoding::Vector<DictionaryOptionalItem, 128> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.items),
12567                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.end_id),
12568                ),
12569                encoder, offset, _depth
12570            )
12571        }
12572    }
12573    unsafe impl<
12574        T0: fidl::encoding::Encode<
12575                fidl::encoding::Vector<DictionaryOptionalItem, 128>,
12576                fidl::encoding::DefaultFuchsiaResourceDialect,
12577            >,
12578        T1: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
12579    >
12580        fidl::encoding::Encode<
12581            DictionaryEnumerateIteratorGetNextResponse,
12582            fidl::encoding::DefaultFuchsiaResourceDialect,
12583        > for (T0, T1)
12584    {
12585        #[inline]
12586        unsafe fn encode(
12587            self,
12588            encoder: &mut fidl::encoding::Encoder<
12589                '_,
12590                fidl::encoding::DefaultFuchsiaResourceDialect,
12591            >,
12592            offset: usize,
12593            depth: fidl::encoding::Depth,
12594        ) -> fidl::Result<()> {
12595            encoder.debug_check_bounds::<DictionaryEnumerateIteratorGetNextResponse>(offset);
12596            // Zero out padding regions. There's no need to apply masks
12597            // because the unmasked parts will be overwritten by fields.
12598            // Write the fields.
12599            self.0.encode(encoder, offset + 0, depth)?;
12600            self.1.encode(encoder, offset + 16, depth)?;
12601            Ok(())
12602        }
12603    }
12604
12605    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12606        for DictionaryEnumerateIteratorGetNextResponse
12607    {
12608        #[inline(always)]
12609        fn new_empty() -> Self {
12610            Self {
12611                items: fidl::new_empty!(fidl::encoding::Vector<DictionaryOptionalItem, 128>, fidl::encoding::DefaultFuchsiaResourceDialect),
12612                end_id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
12613            }
12614        }
12615
12616        #[inline]
12617        unsafe fn decode(
12618            &mut self,
12619            decoder: &mut fidl::encoding::Decoder<
12620                '_,
12621                fidl::encoding::DefaultFuchsiaResourceDialect,
12622            >,
12623            offset: usize,
12624            _depth: fidl::encoding::Depth,
12625        ) -> fidl::Result<()> {
12626            decoder.debug_check_bounds::<Self>(offset);
12627            // Verify that padding bytes are zero.
12628            fidl::decode!(fidl::encoding::Vector<DictionaryOptionalItem, 128>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.items, decoder, offset + 0, _depth)?;
12629            fidl::decode!(
12630                u64,
12631                fidl::encoding::DefaultFuchsiaResourceDialect,
12632                &mut self.end_id,
12633                decoder,
12634                offset + 16,
12635                _depth
12636            )?;
12637            Ok(())
12638        }
12639    }
12640
12641    impl fidl::encoding::ResourceTypeMarker for DictionaryKeysIteratorGetNextResponse {
12642        type Borrowed<'a> = &'a mut Self;
12643        fn take_or_borrow<'a>(
12644            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12645        ) -> Self::Borrowed<'a> {
12646            value
12647        }
12648    }
12649
12650    unsafe impl fidl::encoding::TypeMarker for DictionaryKeysIteratorGetNextResponse {
12651        type Owned = Self;
12652
12653        #[inline(always)]
12654        fn inline_align(_context: fidl::encoding::Context) -> usize {
12655            8
12656        }
12657
12658        #[inline(always)]
12659        fn inline_size(_context: fidl::encoding::Context) -> usize {
12660            16
12661        }
12662    }
12663
12664    unsafe impl
12665        fidl::encoding::Encode<
12666            DictionaryKeysIteratorGetNextResponse,
12667            fidl::encoding::DefaultFuchsiaResourceDialect,
12668        > for &mut DictionaryKeysIteratorGetNextResponse
12669    {
12670        #[inline]
12671        unsafe fn encode(
12672            self,
12673            encoder: &mut fidl::encoding::Encoder<
12674                '_,
12675                fidl::encoding::DefaultFuchsiaResourceDialect,
12676            >,
12677            offset: usize,
12678            _depth: fidl::encoding::Depth,
12679        ) -> fidl::Result<()> {
12680            encoder.debug_check_bounds::<DictionaryKeysIteratorGetNextResponse>(offset);
12681            // Delegate to tuple encoding.
12682            fidl::encoding::Encode::<DictionaryKeysIteratorGetNextResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
12683                (
12684                    <fidl::encoding::Vector<fidl::encoding::BoundedString<255>, 128> as fidl::encoding::ValueTypeMarker>::borrow(&self.keys),
12685                ),
12686                encoder, offset, _depth
12687            )
12688        }
12689    }
12690    unsafe impl<
12691        T0: fidl::encoding::Encode<
12692                fidl::encoding::Vector<fidl::encoding::BoundedString<255>, 128>,
12693                fidl::encoding::DefaultFuchsiaResourceDialect,
12694            >,
12695    >
12696        fidl::encoding::Encode<
12697            DictionaryKeysIteratorGetNextResponse,
12698            fidl::encoding::DefaultFuchsiaResourceDialect,
12699        > for (T0,)
12700    {
12701        #[inline]
12702        unsafe fn encode(
12703            self,
12704            encoder: &mut fidl::encoding::Encoder<
12705                '_,
12706                fidl::encoding::DefaultFuchsiaResourceDialect,
12707            >,
12708            offset: usize,
12709            depth: fidl::encoding::Depth,
12710        ) -> fidl::Result<()> {
12711            encoder.debug_check_bounds::<DictionaryKeysIteratorGetNextResponse>(offset);
12712            // Zero out padding regions. There's no need to apply masks
12713            // because the unmasked parts will be overwritten by fields.
12714            // Write the fields.
12715            self.0.encode(encoder, offset + 0, depth)?;
12716            Ok(())
12717        }
12718    }
12719
12720    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12721        for DictionaryKeysIteratorGetNextResponse
12722    {
12723        #[inline(always)]
12724        fn new_empty() -> Self {
12725            Self {
12726                keys: fidl::new_empty!(
12727                    fidl::encoding::Vector<fidl::encoding::BoundedString<255>, 128>,
12728                    fidl::encoding::DefaultFuchsiaResourceDialect
12729                ),
12730            }
12731        }
12732
12733        #[inline]
12734        unsafe fn decode(
12735            &mut self,
12736            decoder: &mut fidl::encoding::Decoder<
12737                '_,
12738                fidl::encoding::DefaultFuchsiaResourceDialect,
12739            >,
12740            offset: usize,
12741            _depth: fidl::encoding::Depth,
12742        ) -> fidl::Result<()> {
12743            decoder.debug_check_bounds::<Self>(offset);
12744            // Verify that padding bytes are zero.
12745            fidl::decode!(
12746                fidl::encoding::Vector<fidl::encoding::BoundedString<255>, 128>,
12747                fidl::encoding::DefaultFuchsiaResourceDialect,
12748                &mut self.keys,
12749                decoder,
12750                offset + 0,
12751                _depth
12752            )?;
12753            Ok(())
12754        }
12755    }
12756
12757    impl fidl::encoding::ResourceTypeMarker for DictionaryOptionalItem {
12758        type Borrowed<'a> = &'a mut Self;
12759        fn take_or_borrow<'a>(
12760            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12761        ) -> Self::Borrowed<'a> {
12762            value
12763        }
12764    }
12765
12766    unsafe impl fidl::encoding::TypeMarker for DictionaryOptionalItem {
12767        type Owned = Self;
12768
12769        #[inline(always)]
12770        fn inline_align(_context: fidl::encoding::Context) -> usize {
12771            8
12772        }
12773
12774        #[inline(always)]
12775        fn inline_size(_context: fidl::encoding::Context) -> usize {
12776            24
12777        }
12778    }
12779
12780    unsafe impl
12781        fidl::encoding::Encode<
12782            DictionaryOptionalItem,
12783            fidl::encoding::DefaultFuchsiaResourceDialect,
12784        > for &mut DictionaryOptionalItem
12785    {
12786        #[inline]
12787        unsafe fn encode(
12788            self,
12789            encoder: &mut fidl::encoding::Encoder<
12790                '_,
12791                fidl::encoding::DefaultFuchsiaResourceDialect,
12792            >,
12793            offset: usize,
12794            _depth: fidl::encoding::Depth,
12795        ) -> fidl::Result<()> {
12796            encoder.debug_check_bounds::<DictionaryOptionalItem>(offset);
12797            // Delegate to tuple encoding.
12798            fidl::encoding::Encode::<DictionaryOptionalItem, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
12799                (
12800                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(&self.key),
12801                    <fidl::encoding::Boxed<WrappedCapabilityId> as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
12802                ),
12803                encoder, offset, _depth
12804            )
12805        }
12806    }
12807    unsafe impl<
12808        T0: fidl::encoding::Encode<
12809                fidl::encoding::BoundedString<255>,
12810                fidl::encoding::DefaultFuchsiaResourceDialect,
12811            >,
12812        T1: fidl::encoding::Encode<
12813                fidl::encoding::Boxed<WrappedCapabilityId>,
12814                fidl::encoding::DefaultFuchsiaResourceDialect,
12815            >,
12816    >
12817        fidl::encoding::Encode<
12818            DictionaryOptionalItem,
12819            fidl::encoding::DefaultFuchsiaResourceDialect,
12820        > for (T0, T1)
12821    {
12822        #[inline]
12823        unsafe fn encode(
12824            self,
12825            encoder: &mut fidl::encoding::Encoder<
12826                '_,
12827                fidl::encoding::DefaultFuchsiaResourceDialect,
12828            >,
12829            offset: usize,
12830            depth: fidl::encoding::Depth,
12831        ) -> fidl::Result<()> {
12832            encoder.debug_check_bounds::<DictionaryOptionalItem>(offset);
12833            // Zero out padding regions. There's no need to apply masks
12834            // because the unmasked parts will be overwritten by fields.
12835            // Write the fields.
12836            self.0.encode(encoder, offset + 0, depth)?;
12837            self.1.encode(encoder, offset + 16, depth)?;
12838            Ok(())
12839        }
12840    }
12841
12842    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12843        for DictionaryOptionalItem
12844    {
12845        #[inline(always)]
12846        fn new_empty() -> Self {
12847            Self {
12848                key: fidl::new_empty!(
12849                    fidl::encoding::BoundedString<255>,
12850                    fidl::encoding::DefaultFuchsiaResourceDialect
12851                ),
12852                value: fidl::new_empty!(
12853                    fidl::encoding::Boxed<WrappedCapabilityId>,
12854                    fidl::encoding::DefaultFuchsiaResourceDialect
12855                ),
12856            }
12857        }
12858
12859        #[inline]
12860        unsafe fn decode(
12861            &mut self,
12862            decoder: &mut fidl::encoding::Decoder<
12863                '_,
12864                fidl::encoding::DefaultFuchsiaResourceDialect,
12865            >,
12866            offset: usize,
12867            _depth: fidl::encoding::Depth,
12868        ) -> fidl::Result<()> {
12869            decoder.debug_check_bounds::<Self>(offset);
12870            // Verify that padding bytes are zero.
12871            fidl::decode!(
12872                fidl::encoding::BoundedString<255>,
12873                fidl::encoding::DefaultFuchsiaResourceDialect,
12874                &mut self.key,
12875                decoder,
12876                offset + 0,
12877                _depth
12878            )?;
12879            fidl::decode!(
12880                fidl::encoding::Boxed<WrappedCapabilityId>,
12881                fidl::encoding::DefaultFuchsiaResourceDialect,
12882                &mut self.value,
12883                decoder,
12884                offset + 16,
12885                _depth
12886            )?;
12887            Ok(())
12888        }
12889    }
12890
12891    impl fidl::encoding::ResourceTypeMarker for DictionaryRef {
12892        type Borrowed<'a> = &'a mut Self;
12893        fn take_or_borrow<'a>(
12894            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12895        ) -> Self::Borrowed<'a> {
12896            value
12897        }
12898    }
12899
12900    unsafe impl fidl::encoding::TypeMarker for DictionaryRef {
12901        type Owned = Self;
12902
12903        #[inline(always)]
12904        fn inline_align(_context: fidl::encoding::Context) -> usize {
12905            4
12906        }
12907
12908        #[inline(always)]
12909        fn inline_size(_context: fidl::encoding::Context) -> usize {
12910            4
12911        }
12912    }
12913
12914    unsafe impl fidl::encoding::Encode<DictionaryRef, fidl::encoding::DefaultFuchsiaResourceDialect>
12915        for &mut DictionaryRef
12916    {
12917        #[inline]
12918        unsafe fn encode(
12919            self,
12920            encoder: &mut fidl::encoding::Encoder<
12921                '_,
12922                fidl::encoding::DefaultFuchsiaResourceDialect,
12923            >,
12924            offset: usize,
12925            _depth: fidl::encoding::Depth,
12926        ) -> fidl::Result<()> {
12927            encoder.debug_check_bounds::<DictionaryRef>(offset);
12928            // Delegate to tuple encoding.
12929            fidl::encoding::Encode::<DictionaryRef, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
12930                (
12931                    <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.token),
12932                ),
12933                encoder, offset, _depth
12934            )
12935        }
12936    }
12937    unsafe impl<
12938        T0: fidl::encoding::Encode<
12939                fidl::encoding::HandleType<
12940                    fidl::EventPair,
12941                    { fidl::ObjectType::EVENTPAIR.into_raw() },
12942                    2147483648,
12943                >,
12944                fidl::encoding::DefaultFuchsiaResourceDialect,
12945            >,
12946    > fidl::encoding::Encode<DictionaryRef, fidl::encoding::DefaultFuchsiaResourceDialect>
12947        for (T0,)
12948    {
12949        #[inline]
12950        unsafe fn encode(
12951            self,
12952            encoder: &mut fidl::encoding::Encoder<
12953                '_,
12954                fidl::encoding::DefaultFuchsiaResourceDialect,
12955            >,
12956            offset: usize,
12957            depth: fidl::encoding::Depth,
12958        ) -> fidl::Result<()> {
12959            encoder.debug_check_bounds::<DictionaryRef>(offset);
12960            // Zero out padding regions. There's no need to apply masks
12961            // because the unmasked parts will be overwritten by fields.
12962            // Write the fields.
12963            self.0.encode(encoder, offset + 0, depth)?;
12964            Ok(())
12965        }
12966    }
12967
12968    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for DictionaryRef {
12969        #[inline(always)]
12970        fn new_empty() -> Self {
12971            Self {
12972                token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
12973            }
12974        }
12975
12976        #[inline]
12977        unsafe fn decode(
12978            &mut self,
12979            decoder: &mut fidl::encoding::Decoder<
12980                '_,
12981                fidl::encoding::DefaultFuchsiaResourceDialect,
12982            >,
12983            offset: usize,
12984            _depth: fidl::encoding::Depth,
12985        ) -> fidl::Result<()> {
12986            decoder.debug_check_bounds::<Self>(offset);
12987            // Verify that padding bytes are zero.
12988            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.token, decoder, offset + 0, _depth)?;
12989            Ok(())
12990        }
12991    }
12992
12993    impl fidl::encoding::ResourceTypeMarker for DirConnector {
12994        type Borrowed<'a> = &'a mut Self;
12995        fn take_or_borrow<'a>(
12996            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12997        ) -> Self::Borrowed<'a> {
12998            value
12999        }
13000    }
13001
13002    unsafe impl fidl::encoding::TypeMarker for DirConnector {
13003        type Owned = Self;
13004
13005        #[inline(always)]
13006        fn inline_align(_context: fidl::encoding::Context) -> usize {
13007            4
13008        }
13009
13010        #[inline(always)]
13011        fn inline_size(_context: fidl::encoding::Context) -> usize {
13012            4
13013        }
13014    }
13015
13016    unsafe impl fidl::encoding::Encode<DirConnector, fidl::encoding::DefaultFuchsiaResourceDialect>
13017        for &mut DirConnector
13018    {
13019        #[inline]
13020        unsafe fn encode(
13021            self,
13022            encoder: &mut fidl::encoding::Encoder<
13023                '_,
13024                fidl::encoding::DefaultFuchsiaResourceDialect,
13025            >,
13026            offset: usize,
13027            _depth: fidl::encoding::Depth,
13028        ) -> fidl::Result<()> {
13029            encoder.debug_check_bounds::<DirConnector>(offset);
13030            // Delegate to tuple encoding.
13031            fidl::encoding::Encode::<DirConnector, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
13032                (
13033                    <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.token),
13034                ),
13035                encoder, offset, _depth
13036            )
13037        }
13038    }
13039    unsafe impl<
13040        T0: fidl::encoding::Encode<
13041                fidl::encoding::HandleType<
13042                    fidl::EventPair,
13043                    { fidl::ObjectType::EVENTPAIR.into_raw() },
13044                    2147483648,
13045                >,
13046                fidl::encoding::DefaultFuchsiaResourceDialect,
13047            >,
13048    > fidl::encoding::Encode<DirConnector, fidl::encoding::DefaultFuchsiaResourceDialect> for (T0,)
13049    {
13050        #[inline]
13051        unsafe fn encode(
13052            self,
13053            encoder: &mut fidl::encoding::Encoder<
13054                '_,
13055                fidl::encoding::DefaultFuchsiaResourceDialect,
13056            >,
13057            offset: usize,
13058            depth: fidl::encoding::Depth,
13059        ) -> fidl::Result<()> {
13060            encoder.debug_check_bounds::<DirConnector>(offset);
13061            // Zero out padding regions. There's no need to apply masks
13062            // because the unmasked parts will be overwritten by fields.
13063            // Write the fields.
13064            self.0.encode(encoder, offset + 0, depth)?;
13065            Ok(())
13066        }
13067    }
13068
13069    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for DirConnector {
13070        #[inline(always)]
13071        fn new_empty() -> Self {
13072            Self {
13073                token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
13074            }
13075        }
13076
13077        #[inline]
13078        unsafe fn decode(
13079            &mut self,
13080            decoder: &mut fidl::encoding::Decoder<
13081                '_,
13082                fidl::encoding::DefaultFuchsiaResourceDialect,
13083            >,
13084            offset: usize,
13085            _depth: fidl::encoding::Depth,
13086        ) -> fidl::Result<()> {
13087            decoder.debug_check_bounds::<Self>(offset);
13088            // Verify that padding bytes are zero.
13089            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.token, decoder, offset + 0, _depth)?;
13090            Ok(())
13091        }
13092    }
13093
13094    impl fidl::encoding::ResourceTypeMarker for DirEntry {
13095        type Borrowed<'a> = &'a mut Self;
13096        fn take_or_borrow<'a>(
13097            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13098        ) -> Self::Borrowed<'a> {
13099            value
13100        }
13101    }
13102
13103    unsafe impl fidl::encoding::TypeMarker for DirEntry {
13104        type Owned = Self;
13105
13106        #[inline(always)]
13107        fn inline_align(_context: fidl::encoding::Context) -> usize {
13108            4
13109        }
13110
13111        #[inline(always)]
13112        fn inline_size(_context: fidl::encoding::Context) -> usize {
13113            4
13114        }
13115    }
13116
13117    unsafe impl fidl::encoding::Encode<DirEntry, fidl::encoding::DefaultFuchsiaResourceDialect>
13118        for &mut DirEntry
13119    {
13120        #[inline]
13121        unsafe fn encode(
13122            self,
13123            encoder: &mut fidl::encoding::Encoder<
13124                '_,
13125                fidl::encoding::DefaultFuchsiaResourceDialect,
13126            >,
13127            offset: usize,
13128            _depth: fidl::encoding::Depth,
13129        ) -> fidl::Result<()> {
13130            encoder.debug_check_bounds::<DirEntry>(offset);
13131            // Delegate to tuple encoding.
13132            fidl::encoding::Encode::<DirEntry, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
13133                (
13134                    <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.token),
13135                ),
13136                encoder, offset, _depth
13137            )
13138        }
13139    }
13140    unsafe impl<
13141        T0: fidl::encoding::Encode<
13142                fidl::encoding::HandleType<
13143                    fidl::EventPair,
13144                    { fidl::ObjectType::EVENTPAIR.into_raw() },
13145                    2147483648,
13146                >,
13147                fidl::encoding::DefaultFuchsiaResourceDialect,
13148            >,
13149    > fidl::encoding::Encode<DirEntry, fidl::encoding::DefaultFuchsiaResourceDialect> for (T0,)
13150    {
13151        #[inline]
13152        unsafe fn encode(
13153            self,
13154            encoder: &mut fidl::encoding::Encoder<
13155                '_,
13156                fidl::encoding::DefaultFuchsiaResourceDialect,
13157            >,
13158            offset: usize,
13159            depth: fidl::encoding::Depth,
13160        ) -> fidl::Result<()> {
13161            encoder.debug_check_bounds::<DirEntry>(offset);
13162            // Zero out padding regions. There's no need to apply masks
13163            // because the unmasked parts will be overwritten by fields.
13164            // Write the fields.
13165            self.0.encode(encoder, offset + 0, depth)?;
13166            Ok(())
13167        }
13168    }
13169
13170    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for DirEntry {
13171        #[inline(always)]
13172        fn new_empty() -> Self {
13173            Self {
13174                token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
13175            }
13176        }
13177
13178        #[inline]
13179        unsafe fn decode(
13180            &mut self,
13181            decoder: &mut fidl::encoding::Decoder<
13182                '_,
13183                fidl::encoding::DefaultFuchsiaResourceDialect,
13184            >,
13185            offset: usize,
13186            _depth: fidl::encoding::Depth,
13187        ) -> fidl::Result<()> {
13188            decoder.debug_check_bounds::<Self>(offset);
13189            // Verify that padding bytes are zero.
13190            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.token, decoder, offset + 0, _depth)?;
13191            Ok(())
13192        }
13193    }
13194
13195    impl fidl::encoding::ResourceTypeMarker for InstanceToken {
13196        type Borrowed<'a> = &'a mut Self;
13197        fn take_or_borrow<'a>(
13198            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13199        ) -> Self::Borrowed<'a> {
13200            value
13201        }
13202    }
13203
13204    unsafe impl fidl::encoding::TypeMarker for InstanceToken {
13205        type Owned = Self;
13206
13207        #[inline(always)]
13208        fn inline_align(_context: fidl::encoding::Context) -> usize {
13209            4
13210        }
13211
13212        #[inline(always)]
13213        fn inline_size(_context: fidl::encoding::Context) -> usize {
13214            4
13215        }
13216    }
13217
13218    unsafe impl fidl::encoding::Encode<InstanceToken, fidl::encoding::DefaultFuchsiaResourceDialect>
13219        for &mut InstanceToken
13220    {
13221        #[inline]
13222        unsafe fn encode(
13223            self,
13224            encoder: &mut fidl::encoding::Encoder<
13225                '_,
13226                fidl::encoding::DefaultFuchsiaResourceDialect,
13227            >,
13228            offset: usize,
13229            _depth: fidl::encoding::Depth,
13230        ) -> fidl::Result<()> {
13231            encoder.debug_check_bounds::<InstanceToken>(offset);
13232            // Delegate to tuple encoding.
13233            fidl::encoding::Encode::<InstanceToken, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
13234                (
13235                    <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.token),
13236                ),
13237                encoder, offset, _depth
13238            )
13239        }
13240    }
13241    unsafe impl<
13242        T0: fidl::encoding::Encode<
13243                fidl::encoding::HandleType<
13244                    fidl::EventPair,
13245                    { fidl::ObjectType::EVENTPAIR.into_raw() },
13246                    2147483648,
13247                >,
13248                fidl::encoding::DefaultFuchsiaResourceDialect,
13249            >,
13250    > fidl::encoding::Encode<InstanceToken, fidl::encoding::DefaultFuchsiaResourceDialect>
13251        for (T0,)
13252    {
13253        #[inline]
13254        unsafe fn encode(
13255            self,
13256            encoder: &mut fidl::encoding::Encoder<
13257                '_,
13258                fidl::encoding::DefaultFuchsiaResourceDialect,
13259            >,
13260            offset: usize,
13261            depth: fidl::encoding::Depth,
13262        ) -> fidl::Result<()> {
13263            encoder.debug_check_bounds::<InstanceToken>(offset);
13264            // Zero out padding regions. There's no need to apply masks
13265            // because the unmasked parts will be overwritten by fields.
13266            // Write the fields.
13267            self.0.encode(encoder, offset + 0, depth)?;
13268            Ok(())
13269        }
13270    }
13271
13272    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for InstanceToken {
13273        #[inline(always)]
13274        fn new_empty() -> Self {
13275            Self {
13276                token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
13277            }
13278        }
13279
13280        #[inline]
13281        unsafe fn decode(
13282            &mut self,
13283            decoder: &mut fidl::encoding::Decoder<
13284                '_,
13285                fidl::encoding::DefaultFuchsiaResourceDialect,
13286            >,
13287            offset: usize,
13288            _depth: fidl::encoding::Depth,
13289        ) -> fidl::Result<()> {
13290            decoder.debug_check_bounds::<Self>(offset);
13291            // Verify that padding bytes are zero.
13292            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.token, decoder, offset + 0, _depth)?;
13293            Ok(())
13294        }
13295    }
13296
13297    impl fidl::encoding::ResourceTypeMarker for ProtocolPayload {
13298        type Borrowed<'a> = &'a mut Self;
13299        fn take_or_borrow<'a>(
13300            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13301        ) -> Self::Borrowed<'a> {
13302            value
13303        }
13304    }
13305
13306    unsafe impl fidl::encoding::TypeMarker for ProtocolPayload {
13307        type Owned = Self;
13308
13309        #[inline(always)]
13310        fn inline_align(_context: fidl::encoding::Context) -> usize {
13311            4
13312        }
13313
13314        #[inline(always)]
13315        fn inline_size(_context: fidl::encoding::Context) -> usize {
13316            4
13317        }
13318    }
13319
13320    unsafe impl
13321        fidl::encoding::Encode<ProtocolPayload, fidl::encoding::DefaultFuchsiaResourceDialect>
13322        for &mut ProtocolPayload
13323    {
13324        #[inline]
13325        unsafe fn encode(
13326            self,
13327            encoder: &mut fidl::encoding::Encoder<
13328                '_,
13329                fidl::encoding::DefaultFuchsiaResourceDialect,
13330            >,
13331            offset: usize,
13332            _depth: fidl::encoding::Depth,
13333        ) -> fidl::Result<()> {
13334            encoder.debug_check_bounds::<ProtocolPayload>(offset);
13335            // Delegate to tuple encoding.
13336            fidl::encoding::Encode::<ProtocolPayload, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
13337                (
13338                    <fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.channel),
13339                ),
13340                encoder, offset, _depth
13341            )
13342        }
13343    }
13344    unsafe impl<
13345        T0: fidl::encoding::Encode<
13346                fidl::encoding::HandleType<
13347                    fidl::Channel,
13348                    { fidl::ObjectType::CHANNEL.into_raw() },
13349                    2147483648,
13350                >,
13351                fidl::encoding::DefaultFuchsiaResourceDialect,
13352            >,
13353    > fidl::encoding::Encode<ProtocolPayload, fidl::encoding::DefaultFuchsiaResourceDialect>
13354        for (T0,)
13355    {
13356        #[inline]
13357        unsafe fn encode(
13358            self,
13359            encoder: &mut fidl::encoding::Encoder<
13360                '_,
13361                fidl::encoding::DefaultFuchsiaResourceDialect,
13362            >,
13363            offset: usize,
13364            depth: fidl::encoding::Depth,
13365        ) -> fidl::Result<()> {
13366            encoder.debug_check_bounds::<ProtocolPayload>(offset);
13367            // Zero out padding regions. There's no need to apply masks
13368            // because the unmasked parts will be overwritten by fields.
13369            // Write the fields.
13370            self.0.encode(encoder, offset + 0, depth)?;
13371            Ok(())
13372        }
13373    }
13374
13375    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13376        for ProtocolPayload
13377    {
13378        #[inline(always)]
13379        fn new_empty() -> Self {
13380            Self {
13381                channel: fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
13382            }
13383        }
13384
13385        #[inline]
13386        unsafe fn decode(
13387            &mut self,
13388            decoder: &mut fidl::encoding::Decoder<
13389                '_,
13390                fidl::encoding::DefaultFuchsiaResourceDialect,
13391            >,
13392            offset: usize,
13393            _depth: fidl::encoding::Depth,
13394        ) -> fidl::Result<()> {
13395            decoder.debug_check_bounds::<Self>(offset);
13396            // Verify that padding bytes are zero.
13397            fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.channel, decoder, offset + 0, _depth)?;
13398            Ok(())
13399        }
13400    }
13401
13402    impl AggregateSource {
13403        #[inline(always)]
13404        fn max_ordinal_present(&self) -> u64 {
13405            if let Some(_) = self.renamed_instances {
13406                return 3;
13407            }
13408            if let Some(_) = self.source_instance_filter {
13409                return 2;
13410            }
13411            if let Some(_) = self.dir_connector {
13412                return 1;
13413            }
13414            0
13415        }
13416    }
13417
13418    impl fidl::encoding::ResourceTypeMarker for AggregateSource {
13419        type Borrowed<'a> = &'a mut Self;
13420        fn take_or_borrow<'a>(
13421            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13422        ) -> Self::Borrowed<'a> {
13423            value
13424        }
13425    }
13426
13427    unsafe impl fidl::encoding::TypeMarker for AggregateSource {
13428        type Owned = Self;
13429
13430        #[inline(always)]
13431        fn inline_align(_context: fidl::encoding::Context) -> usize {
13432            8
13433        }
13434
13435        #[inline(always)]
13436        fn inline_size(_context: fidl::encoding::Context) -> usize {
13437            16
13438        }
13439    }
13440
13441    unsafe impl
13442        fidl::encoding::Encode<AggregateSource, fidl::encoding::DefaultFuchsiaResourceDialect>
13443        for &mut AggregateSource
13444    {
13445        unsafe fn encode(
13446            self,
13447            encoder: &mut fidl::encoding::Encoder<
13448                '_,
13449                fidl::encoding::DefaultFuchsiaResourceDialect,
13450            >,
13451            offset: usize,
13452            mut depth: fidl::encoding::Depth,
13453        ) -> fidl::Result<()> {
13454            encoder.debug_check_bounds::<AggregateSource>(offset);
13455            // Vector header
13456            let max_ordinal: u64 = self.max_ordinal_present();
13457            encoder.write_num(max_ordinal, offset);
13458            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
13459            // Calling encoder.out_of_line_offset(0) is not allowed.
13460            if max_ordinal == 0 {
13461                return Ok(());
13462            }
13463            depth.increment()?;
13464            let envelope_size = 8;
13465            let bytes_len = max_ordinal as usize * envelope_size;
13466            #[allow(unused_variables)]
13467            let offset = encoder.out_of_line_offset(bytes_len);
13468            let mut _prev_end_offset: usize = 0;
13469            if 1 > max_ordinal {
13470                return Ok(());
13471            }
13472
13473            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13474            // are envelope_size bytes.
13475            let cur_offset: usize = (1 - 1) * envelope_size;
13476
13477            // Zero reserved fields.
13478            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13479
13480            // Safety:
13481            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13482            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13483            //   envelope_size bytes, there is always sufficient room.
13484            fidl::encoding::encode_in_envelope_optional::<
13485                DirConnector,
13486                fidl::encoding::DefaultFuchsiaResourceDialect,
13487            >(
13488                self.dir_connector
13489                    .as_mut()
13490                    .map(<DirConnector as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
13491                encoder,
13492                offset + cur_offset,
13493                depth,
13494            )?;
13495
13496            _prev_end_offset = cur_offset + envelope_size;
13497            if 2 > max_ordinal {
13498                return Ok(());
13499            }
13500
13501            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13502            // are envelope_size bytes.
13503            let cur_offset: usize = (2 - 1) * envelope_size;
13504
13505            // Zero reserved fields.
13506            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13507
13508            // Safety:
13509            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13510            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13511            //   envelope_size bytes, there is always sufficient room.
13512            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<255>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
13513            self.source_instance_filter.as_ref().map(<fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<255>> as fidl::encoding::ValueTypeMarker>::borrow),
13514            encoder, offset + cur_offset, depth
13515        )?;
13516
13517            _prev_end_offset = cur_offset + envelope_size;
13518            if 3 > max_ordinal {
13519                return Ok(());
13520            }
13521
13522            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13523            // are envelope_size bytes.
13524            let cur_offset: usize = (3 - 1) * envelope_size;
13525
13526            // Zero reserved fields.
13527            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13528
13529            // Safety:
13530            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13531            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13532            //   envelope_size bytes, there is always sufficient room.
13533            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<fidl_fuchsia_component_decl::NameMapping>, fidl::encoding::DefaultFuchsiaResourceDialect>(
13534            self.renamed_instances.as_ref().map(<fidl::encoding::UnboundedVector<fidl_fuchsia_component_decl::NameMapping> as fidl::encoding::ValueTypeMarker>::borrow),
13535            encoder, offset + cur_offset, depth
13536        )?;
13537
13538            _prev_end_offset = cur_offset + envelope_size;
13539
13540            Ok(())
13541        }
13542    }
13543
13544    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13545        for AggregateSource
13546    {
13547        #[inline(always)]
13548        fn new_empty() -> Self {
13549            Self::default()
13550        }
13551
13552        unsafe fn decode(
13553            &mut self,
13554            decoder: &mut fidl::encoding::Decoder<
13555                '_,
13556                fidl::encoding::DefaultFuchsiaResourceDialect,
13557            >,
13558            offset: usize,
13559            mut depth: fidl::encoding::Depth,
13560        ) -> fidl::Result<()> {
13561            decoder.debug_check_bounds::<Self>(offset);
13562            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13563                None => return Err(fidl::Error::NotNullable),
13564                Some(len) => len,
13565            };
13566            // Calling decoder.out_of_line_offset(0) is not allowed.
13567            if len == 0 {
13568                return Ok(());
13569            };
13570            depth.increment()?;
13571            let envelope_size = 8;
13572            let bytes_len = len * envelope_size;
13573            let offset = decoder.out_of_line_offset(bytes_len)?;
13574            // Decode the envelope for each type.
13575            let mut _next_ordinal_to_read = 0;
13576            let mut next_offset = offset;
13577            let end_offset = offset + bytes_len;
13578            _next_ordinal_to_read += 1;
13579            if next_offset >= end_offset {
13580                return Ok(());
13581            }
13582
13583            // Decode unknown envelopes for gaps in ordinals.
13584            while _next_ordinal_to_read < 1 {
13585                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13586                _next_ordinal_to_read += 1;
13587                next_offset += envelope_size;
13588            }
13589
13590            let next_out_of_line = decoder.next_out_of_line();
13591            let handles_before = decoder.remaining_handles();
13592            if let Some((inlined, num_bytes, num_handles)) =
13593                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13594            {
13595                let member_inline_size =
13596                    <DirConnector as fidl::encoding::TypeMarker>::inline_size(decoder.context);
13597                if inlined != (member_inline_size <= 4) {
13598                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13599                }
13600                let inner_offset;
13601                let mut inner_depth = depth.clone();
13602                if inlined {
13603                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13604                    inner_offset = next_offset;
13605                } else {
13606                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13607                    inner_depth.increment()?;
13608                }
13609                let val_ref = self.dir_connector.get_or_insert_with(|| {
13610                    fidl::new_empty!(DirConnector, fidl::encoding::DefaultFuchsiaResourceDialect)
13611                });
13612                fidl::decode!(
13613                    DirConnector,
13614                    fidl::encoding::DefaultFuchsiaResourceDialect,
13615                    val_ref,
13616                    decoder,
13617                    inner_offset,
13618                    inner_depth
13619                )?;
13620                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13621                {
13622                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13623                }
13624                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13625                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13626                }
13627            }
13628
13629            next_offset += envelope_size;
13630            _next_ordinal_to_read += 1;
13631            if next_offset >= end_offset {
13632                return Ok(());
13633            }
13634
13635            // Decode unknown envelopes for gaps in ordinals.
13636            while _next_ordinal_to_read < 2 {
13637                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13638                _next_ordinal_to_read += 1;
13639                next_offset += envelope_size;
13640            }
13641
13642            let next_out_of_line = decoder.next_out_of_line();
13643            let handles_before = decoder.remaining_handles();
13644            if let Some((inlined, num_bytes, num_handles)) =
13645                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13646            {
13647                let member_inline_size = <fidl::encoding::UnboundedVector<
13648                    fidl::encoding::BoundedString<255>,
13649                > as fidl::encoding::TypeMarker>::inline_size(
13650                    decoder.context
13651                );
13652                if inlined != (member_inline_size <= 4) {
13653                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13654                }
13655                let inner_offset;
13656                let mut inner_depth = depth.clone();
13657                if inlined {
13658                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13659                    inner_offset = next_offset;
13660                } else {
13661                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13662                    inner_depth.increment()?;
13663                }
13664                let val_ref = self.source_instance_filter.get_or_insert_with(|| {
13665                    fidl::new_empty!(
13666                        fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<255>>,
13667                        fidl::encoding::DefaultFuchsiaResourceDialect
13668                    )
13669                });
13670                fidl::decode!(
13671                    fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<255>>,
13672                    fidl::encoding::DefaultFuchsiaResourceDialect,
13673                    val_ref,
13674                    decoder,
13675                    inner_offset,
13676                    inner_depth
13677                )?;
13678                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13679                {
13680                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13681                }
13682                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13683                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13684                }
13685            }
13686
13687            next_offset += envelope_size;
13688            _next_ordinal_to_read += 1;
13689            if next_offset >= end_offset {
13690                return Ok(());
13691            }
13692
13693            // Decode unknown envelopes for gaps in ordinals.
13694            while _next_ordinal_to_read < 3 {
13695                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13696                _next_ordinal_to_read += 1;
13697                next_offset += envelope_size;
13698            }
13699
13700            let next_out_of_line = decoder.next_out_of_line();
13701            let handles_before = decoder.remaining_handles();
13702            if let Some((inlined, num_bytes, num_handles)) =
13703                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13704            {
13705                let member_inline_size = <fidl::encoding::UnboundedVector<
13706                    fidl_fuchsia_component_decl::NameMapping,
13707                > as fidl::encoding::TypeMarker>::inline_size(
13708                    decoder.context
13709                );
13710                if inlined != (member_inline_size <= 4) {
13711                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13712                }
13713                let inner_offset;
13714                let mut inner_depth = depth.clone();
13715                if inlined {
13716                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13717                    inner_offset = next_offset;
13718                } else {
13719                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13720                    inner_depth.increment()?;
13721                }
13722                let val_ref = self.renamed_instances.get_or_insert_with(|| {
13723                    fidl::new_empty!(
13724                        fidl::encoding::UnboundedVector<fidl_fuchsia_component_decl::NameMapping>,
13725                        fidl::encoding::DefaultFuchsiaResourceDialect
13726                    )
13727                });
13728                fidl::decode!(
13729                    fidl::encoding::UnboundedVector<fidl_fuchsia_component_decl::NameMapping>,
13730                    fidl::encoding::DefaultFuchsiaResourceDialect,
13731                    val_ref,
13732                    decoder,
13733                    inner_offset,
13734                    inner_depth
13735                )?;
13736                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13737                {
13738                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13739                }
13740                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13741                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13742                }
13743            }
13744
13745            next_offset += envelope_size;
13746
13747            // Decode the remaining unknown envelopes.
13748            while next_offset < end_offset {
13749                _next_ordinal_to_read += 1;
13750                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13751                next_offset += envelope_size;
13752            }
13753
13754            Ok(())
13755        }
13756    }
13757
13758    impl CapabilityStoreDirConnectorOpenRequest {
13759        #[inline(always)]
13760        fn max_ordinal_present(&self) -> u64 {
13761            if let Some(_) = self.path {
13762                return 4;
13763            }
13764            if let Some(_) = self.flags {
13765                return 3;
13766            }
13767            if let Some(_) = self.server_end {
13768                return 2;
13769            }
13770            if let Some(_) = self.id {
13771                return 1;
13772            }
13773            0
13774        }
13775    }
13776
13777    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDirConnectorOpenRequest {
13778        type Borrowed<'a> = &'a mut Self;
13779        fn take_or_borrow<'a>(
13780            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13781        ) -> Self::Borrowed<'a> {
13782            value
13783        }
13784    }
13785
13786    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDirConnectorOpenRequest {
13787        type Owned = Self;
13788
13789        #[inline(always)]
13790        fn inline_align(_context: fidl::encoding::Context) -> usize {
13791            8
13792        }
13793
13794        #[inline(always)]
13795        fn inline_size(_context: fidl::encoding::Context) -> usize {
13796            16
13797        }
13798    }
13799
13800    unsafe impl
13801        fidl::encoding::Encode<
13802            CapabilityStoreDirConnectorOpenRequest,
13803            fidl::encoding::DefaultFuchsiaResourceDialect,
13804        > for &mut CapabilityStoreDirConnectorOpenRequest
13805    {
13806        unsafe fn encode(
13807            self,
13808            encoder: &mut fidl::encoding::Encoder<
13809                '_,
13810                fidl::encoding::DefaultFuchsiaResourceDialect,
13811            >,
13812            offset: usize,
13813            mut depth: fidl::encoding::Depth,
13814        ) -> fidl::Result<()> {
13815            encoder.debug_check_bounds::<CapabilityStoreDirConnectorOpenRequest>(offset);
13816            // Vector header
13817            let max_ordinal: u64 = self.max_ordinal_present();
13818            encoder.write_num(max_ordinal, offset);
13819            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
13820            // Calling encoder.out_of_line_offset(0) is not allowed.
13821            if max_ordinal == 0 {
13822                return Ok(());
13823            }
13824            depth.increment()?;
13825            let envelope_size = 8;
13826            let bytes_len = max_ordinal as usize * envelope_size;
13827            #[allow(unused_variables)]
13828            let offset = encoder.out_of_line_offset(bytes_len);
13829            let mut _prev_end_offset: usize = 0;
13830            if 1 > max_ordinal {
13831                return Ok(());
13832            }
13833
13834            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13835            // are envelope_size bytes.
13836            let cur_offset: usize = (1 - 1) * envelope_size;
13837
13838            // Zero reserved fields.
13839            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13840
13841            // Safety:
13842            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13843            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13844            //   envelope_size bytes, there is always sufficient room.
13845            fidl::encoding::encode_in_envelope_optional::<
13846                u64,
13847                fidl::encoding::DefaultFuchsiaResourceDialect,
13848            >(
13849                self.id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
13850                encoder,
13851                offset + cur_offset,
13852                depth,
13853            )?;
13854
13855            _prev_end_offset = cur_offset + envelope_size;
13856            if 2 > max_ordinal {
13857                return Ok(());
13858            }
13859
13860            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13861            // are envelope_size bytes.
13862            let cur_offset: usize = (2 - 1) * envelope_size;
13863
13864            // Zero reserved fields.
13865            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13866
13867            // Safety:
13868            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13869            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13870            //   envelope_size bytes, there is always sufficient room.
13871            fidl::encoding::encode_in_envelope_optional::<
13872                fidl::encoding::Endpoint<
13873                    fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
13874                >,
13875                fidl::encoding::DefaultFuchsiaResourceDialect,
13876            >(
13877                self.server_end.as_mut().map(
13878                    <fidl::encoding::Endpoint<
13879                        fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
13880                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
13881                ),
13882                encoder,
13883                offset + cur_offset,
13884                depth,
13885            )?;
13886
13887            _prev_end_offset = cur_offset + envelope_size;
13888            if 3 > max_ordinal {
13889                return Ok(());
13890            }
13891
13892            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13893            // are envelope_size bytes.
13894            let cur_offset: usize = (3 - 1) * envelope_size;
13895
13896            // Zero reserved fields.
13897            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13898
13899            // Safety:
13900            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13901            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13902            //   envelope_size bytes, there is always sufficient room.
13903            fidl::encoding::encode_in_envelope_optional::<
13904                fidl_fuchsia_io::Flags,
13905                fidl::encoding::DefaultFuchsiaResourceDialect,
13906            >(
13907                self.flags
13908                    .as_ref()
13909                    .map(<fidl_fuchsia_io::Flags as fidl::encoding::ValueTypeMarker>::borrow),
13910                encoder,
13911                offset + cur_offset,
13912                depth,
13913            )?;
13914
13915            _prev_end_offset = cur_offset + envelope_size;
13916            if 4 > max_ordinal {
13917                return Ok(());
13918            }
13919
13920            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13921            // are envelope_size bytes.
13922            let cur_offset: usize = (4 - 1) * envelope_size;
13923
13924            // Zero reserved fields.
13925            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13926
13927            // Safety:
13928            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13929            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13930            //   envelope_size bytes, there is always sufficient room.
13931            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<4095>, fidl::encoding::DefaultFuchsiaResourceDialect>(
13932            self.path.as_ref().map(<fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow),
13933            encoder, offset + cur_offset, depth
13934        )?;
13935
13936            _prev_end_offset = cur_offset + envelope_size;
13937
13938            Ok(())
13939        }
13940    }
13941
13942    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13943        for CapabilityStoreDirConnectorOpenRequest
13944    {
13945        #[inline(always)]
13946        fn new_empty() -> Self {
13947            Self::default()
13948        }
13949
13950        unsafe fn decode(
13951            &mut self,
13952            decoder: &mut fidl::encoding::Decoder<
13953                '_,
13954                fidl::encoding::DefaultFuchsiaResourceDialect,
13955            >,
13956            offset: usize,
13957            mut depth: fidl::encoding::Depth,
13958        ) -> fidl::Result<()> {
13959            decoder.debug_check_bounds::<Self>(offset);
13960            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13961                None => return Err(fidl::Error::NotNullable),
13962                Some(len) => len,
13963            };
13964            // Calling decoder.out_of_line_offset(0) is not allowed.
13965            if len == 0 {
13966                return Ok(());
13967            };
13968            depth.increment()?;
13969            let envelope_size = 8;
13970            let bytes_len = len * envelope_size;
13971            let offset = decoder.out_of_line_offset(bytes_len)?;
13972            // Decode the envelope for each type.
13973            let mut _next_ordinal_to_read = 0;
13974            let mut next_offset = offset;
13975            let end_offset = offset + bytes_len;
13976            _next_ordinal_to_read += 1;
13977            if next_offset >= end_offset {
13978                return Ok(());
13979            }
13980
13981            // Decode unknown envelopes for gaps in ordinals.
13982            while _next_ordinal_to_read < 1 {
13983                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13984                _next_ordinal_to_read += 1;
13985                next_offset += envelope_size;
13986            }
13987
13988            let next_out_of_line = decoder.next_out_of_line();
13989            let handles_before = decoder.remaining_handles();
13990            if let Some((inlined, num_bytes, num_handles)) =
13991                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13992            {
13993                let member_inline_size =
13994                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
13995                if inlined != (member_inline_size <= 4) {
13996                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13997                }
13998                let inner_offset;
13999                let mut inner_depth = depth.clone();
14000                if inlined {
14001                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14002                    inner_offset = next_offset;
14003                } else {
14004                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14005                    inner_depth.increment()?;
14006                }
14007                let val_ref = self.id.get_or_insert_with(|| {
14008                    fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect)
14009                });
14010                fidl::decode!(
14011                    u64,
14012                    fidl::encoding::DefaultFuchsiaResourceDialect,
14013                    val_ref,
14014                    decoder,
14015                    inner_offset,
14016                    inner_depth
14017                )?;
14018                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14019                {
14020                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
14021                }
14022                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14023                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14024                }
14025            }
14026
14027            next_offset += envelope_size;
14028            _next_ordinal_to_read += 1;
14029            if next_offset >= end_offset {
14030                return Ok(());
14031            }
14032
14033            // Decode unknown envelopes for gaps in ordinals.
14034            while _next_ordinal_to_read < 2 {
14035                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14036                _next_ordinal_to_read += 1;
14037                next_offset += envelope_size;
14038            }
14039
14040            let next_out_of_line = decoder.next_out_of_line();
14041            let handles_before = decoder.remaining_handles();
14042            if let Some((inlined, num_bytes, num_handles)) =
14043                fidl::encoding::decode_envelope_header(decoder, next_offset)?
14044            {
14045                let member_inline_size = <fidl::encoding::Endpoint<
14046                    fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
14047                > as fidl::encoding::TypeMarker>::inline_size(
14048                    decoder.context
14049                );
14050                if inlined != (member_inline_size <= 4) {
14051                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
14052                }
14053                let inner_offset;
14054                let mut inner_depth = depth.clone();
14055                if inlined {
14056                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14057                    inner_offset = next_offset;
14058                } else {
14059                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14060                    inner_depth.increment()?;
14061                }
14062                let val_ref = self.server_end.get_or_insert_with(|| {
14063                    fidl::new_empty!(
14064                        fidl::encoding::Endpoint<
14065                            fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
14066                        >,
14067                        fidl::encoding::DefaultFuchsiaResourceDialect
14068                    )
14069                });
14070                fidl::decode!(
14071                    fidl::encoding::Endpoint<
14072                        fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
14073                    >,
14074                    fidl::encoding::DefaultFuchsiaResourceDialect,
14075                    val_ref,
14076                    decoder,
14077                    inner_offset,
14078                    inner_depth
14079                )?;
14080                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14081                {
14082                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
14083                }
14084                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14085                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14086                }
14087            }
14088
14089            next_offset += envelope_size;
14090            _next_ordinal_to_read += 1;
14091            if next_offset >= end_offset {
14092                return Ok(());
14093            }
14094
14095            // Decode unknown envelopes for gaps in ordinals.
14096            while _next_ordinal_to_read < 3 {
14097                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14098                _next_ordinal_to_read += 1;
14099                next_offset += envelope_size;
14100            }
14101
14102            let next_out_of_line = decoder.next_out_of_line();
14103            let handles_before = decoder.remaining_handles();
14104            if let Some((inlined, num_bytes, num_handles)) =
14105                fidl::encoding::decode_envelope_header(decoder, next_offset)?
14106            {
14107                let member_inline_size =
14108                    <fidl_fuchsia_io::Flags as fidl::encoding::TypeMarker>::inline_size(
14109                        decoder.context,
14110                    );
14111                if inlined != (member_inline_size <= 4) {
14112                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
14113                }
14114                let inner_offset;
14115                let mut inner_depth = depth.clone();
14116                if inlined {
14117                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14118                    inner_offset = next_offset;
14119                } else {
14120                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14121                    inner_depth.increment()?;
14122                }
14123                let val_ref = self.flags.get_or_insert_with(|| {
14124                    fidl::new_empty!(
14125                        fidl_fuchsia_io::Flags,
14126                        fidl::encoding::DefaultFuchsiaResourceDialect
14127                    )
14128                });
14129                fidl::decode!(
14130                    fidl_fuchsia_io::Flags,
14131                    fidl::encoding::DefaultFuchsiaResourceDialect,
14132                    val_ref,
14133                    decoder,
14134                    inner_offset,
14135                    inner_depth
14136                )?;
14137                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14138                {
14139                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
14140                }
14141                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14142                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14143                }
14144            }
14145
14146            next_offset += envelope_size;
14147            _next_ordinal_to_read += 1;
14148            if next_offset >= end_offset {
14149                return Ok(());
14150            }
14151
14152            // Decode unknown envelopes for gaps in ordinals.
14153            while _next_ordinal_to_read < 4 {
14154                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14155                _next_ordinal_to_read += 1;
14156                next_offset += envelope_size;
14157            }
14158
14159            let next_out_of_line = decoder.next_out_of_line();
14160            let handles_before = decoder.remaining_handles();
14161            if let Some((inlined, num_bytes, num_handles)) =
14162                fidl::encoding::decode_envelope_header(decoder, next_offset)?
14163            {
14164                let member_inline_size = <fidl::encoding::BoundedString<4095> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
14165                if inlined != (member_inline_size <= 4) {
14166                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
14167                }
14168                let inner_offset;
14169                let mut inner_depth = depth.clone();
14170                if inlined {
14171                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14172                    inner_offset = next_offset;
14173                } else {
14174                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14175                    inner_depth.increment()?;
14176                }
14177                let val_ref = self.path.get_or_insert_with(|| {
14178                    fidl::new_empty!(
14179                        fidl::encoding::BoundedString<4095>,
14180                        fidl::encoding::DefaultFuchsiaResourceDialect
14181                    )
14182                });
14183                fidl::decode!(
14184                    fidl::encoding::BoundedString<4095>,
14185                    fidl::encoding::DefaultFuchsiaResourceDialect,
14186                    val_ref,
14187                    decoder,
14188                    inner_offset,
14189                    inner_depth
14190                )?;
14191                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14192                {
14193                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
14194                }
14195                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14196                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14197                }
14198            }
14199
14200            next_offset += envelope_size;
14201
14202            // Decode the remaining unknown envelopes.
14203            while next_offset < end_offset {
14204                _next_ordinal_to_read += 1;
14205                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14206                next_offset += envelope_size;
14207            }
14208
14209            Ok(())
14210        }
14211    }
14212
14213    impl DirReceiverReceiveRequest {
14214        #[inline(always)]
14215        fn max_ordinal_present(&self) -> u64 {
14216            if let Some(_) = self.subdir {
14217                return 3;
14218            }
14219            if let Some(_) = self.flags {
14220                return 2;
14221            }
14222            if let Some(_) = self.channel {
14223                return 1;
14224            }
14225            0
14226        }
14227    }
14228
14229    impl fidl::encoding::ResourceTypeMarker for DirReceiverReceiveRequest {
14230        type Borrowed<'a> = &'a mut Self;
14231        fn take_or_borrow<'a>(
14232            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14233        ) -> Self::Borrowed<'a> {
14234            value
14235        }
14236    }
14237
14238    unsafe impl fidl::encoding::TypeMarker for DirReceiverReceiveRequest {
14239        type Owned = Self;
14240
14241        #[inline(always)]
14242        fn inline_align(_context: fidl::encoding::Context) -> usize {
14243            8
14244        }
14245
14246        #[inline(always)]
14247        fn inline_size(_context: fidl::encoding::Context) -> usize {
14248            16
14249        }
14250    }
14251
14252    unsafe impl
14253        fidl::encoding::Encode<
14254            DirReceiverReceiveRequest,
14255            fidl::encoding::DefaultFuchsiaResourceDialect,
14256        > for &mut DirReceiverReceiveRequest
14257    {
14258        unsafe fn encode(
14259            self,
14260            encoder: &mut fidl::encoding::Encoder<
14261                '_,
14262                fidl::encoding::DefaultFuchsiaResourceDialect,
14263            >,
14264            offset: usize,
14265            mut depth: fidl::encoding::Depth,
14266        ) -> fidl::Result<()> {
14267            encoder.debug_check_bounds::<DirReceiverReceiveRequest>(offset);
14268            // Vector header
14269            let max_ordinal: u64 = self.max_ordinal_present();
14270            encoder.write_num(max_ordinal, offset);
14271            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
14272            // Calling encoder.out_of_line_offset(0) is not allowed.
14273            if max_ordinal == 0 {
14274                return Ok(());
14275            }
14276            depth.increment()?;
14277            let envelope_size = 8;
14278            let bytes_len = max_ordinal as usize * envelope_size;
14279            #[allow(unused_variables)]
14280            let offset = encoder.out_of_line_offset(bytes_len);
14281            let mut _prev_end_offset: usize = 0;
14282            if 1 > max_ordinal {
14283                return Ok(());
14284            }
14285
14286            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
14287            // are envelope_size bytes.
14288            let cur_offset: usize = (1 - 1) * envelope_size;
14289
14290            // Zero reserved fields.
14291            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14292
14293            // Safety:
14294            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
14295            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
14296            //   envelope_size bytes, there is always sufficient room.
14297            fidl::encoding::encode_in_envelope_optional::<
14298                fidl::encoding::HandleType<
14299                    fidl::Channel,
14300                    { fidl::ObjectType::CHANNEL.into_raw() },
14301                    2147483648,
14302                >,
14303                fidl::encoding::DefaultFuchsiaResourceDialect,
14304            >(
14305                self.channel.as_mut().map(
14306                    <fidl::encoding::HandleType<
14307                        fidl::Channel,
14308                        { fidl::ObjectType::CHANNEL.into_raw() },
14309                        2147483648,
14310                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
14311                ),
14312                encoder,
14313                offset + cur_offset,
14314                depth,
14315            )?;
14316
14317            _prev_end_offset = cur_offset + envelope_size;
14318            if 2 > max_ordinal {
14319                return Ok(());
14320            }
14321
14322            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
14323            // are envelope_size bytes.
14324            let cur_offset: usize = (2 - 1) * envelope_size;
14325
14326            // Zero reserved fields.
14327            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14328
14329            // Safety:
14330            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
14331            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
14332            //   envelope_size bytes, there is always sufficient room.
14333            fidl::encoding::encode_in_envelope_optional::<
14334                fidl_fuchsia_io::Flags,
14335                fidl::encoding::DefaultFuchsiaResourceDialect,
14336            >(
14337                self.flags
14338                    .as_ref()
14339                    .map(<fidl_fuchsia_io::Flags as fidl::encoding::ValueTypeMarker>::borrow),
14340                encoder,
14341                offset + cur_offset,
14342                depth,
14343            )?;
14344
14345            _prev_end_offset = cur_offset + envelope_size;
14346            if 3 > max_ordinal {
14347                return Ok(());
14348            }
14349
14350            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
14351            // are envelope_size bytes.
14352            let cur_offset: usize = (3 - 1) * envelope_size;
14353
14354            // Zero reserved fields.
14355            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14356
14357            // Safety:
14358            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
14359            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
14360            //   envelope_size bytes, there is always sufficient room.
14361            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<4095>, fidl::encoding::DefaultFuchsiaResourceDialect>(
14362            self.subdir.as_ref().map(<fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow),
14363            encoder, offset + cur_offset, depth
14364        )?;
14365
14366            _prev_end_offset = cur_offset + envelope_size;
14367
14368            Ok(())
14369        }
14370    }
14371
14372    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14373        for DirReceiverReceiveRequest
14374    {
14375        #[inline(always)]
14376        fn new_empty() -> Self {
14377            Self::default()
14378        }
14379
14380        unsafe fn decode(
14381            &mut self,
14382            decoder: &mut fidl::encoding::Decoder<
14383                '_,
14384                fidl::encoding::DefaultFuchsiaResourceDialect,
14385            >,
14386            offset: usize,
14387            mut depth: fidl::encoding::Depth,
14388        ) -> fidl::Result<()> {
14389            decoder.debug_check_bounds::<Self>(offset);
14390            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
14391                None => return Err(fidl::Error::NotNullable),
14392                Some(len) => len,
14393            };
14394            // Calling decoder.out_of_line_offset(0) is not allowed.
14395            if len == 0 {
14396                return Ok(());
14397            };
14398            depth.increment()?;
14399            let envelope_size = 8;
14400            let bytes_len = len * envelope_size;
14401            let offset = decoder.out_of_line_offset(bytes_len)?;
14402            // Decode the envelope for each type.
14403            let mut _next_ordinal_to_read = 0;
14404            let mut next_offset = offset;
14405            let end_offset = offset + bytes_len;
14406            _next_ordinal_to_read += 1;
14407            if next_offset >= end_offset {
14408                return Ok(());
14409            }
14410
14411            // Decode unknown envelopes for gaps in ordinals.
14412            while _next_ordinal_to_read < 1 {
14413                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14414                _next_ordinal_to_read += 1;
14415                next_offset += envelope_size;
14416            }
14417
14418            let next_out_of_line = decoder.next_out_of_line();
14419            let handles_before = decoder.remaining_handles();
14420            if let Some((inlined, num_bytes, num_handles)) =
14421                fidl::encoding::decode_envelope_header(decoder, next_offset)?
14422            {
14423                let member_inline_size = <fidl::encoding::HandleType<
14424                    fidl::Channel,
14425                    { fidl::ObjectType::CHANNEL.into_raw() },
14426                    2147483648,
14427                > as fidl::encoding::TypeMarker>::inline_size(
14428                    decoder.context
14429                );
14430                if inlined != (member_inline_size <= 4) {
14431                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
14432                }
14433                let inner_offset;
14434                let mut inner_depth = depth.clone();
14435                if inlined {
14436                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14437                    inner_offset = next_offset;
14438                } else {
14439                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14440                    inner_depth.increment()?;
14441                }
14442                let val_ref =
14443                self.channel.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
14444                fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
14445                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14446                {
14447                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
14448                }
14449                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14450                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14451                }
14452            }
14453
14454            next_offset += envelope_size;
14455            _next_ordinal_to_read += 1;
14456            if next_offset >= end_offset {
14457                return Ok(());
14458            }
14459
14460            // Decode unknown envelopes for gaps in ordinals.
14461            while _next_ordinal_to_read < 2 {
14462                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14463                _next_ordinal_to_read += 1;
14464                next_offset += envelope_size;
14465            }
14466
14467            let next_out_of_line = decoder.next_out_of_line();
14468            let handles_before = decoder.remaining_handles();
14469            if let Some((inlined, num_bytes, num_handles)) =
14470                fidl::encoding::decode_envelope_header(decoder, next_offset)?
14471            {
14472                let member_inline_size =
14473                    <fidl_fuchsia_io::Flags as fidl::encoding::TypeMarker>::inline_size(
14474                        decoder.context,
14475                    );
14476                if inlined != (member_inline_size <= 4) {
14477                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
14478                }
14479                let inner_offset;
14480                let mut inner_depth = depth.clone();
14481                if inlined {
14482                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14483                    inner_offset = next_offset;
14484                } else {
14485                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14486                    inner_depth.increment()?;
14487                }
14488                let val_ref = self.flags.get_or_insert_with(|| {
14489                    fidl::new_empty!(
14490                        fidl_fuchsia_io::Flags,
14491                        fidl::encoding::DefaultFuchsiaResourceDialect
14492                    )
14493                });
14494                fidl::decode!(
14495                    fidl_fuchsia_io::Flags,
14496                    fidl::encoding::DefaultFuchsiaResourceDialect,
14497                    val_ref,
14498                    decoder,
14499                    inner_offset,
14500                    inner_depth
14501                )?;
14502                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14503                {
14504                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
14505                }
14506                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14507                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14508                }
14509            }
14510
14511            next_offset += envelope_size;
14512            _next_ordinal_to_read += 1;
14513            if next_offset >= end_offset {
14514                return Ok(());
14515            }
14516
14517            // Decode unknown envelopes for gaps in ordinals.
14518            while _next_ordinal_to_read < 3 {
14519                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14520                _next_ordinal_to_read += 1;
14521                next_offset += envelope_size;
14522            }
14523
14524            let next_out_of_line = decoder.next_out_of_line();
14525            let handles_before = decoder.remaining_handles();
14526            if let Some((inlined, num_bytes, num_handles)) =
14527                fidl::encoding::decode_envelope_header(decoder, next_offset)?
14528            {
14529                let member_inline_size = <fidl::encoding::BoundedString<4095> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
14530                if inlined != (member_inline_size <= 4) {
14531                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
14532                }
14533                let inner_offset;
14534                let mut inner_depth = depth.clone();
14535                if inlined {
14536                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14537                    inner_offset = next_offset;
14538                } else {
14539                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14540                    inner_depth.increment()?;
14541                }
14542                let val_ref = self.subdir.get_or_insert_with(|| {
14543                    fidl::new_empty!(
14544                        fidl::encoding::BoundedString<4095>,
14545                        fidl::encoding::DefaultFuchsiaResourceDialect
14546                    )
14547                });
14548                fidl::decode!(
14549                    fidl::encoding::BoundedString<4095>,
14550                    fidl::encoding::DefaultFuchsiaResourceDialect,
14551                    val_ref,
14552                    decoder,
14553                    inner_offset,
14554                    inner_depth
14555                )?;
14556                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14557                {
14558                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
14559                }
14560                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14561                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14562                }
14563            }
14564
14565            next_offset += envelope_size;
14566
14567            // Decode the remaining unknown envelopes.
14568            while next_offset < end_offset {
14569                _next_ordinal_to_read += 1;
14570                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14571                next_offset += envelope_size;
14572            }
14573
14574            Ok(())
14575        }
14576    }
14577
14578    impl RouteRequest {
14579        #[inline(always)]
14580        fn max_ordinal_present(&self) -> u64 {
14581            if let Some(_) = self.requesting {
14582                return 1;
14583            }
14584            0
14585        }
14586    }
14587
14588    impl fidl::encoding::ResourceTypeMarker for RouteRequest {
14589        type Borrowed<'a> = &'a mut Self;
14590        fn take_or_borrow<'a>(
14591            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14592        ) -> Self::Borrowed<'a> {
14593            value
14594        }
14595    }
14596
14597    unsafe impl fidl::encoding::TypeMarker for RouteRequest {
14598        type Owned = Self;
14599
14600        #[inline(always)]
14601        fn inline_align(_context: fidl::encoding::Context) -> usize {
14602            8
14603        }
14604
14605        #[inline(always)]
14606        fn inline_size(_context: fidl::encoding::Context) -> usize {
14607            16
14608        }
14609    }
14610
14611    unsafe impl fidl::encoding::Encode<RouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
14612        for &mut RouteRequest
14613    {
14614        unsafe fn encode(
14615            self,
14616            encoder: &mut fidl::encoding::Encoder<
14617                '_,
14618                fidl::encoding::DefaultFuchsiaResourceDialect,
14619            >,
14620            offset: usize,
14621            mut depth: fidl::encoding::Depth,
14622        ) -> fidl::Result<()> {
14623            encoder.debug_check_bounds::<RouteRequest>(offset);
14624            // Vector header
14625            let max_ordinal: u64 = self.max_ordinal_present();
14626            encoder.write_num(max_ordinal, offset);
14627            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
14628            // Calling encoder.out_of_line_offset(0) is not allowed.
14629            if max_ordinal == 0 {
14630                return Ok(());
14631            }
14632            depth.increment()?;
14633            let envelope_size = 8;
14634            let bytes_len = max_ordinal as usize * envelope_size;
14635            #[allow(unused_variables)]
14636            let offset = encoder.out_of_line_offset(bytes_len);
14637            let mut _prev_end_offset: usize = 0;
14638            if 1 > max_ordinal {
14639                return Ok(());
14640            }
14641
14642            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
14643            // are envelope_size bytes.
14644            let cur_offset: usize = (1 - 1) * envelope_size;
14645
14646            // Zero reserved fields.
14647            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14648
14649            // Safety:
14650            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
14651            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
14652            //   envelope_size bytes, there is always sufficient room.
14653            fidl::encoding::encode_in_envelope_optional::<
14654                InstanceToken,
14655                fidl::encoding::DefaultFuchsiaResourceDialect,
14656            >(
14657                self.requesting
14658                    .as_mut()
14659                    .map(<InstanceToken as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
14660                encoder,
14661                offset + cur_offset,
14662                depth,
14663            )?;
14664
14665            _prev_end_offset = cur_offset + envelope_size;
14666
14667            Ok(())
14668        }
14669    }
14670
14671    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for RouteRequest {
14672        #[inline(always)]
14673        fn new_empty() -> Self {
14674            Self::default()
14675        }
14676
14677        unsafe fn decode(
14678            &mut self,
14679            decoder: &mut fidl::encoding::Decoder<
14680                '_,
14681                fidl::encoding::DefaultFuchsiaResourceDialect,
14682            >,
14683            offset: usize,
14684            mut depth: fidl::encoding::Depth,
14685        ) -> fidl::Result<()> {
14686            decoder.debug_check_bounds::<Self>(offset);
14687            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
14688                None => return Err(fidl::Error::NotNullable),
14689                Some(len) => len,
14690            };
14691            // Calling decoder.out_of_line_offset(0) is not allowed.
14692            if len == 0 {
14693                return Ok(());
14694            };
14695            depth.increment()?;
14696            let envelope_size = 8;
14697            let bytes_len = len * envelope_size;
14698            let offset = decoder.out_of_line_offset(bytes_len)?;
14699            // Decode the envelope for each type.
14700            let mut _next_ordinal_to_read = 0;
14701            let mut next_offset = offset;
14702            let end_offset = offset + bytes_len;
14703            _next_ordinal_to_read += 1;
14704            if next_offset >= end_offset {
14705                return Ok(());
14706            }
14707
14708            // Decode unknown envelopes for gaps in ordinals.
14709            while _next_ordinal_to_read < 1 {
14710                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14711                _next_ordinal_to_read += 1;
14712                next_offset += envelope_size;
14713            }
14714
14715            let next_out_of_line = decoder.next_out_of_line();
14716            let handles_before = decoder.remaining_handles();
14717            if let Some((inlined, num_bytes, num_handles)) =
14718                fidl::encoding::decode_envelope_header(decoder, next_offset)?
14719            {
14720                let member_inline_size =
14721                    <InstanceToken as fidl::encoding::TypeMarker>::inline_size(decoder.context);
14722                if inlined != (member_inline_size <= 4) {
14723                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
14724                }
14725                let inner_offset;
14726                let mut inner_depth = depth.clone();
14727                if inlined {
14728                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14729                    inner_offset = next_offset;
14730                } else {
14731                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14732                    inner_depth.increment()?;
14733                }
14734                let val_ref = self.requesting.get_or_insert_with(|| {
14735                    fidl::new_empty!(InstanceToken, fidl::encoding::DefaultFuchsiaResourceDialect)
14736                });
14737                fidl::decode!(
14738                    InstanceToken,
14739                    fidl::encoding::DefaultFuchsiaResourceDialect,
14740                    val_ref,
14741                    decoder,
14742                    inner_offset,
14743                    inner_depth
14744                )?;
14745                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14746                {
14747                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
14748                }
14749                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14750                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14751                }
14752            }
14753
14754            next_offset += envelope_size;
14755
14756            // Decode the remaining unknown envelopes.
14757            while next_offset < end_offset {
14758                _next_ordinal_to_read += 1;
14759                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14760                next_offset += envelope_size;
14761            }
14762
14763            Ok(())
14764        }
14765    }
14766
14767    impl fidl::encoding::ResourceTypeMarker for Capability {
14768        type Borrowed<'a> = &'a mut Self;
14769        fn take_or_borrow<'a>(
14770            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14771        ) -> Self::Borrowed<'a> {
14772            value
14773        }
14774    }
14775
14776    unsafe impl fidl::encoding::TypeMarker for Capability {
14777        type Owned = Self;
14778
14779        #[inline(always)]
14780        fn inline_align(_context: fidl::encoding::Context) -> usize {
14781            8
14782        }
14783
14784        #[inline(always)]
14785        fn inline_size(_context: fidl::encoding::Context) -> usize {
14786            16
14787        }
14788    }
14789
14790    unsafe impl fidl::encoding::Encode<Capability, fidl::encoding::DefaultFuchsiaResourceDialect>
14791        for &mut Capability
14792    {
14793        #[inline]
14794        unsafe fn encode(
14795            self,
14796            encoder: &mut fidl::encoding::Encoder<
14797                '_,
14798                fidl::encoding::DefaultFuchsiaResourceDialect,
14799            >,
14800            offset: usize,
14801            _depth: fidl::encoding::Depth,
14802        ) -> fidl::Result<()> {
14803            encoder.debug_check_bounds::<Capability>(offset);
14804            encoder.write_num::<u64>(self.ordinal(), offset);
14805            match self {
14806            Capability::Unit(ref val) => {
14807                fidl::encoding::encode_in_envelope::<Unit, fidl::encoding::DefaultFuchsiaResourceDialect>(
14808                    <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
14809                    encoder, offset + 8, _depth
14810                )
14811            }
14812            Capability::Handle(ref mut val) => {
14813                fidl::encoding::encode_in_envelope::<fidl::encoding::HandleType<fidl::NullableHandle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect>(
14814                    <fidl::encoding::HandleType<fidl::NullableHandle, { fidl::ObjectType::NONE.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
14815                    encoder, offset + 8, _depth
14816                )
14817            }
14818            Capability::Data(ref val) => {
14819                fidl::encoding::encode_in_envelope::<Data, fidl::encoding::DefaultFuchsiaResourceDialect>(
14820                    <Data as fidl::encoding::ValueTypeMarker>::borrow(val),
14821                    encoder, offset + 8, _depth
14822                )
14823            }
14824            Capability::Dictionary(ref mut val) => {
14825                fidl::encoding::encode_in_envelope::<DictionaryRef, fidl::encoding::DefaultFuchsiaResourceDialect>(
14826                    <DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
14827                    encoder, offset + 8, _depth
14828                )
14829            }
14830            Capability::Connector(ref mut val) => {
14831                fidl::encoding::encode_in_envelope::<Connector, fidl::encoding::DefaultFuchsiaResourceDialect>(
14832                    <Connector as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
14833                    encoder, offset + 8, _depth
14834                )
14835            }
14836            Capability::DirConnector(ref mut val) => {
14837                fidl::encoding::encode_in_envelope::<DirConnector, fidl::encoding::DefaultFuchsiaResourceDialect>(
14838                    <DirConnector as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
14839                    encoder, offset + 8, _depth
14840                )
14841            }
14842            Capability::Directory(ref mut val) => {
14843                fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
14844                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
14845                    encoder, offset + 8, _depth
14846                )
14847            }
14848            Capability::DirEntry(ref mut val) => {
14849                fidl::encoding::encode_in_envelope::<DirEntry, fidl::encoding::DefaultFuchsiaResourceDialect>(
14850                    <DirEntry as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
14851                    encoder, offset + 8, _depth
14852                )
14853            }
14854            Capability::ConnectorRouter(ref mut val) => {
14855                fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ConnectorRouterMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
14856                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ConnectorRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
14857                    encoder, offset + 8, _depth
14858                )
14859            }
14860            Capability::DictionaryRouter(ref mut val) => {
14861                fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DictionaryRouterMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
14862                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DictionaryRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
14863                    encoder, offset + 8, _depth
14864                )
14865            }
14866            Capability::DirEntryRouter(ref mut val) => {
14867                fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirEntryRouterMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
14868                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirEntryRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
14869                    encoder, offset + 8, _depth
14870                )
14871            }
14872            Capability::DataRouter(ref mut val) => {
14873                fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DataRouterMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
14874                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DataRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
14875                    encoder, offset + 8, _depth
14876                )
14877            }
14878            Capability::DirConnectorRouter(ref mut val) => {
14879                fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirConnectorRouterMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
14880                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirConnectorRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
14881                    encoder, offset + 8, _depth
14882                )
14883            }
14884            Capability::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
14885        }
14886        }
14887    }
14888
14889    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Capability {
14890        #[inline(always)]
14891        fn new_empty() -> Self {
14892            Self::__SourceBreaking { unknown_ordinal: 0 }
14893        }
14894
14895        #[inline]
14896        unsafe fn decode(
14897            &mut self,
14898            decoder: &mut fidl::encoding::Decoder<
14899                '_,
14900                fidl::encoding::DefaultFuchsiaResourceDialect,
14901            >,
14902            offset: usize,
14903            mut depth: fidl::encoding::Depth,
14904        ) -> fidl::Result<()> {
14905            decoder.debug_check_bounds::<Self>(offset);
14906            #[allow(unused_variables)]
14907            let next_out_of_line = decoder.next_out_of_line();
14908            let handles_before = decoder.remaining_handles();
14909            let (ordinal, inlined, num_bytes, num_handles) =
14910                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
14911
14912            let member_inline_size = match ordinal {
14913            1 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14914            2 => <fidl::encoding::HandleType<fidl::NullableHandle, { fidl::ObjectType::NONE.into_raw() }, 2147483648> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14915            3 => <Data as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14916            4 => <DictionaryRef as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14917            5 => <Connector as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14918            6 => <DirConnector as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14919            7 => <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14920            8 => <DirEntry as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14921            9 => <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ConnectorRouterMarker>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14922            10 => <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DictionaryRouterMarker>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14923            11 => <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirEntryRouterMarker>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14924            12 => <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DataRouterMarker>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14925            13 => <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirConnectorRouterMarker>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14926            0 => return Err(fidl::Error::UnknownUnionTag),
14927            _ => num_bytes as usize,
14928        };
14929
14930            if inlined != (member_inline_size <= 4) {
14931                return Err(fidl::Error::InvalidInlineBitInEnvelope);
14932            }
14933            let _inner_offset;
14934            if inlined {
14935                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
14936                _inner_offset = offset + 8;
14937            } else {
14938                depth.increment()?;
14939                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14940            }
14941            match ordinal {
14942                1 => {
14943                    #[allow(irrefutable_let_patterns)]
14944                    if let Capability::Unit(_) = self {
14945                        // Do nothing, read the value into the object
14946                    } else {
14947                        // Initialize `self` to the right variant
14948                        *self = Capability::Unit(fidl::new_empty!(
14949                            Unit,
14950                            fidl::encoding::DefaultFuchsiaResourceDialect
14951                        ));
14952                    }
14953                    #[allow(irrefutable_let_patterns)]
14954                    if let Capability::Unit(ref mut val) = self {
14955                        fidl::decode!(
14956                            Unit,
14957                            fidl::encoding::DefaultFuchsiaResourceDialect,
14958                            val,
14959                            decoder,
14960                            _inner_offset,
14961                            depth
14962                        )?;
14963                    } else {
14964                        unreachable!()
14965                    }
14966                }
14967                2 => {
14968                    #[allow(irrefutable_let_patterns)]
14969                    if let Capability::Handle(_) = self {
14970                        // Do nothing, read the value into the object
14971                    } else {
14972                        // Initialize `self` to the right variant
14973                        *self = Capability::Handle(
14974                            fidl::new_empty!(fidl::encoding::HandleType<fidl::NullableHandle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
14975                        );
14976                    }
14977                    #[allow(irrefutable_let_patterns)]
14978                    if let Capability::Handle(ref mut val) = self {
14979                        fidl::decode!(fidl::encoding::HandleType<fidl::NullableHandle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val, decoder, _inner_offset, depth)?;
14980                    } else {
14981                        unreachable!()
14982                    }
14983                }
14984                3 => {
14985                    #[allow(irrefutable_let_patterns)]
14986                    if let Capability::Data(_) = self {
14987                        // Do nothing, read the value into the object
14988                    } else {
14989                        // Initialize `self` to the right variant
14990                        *self = Capability::Data(fidl::new_empty!(
14991                            Data,
14992                            fidl::encoding::DefaultFuchsiaResourceDialect
14993                        ));
14994                    }
14995                    #[allow(irrefutable_let_patterns)]
14996                    if let Capability::Data(ref mut val) = self {
14997                        fidl::decode!(
14998                            Data,
14999                            fidl::encoding::DefaultFuchsiaResourceDialect,
15000                            val,
15001                            decoder,
15002                            _inner_offset,
15003                            depth
15004                        )?;
15005                    } else {
15006                        unreachable!()
15007                    }
15008                }
15009                4 => {
15010                    #[allow(irrefutable_let_patterns)]
15011                    if let Capability::Dictionary(_) = self {
15012                        // Do nothing, read the value into the object
15013                    } else {
15014                        // Initialize `self` to the right variant
15015                        *self = Capability::Dictionary(fidl::new_empty!(
15016                            DictionaryRef,
15017                            fidl::encoding::DefaultFuchsiaResourceDialect
15018                        ));
15019                    }
15020                    #[allow(irrefutable_let_patterns)]
15021                    if let Capability::Dictionary(ref mut val) = self {
15022                        fidl::decode!(
15023                            DictionaryRef,
15024                            fidl::encoding::DefaultFuchsiaResourceDialect,
15025                            val,
15026                            decoder,
15027                            _inner_offset,
15028                            depth
15029                        )?;
15030                    } else {
15031                        unreachable!()
15032                    }
15033                }
15034                5 => {
15035                    #[allow(irrefutable_let_patterns)]
15036                    if let Capability::Connector(_) = self {
15037                        // Do nothing, read the value into the object
15038                    } else {
15039                        // Initialize `self` to the right variant
15040                        *self = Capability::Connector(fidl::new_empty!(
15041                            Connector,
15042                            fidl::encoding::DefaultFuchsiaResourceDialect
15043                        ));
15044                    }
15045                    #[allow(irrefutable_let_patterns)]
15046                    if let Capability::Connector(ref mut val) = self {
15047                        fidl::decode!(
15048                            Connector,
15049                            fidl::encoding::DefaultFuchsiaResourceDialect,
15050                            val,
15051                            decoder,
15052                            _inner_offset,
15053                            depth
15054                        )?;
15055                    } else {
15056                        unreachable!()
15057                    }
15058                }
15059                6 => {
15060                    #[allow(irrefutable_let_patterns)]
15061                    if let Capability::DirConnector(_) = self {
15062                        // Do nothing, read the value into the object
15063                    } else {
15064                        // Initialize `self` to the right variant
15065                        *self = Capability::DirConnector(fidl::new_empty!(
15066                            DirConnector,
15067                            fidl::encoding::DefaultFuchsiaResourceDialect
15068                        ));
15069                    }
15070                    #[allow(irrefutable_let_patterns)]
15071                    if let Capability::DirConnector(ref mut val) = self {
15072                        fidl::decode!(
15073                            DirConnector,
15074                            fidl::encoding::DefaultFuchsiaResourceDialect,
15075                            val,
15076                            decoder,
15077                            _inner_offset,
15078                            depth
15079                        )?;
15080                    } else {
15081                        unreachable!()
15082                    }
15083                }
15084                7 => {
15085                    #[allow(irrefutable_let_patterns)]
15086                    if let Capability::Directory(_) = self {
15087                        // Do nothing, read the value into the object
15088                    } else {
15089                        // Initialize `self` to the right variant
15090                        *self = Capability::Directory(fidl::new_empty!(
15091                            fidl::encoding::Endpoint<
15092                                fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
15093                            >,
15094                            fidl::encoding::DefaultFuchsiaResourceDialect
15095                        ));
15096                    }
15097                    #[allow(irrefutable_let_patterns)]
15098                    if let Capability::Directory(ref mut val) = self {
15099                        fidl::decode!(
15100                            fidl::encoding::Endpoint<
15101                                fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
15102                            >,
15103                            fidl::encoding::DefaultFuchsiaResourceDialect,
15104                            val,
15105                            decoder,
15106                            _inner_offset,
15107                            depth
15108                        )?;
15109                    } else {
15110                        unreachable!()
15111                    }
15112                }
15113                8 => {
15114                    #[allow(irrefutable_let_patterns)]
15115                    if let Capability::DirEntry(_) = self {
15116                        // Do nothing, read the value into the object
15117                    } else {
15118                        // Initialize `self` to the right variant
15119                        *self = Capability::DirEntry(fidl::new_empty!(
15120                            DirEntry,
15121                            fidl::encoding::DefaultFuchsiaResourceDialect
15122                        ));
15123                    }
15124                    #[allow(irrefutable_let_patterns)]
15125                    if let Capability::DirEntry(ref mut val) = self {
15126                        fidl::decode!(
15127                            DirEntry,
15128                            fidl::encoding::DefaultFuchsiaResourceDialect,
15129                            val,
15130                            decoder,
15131                            _inner_offset,
15132                            depth
15133                        )?;
15134                    } else {
15135                        unreachable!()
15136                    }
15137                }
15138                9 => {
15139                    #[allow(irrefutable_let_patterns)]
15140                    if let Capability::ConnectorRouter(_) = self {
15141                        // Do nothing, read the value into the object
15142                    } else {
15143                        // Initialize `self` to the right variant
15144                        *self = Capability::ConnectorRouter(fidl::new_empty!(
15145                            fidl::encoding::Endpoint<
15146                                fidl::endpoints::ClientEnd<ConnectorRouterMarker>,
15147                            >,
15148                            fidl::encoding::DefaultFuchsiaResourceDialect
15149                        ));
15150                    }
15151                    #[allow(irrefutable_let_patterns)]
15152                    if let Capability::ConnectorRouter(ref mut val) = self {
15153                        fidl::decode!(
15154                            fidl::encoding::Endpoint<
15155                                fidl::endpoints::ClientEnd<ConnectorRouterMarker>,
15156                            >,
15157                            fidl::encoding::DefaultFuchsiaResourceDialect,
15158                            val,
15159                            decoder,
15160                            _inner_offset,
15161                            depth
15162                        )?;
15163                    } else {
15164                        unreachable!()
15165                    }
15166                }
15167                10 => {
15168                    #[allow(irrefutable_let_patterns)]
15169                    if let Capability::DictionaryRouter(_) = self {
15170                        // Do nothing, read the value into the object
15171                    } else {
15172                        // Initialize `self` to the right variant
15173                        *self = Capability::DictionaryRouter(fidl::new_empty!(
15174                            fidl::encoding::Endpoint<
15175                                fidl::endpoints::ClientEnd<DictionaryRouterMarker>,
15176                            >,
15177                            fidl::encoding::DefaultFuchsiaResourceDialect
15178                        ));
15179                    }
15180                    #[allow(irrefutable_let_patterns)]
15181                    if let Capability::DictionaryRouter(ref mut val) = self {
15182                        fidl::decode!(
15183                            fidl::encoding::Endpoint<
15184                                fidl::endpoints::ClientEnd<DictionaryRouterMarker>,
15185                            >,
15186                            fidl::encoding::DefaultFuchsiaResourceDialect,
15187                            val,
15188                            decoder,
15189                            _inner_offset,
15190                            depth
15191                        )?;
15192                    } else {
15193                        unreachable!()
15194                    }
15195                }
15196                11 => {
15197                    #[allow(irrefutable_let_patterns)]
15198                    if let Capability::DirEntryRouter(_) = self {
15199                        // Do nothing, read the value into the object
15200                    } else {
15201                        // Initialize `self` to the right variant
15202                        *self = Capability::DirEntryRouter(fidl::new_empty!(
15203                            fidl::encoding::Endpoint<
15204                                fidl::endpoints::ClientEnd<DirEntryRouterMarker>,
15205                            >,
15206                            fidl::encoding::DefaultFuchsiaResourceDialect
15207                        ));
15208                    }
15209                    #[allow(irrefutable_let_patterns)]
15210                    if let Capability::DirEntryRouter(ref mut val) = self {
15211                        fidl::decode!(
15212                            fidl::encoding::Endpoint<
15213                                fidl::endpoints::ClientEnd<DirEntryRouterMarker>,
15214                            >,
15215                            fidl::encoding::DefaultFuchsiaResourceDialect,
15216                            val,
15217                            decoder,
15218                            _inner_offset,
15219                            depth
15220                        )?;
15221                    } else {
15222                        unreachable!()
15223                    }
15224                }
15225                12 => {
15226                    #[allow(irrefutable_let_patterns)]
15227                    if let Capability::DataRouter(_) = self {
15228                        // Do nothing, read the value into the object
15229                    } else {
15230                        // Initialize `self` to the right variant
15231                        *self = Capability::DataRouter(fidl::new_empty!(
15232                            fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DataRouterMarker>>,
15233                            fidl::encoding::DefaultFuchsiaResourceDialect
15234                        ));
15235                    }
15236                    #[allow(irrefutable_let_patterns)]
15237                    if let Capability::DataRouter(ref mut val) = self {
15238                        fidl::decode!(
15239                            fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DataRouterMarker>>,
15240                            fidl::encoding::DefaultFuchsiaResourceDialect,
15241                            val,
15242                            decoder,
15243                            _inner_offset,
15244                            depth
15245                        )?;
15246                    } else {
15247                        unreachable!()
15248                    }
15249                }
15250                13 => {
15251                    #[allow(irrefutable_let_patterns)]
15252                    if let Capability::DirConnectorRouter(_) = self {
15253                        // Do nothing, read the value into the object
15254                    } else {
15255                        // Initialize `self` to the right variant
15256                        *self = Capability::DirConnectorRouter(fidl::new_empty!(
15257                            fidl::encoding::Endpoint<
15258                                fidl::endpoints::ClientEnd<DirConnectorRouterMarker>,
15259                            >,
15260                            fidl::encoding::DefaultFuchsiaResourceDialect
15261                        ));
15262                    }
15263                    #[allow(irrefutable_let_patterns)]
15264                    if let Capability::DirConnectorRouter(ref mut val) = self {
15265                        fidl::decode!(
15266                            fidl::encoding::Endpoint<
15267                                fidl::endpoints::ClientEnd<DirConnectorRouterMarker>,
15268                            >,
15269                            fidl::encoding::DefaultFuchsiaResourceDialect,
15270                            val,
15271                            decoder,
15272                            _inner_offset,
15273                            depth
15274                        )?;
15275                    } else {
15276                        unreachable!()
15277                    }
15278                }
15279                #[allow(deprecated)]
15280                ordinal => {
15281                    for _ in 0..num_handles {
15282                        decoder.drop_next_handle()?;
15283                    }
15284                    *self = Capability::__SourceBreaking { unknown_ordinal: ordinal };
15285                }
15286            }
15287            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
15288                return Err(fidl::Error::InvalidNumBytesInEnvelope);
15289            }
15290            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15291                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15292            }
15293            Ok(())
15294        }
15295    }
15296
15297    impl fidl::encoding::ResourceTypeMarker for ConnectorRouterRouteResponse {
15298        type Borrowed<'a> = &'a mut Self;
15299        fn take_or_borrow<'a>(
15300            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
15301        ) -> Self::Borrowed<'a> {
15302            value
15303        }
15304    }
15305
15306    unsafe impl fidl::encoding::TypeMarker for ConnectorRouterRouteResponse {
15307        type Owned = Self;
15308
15309        #[inline(always)]
15310        fn inline_align(_context: fidl::encoding::Context) -> usize {
15311            8
15312        }
15313
15314        #[inline(always)]
15315        fn inline_size(_context: fidl::encoding::Context) -> usize {
15316            16
15317        }
15318    }
15319
15320    unsafe impl
15321        fidl::encoding::Encode<
15322            ConnectorRouterRouteResponse,
15323            fidl::encoding::DefaultFuchsiaResourceDialect,
15324        > for &mut ConnectorRouterRouteResponse
15325    {
15326        #[inline]
15327        unsafe fn encode(
15328            self,
15329            encoder: &mut fidl::encoding::Encoder<
15330                '_,
15331                fidl::encoding::DefaultFuchsiaResourceDialect,
15332            >,
15333            offset: usize,
15334            _depth: fidl::encoding::Depth,
15335        ) -> fidl::Result<()> {
15336            encoder.debug_check_bounds::<ConnectorRouterRouteResponse>(offset);
15337            encoder.write_num::<u64>(self.ordinal(), offset);
15338            match self {
15339                ConnectorRouterRouteResponse::Connector(ref mut val) => {
15340                    fidl::encoding::encode_in_envelope::<
15341                        Connector,
15342                        fidl::encoding::DefaultFuchsiaResourceDialect,
15343                    >(
15344                        <Connector as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
15345                        encoder,
15346                        offset + 8,
15347                        _depth,
15348                    )
15349                }
15350                ConnectorRouterRouteResponse::Unavailable(ref val) => {
15351                    fidl::encoding::encode_in_envelope::<
15352                        Unit,
15353                        fidl::encoding::DefaultFuchsiaResourceDialect,
15354                    >(
15355                        <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
15356                        encoder,
15357                        offset + 8,
15358                        _depth,
15359                    )
15360                }
15361            }
15362        }
15363    }
15364
15365    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
15366        for ConnectorRouterRouteResponse
15367    {
15368        #[inline(always)]
15369        fn new_empty() -> Self {
15370            Self::Connector(fidl::new_empty!(
15371                Connector,
15372                fidl::encoding::DefaultFuchsiaResourceDialect
15373            ))
15374        }
15375
15376        #[inline]
15377        unsafe fn decode(
15378            &mut self,
15379            decoder: &mut fidl::encoding::Decoder<
15380                '_,
15381                fidl::encoding::DefaultFuchsiaResourceDialect,
15382            >,
15383            offset: usize,
15384            mut depth: fidl::encoding::Depth,
15385        ) -> fidl::Result<()> {
15386            decoder.debug_check_bounds::<Self>(offset);
15387            #[allow(unused_variables)]
15388            let next_out_of_line = decoder.next_out_of_line();
15389            let handles_before = decoder.remaining_handles();
15390            let (ordinal, inlined, num_bytes, num_handles) =
15391                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
15392
15393            let member_inline_size = match ordinal {
15394                1 => <Connector as fidl::encoding::TypeMarker>::inline_size(decoder.context),
15395                2 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
15396                _ => return Err(fidl::Error::UnknownUnionTag),
15397            };
15398
15399            if inlined != (member_inline_size <= 4) {
15400                return Err(fidl::Error::InvalidInlineBitInEnvelope);
15401            }
15402            let _inner_offset;
15403            if inlined {
15404                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
15405                _inner_offset = offset + 8;
15406            } else {
15407                depth.increment()?;
15408                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15409            }
15410            match ordinal {
15411                1 => {
15412                    #[allow(irrefutable_let_patterns)]
15413                    if let ConnectorRouterRouteResponse::Connector(_) = self {
15414                        // Do nothing, read the value into the object
15415                    } else {
15416                        // Initialize `self` to the right variant
15417                        *self = ConnectorRouterRouteResponse::Connector(fidl::new_empty!(
15418                            Connector,
15419                            fidl::encoding::DefaultFuchsiaResourceDialect
15420                        ));
15421                    }
15422                    #[allow(irrefutable_let_patterns)]
15423                    if let ConnectorRouterRouteResponse::Connector(ref mut val) = self {
15424                        fidl::decode!(
15425                            Connector,
15426                            fidl::encoding::DefaultFuchsiaResourceDialect,
15427                            val,
15428                            decoder,
15429                            _inner_offset,
15430                            depth
15431                        )?;
15432                    } else {
15433                        unreachable!()
15434                    }
15435                }
15436                2 => {
15437                    #[allow(irrefutable_let_patterns)]
15438                    if let ConnectorRouterRouteResponse::Unavailable(_) = self {
15439                        // Do nothing, read the value into the object
15440                    } else {
15441                        // Initialize `self` to the right variant
15442                        *self = ConnectorRouterRouteResponse::Unavailable(fidl::new_empty!(
15443                            Unit,
15444                            fidl::encoding::DefaultFuchsiaResourceDialect
15445                        ));
15446                    }
15447                    #[allow(irrefutable_let_patterns)]
15448                    if let ConnectorRouterRouteResponse::Unavailable(ref mut val) = self {
15449                        fidl::decode!(
15450                            Unit,
15451                            fidl::encoding::DefaultFuchsiaResourceDialect,
15452                            val,
15453                            decoder,
15454                            _inner_offset,
15455                            depth
15456                        )?;
15457                    } else {
15458                        unreachable!()
15459                    }
15460                }
15461                ordinal => panic!("unexpected ordinal {:?}", ordinal),
15462            }
15463            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
15464                return Err(fidl::Error::InvalidNumBytesInEnvelope);
15465            }
15466            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15467                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15468            }
15469            Ok(())
15470        }
15471    }
15472
15473    impl fidl::encoding::ResourceTypeMarker for DataRouterRouteResponse {
15474        type Borrowed<'a> = &'a mut Self;
15475        fn take_or_borrow<'a>(
15476            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
15477        ) -> Self::Borrowed<'a> {
15478            value
15479        }
15480    }
15481
15482    unsafe impl fidl::encoding::TypeMarker for DataRouterRouteResponse {
15483        type Owned = Self;
15484
15485        #[inline(always)]
15486        fn inline_align(_context: fidl::encoding::Context) -> usize {
15487            8
15488        }
15489
15490        #[inline(always)]
15491        fn inline_size(_context: fidl::encoding::Context) -> usize {
15492            16
15493        }
15494    }
15495
15496    unsafe impl
15497        fidl::encoding::Encode<
15498            DataRouterRouteResponse,
15499            fidl::encoding::DefaultFuchsiaResourceDialect,
15500        > for &mut DataRouterRouteResponse
15501    {
15502        #[inline]
15503        unsafe fn encode(
15504            self,
15505            encoder: &mut fidl::encoding::Encoder<
15506                '_,
15507                fidl::encoding::DefaultFuchsiaResourceDialect,
15508            >,
15509            offset: usize,
15510            _depth: fidl::encoding::Depth,
15511        ) -> fidl::Result<()> {
15512            encoder.debug_check_bounds::<DataRouterRouteResponse>(offset);
15513            encoder.write_num::<u64>(self.ordinal(), offset);
15514            match self {
15515                DataRouterRouteResponse::Data(ref val) => fidl::encoding::encode_in_envelope::<
15516                    Data,
15517                    fidl::encoding::DefaultFuchsiaResourceDialect,
15518                >(
15519                    <Data as fidl::encoding::ValueTypeMarker>::borrow(val),
15520                    encoder,
15521                    offset + 8,
15522                    _depth,
15523                ),
15524                DataRouterRouteResponse::Unavailable(ref val) => {
15525                    fidl::encoding::encode_in_envelope::<
15526                        Unit,
15527                        fidl::encoding::DefaultFuchsiaResourceDialect,
15528                    >(
15529                        <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
15530                        encoder,
15531                        offset + 8,
15532                        _depth,
15533                    )
15534                }
15535            }
15536        }
15537    }
15538
15539    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
15540        for DataRouterRouteResponse
15541    {
15542        #[inline(always)]
15543        fn new_empty() -> Self {
15544            Self::Data(fidl::new_empty!(Data, fidl::encoding::DefaultFuchsiaResourceDialect))
15545        }
15546
15547        #[inline]
15548        unsafe fn decode(
15549            &mut self,
15550            decoder: &mut fidl::encoding::Decoder<
15551                '_,
15552                fidl::encoding::DefaultFuchsiaResourceDialect,
15553            >,
15554            offset: usize,
15555            mut depth: fidl::encoding::Depth,
15556        ) -> fidl::Result<()> {
15557            decoder.debug_check_bounds::<Self>(offset);
15558            #[allow(unused_variables)]
15559            let next_out_of_line = decoder.next_out_of_line();
15560            let handles_before = decoder.remaining_handles();
15561            let (ordinal, inlined, num_bytes, num_handles) =
15562                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
15563
15564            let member_inline_size = match ordinal {
15565                1 => <Data as fidl::encoding::TypeMarker>::inline_size(decoder.context),
15566                2 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
15567                _ => return Err(fidl::Error::UnknownUnionTag),
15568            };
15569
15570            if inlined != (member_inline_size <= 4) {
15571                return Err(fidl::Error::InvalidInlineBitInEnvelope);
15572            }
15573            let _inner_offset;
15574            if inlined {
15575                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
15576                _inner_offset = offset + 8;
15577            } else {
15578                depth.increment()?;
15579                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15580            }
15581            match ordinal {
15582                1 => {
15583                    #[allow(irrefutable_let_patterns)]
15584                    if let DataRouterRouteResponse::Data(_) = self {
15585                        // Do nothing, read the value into the object
15586                    } else {
15587                        // Initialize `self` to the right variant
15588                        *self = DataRouterRouteResponse::Data(fidl::new_empty!(
15589                            Data,
15590                            fidl::encoding::DefaultFuchsiaResourceDialect
15591                        ));
15592                    }
15593                    #[allow(irrefutable_let_patterns)]
15594                    if let DataRouterRouteResponse::Data(ref mut val) = self {
15595                        fidl::decode!(
15596                            Data,
15597                            fidl::encoding::DefaultFuchsiaResourceDialect,
15598                            val,
15599                            decoder,
15600                            _inner_offset,
15601                            depth
15602                        )?;
15603                    } else {
15604                        unreachable!()
15605                    }
15606                }
15607                2 => {
15608                    #[allow(irrefutable_let_patterns)]
15609                    if let DataRouterRouteResponse::Unavailable(_) = self {
15610                        // Do nothing, read the value into the object
15611                    } else {
15612                        // Initialize `self` to the right variant
15613                        *self = DataRouterRouteResponse::Unavailable(fidl::new_empty!(
15614                            Unit,
15615                            fidl::encoding::DefaultFuchsiaResourceDialect
15616                        ));
15617                    }
15618                    #[allow(irrefutable_let_patterns)]
15619                    if let DataRouterRouteResponse::Unavailable(ref mut val) = self {
15620                        fidl::decode!(
15621                            Unit,
15622                            fidl::encoding::DefaultFuchsiaResourceDialect,
15623                            val,
15624                            decoder,
15625                            _inner_offset,
15626                            depth
15627                        )?;
15628                    } else {
15629                        unreachable!()
15630                    }
15631                }
15632                ordinal => panic!("unexpected ordinal {:?}", ordinal),
15633            }
15634            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
15635                return Err(fidl::Error::InvalidNumBytesInEnvelope);
15636            }
15637            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15638                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15639            }
15640            Ok(())
15641        }
15642    }
15643
15644    impl fidl::encoding::ResourceTypeMarker for DictionaryRouterRouteResponse {
15645        type Borrowed<'a> = &'a mut Self;
15646        fn take_or_borrow<'a>(
15647            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
15648        ) -> Self::Borrowed<'a> {
15649            value
15650        }
15651    }
15652
15653    unsafe impl fidl::encoding::TypeMarker for DictionaryRouterRouteResponse {
15654        type Owned = Self;
15655
15656        #[inline(always)]
15657        fn inline_align(_context: fidl::encoding::Context) -> usize {
15658            8
15659        }
15660
15661        #[inline(always)]
15662        fn inline_size(_context: fidl::encoding::Context) -> usize {
15663            16
15664        }
15665    }
15666
15667    unsafe impl
15668        fidl::encoding::Encode<
15669            DictionaryRouterRouteResponse,
15670            fidl::encoding::DefaultFuchsiaResourceDialect,
15671        > for &mut DictionaryRouterRouteResponse
15672    {
15673        #[inline]
15674        unsafe fn encode(
15675            self,
15676            encoder: &mut fidl::encoding::Encoder<
15677                '_,
15678                fidl::encoding::DefaultFuchsiaResourceDialect,
15679            >,
15680            offset: usize,
15681            _depth: fidl::encoding::Depth,
15682        ) -> fidl::Result<()> {
15683            encoder.debug_check_bounds::<DictionaryRouterRouteResponse>(offset);
15684            encoder.write_num::<u64>(self.ordinal(), offset);
15685            match self {
15686                DictionaryRouterRouteResponse::Dictionary(ref mut val) => {
15687                    fidl::encoding::encode_in_envelope::<
15688                        DictionaryRef,
15689                        fidl::encoding::DefaultFuchsiaResourceDialect,
15690                    >(
15691                        <DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
15692                        encoder,
15693                        offset + 8,
15694                        _depth,
15695                    )
15696                }
15697                DictionaryRouterRouteResponse::Unavailable(ref val) => {
15698                    fidl::encoding::encode_in_envelope::<
15699                        Unit,
15700                        fidl::encoding::DefaultFuchsiaResourceDialect,
15701                    >(
15702                        <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
15703                        encoder,
15704                        offset + 8,
15705                        _depth,
15706                    )
15707                }
15708            }
15709        }
15710    }
15711
15712    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
15713        for DictionaryRouterRouteResponse
15714    {
15715        #[inline(always)]
15716        fn new_empty() -> Self {
15717            Self::Dictionary(fidl::new_empty!(
15718                DictionaryRef,
15719                fidl::encoding::DefaultFuchsiaResourceDialect
15720            ))
15721        }
15722
15723        #[inline]
15724        unsafe fn decode(
15725            &mut self,
15726            decoder: &mut fidl::encoding::Decoder<
15727                '_,
15728                fidl::encoding::DefaultFuchsiaResourceDialect,
15729            >,
15730            offset: usize,
15731            mut depth: fidl::encoding::Depth,
15732        ) -> fidl::Result<()> {
15733            decoder.debug_check_bounds::<Self>(offset);
15734            #[allow(unused_variables)]
15735            let next_out_of_line = decoder.next_out_of_line();
15736            let handles_before = decoder.remaining_handles();
15737            let (ordinal, inlined, num_bytes, num_handles) =
15738                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
15739
15740            let member_inline_size = match ordinal {
15741                1 => <DictionaryRef as fidl::encoding::TypeMarker>::inline_size(decoder.context),
15742                2 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
15743                _ => return Err(fidl::Error::UnknownUnionTag),
15744            };
15745
15746            if inlined != (member_inline_size <= 4) {
15747                return Err(fidl::Error::InvalidInlineBitInEnvelope);
15748            }
15749            let _inner_offset;
15750            if inlined {
15751                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
15752                _inner_offset = offset + 8;
15753            } else {
15754                depth.increment()?;
15755                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15756            }
15757            match ordinal {
15758                1 => {
15759                    #[allow(irrefutable_let_patterns)]
15760                    if let DictionaryRouterRouteResponse::Dictionary(_) = self {
15761                        // Do nothing, read the value into the object
15762                    } else {
15763                        // Initialize `self` to the right variant
15764                        *self = DictionaryRouterRouteResponse::Dictionary(fidl::new_empty!(
15765                            DictionaryRef,
15766                            fidl::encoding::DefaultFuchsiaResourceDialect
15767                        ));
15768                    }
15769                    #[allow(irrefutable_let_patterns)]
15770                    if let DictionaryRouterRouteResponse::Dictionary(ref mut val) = self {
15771                        fidl::decode!(
15772                            DictionaryRef,
15773                            fidl::encoding::DefaultFuchsiaResourceDialect,
15774                            val,
15775                            decoder,
15776                            _inner_offset,
15777                            depth
15778                        )?;
15779                    } else {
15780                        unreachable!()
15781                    }
15782                }
15783                2 => {
15784                    #[allow(irrefutable_let_patterns)]
15785                    if let DictionaryRouterRouteResponse::Unavailable(_) = self {
15786                        // Do nothing, read the value into the object
15787                    } else {
15788                        // Initialize `self` to the right variant
15789                        *self = DictionaryRouterRouteResponse::Unavailable(fidl::new_empty!(
15790                            Unit,
15791                            fidl::encoding::DefaultFuchsiaResourceDialect
15792                        ));
15793                    }
15794                    #[allow(irrefutable_let_patterns)]
15795                    if let DictionaryRouterRouteResponse::Unavailable(ref mut val) = self {
15796                        fidl::decode!(
15797                            Unit,
15798                            fidl::encoding::DefaultFuchsiaResourceDialect,
15799                            val,
15800                            decoder,
15801                            _inner_offset,
15802                            depth
15803                        )?;
15804                    } else {
15805                        unreachable!()
15806                    }
15807                }
15808                ordinal => panic!("unexpected ordinal {:?}", ordinal),
15809            }
15810            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
15811                return Err(fidl::Error::InvalidNumBytesInEnvelope);
15812            }
15813            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15814                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15815            }
15816            Ok(())
15817        }
15818    }
15819
15820    impl fidl::encoding::ResourceTypeMarker for DirConnectorRouterRouteResponse {
15821        type Borrowed<'a> = &'a mut Self;
15822        fn take_or_borrow<'a>(
15823            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
15824        ) -> Self::Borrowed<'a> {
15825            value
15826        }
15827    }
15828
15829    unsafe impl fidl::encoding::TypeMarker for DirConnectorRouterRouteResponse {
15830        type Owned = Self;
15831
15832        #[inline(always)]
15833        fn inline_align(_context: fidl::encoding::Context) -> usize {
15834            8
15835        }
15836
15837        #[inline(always)]
15838        fn inline_size(_context: fidl::encoding::Context) -> usize {
15839            16
15840        }
15841    }
15842
15843    unsafe impl
15844        fidl::encoding::Encode<
15845            DirConnectorRouterRouteResponse,
15846            fidl::encoding::DefaultFuchsiaResourceDialect,
15847        > for &mut DirConnectorRouterRouteResponse
15848    {
15849        #[inline]
15850        unsafe fn encode(
15851            self,
15852            encoder: &mut fidl::encoding::Encoder<
15853                '_,
15854                fidl::encoding::DefaultFuchsiaResourceDialect,
15855            >,
15856            offset: usize,
15857            _depth: fidl::encoding::Depth,
15858        ) -> fidl::Result<()> {
15859            encoder.debug_check_bounds::<DirConnectorRouterRouteResponse>(offset);
15860            encoder.write_num::<u64>(self.ordinal(), offset);
15861            match self {
15862                DirConnectorRouterRouteResponse::DirConnector(ref mut val) => {
15863                    fidl::encoding::encode_in_envelope::<
15864                        DirConnector,
15865                        fidl::encoding::DefaultFuchsiaResourceDialect,
15866                    >(
15867                        <DirConnector as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
15868                        encoder,
15869                        offset + 8,
15870                        _depth,
15871                    )
15872                }
15873                DirConnectorRouterRouteResponse::Unavailable(ref val) => {
15874                    fidl::encoding::encode_in_envelope::<
15875                        Unit,
15876                        fidl::encoding::DefaultFuchsiaResourceDialect,
15877                    >(
15878                        <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
15879                        encoder,
15880                        offset + 8,
15881                        _depth,
15882                    )
15883                }
15884            }
15885        }
15886    }
15887
15888    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
15889        for DirConnectorRouterRouteResponse
15890    {
15891        #[inline(always)]
15892        fn new_empty() -> Self {
15893            Self::DirConnector(fidl::new_empty!(
15894                DirConnector,
15895                fidl::encoding::DefaultFuchsiaResourceDialect
15896            ))
15897        }
15898
15899        #[inline]
15900        unsafe fn decode(
15901            &mut self,
15902            decoder: &mut fidl::encoding::Decoder<
15903                '_,
15904                fidl::encoding::DefaultFuchsiaResourceDialect,
15905            >,
15906            offset: usize,
15907            mut depth: fidl::encoding::Depth,
15908        ) -> fidl::Result<()> {
15909            decoder.debug_check_bounds::<Self>(offset);
15910            #[allow(unused_variables)]
15911            let next_out_of_line = decoder.next_out_of_line();
15912            let handles_before = decoder.remaining_handles();
15913            let (ordinal, inlined, num_bytes, num_handles) =
15914                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
15915
15916            let member_inline_size = match ordinal {
15917                1 => <DirConnector as fidl::encoding::TypeMarker>::inline_size(decoder.context),
15918                2 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
15919                _ => return Err(fidl::Error::UnknownUnionTag),
15920            };
15921
15922            if inlined != (member_inline_size <= 4) {
15923                return Err(fidl::Error::InvalidInlineBitInEnvelope);
15924            }
15925            let _inner_offset;
15926            if inlined {
15927                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
15928                _inner_offset = offset + 8;
15929            } else {
15930                depth.increment()?;
15931                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15932            }
15933            match ordinal {
15934                1 => {
15935                    #[allow(irrefutable_let_patterns)]
15936                    if let DirConnectorRouterRouteResponse::DirConnector(_) = self {
15937                        // Do nothing, read the value into the object
15938                    } else {
15939                        // Initialize `self` to the right variant
15940                        *self = DirConnectorRouterRouteResponse::DirConnector(fidl::new_empty!(
15941                            DirConnector,
15942                            fidl::encoding::DefaultFuchsiaResourceDialect
15943                        ));
15944                    }
15945                    #[allow(irrefutable_let_patterns)]
15946                    if let DirConnectorRouterRouteResponse::DirConnector(ref mut val) = self {
15947                        fidl::decode!(
15948                            DirConnector,
15949                            fidl::encoding::DefaultFuchsiaResourceDialect,
15950                            val,
15951                            decoder,
15952                            _inner_offset,
15953                            depth
15954                        )?;
15955                    } else {
15956                        unreachable!()
15957                    }
15958                }
15959                2 => {
15960                    #[allow(irrefutable_let_patterns)]
15961                    if let DirConnectorRouterRouteResponse::Unavailable(_) = self {
15962                        // Do nothing, read the value into the object
15963                    } else {
15964                        // Initialize `self` to the right variant
15965                        *self = DirConnectorRouterRouteResponse::Unavailable(fidl::new_empty!(
15966                            Unit,
15967                            fidl::encoding::DefaultFuchsiaResourceDialect
15968                        ));
15969                    }
15970                    #[allow(irrefutable_let_patterns)]
15971                    if let DirConnectorRouterRouteResponse::Unavailable(ref mut val) = self {
15972                        fidl::decode!(
15973                            Unit,
15974                            fidl::encoding::DefaultFuchsiaResourceDialect,
15975                            val,
15976                            decoder,
15977                            _inner_offset,
15978                            depth
15979                        )?;
15980                    } else {
15981                        unreachable!()
15982                    }
15983                }
15984                ordinal => panic!("unexpected ordinal {:?}", ordinal),
15985            }
15986            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
15987                return Err(fidl::Error::InvalidNumBytesInEnvelope);
15988            }
15989            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15990                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15991            }
15992            Ok(())
15993        }
15994    }
15995
15996    impl fidl::encoding::ResourceTypeMarker for DirEntryRouterRouteResponse {
15997        type Borrowed<'a> = &'a mut Self;
15998        fn take_or_borrow<'a>(
15999            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
16000        ) -> Self::Borrowed<'a> {
16001            value
16002        }
16003    }
16004
16005    unsafe impl fidl::encoding::TypeMarker for DirEntryRouterRouteResponse {
16006        type Owned = Self;
16007
16008        #[inline(always)]
16009        fn inline_align(_context: fidl::encoding::Context) -> usize {
16010            8
16011        }
16012
16013        #[inline(always)]
16014        fn inline_size(_context: fidl::encoding::Context) -> usize {
16015            16
16016        }
16017    }
16018
16019    unsafe impl
16020        fidl::encoding::Encode<
16021            DirEntryRouterRouteResponse,
16022            fidl::encoding::DefaultFuchsiaResourceDialect,
16023        > for &mut DirEntryRouterRouteResponse
16024    {
16025        #[inline]
16026        unsafe fn encode(
16027            self,
16028            encoder: &mut fidl::encoding::Encoder<
16029                '_,
16030                fidl::encoding::DefaultFuchsiaResourceDialect,
16031            >,
16032            offset: usize,
16033            _depth: fidl::encoding::Depth,
16034        ) -> fidl::Result<()> {
16035            encoder.debug_check_bounds::<DirEntryRouterRouteResponse>(offset);
16036            encoder.write_num::<u64>(self.ordinal(), offset);
16037            match self {
16038                DirEntryRouterRouteResponse::DirEntry(ref mut val) => {
16039                    fidl::encoding::encode_in_envelope::<
16040                        DirEntry,
16041                        fidl::encoding::DefaultFuchsiaResourceDialect,
16042                    >(
16043                        <DirEntry as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
16044                        encoder,
16045                        offset + 8,
16046                        _depth,
16047                    )
16048                }
16049                DirEntryRouterRouteResponse::Unavailable(ref val) => {
16050                    fidl::encoding::encode_in_envelope::<
16051                        Unit,
16052                        fidl::encoding::DefaultFuchsiaResourceDialect,
16053                    >(
16054                        <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
16055                        encoder,
16056                        offset + 8,
16057                        _depth,
16058                    )
16059                }
16060            }
16061        }
16062    }
16063
16064    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
16065        for DirEntryRouterRouteResponse
16066    {
16067        #[inline(always)]
16068        fn new_empty() -> Self {
16069            Self::DirEntry(fidl::new_empty!(
16070                DirEntry,
16071                fidl::encoding::DefaultFuchsiaResourceDialect
16072            ))
16073        }
16074
16075        #[inline]
16076        unsafe fn decode(
16077            &mut self,
16078            decoder: &mut fidl::encoding::Decoder<
16079                '_,
16080                fidl::encoding::DefaultFuchsiaResourceDialect,
16081            >,
16082            offset: usize,
16083            mut depth: fidl::encoding::Depth,
16084        ) -> fidl::Result<()> {
16085            decoder.debug_check_bounds::<Self>(offset);
16086            #[allow(unused_variables)]
16087            let next_out_of_line = decoder.next_out_of_line();
16088            let handles_before = decoder.remaining_handles();
16089            let (ordinal, inlined, num_bytes, num_handles) =
16090                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
16091
16092            let member_inline_size = match ordinal {
16093                1 => <DirEntry as fidl::encoding::TypeMarker>::inline_size(decoder.context),
16094                2 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
16095                _ => return Err(fidl::Error::UnknownUnionTag),
16096            };
16097
16098            if inlined != (member_inline_size <= 4) {
16099                return Err(fidl::Error::InvalidInlineBitInEnvelope);
16100            }
16101            let _inner_offset;
16102            if inlined {
16103                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
16104                _inner_offset = offset + 8;
16105            } else {
16106                depth.increment()?;
16107                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16108            }
16109            match ordinal {
16110                1 => {
16111                    #[allow(irrefutable_let_patterns)]
16112                    if let DirEntryRouterRouteResponse::DirEntry(_) = self {
16113                        // Do nothing, read the value into the object
16114                    } else {
16115                        // Initialize `self` to the right variant
16116                        *self = DirEntryRouterRouteResponse::DirEntry(fidl::new_empty!(
16117                            DirEntry,
16118                            fidl::encoding::DefaultFuchsiaResourceDialect
16119                        ));
16120                    }
16121                    #[allow(irrefutable_let_patterns)]
16122                    if let DirEntryRouterRouteResponse::DirEntry(ref mut val) = self {
16123                        fidl::decode!(
16124                            DirEntry,
16125                            fidl::encoding::DefaultFuchsiaResourceDialect,
16126                            val,
16127                            decoder,
16128                            _inner_offset,
16129                            depth
16130                        )?;
16131                    } else {
16132                        unreachable!()
16133                    }
16134                }
16135                2 => {
16136                    #[allow(irrefutable_let_patterns)]
16137                    if let DirEntryRouterRouteResponse::Unavailable(_) = self {
16138                        // Do nothing, read the value into the object
16139                    } else {
16140                        // Initialize `self` to the right variant
16141                        *self = DirEntryRouterRouteResponse::Unavailable(fidl::new_empty!(
16142                            Unit,
16143                            fidl::encoding::DefaultFuchsiaResourceDialect
16144                        ));
16145                    }
16146                    #[allow(irrefutable_let_patterns)]
16147                    if let DirEntryRouterRouteResponse::Unavailable(ref mut val) = self {
16148                        fidl::decode!(
16149                            Unit,
16150                            fidl::encoding::DefaultFuchsiaResourceDialect,
16151                            val,
16152                            decoder,
16153                            _inner_offset,
16154                            depth
16155                        )?;
16156                    } else {
16157                        unreachable!()
16158                    }
16159                }
16160                ordinal => panic!("unexpected ordinal {:?}", ordinal),
16161            }
16162            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
16163                return Err(fidl::Error::InvalidNumBytesInEnvelope);
16164            }
16165            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16166                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16167            }
16168            Ok(())
16169        }
16170    }
16171
16172    impl fidl::encoding::ResourceTypeMarker for DirectoryRouterRouteResponse {
16173        type Borrowed<'a> = &'a mut Self;
16174        fn take_or_borrow<'a>(
16175            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
16176        ) -> Self::Borrowed<'a> {
16177            value
16178        }
16179    }
16180
16181    unsafe impl fidl::encoding::TypeMarker for DirectoryRouterRouteResponse {
16182        type Owned = Self;
16183
16184        #[inline(always)]
16185        fn inline_align(_context: fidl::encoding::Context) -> usize {
16186            8
16187        }
16188
16189        #[inline(always)]
16190        fn inline_size(_context: fidl::encoding::Context) -> usize {
16191            16
16192        }
16193    }
16194
16195    unsafe impl
16196        fidl::encoding::Encode<
16197            DirectoryRouterRouteResponse,
16198            fidl::encoding::DefaultFuchsiaResourceDialect,
16199        > for &mut DirectoryRouterRouteResponse
16200    {
16201        #[inline]
16202        unsafe fn encode(
16203            self,
16204            encoder: &mut fidl::encoding::Encoder<
16205                '_,
16206                fidl::encoding::DefaultFuchsiaResourceDialect,
16207            >,
16208            offset: usize,
16209            _depth: fidl::encoding::Depth,
16210        ) -> fidl::Result<()> {
16211            encoder.debug_check_bounds::<DirectoryRouterRouteResponse>(offset);
16212            encoder.write_num::<u64>(self.ordinal(), offset);
16213            match self {
16214                DirectoryRouterRouteResponse::Directory(ref mut val) => {
16215                    fidl::encoding::encode_in_envelope::<
16216                        fidl::encoding::Endpoint<
16217                            fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
16218                        >,
16219                        fidl::encoding::DefaultFuchsiaResourceDialect,
16220                    >(
16221                        <fidl::encoding::Endpoint<
16222                            fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
16223                        > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
16224                            val
16225                        ),
16226                        encoder,
16227                        offset + 8,
16228                        _depth,
16229                    )
16230                }
16231                DirectoryRouterRouteResponse::Unavailable(ref val) => {
16232                    fidl::encoding::encode_in_envelope::<
16233                        Unit,
16234                        fidl::encoding::DefaultFuchsiaResourceDialect,
16235                    >(
16236                        <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
16237                        encoder,
16238                        offset + 8,
16239                        _depth,
16240                    )
16241                }
16242            }
16243        }
16244    }
16245
16246    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
16247        for DirectoryRouterRouteResponse
16248    {
16249        #[inline(always)]
16250        fn new_empty() -> Self {
16251            Self::Directory(fidl::new_empty!(
16252                fidl::encoding::Endpoint<
16253                    fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
16254                >,
16255                fidl::encoding::DefaultFuchsiaResourceDialect
16256            ))
16257        }
16258
16259        #[inline]
16260        unsafe fn decode(
16261            &mut self,
16262            decoder: &mut fidl::encoding::Decoder<
16263                '_,
16264                fidl::encoding::DefaultFuchsiaResourceDialect,
16265            >,
16266            offset: usize,
16267            mut depth: fidl::encoding::Depth,
16268        ) -> fidl::Result<()> {
16269            decoder.debug_check_bounds::<Self>(offset);
16270            #[allow(unused_variables)]
16271            let next_out_of_line = decoder.next_out_of_line();
16272            let handles_before = decoder.remaining_handles();
16273            let (ordinal, inlined, num_bytes, num_handles) =
16274                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
16275
16276            let member_inline_size = match ordinal {
16277                1 => <fidl::encoding::Endpoint<
16278                    fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
16279                > as fidl::encoding::TypeMarker>::inline_size(decoder.context),
16280                2 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
16281                _ => return Err(fidl::Error::UnknownUnionTag),
16282            };
16283
16284            if inlined != (member_inline_size <= 4) {
16285                return Err(fidl::Error::InvalidInlineBitInEnvelope);
16286            }
16287            let _inner_offset;
16288            if inlined {
16289                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
16290                _inner_offset = offset + 8;
16291            } else {
16292                depth.increment()?;
16293                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16294            }
16295            match ordinal {
16296                1 => {
16297                    #[allow(irrefutable_let_patterns)]
16298                    if let DirectoryRouterRouteResponse::Directory(_) = self {
16299                        // Do nothing, read the value into the object
16300                    } else {
16301                        // Initialize `self` to the right variant
16302                        *self = DirectoryRouterRouteResponse::Directory(fidl::new_empty!(
16303                            fidl::encoding::Endpoint<
16304                                fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
16305                            >,
16306                            fidl::encoding::DefaultFuchsiaResourceDialect
16307                        ));
16308                    }
16309                    #[allow(irrefutable_let_patterns)]
16310                    if let DirectoryRouterRouteResponse::Directory(ref mut val) = self {
16311                        fidl::decode!(
16312                            fidl::encoding::Endpoint<
16313                                fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
16314                            >,
16315                            fidl::encoding::DefaultFuchsiaResourceDialect,
16316                            val,
16317                            decoder,
16318                            _inner_offset,
16319                            depth
16320                        )?;
16321                    } else {
16322                        unreachable!()
16323                    }
16324                }
16325                2 => {
16326                    #[allow(irrefutable_let_patterns)]
16327                    if let DirectoryRouterRouteResponse::Unavailable(_) = self {
16328                        // Do nothing, read the value into the object
16329                    } else {
16330                        // Initialize `self` to the right variant
16331                        *self = DirectoryRouterRouteResponse::Unavailable(fidl::new_empty!(
16332                            Unit,
16333                            fidl::encoding::DefaultFuchsiaResourceDialect
16334                        ));
16335                    }
16336                    #[allow(irrefutable_let_patterns)]
16337                    if let DirectoryRouterRouteResponse::Unavailable(ref mut val) = self {
16338                        fidl::decode!(
16339                            Unit,
16340                            fidl::encoding::DefaultFuchsiaResourceDialect,
16341                            val,
16342                            decoder,
16343                            _inner_offset,
16344                            depth
16345                        )?;
16346                    } else {
16347                        unreachable!()
16348                    }
16349                }
16350                ordinal => panic!("unexpected ordinal {:?}", ordinal),
16351            }
16352            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
16353                return Err(fidl::Error::InvalidNumBytesInEnvelope);
16354            }
16355            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16356                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16357            }
16358            Ok(())
16359        }
16360    }
16361}