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 CapabilityStoreControlHandle {
3320    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
3321        self.inner.shutdown_with_epitaph(status.into())
3322    }
3323}
3324
3325impl fidl::endpoints::ControlHandle for CapabilityStoreControlHandle {
3326    fn shutdown(&self) {
3327        self.inner.shutdown()
3328    }
3329
3330    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
3331        self.inner.shutdown_with_epitaph(status)
3332    }
3333
3334    fn is_closed(&self) -> bool {
3335        self.inner.channel().is_closed()
3336    }
3337    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3338        self.inner.channel().on_closed()
3339    }
3340
3341    #[cfg(target_os = "fuchsia")]
3342    fn signal_peer(
3343        &self,
3344        clear_mask: zx::Signals,
3345        set_mask: zx::Signals,
3346    ) -> Result<(), zx_status::Status> {
3347        use fidl::Peered;
3348        self.inner.channel().signal_peer(clear_mask, set_mask)
3349    }
3350}
3351
3352impl CapabilityStoreControlHandle {}
3353
3354#[must_use = "FIDL methods require a response to be sent"]
3355#[derive(Debug)]
3356pub struct CapabilityStoreDuplicateResponder {
3357    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3358    tx_id: u32,
3359}
3360
3361/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3362/// if the responder is dropped without sending a response, so that the client
3363/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3364impl std::ops::Drop for CapabilityStoreDuplicateResponder {
3365    fn drop(&mut self) {
3366        self.control_handle.shutdown();
3367        // Safety: drops once, never accessed again
3368        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3369    }
3370}
3371
3372impl fidl::endpoints::Responder for CapabilityStoreDuplicateResponder {
3373    type ControlHandle = CapabilityStoreControlHandle;
3374
3375    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3376        &self.control_handle
3377    }
3378
3379    fn drop_without_shutdown(mut self) {
3380        // Safety: drops once, never accessed again due to mem::forget
3381        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3382        // Prevent Drop from running (which would shut down the channel)
3383        std::mem::forget(self);
3384    }
3385}
3386
3387impl CapabilityStoreDuplicateResponder {
3388    /// Sends a response to the FIDL transaction.
3389    ///
3390    /// Sets the channel to shutdown if an error occurs.
3391    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3392        let _result = self.send_raw(result);
3393        if _result.is_err() {
3394            self.control_handle.shutdown();
3395        }
3396        self.drop_without_shutdown();
3397        _result
3398    }
3399
3400    /// Similar to "send" but does not shutdown the channel if an error occurs.
3401    pub fn send_no_shutdown_on_err(
3402        self,
3403        mut result: Result<(), CapabilityStoreError>,
3404    ) -> Result<(), fidl::Error> {
3405        let _result = self.send_raw(result);
3406        self.drop_without_shutdown();
3407        _result
3408    }
3409
3410    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3411        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3412            fidl::encoding::EmptyStruct,
3413            CapabilityStoreError,
3414        >>(
3415            fidl::encoding::FlexibleResult::new(result),
3416            self.tx_id,
3417            0x5d5d35d9c20a2184,
3418            fidl::encoding::DynamicFlags::FLEXIBLE,
3419        )
3420    }
3421}
3422
3423#[must_use = "FIDL methods require a response to be sent"]
3424#[derive(Debug)]
3425pub struct CapabilityStoreDropResponder {
3426    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3427    tx_id: u32,
3428}
3429
3430/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3431/// if the responder is dropped without sending a response, so that the client
3432/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3433impl std::ops::Drop for CapabilityStoreDropResponder {
3434    fn drop(&mut self) {
3435        self.control_handle.shutdown();
3436        // Safety: drops once, never accessed again
3437        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3438    }
3439}
3440
3441impl fidl::endpoints::Responder for CapabilityStoreDropResponder {
3442    type ControlHandle = CapabilityStoreControlHandle;
3443
3444    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3445        &self.control_handle
3446    }
3447
3448    fn drop_without_shutdown(mut self) {
3449        // Safety: drops once, never accessed again due to mem::forget
3450        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3451        // Prevent Drop from running (which would shut down the channel)
3452        std::mem::forget(self);
3453    }
3454}
3455
3456impl CapabilityStoreDropResponder {
3457    /// Sends a response to the FIDL transaction.
3458    ///
3459    /// Sets the channel to shutdown if an error occurs.
3460    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3461        let _result = self.send_raw(result);
3462        if _result.is_err() {
3463            self.control_handle.shutdown();
3464        }
3465        self.drop_without_shutdown();
3466        _result
3467    }
3468
3469    /// Similar to "send" but does not shutdown the channel if an error occurs.
3470    pub fn send_no_shutdown_on_err(
3471        self,
3472        mut result: Result<(), CapabilityStoreError>,
3473    ) -> Result<(), fidl::Error> {
3474        let _result = self.send_raw(result);
3475        self.drop_without_shutdown();
3476        _result
3477    }
3478
3479    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3480        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3481            fidl::encoding::EmptyStruct,
3482            CapabilityStoreError,
3483        >>(
3484            fidl::encoding::FlexibleResult::new(result),
3485            self.tx_id,
3486            0xa745c0990fc2559,
3487            fidl::encoding::DynamicFlags::FLEXIBLE,
3488        )
3489    }
3490}
3491
3492#[must_use = "FIDL methods require a response to be sent"]
3493#[derive(Debug)]
3494pub struct CapabilityStoreExportResponder {
3495    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3496    tx_id: u32,
3497}
3498
3499/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3500/// if the responder is dropped without sending a response, so that the client
3501/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3502impl std::ops::Drop for CapabilityStoreExportResponder {
3503    fn drop(&mut self) {
3504        self.control_handle.shutdown();
3505        // Safety: drops once, never accessed again
3506        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3507    }
3508}
3509
3510impl fidl::endpoints::Responder for CapabilityStoreExportResponder {
3511    type ControlHandle = CapabilityStoreControlHandle;
3512
3513    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3514        &self.control_handle
3515    }
3516
3517    fn drop_without_shutdown(mut self) {
3518        // Safety: drops once, never accessed again due to mem::forget
3519        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3520        // Prevent Drop from running (which would shut down the channel)
3521        std::mem::forget(self);
3522    }
3523}
3524
3525impl CapabilityStoreExportResponder {
3526    /// Sends a response to the FIDL transaction.
3527    ///
3528    /// Sets the channel to shutdown if an error occurs.
3529    pub fn send(
3530        self,
3531        mut result: Result<Capability, CapabilityStoreError>,
3532    ) -> Result<(), fidl::Error> {
3533        let _result = self.send_raw(result);
3534        if _result.is_err() {
3535            self.control_handle.shutdown();
3536        }
3537        self.drop_without_shutdown();
3538        _result
3539    }
3540
3541    /// Similar to "send" but does not shutdown the channel if an error occurs.
3542    pub fn send_no_shutdown_on_err(
3543        self,
3544        mut result: Result<Capability, CapabilityStoreError>,
3545    ) -> Result<(), fidl::Error> {
3546        let _result = self.send_raw(result);
3547        self.drop_without_shutdown();
3548        _result
3549    }
3550
3551    fn send_raw(
3552        &self,
3553        mut result: Result<Capability, CapabilityStoreError>,
3554    ) -> Result<(), fidl::Error> {
3555        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3556            CapabilityStoreExportResponse,
3557            CapabilityStoreError,
3558        >>(
3559            fidl::encoding::FlexibleResult::new(
3560                result.as_mut().map_err(|e| *e).map(|capability| (capability,)),
3561            ),
3562            self.tx_id,
3563            0x3237a8f4748faff,
3564            fidl::encoding::DynamicFlags::FLEXIBLE,
3565        )
3566    }
3567}
3568
3569#[must_use = "FIDL methods require a response to be sent"]
3570#[derive(Debug)]
3571pub struct CapabilityStoreImportResponder {
3572    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3573    tx_id: u32,
3574}
3575
3576/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3577/// if the responder is dropped without sending a response, so that the client
3578/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3579impl std::ops::Drop for CapabilityStoreImportResponder {
3580    fn drop(&mut self) {
3581        self.control_handle.shutdown();
3582        // Safety: drops once, never accessed again
3583        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3584    }
3585}
3586
3587impl fidl::endpoints::Responder for CapabilityStoreImportResponder {
3588    type ControlHandle = CapabilityStoreControlHandle;
3589
3590    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3591        &self.control_handle
3592    }
3593
3594    fn drop_without_shutdown(mut self) {
3595        // Safety: drops once, never accessed again due to mem::forget
3596        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3597        // Prevent Drop from running (which would shut down the channel)
3598        std::mem::forget(self);
3599    }
3600}
3601
3602impl CapabilityStoreImportResponder {
3603    /// Sends a response to the FIDL transaction.
3604    ///
3605    /// Sets the channel to shutdown if an error occurs.
3606    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3607        let _result = self.send_raw(result);
3608        if _result.is_err() {
3609            self.control_handle.shutdown();
3610        }
3611        self.drop_without_shutdown();
3612        _result
3613    }
3614
3615    /// Similar to "send" but does not shutdown the channel if an error occurs.
3616    pub fn send_no_shutdown_on_err(
3617        self,
3618        mut result: Result<(), CapabilityStoreError>,
3619    ) -> Result<(), fidl::Error> {
3620        let _result = self.send_raw(result);
3621        self.drop_without_shutdown();
3622        _result
3623    }
3624
3625    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3626        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3627            fidl::encoding::EmptyStruct,
3628            CapabilityStoreError,
3629        >>(
3630            fidl::encoding::FlexibleResult::new(result),
3631            self.tx_id,
3632            0x1f96157a29f4539b,
3633            fidl::encoding::DynamicFlags::FLEXIBLE,
3634        )
3635    }
3636}
3637
3638#[must_use = "FIDL methods require a response to be sent"]
3639#[derive(Debug)]
3640pub struct CapabilityStoreConnectorCreateResponder {
3641    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3642    tx_id: u32,
3643}
3644
3645/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3646/// if the responder is dropped without sending a response, so that the client
3647/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3648impl std::ops::Drop for CapabilityStoreConnectorCreateResponder {
3649    fn drop(&mut self) {
3650        self.control_handle.shutdown();
3651        // Safety: drops once, never accessed again
3652        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3653    }
3654}
3655
3656impl fidl::endpoints::Responder for CapabilityStoreConnectorCreateResponder {
3657    type ControlHandle = CapabilityStoreControlHandle;
3658
3659    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3660        &self.control_handle
3661    }
3662
3663    fn drop_without_shutdown(mut self) {
3664        // Safety: drops once, never accessed again due to mem::forget
3665        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3666        // Prevent Drop from running (which would shut down the channel)
3667        std::mem::forget(self);
3668    }
3669}
3670
3671impl CapabilityStoreConnectorCreateResponder {
3672    /// Sends a response to the FIDL transaction.
3673    ///
3674    /// Sets the channel to shutdown if an error occurs.
3675    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3676        let _result = self.send_raw(result);
3677        if _result.is_err() {
3678            self.control_handle.shutdown();
3679        }
3680        self.drop_without_shutdown();
3681        _result
3682    }
3683
3684    /// Similar to "send" but does not shutdown the channel if an error occurs.
3685    pub fn send_no_shutdown_on_err(
3686        self,
3687        mut result: Result<(), CapabilityStoreError>,
3688    ) -> Result<(), fidl::Error> {
3689        let _result = self.send_raw(result);
3690        self.drop_without_shutdown();
3691        _result
3692    }
3693
3694    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3695        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3696            fidl::encoding::EmptyStruct,
3697            CapabilityStoreError,
3698        >>(
3699            fidl::encoding::FlexibleResult::new(result),
3700            self.tx_id,
3701            0x29592c5d63e91c25,
3702            fidl::encoding::DynamicFlags::FLEXIBLE,
3703        )
3704    }
3705}
3706
3707#[must_use = "FIDL methods require a response to be sent"]
3708#[derive(Debug)]
3709pub struct CapabilityStoreConnectorOpenResponder {
3710    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3711    tx_id: u32,
3712}
3713
3714/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3715/// if the responder is dropped without sending a response, so that the client
3716/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3717impl std::ops::Drop for CapabilityStoreConnectorOpenResponder {
3718    fn drop(&mut self) {
3719        self.control_handle.shutdown();
3720        // Safety: drops once, never accessed again
3721        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3722    }
3723}
3724
3725impl fidl::endpoints::Responder for CapabilityStoreConnectorOpenResponder {
3726    type ControlHandle = CapabilityStoreControlHandle;
3727
3728    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3729        &self.control_handle
3730    }
3731
3732    fn drop_without_shutdown(mut self) {
3733        // Safety: drops once, never accessed again due to mem::forget
3734        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3735        // Prevent Drop from running (which would shut down the channel)
3736        std::mem::forget(self);
3737    }
3738}
3739
3740impl CapabilityStoreConnectorOpenResponder {
3741    /// Sends a response to the FIDL transaction.
3742    ///
3743    /// Sets the channel to shutdown if an error occurs.
3744    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3745        let _result = self.send_raw(result);
3746        if _result.is_err() {
3747            self.control_handle.shutdown();
3748        }
3749        self.drop_without_shutdown();
3750        _result
3751    }
3752
3753    /// Similar to "send" but does not shutdown the channel if an error occurs.
3754    pub fn send_no_shutdown_on_err(
3755        self,
3756        mut result: Result<(), CapabilityStoreError>,
3757    ) -> Result<(), fidl::Error> {
3758        let _result = self.send_raw(result);
3759        self.drop_without_shutdown();
3760        _result
3761    }
3762
3763    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3764        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3765            fidl::encoding::EmptyStruct,
3766            CapabilityStoreError,
3767        >>(
3768            fidl::encoding::FlexibleResult::new(result),
3769            self.tx_id,
3770            0x537e69ab40563b9f,
3771            fidl::encoding::DynamicFlags::FLEXIBLE,
3772        )
3773    }
3774}
3775
3776#[must_use = "FIDL methods require a response to be sent"]
3777#[derive(Debug)]
3778pub struct CapabilityStoreDirConnectorCreateResponder {
3779    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3780    tx_id: u32,
3781}
3782
3783/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3784/// if the responder is dropped without sending a response, so that the client
3785/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3786impl std::ops::Drop for CapabilityStoreDirConnectorCreateResponder {
3787    fn drop(&mut self) {
3788        self.control_handle.shutdown();
3789        // Safety: drops once, never accessed again
3790        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3791    }
3792}
3793
3794impl fidl::endpoints::Responder for CapabilityStoreDirConnectorCreateResponder {
3795    type ControlHandle = CapabilityStoreControlHandle;
3796
3797    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3798        &self.control_handle
3799    }
3800
3801    fn drop_without_shutdown(mut self) {
3802        // Safety: drops once, never accessed again due to mem::forget
3803        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3804        // Prevent Drop from running (which would shut down the channel)
3805        std::mem::forget(self);
3806    }
3807}
3808
3809impl CapabilityStoreDirConnectorCreateResponder {
3810    /// Sends a response to the FIDL transaction.
3811    ///
3812    /// Sets the channel to shutdown if an error occurs.
3813    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3814        let _result = self.send_raw(result);
3815        if _result.is_err() {
3816            self.control_handle.shutdown();
3817        }
3818        self.drop_without_shutdown();
3819        _result
3820    }
3821
3822    /// Similar to "send" but does not shutdown the channel if an error occurs.
3823    pub fn send_no_shutdown_on_err(
3824        self,
3825        mut result: Result<(), CapabilityStoreError>,
3826    ) -> Result<(), fidl::Error> {
3827        let _result = self.send_raw(result);
3828        self.drop_without_shutdown();
3829        _result
3830    }
3831
3832    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3833        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3834            fidl::encoding::EmptyStruct,
3835            CapabilityStoreError,
3836        >>(
3837            fidl::encoding::FlexibleResult::new(result),
3838            self.tx_id,
3839            0x186138a11ccf19bb,
3840            fidl::encoding::DynamicFlags::FLEXIBLE,
3841        )
3842    }
3843}
3844
3845#[must_use = "FIDL methods require a response to be sent"]
3846#[derive(Debug)]
3847pub struct CapabilityStoreDirConnectorOpenResponder {
3848    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3849    tx_id: u32,
3850}
3851
3852/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3853/// if the responder is dropped without sending a response, so that the client
3854/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3855impl std::ops::Drop for CapabilityStoreDirConnectorOpenResponder {
3856    fn drop(&mut self) {
3857        self.control_handle.shutdown();
3858        // Safety: drops once, never accessed again
3859        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3860    }
3861}
3862
3863impl fidl::endpoints::Responder for CapabilityStoreDirConnectorOpenResponder {
3864    type ControlHandle = CapabilityStoreControlHandle;
3865
3866    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3867        &self.control_handle
3868    }
3869
3870    fn drop_without_shutdown(mut self) {
3871        // Safety: drops once, never accessed again due to mem::forget
3872        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3873        // Prevent Drop from running (which would shut down the channel)
3874        std::mem::forget(self);
3875    }
3876}
3877
3878impl CapabilityStoreDirConnectorOpenResponder {
3879    /// Sends a response to the FIDL transaction.
3880    ///
3881    /// Sets the channel to shutdown if an error occurs.
3882    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3883        let _result = self.send_raw(result);
3884        if _result.is_err() {
3885            self.control_handle.shutdown();
3886        }
3887        self.drop_without_shutdown();
3888        _result
3889    }
3890
3891    /// Similar to "send" but does not shutdown the channel if an error occurs.
3892    pub fn send_no_shutdown_on_err(
3893        self,
3894        mut result: Result<(), CapabilityStoreError>,
3895    ) -> Result<(), fidl::Error> {
3896        let _result = self.send_raw(result);
3897        self.drop_without_shutdown();
3898        _result
3899    }
3900
3901    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3902        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3903            fidl::encoding::EmptyStruct,
3904            CapabilityStoreError,
3905        >>(
3906            fidl::encoding::FlexibleResult::new(result),
3907            self.tx_id,
3908            0x5650d3d6a3a13901,
3909            fidl::encoding::DynamicFlags::FLEXIBLE,
3910        )
3911    }
3912}
3913
3914#[must_use = "FIDL methods require a response to be sent"]
3915#[derive(Debug)]
3916pub struct CapabilityStoreDictionaryCreateResponder {
3917    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3918    tx_id: u32,
3919}
3920
3921/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3922/// if the responder is dropped without sending a response, so that the client
3923/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3924impl std::ops::Drop for CapabilityStoreDictionaryCreateResponder {
3925    fn drop(&mut self) {
3926        self.control_handle.shutdown();
3927        // Safety: drops once, never accessed again
3928        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3929    }
3930}
3931
3932impl fidl::endpoints::Responder for CapabilityStoreDictionaryCreateResponder {
3933    type ControlHandle = CapabilityStoreControlHandle;
3934
3935    fn control_handle(&self) -> &CapabilityStoreControlHandle {
3936        &self.control_handle
3937    }
3938
3939    fn drop_without_shutdown(mut self) {
3940        // Safety: drops once, never accessed again due to mem::forget
3941        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3942        // Prevent Drop from running (which would shut down the channel)
3943        std::mem::forget(self);
3944    }
3945}
3946
3947impl CapabilityStoreDictionaryCreateResponder {
3948    /// Sends a response to the FIDL transaction.
3949    ///
3950    /// Sets the channel to shutdown if an error occurs.
3951    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3952        let _result = self.send_raw(result);
3953        if _result.is_err() {
3954            self.control_handle.shutdown();
3955        }
3956        self.drop_without_shutdown();
3957        _result
3958    }
3959
3960    /// Similar to "send" but does not shutdown the channel if an error occurs.
3961    pub fn send_no_shutdown_on_err(
3962        self,
3963        mut result: Result<(), CapabilityStoreError>,
3964    ) -> Result<(), fidl::Error> {
3965        let _result = self.send_raw(result);
3966        self.drop_without_shutdown();
3967        _result
3968    }
3969
3970    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3971        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3972            fidl::encoding::EmptyStruct,
3973            CapabilityStoreError,
3974        >>(
3975            fidl::encoding::FlexibleResult::new(result),
3976            self.tx_id,
3977            0x6997c8dfc63de093,
3978            fidl::encoding::DynamicFlags::FLEXIBLE,
3979        )
3980    }
3981}
3982
3983#[must_use = "FIDL methods require a response to be sent"]
3984#[derive(Debug)]
3985pub struct CapabilityStoreDictionaryLegacyImportResponder {
3986    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3987    tx_id: u32,
3988}
3989
3990/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
3991/// if the responder is dropped without sending a response, so that the client
3992/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3993impl std::ops::Drop for CapabilityStoreDictionaryLegacyImportResponder {
3994    fn drop(&mut self) {
3995        self.control_handle.shutdown();
3996        // Safety: drops once, never accessed again
3997        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3998    }
3999}
4000
4001impl fidl::endpoints::Responder for CapabilityStoreDictionaryLegacyImportResponder {
4002    type ControlHandle = CapabilityStoreControlHandle;
4003
4004    fn control_handle(&self) -> &CapabilityStoreControlHandle {
4005        &self.control_handle
4006    }
4007
4008    fn drop_without_shutdown(mut self) {
4009        // Safety: drops once, never accessed again due to mem::forget
4010        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4011        // Prevent Drop from running (which would shut down the channel)
4012        std::mem::forget(self);
4013    }
4014}
4015
4016impl CapabilityStoreDictionaryLegacyImportResponder {
4017    /// Sends a response to the FIDL transaction.
4018    ///
4019    /// Sets the channel to shutdown if an error occurs.
4020    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4021        let _result = self.send_raw(result);
4022        if _result.is_err() {
4023            self.control_handle.shutdown();
4024        }
4025        self.drop_without_shutdown();
4026        _result
4027    }
4028
4029    /// Similar to "send" but does not shutdown the channel if an error occurs.
4030    pub fn send_no_shutdown_on_err(
4031        self,
4032        mut result: Result<(), CapabilityStoreError>,
4033    ) -> Result<(), fidl::Error> {
4034        let _result = self.send_raw(result);
4035        self.drop_without_shutdown();
4036        _result
4037    }
4038
4039    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4040        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4041            fidl::encoding::EmptyStruct,
4042            CapabilityStoreError,
4043        >>(
4044            fidl::encoding::FlexibleResult::new(result),
4045            self.tx_id,
4046            0x72fd686c37b6025f,
4047            fidl::encoding::DynamicFlags::FLEXIBLE,
4048        )
4049    }
4050}
4051
4052#[must_use = "FIDL methods require a response to be sent"]
4053#[derive(Debug)]
4054pub struct CapabilityStoreDictionaryLegacyExportResponder {
4055    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
4056    tx_id: u32,
4057}
4058
4059/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
4060/// if the responder is dropped without sending a response, so that the client
4061/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4062impl std::ops::Drop for CapabilityStoreDictionaryLegacyExportResponder {
4063    fn drop(&mut self) {
4064        self.control_handle.shutdown();
4065        // Safety: drops once, never accessed again
4066        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4067    }
4068}
4069
4070impl fidl::endpoints::Responder for CapabilityStoreDictionaryLegacyExportResponder {
4071    type ControlHandle = CapabilityStoreControlHandle;
4072
4073    fn control_handle(&self) -> &CapabilityStoreControlHandle {
4074        &self.control_handle
4075    }
4076
4077    fn drop_without_shutdown(mut self) {
4078        // Safety: drops once, never accessed again due to mem::forget
4079        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4080        // Prevent Drop from running (which would shut down the channel)
4081        std::mem::forget(self);
4082    }
4083}
4084
4085impl CapabilityStoreDictionaryLegacyExportResponder {
4086    /// Sends a response to the FIDL transaction.
4087    ///
4088    /// Sets the channel to shutdown if an error occurs.
4089    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4090        let _result = self.send_raw(result);
4091        if _result.is_err() {
4092            self.control_handle.shutdown();
4093        }
4094        self.drop_without_shutdown();
4095        _result
4096    }
4097
4098    /// Similar to "send" but does not shutdown the channel if an error occurs.
4099    pub fn send_no_shutdown_on_err(
4100        self,
4101        mut result: Result<(), CapabilityStoreError>,
4102    ) -> Result<(), fidl::Error> {
4103        let _result = self.send_raw(result);
4104        self.drop_without_shutdown();
4105        _result
4106    }
4107
4108    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4109        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4110            fidl::encoding::EmptyStruct,
4111            CapabilityStoreError,
4112        >>(
4113            fidl::encoding::FlexibleResult::new(result),
4114            self.tx_id,
4115            0x407e15cc4bde5dcd,
4116            fidl::encoding::DynamicFlags::FLEXIBLE,
4117        )
4118    }
4119}
4120
4121#[must_use = "FIDL methods require a response to be sent"]
4122#[derive(Debug)]
4123pub struct CapabilityStoreDictionaryInsertResponder {
4124    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
4125    tx_id: u32,
4126}
4127
4128/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
4129/// if the responder is dropped without sending a response, so that the client
4130/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4131impl std::ops::Drop for CapabilityStoreDictionaryInsertResponder {
4132    fn drop(&mut self) {
4133        self.control_handle.shutdown();
4134        // Safety: drops once, never accessed again
4135        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4136    }
4137}
4138
4139impl fidl::endpoints::Responder for CapabilityStoreDictionaryInsertResponder {
4140    type ControlHandle = CapabilityStoreControlHandle;
4141
4142    fn control_handle(&self) -> &CapabilityStoreControlHandle {
4143        &self.control_handle
4144    }
4145
4146    fn drop_without_shutdown(mut self) {
4147        // Safety: drops once, never accessed again due to mem::forget
4148        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4149        // Prevent Drop from running (which would shut down the channel)
4150        std::mem::forget(self);
4151    }
4152}
4153
4154impl CapabilityStoreDictionaryInsertResponder {
4155    /// Sends a response to the FIDL transaction.
4156    ///
4157    /// Sets the channel to shutdown if an error occurs.
4158    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4159        let _result = self.send_raw(result);
4160        if _result.is_err() {
4161            self.control_handle.shutdown();
4162        }
4163        self.drop_without_shutdown();
4164        _result
4165    }
4166
4167    /// Similar to "send" but does not shutdown the channel if an error occurs.
4168    pub fn send_no_shutdown_on_err(
4169        self,
4170        mut result: Result<(), CapabilityStoreError>,
4171    ) -> Result<(), fidl::Error> {
4172        let _result = self.send_raw(result);
4173        self.drop_without_shutdown();
4174        _result
4175    }
4176
4177    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4178        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4179            fidl::encoding::EmptyStruct,
4180            CapabilityStoreError,
4181        >>(
4182            fidl::encoding::FlexibleResult::new(result),
4183            self.tx_id,
4184            0x7702183689d44c27,
4185            fidl::encoding::DynamicFlags::FLEXIBLE,
4186        )
4187    }
4188}
4189
4190#[must_use = "FIDL methods require a response to be sent"]
4191#[derive(Debug)]
4192pub struct CapabilityStoreDictionaryGetResponder {
4193    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
4194    tx_id: u32,
4195}
4196
4197/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
4198/// if the responder is dropped without sending a response, so that the client
4199/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4200impl std::ops::Drop for CapabilityStoreDictionaryGetResponder {
4201    fn drop(&mut self) {
4202        self.control_handle.shutdown();
4203        // Safety: drops once, never accessed again
4204        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4205    }
4206}
4207
4208impl fidl::endpoints::Responder for CapabilityStoreDictionaryGetResponder {
4209    type ControlHandle = CapabilityStoreControlHandle;
4210
4211    fn control_handle(&self) -> &CapabilityStoreControlHandle {
4212        &self.control_handle
4213    }
4214
4215    fn drop_without_shutdown(mut self) {
4216        // Safety: drops once, never accessed again due to mem::forget
4217        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4218        // Prevent Drop from running (which would shut down the channel)
4219        std::mem::forget(self);
4220    }
4221}
4222
4223impl CapabilityStoreDictionaryGetResponder {
4224    /// Sends a response to the FIDL transaction.
4225    ///
4226    /// Sets the channel to shutdown if an error occurs.
4227    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4228        let _result = self.send_raw(result);
4229        if _result.is_err() {
4230            self.control_handle.shutdown();
4231        }
4232        self.drop_without_shutdown();
4233        _result
4234    }
4235
4236    /// Similar to "send" but does not shutdown the channel if an error occurs.
4237    pub fn send_no_shutdown_on_err(
4238        self,
4239        mut result: Result<(), CapabilityStoreError>,
4240    ) -> Result<(), fidl::Error> {
4241        let _result = self.send_raw(result);
4242        self.drop_without_shutdown();
4243        _result
4244    }
4245
4246    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4247        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4248            fidl::encoding::EmptyStruct,
4249            CapabilityStoreError,
4250        >>(
4251            fidl::encoding::FlexibleResult::new(result),
4252            self.tx_id,
4253            0x4d9e27538284add2,
4254            fidl::encoding::DynamicFlags::FLEXIBLE,
4255        )
4256    }
4257}
4258
4259#[must_use = "FIDL methods require a response to be sent"]
4260#[derive(Debug)]
4261pub struct CapabilityStoreDictionaryRemoveResponder {
4262    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
4263    tx_id: u32,
4264}
4265
4266/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
4267/// if the responder is dropped without sending a response, so that the client
4268/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4269impl std::ops::Drop for CapabilityStoreDictionaryRemoveResponder {
4270    fn drop(&mut self) {
4271        self.control_handle.shutdown();
4272        // Safety: drops once, never accessed again
4273        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4274    }
4275}
4276
4277impl fidl::endpoints::Responder for CapabilityStoreDictionaryRemoveResponder {
4278    type ControlHandle = CapabilityStoreControlHandle;
4279
4280    fn control_handle(&self) -> &CapabilityStoreControlHandle {
4281        &self.control_handle
4282    }
4283
4284    fn drop_without_shutdown(mut self) {
4285        // Safety: drops once, never accessed again due to mem::forget
4286        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4287        // Prevent Drop from running (which would shut down the channel)
4288        std::mem::forget(self);
4289    }
4290}
4291
4292impl CapabilityStoreDictionaryRemoveResponder {
4293    /// Sends a response to the FIDL transaction.
4294    ///
4295    /// Sets the channel to shutdown if an error occurs.
4296    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4297        let _result = self.send_raw(result);
4298        if _result.is_err() {
4299            self.control_handle.shutdown();
4300        }
4301        self.drop_without_shutdown();
4302        _result
4303    }
4304
4305    /// Similar to "send" but does not shutdown the channel if an error occurs.
4306    pub fn send_no_shutdown_on_err(
4307        self,
4308        mut result: Result<(), CapabilityStoreError>,
4309    ) -> Result<(), fidl::Error> {
4310        let _result = self.send_raw(result);
4311        self.drop_without_shutdown();
4312        _result
4313    }
4314
4315    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4316        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4317            fidl::encoding::EmptyStruct,
4318            CapabilityStoreError,
4319        >>(
4320            fidl::encoding::FlexibleResult::new(result),
4321            self.tx_id,
4322            0x4c5c025ab05d4f3,
4323            fidl::encoding::DynamicFlags::FLEXIBLE,
4324        )
4325    }
4326}
4327
4328#[must_use = "FIDL methods require a response to be sent"]
4329#[derive(Debug)]
4330pub struct CapabilityStoreDictionaryCopyResponder {
4331    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
4332    tx_id: u32,
4333}
4334
4335/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
4336/// if the responder is dropped without sending a response, so that the client
4337/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4338impl std::ops::Drop for CapabilityStoreDictionaryCopyResponder {
4339    fn drop(&mut self) {
4340        self.control_handle.shutdown();
4341        // Safety: drops once, never accessed again
4342        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4343    }
4344}
4345
4346impl fidl::endpoints::Responder for CapabilityStoreDictionaryCopyResponder {
4347    type ControlHandle = CapabilityStoreControlHandle;
4348
4349    fn control_handle(&self) -> &CapabilityStoreControlHandle {
4350        &self.control_handle
4351    }
4352
4353    fn drop_without_shutdown(mut self) {
4354        // Safety: drops once, never accessed again due to mem::forget
4355        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4356        // Prevent Drop from running (which would shut down the channel)
4357        std::mem::forget(self);
4358    }
4359}
4360
4361impl CapabilityStoreDictionaryCopyResponder {
4362    /// Sends a response to the FIDL transaction.
4363    ///
4364    /// Sets the channel to shutdown if an error occurs.
4365    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4366        let _result = self.send_raw(result);
4367        if _result.is_err() {
4368            self.control_handle.shutdown();
4369        }
4370        self.drop_without_shutdown();
4371        _result
4372    }
4373
4374    /// Similar to "send" but does not shutdown the channel if an error occurs.
4375    pub fn send_no_shutdown_on_err(
4376        self,
4377        mut result: Result<(), CapabilityStoreError>,
4378    ) -> Result<(), fidl::Error> {
4379        let _result = self.send_raw(result);
4380        self.drop_without_shutdown();
4381        _result
4382    }
4383
4384    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4385        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4386            fidl::encoding::EmptyStruct,
4387            CapabilityStoreError,
4388        >>(
4389            fidl::encoding::FlexibleResult::new(result),
4390            self.tx_id,
4391            0x3733ecdf4ea1b44f,
4392            fidl::encoding::DynamicFlags::FLEXIBLE,
4393        )
4394    }
4395}
4396
4397#[must_use = "FIDL methods require a response to be sent"]
4398#[derive(Debug)]
4399pub struct CapabilityStoreDictionaryKeysResponder {
4400    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
4401    tx_id: u32,
4402}
4403
4404/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
4405/// if the responder is dropped without sending a response, so that the client
4406/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4407impl std::ops::Drop for CapabilityStoreDictionaryKeysResponder {
4408    fn drop(&mut self) {
4409        self.control_handle.shutdown();
4410        // Safety: drops once, never accessed again
4411        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4412    }
4413}
4414
4415impl fidl::endpoints::Responder for CapabilityStoreDictionaryKeysResponder {
4416    type ControlHandle = CapabilityStoreControlHandle;
4417
4418    fn control_handle(&self) -> &CapabilityStoreControlHandle {
4419        &self.control_handle
4420    }
4421
4422    fn drop_without_shutdown(mut self) {
4423        // Safety: drops once, never accessed again due to mem::forget
4424        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4425        // Prevent Drop from running (which would shut down the channel)
4426        std::mem::forget(self);
4427    }
4428}
4429
4430impl CapabilityStoreDictionaryKeysResponder {
4431    /// Sends a response to the FIDL transaction.
4432    ///
4433    /// Sets the channel to shutdown if an error occurs.
4434    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4435        let _result = self.send_raw(result);
4436        if _result.is_err() {
4437            self.control_handle.shutdown();
4438        }
4439        self.drop_without_shutdown();
4440        _result
4441    }
4442
4443    /// Similar to "send" but does not shutdown the channel if an error occurs.
4444    pub fn send_no_shutdown_on_err(
4445        self,
4446        mut result: Result<(), CapabilityStoreError>,
4447    ) -> Result<(), fidl::Error> {
4448        let _result = self.send_raw(result);
4449        self.drop_without_shutdown();
4450        _result
4451    }
4452
4453    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4454        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4455            fidl::encoding::EmptyStruct,
4456            CapabilityStoreError,
4457        >>(
4458            fidl::encoding::FlexibleResult::new(result),
4459            self.tx_id,
4460            0x84b05577ceaec9e,
4461            fidl::encoding::DynamicFlags::FLEXIBLE,
4462        )
4463    }
4464}
4465
4466#[must_use = "FIDL methods require a response to be sent"]
4467#[derive(Debug)]
4468pub struct CapabilityStoreDictionaryEnumerateResponder {
4469    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
4470    tx_id: u32,
4471}
4472
4473/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
4474/// if the responder is dropped without sending a response, so that the client
4475/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4476impl std::ops::Drop for CapabilityStoreDictionaryEnumerateResponder {
4477    fn drop(&mut self) {
4478        self.control_handle.shutdown();
4479        // Safety: drops once, never accessed again
4480        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4481    }
4482}
4483
4484impl fidl::endpoints::Responder for CapabilityStoreDictionaryEnumerateResponder {
4485    type ControlHandle = CapabilityStoreControlHandle;
4486
4487    fn control_handle(&self) -> &CapabilityStoreControlHandle {
4488        &self.control_handle
4489    }
4490
4491    fn drop_without_shutdown(mut self) {
4492        // Safety: drops once, never accessed again due to mem::forget
4493        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4494        // Prevent Drop from running (which would shut down the channel)
4495        std::mem::forget(self);
4496    }
4497}
4498
4499impl CapabilityStoreDictionaryEnumerateResponder {
4500    /// Sends a response to the FIDL transaction.
4501    ///
4502    /// Sets the channel to shutdown if an error occurs.
4503    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4504        let _result = self.send_raw(result);
4505        if _result.is_err() {
4506            self.control_handle.shutdown();
4507        }
4508        self.drop_without_shutdown();
4509        _result
4510    }
4511
4512    /// Similar to "send" but does not shutdown the channel if an error occurs.
4513    pub fn send_no_shutdown_on_err(
4514        self,
4515        mut result: Result<(), CapabilityStoreError>,
4516    ) -> Result<(), fidl::Error> {
4517        let _result = self.send_raw(result);
4518        self.drop_without_shutdown();
4519        _result
4520    }
4521
4522    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4523        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4524            fidl::encoding::EmptyStruct,
4525            CapabilityStoreError,
4526        >>(
4527            fidl::encoding::FlexibleResult::new(result),
4528            self.tx_id,
4529            0xd6279b6ced04641,
4530            fidl::encoding::DynamicFlags::FLEXIBLE,
4531        )
4532    }
4533}
4534
4535#[must_use = "FIDL methods require a response to be sent"]
4536#[derive(Debug)]
4537pub struct CapabilityStoreDictionaryDrainResponder {
4538    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
4539    tx_id: u32,
4540}
4541
4542/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
4543/// if the responder is dropped without sending a response, so that the client
4544/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4545impl std::ops::Drop for CapabilityStoreDictionaryDrainResponder {
4546    fn drop(&mut self) {
4547        self.control_handle.shutdown();
4548        // Safety: drops once, never accessed again
4549        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4550    }
4551}
4552
4553impl fidl::endpoints::Responder for CapabilityStoreDictionaryDrainResponder {
4554    type ControlHandle = CapabilityStoreControlHandle;
4555
4556    fn control_handle(&self) -> &CapabilityStoreControlHandle {
4557        &self.control_handle
4558    }
4559
4560    fn drop_without_shutdown(mut self) {
4561        // Safety: drops once, never accessed again due to mem::forget
4562        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4563        // Prevent Drop from running (which would shut down the channel)
4564        std::mem::forget(self);
4565    }
4566}
4567
4568impl CapabilityStoreDictionaryDrainResponder {
4569    /// Sends a response to the FIDL transaction.
4570    ///
4571    /// Sets the channel to shutdown if an error occurs.
4572    pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4573        let _result = self.send_raw(result);
4574        if _result.is_err() {
4575            self.control_handle.shutdown();
4576        }
4577        self.drop_without_shutdown();
4578        _result
4579    }
4580
4581    /// Similar to "send" but does not shutdown the channel if an error occurs.
4582    pub fn send_no_shutdown_on_err(
4583        self,
4584        mut result: Result<(), CapabilityStoreError>,
4585    ) -> Result<(), fidl::Error> {
4586        let _result = self.send_raw(result);
4587        self.drop_without_shutdown();
4588        _result
4589    }
4590
4591    fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4592        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4593            fidl::encoding::EmptyStruct,
4594            CapabilityStoreError,
4595        >>(
4596            fidl::encoding::FlexibleResult::new(result),
4597            self.tx_id,
4598            0x28a3a3f84d928cd8,
4599            fidl::encoding::DynamicFlags::FLEXIBLE,
4600        )
4601    }
4602}
4603
4604#[must_use = "FIDL methods require a response to be sent"]
4605#[derive(Debug)]
4606pub struct CapabilityStoreCreateServiceAggregateResponder {
4607    control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
4608    tx_id: u32,
4609}
4610
4611/// Set the the channel to be shutdown (see [`CapabilityStoreControlHandle::shutdown`])
4612/// if the responder is dropped without sending a response, so that the client
4613/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4614impl std::ops::Drop for CapabilityStoreCreateServiceAggregateResponder {
4615    fn drop(&mut self) {
4616        self.control_handle.shutdown();
4617        // Safety: drops once, never accessed again
4618        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4619    }
4620}
4621
4622impl fidl::endpoints::Responder for CapabilityStoreCreateServiceAggregateResponder {
4623    type ControlHandle = CapabilityStoreControlHandle;
4624
4625    fn control_handle(&self) -> &CapabilityStoreControlHandle {
4626        &self.control_handle
4627    }
4628
4629    fn drop_without_shutdown(mut self) {
4630        // Safety: drops once, never accessed again due to mem::forget
4631        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4632        // Prevent Drop from running (which would shut down the channel)
4633        std::mem::forget(self);
4634    }
4635}
4636
4637impl CapabilityStoreCreateServiceAggregateResponder {
4638    /// Sends a response to the FIDL transaction.
4639    ///
4640    /// Sets the channel to shutdown if an error occurs.
4641    pub fn send(
4642        self,
4643        mut result: Result<DirConnector, CapabilityStoreError>,
4644    ) -> Result<(), fidl::Error> {
4645        let _result = self.send_raw(result);
4646        if _result.is_err() {
4647            self.control_handle.shutdown();
4648        }
4649        self.drop_without_shutdown();
4650        _result
4651    }
4652
4653    /// Similar to "send" but does not shutdown the channel if an error occurs.
4654    pub fn send_no_shutdown_on_err(
4655        self,
4656        mut result: Result<DirConnector, CapabilityStoreError>,
4657    ) -> Result<(), fidl::Error> {
4658        let _result = self.send_raw(result);
4659        self.drop_without_shutdown();
4660        _result
4661    }
4662
4663    fn send_raw(
4664        &self,
4665        mut result: Result<DirConnector, CapabilityStoreError>,
4666    ) -> Result<(), fidl::Error> {
4667        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4668            CapabilityStoreCreateServiceAggregateResponse,
4669            CapabilityStoreError,
4670        >>(
4671            fidl::encoding::FlexibleResult::new(
4672                result
4673                    .as_mut()
4674                    .map_err(|e| *e)
4675                    .map(|aggregate_dir_connector| (aggregate_dir_connector,)),
4676            ),
4677            self.tx_id,
4678            0x4584116c8085885a,
4679            fidl::encoding::DynamicFlags::FLEXIBLE,
4680        )
4681    }
4682}
4683
4684#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4685pub struct ConnectorRouterMarker;
4686
4687impl fidl::endpoints::ProtocolMarker for ConnectorRouterMarker {
4688    type Proxy = ConnectorRouterProxy;
4689    type RequestStream = ConnectorRouterRequestStream;
4690    #[cfg(target_os = "fuchsia")]
4691    type SynchronousProxy = ConnectorRouterSynchronousProxy;
4692
4693    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.ConnectorRouter";
4694}
4695impl fidl::endpoints::DiscoverableProtocolMarker for ConnectorRouterMarker {}
4696pub type ConnectorRouterRouteResult = Result<ConnectorRouterRouteResponse, RouterError>;
4697
4698pub trait ConnectorRouterProxyInterface: Send + Sync {
4699    type RouteResponseFut: std::future::Future<Output = Result<ConnectorRouterRouteResult, fidl::Error>>
4700        + Send;
4701    fn r#route(&self, payload: RouteRequest) -> Self::RouteResponseFut;
4702}
4703#[derive(Debug)]
4704#[cfg(target_os = "fuchsia")]
4705pub struct ConnectorRouterSynchronousProxy {
4706    client: fidl::client::sync::Client,
4707}
4708
4709#[cfg(target_os = "fuchsia")]
4710impl fidl::endpoints::SynchronousProxy for ConnectorRouterSynchronousProxy {
4711    type Proxy = ConnectorRouterProxy;
4712    type Protocol = ConnectorRouterMarker;
4713
4714    fn from_channel(inner: fidl::Channel) -> Self {
4715        Self::new(inner)
4716    }
4717
4718    fn into_channel(self) -> fidl::Channel {
4719        self.client.into_channel()
4720    }
4721
4722    fn as_channel(&self) -> &fidl::Channel {
4723        self.client.as_channel()
4724    }
4725}
4726
4727#[cfg(target_os = "fuchsia")]
4728impl ConnectorRouterSynchronousProxy {
4729    pub fn new(channel: fidl::Channel) -> Self {
4730        Self { client: fidl::client::sync::Client::new(channel) }
4731    }
4732
4733    pub fn into_channel(self) -> fidl::Channel {
4734        self.client.into_channel()
4735    }
4736
4737    /// Waits until an event arrives and returns it. It is safe for other
4738    /// threads to make concurrent requests while waiting for an event.
4739    pub fn wait_for_event(
4740        &self,
4741        deadline: zx::MonotonicInstant,
4742    ) -> Result<ConnectorRouterEvent, fidl::Error> {
4743        ConnectorRouterEvent::decode(self.client.wait_for_event::<ConnectorRouterMarker>(deadline)?)
4744    }
4745
4746    pub fn r#route(
4747        &self,
4748        mut payload: RouteRequest,
4749        ___deadline: zx::MonotonicInstant,
4750    ) -> Result<ConnectorRouterRouteResult, fidl::Error> {
4751        let _response = self.client.send_query::<
4752            RouteRequest,
4753            fidl::encoding::FlexibleResultType<ConnectorRouterRouteResponse, RouterError>,
4754            ConnectorRouterMarker,
4755        >(
4756            &mut payload,
4757            0x74dbb8bc13730766,
4758            fidl::encoding::DynamicFlags::FLEXIBLE,
4759            ___deadline,
4760        )?
4761        .into_result::<ConnectorRouterMarker>("route")?;
4762        Ok(_response.map(|x| x))
4763    }
4764}
4765
4766#[cfg(target_os = "fuchsia")]
4767impl From<ConnectorRouterSynchronousProxy> for zx::NullableHandle {
4768    fn from(value: ConnectorRouterSynchronousProxy) -> Self {
4769        value.into_channel().into()
4770    }
4771}
4772
4773#[cfg(target_os = "fuchsia")]
4774impl From<fidl::Channel> for ConnectorRouterSynchronousProxy {
4775    fn from(value: fidl::Channel) -> Self {
4776        Self::new(value)
4777    }
4778}
4779
4780#[cfg(target_os = "fuchsia")]
4781impl fidl::endpoints::FromClient for ConnectorRouterSynchronousProxy {
4782    type Protocol = ConnectorRouterMarker;
4783
4784    fn from_client(value: fidl::endpoints::ClientEnd<ConnectorRouterMarker>) -> Self {
4785        Self::new(value.into_channel())
4786    }
4787}
4788
4789#[derive(Debug, Clone)]
4790pub struct ConnectorRouterProxy {
4791    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
4792}
4793
4794impl fidl::endpoints::Proxy for ConnectorRouterProxy {
4795    type Protocol = ConnectorRouterMarker;
4796
4797    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
4798        Self::new(inner)
4799    }
4800
4801    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
4802        self.client.into_channel().map_err(|client| Self { client })
4803    }
4804
4805    fn as_channel(&self) -> &::fidl::AsyncChannel {
4806        self.client.as_channel()
4807    }
4808}
4809
4810impl ConnectorRouterProxy {
4811    /// Create a new Proxy for fuchsia.component.sandbox/ConnectorRouter.
4812    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
4813        let protocol_name = <ConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4814        Self { client: fidl::client::Client::new(channel, protocol_name) }
4815    }
4816
4817    /// Get a Stream of events from the remote end of the protocol.
4818    ///
4819    /// # Panics
4820    ///
4821    /// Panics if the event stream was already taken.
4822    pub fn take_event_stream(&self) -> ConnectorRouterEventStream {
4823        ConnectorRouterEventStream { event_receiver: self.client.take_event_receiver() }
4824    }
4825
4826    pub fn r#route(
4827        &self,
4828        mut payload: RouteRequest,
4829    ) -> fidl::client::QueryResponseFut<
4830        ConnectorRouterRouteResult,
4831        fidl::encoding::DefaultFuchsiaResourceDialect,
4832    > {
4833        ConnectorRouterProxyInterface::r#route(self, payload)
4834    }
4835}
4836
4837impl ConnectorRouterProxyInterface for ConnectorRouterProxy {
4838    type RouteResponseFut = fidl::client::QueryResponseFut<
4839        ConnectorRouterRouteResult,
4840        fidl::encoding::DefaultFuchsiaResourceDialect,
4841    >;
4842    fn r#route(&self, mut payload: RouteRequest) -> Self::RouteResponseFut {
4843        fn _decode(
4844            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4845        ) -> Result<ConnectorRouterRouteResult, fidl::Error> {
4846            let _response = fidl::client::decode_transaction_body::<
4847                fidl::encoding::FlexibleResultType<ConnectorRouterRouteResponse, RouterError>,
4848                fidl::encoding::DefaultFuchsiaResourceDialect,
4849                0x74dbb8bc13730766,
4850            >(_buf?)?
4851            .into_result::<ConnectorRouterMarker>("route")?;
4852            Ok(_response.map(|x| x))
4853        }
4854        self.client.send_query_and_decode::<RouteRequest, ConnectorRouterRouteResult>(
4855            &mut payload,
4856            0x74dbb8bc13730766,
4857            fidl::encoding::DynamicFlags::FLEXIBLE,
4858            _decode,
4859        )
4860    }
4861}
4862
4863pub struct ConnectorRouterEventStream {
4864    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
4865}
4866
4867impl std::marker::Unpin for ConnectorRouterEventStream {}
4868
4869impl futures::stream::FusedStream for ConnectorRouterEventStream {
4870    fn is_terminated(&self) -> bool {
4871        self.event_receiver.is_terminated()
4872    }
4873}
4874
4875impl futures::Stream for ConnectorRouterEventStream {
4876    type Item = Result<ConnectorRouterEvent, fidl::Error>;
4877
4878    fn poll_next(
4879        mut self: std::pin::Pin<&mut Self>,
4880        cx: &mut std::task::Context<'_>,
4881    ) -> std::task::Poll<Option<Self::Item>> {
4882        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4883            &mut self.event_receiver,
4884            cx
4885        )?) {
4886            Some(buf) => std::task::Poll::Ready(Some(ConnectorRouterEvent::decode(buf))),
4887            None => std::task::Poll::Ready(None),
4888        }
4889    }
4890}
4891
4892#[derive(Debug)]
4893pub enum ConnectorRouterEvent {
4894    #[non_exhaustive]
4895    _UnknownEvent {
4896        /// Ordinal of the event that was sent.
4897        ordinal: u64,
4898    },
4899}
4900
4901impl ConnectorRouterEvent {
4902    /// Decodes a message buffer as a [`ConnectorRouterEvent`].
4903    fn decode(
4904        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4905    ) -> Result<ConnectorRouterEvent, fidl::Error> {
4906        let (bytes, _handles) = buf.split_mut();
4907        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4908        debug_assert_eq!(tx_header.tx_id, 0);
4909        match tx_header.ordinal {
4910            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4911                Ok(ConnectorRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
4912            }
4913            _ => Err(fidl::Error::UnknownOrdinal {
4914                ordinal: tx_header.ordinal,
4915                protocol_name:
4916                    <ConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4917            }),
4918        }
4919    }
4920}
4921
4922/// A Stream of incoming requests for fuchsia.component.sandbox/ConnectorRouter.
4923pub struct ConnectorRouterRequestStream {
4924    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4925    is_terminated: bool,
4926}
4927
4928impl std::marker::Unpin for ConnectorRouterRequestStream {}
4929
4930impl futures::stream::FusedStream for ConnectorRouterRequestStream {
4931    fn is_terminated(&self) -> bool {
4932        self.is_terminated
4933    }
4934}
4935
4936impl fidl::endpoints::RequestStream for ConnectorRouterRequestStream {
4937    type Protocol = ConnectorRouterMarker;
4938    type ControlHandle = ConnectorRouterControlHandle;
4939
4940    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
4941        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4942    }
4943
4944    fn control_handle(&self) -> Self::ControlHandle {
4945        ConnectorRouterControlHandle { inner: self.inner.clone() }
4946    }
4947
4948    fn into_inner(
4949        self,
4950    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
4951    {
4952        (self.inner, self.is_terminated)
4953    }
4954
4955    fn from_inner(
4956        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4957        is_terminated: bool,
4958    ) -> Self {
4959        Self { inner, is_terminated }
4960    }
4961}
4962
4963impl futures::Stream for ConnectorRouterRequestStream {
4964    type Item = Result<ConnectorRouterRequest, fidl::Error>;
4965
4966    fn poll_next(
4967        mut self: std::pin::Pin<&mut Self>,
4968        cx: &mut std::task::Context<'_>,
4969    ) -> std::task::Poll<Option<Self::Item>> {
4970        let this = &mut *self;
4971        if this.inner.check_shutdown(cx) {
4972            this.is_terminated = true;
4973            return std::task::Poll::Ready(None);
4974        }
4975        if this.is_terminated {
4976            panic!("polled ConnectorRouterRequestStream after completion");
4977        }
4978        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4979            |bytes, handles| {
4980                match this.inner.channel().read_etc(cx, bytes, handles) {
4981                    std::task::Poll::Ready(Ok(())) => {}
4982                    std::task::Poll::Pending => return std::task::Poll::Pending,
4983                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4984                        this.is_terminated = true;
4985                        return std::task::Poll::Ready(None);
4986                    }
4987                    std::task::Poll::Ready(Err(e)) => {
4988                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4989                            e.into(),
4990                        ))));
4991                    }
4992                }
4993
4994                // A message has been received from the channel
4995                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4996
4997                std::task::Poll::Ready(Some(match header.ordinal {
4998                    0x74dbb8bc13730766 => {
4999                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5000                        let mut req = fidl::new_empty!(
5001                            RouteRequest,
5002                            fidl::encoding::DefaultFuchsiaResourceDialect
5003                        );
5004                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RouteRequest>(&header, _body_bytes, handles, &mut req)?;
5005                        let control_handle =
5006                            ConnectorRouterControlHandle { inner: this.inner.clone() };
5007                        Ok(ConnectorRouterRequest::Route {
5008                            payload: req,
5009                            responder: ConnectorRouterRouteResponder {
5010                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5011                                tx_id: header.tx_id,
5012                            },
5013                        })
5014                    }
5015                    _ if header.tx_id == 0
5016                        && header
5017                            .dynamic_flags()
5018                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5019                    {
5020                        Ok(ConnectorRouterRequest::_UnknownMethod {
5021                            ordinal: header.ordinal,
5022                            control_handle: ConnectorRouterControlHandle {
5023                                inner: this.inner.clone(),
5024                            },
5025                            method_type: fidl::MethodType::OneWay,
5026                        })
5027                    }
5028                    _ if header
5029                        .dynamic_flags()
5030                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5031                    {
5032                        this.inner.send_framework_err(
5033                            fidl::encoding::FrameworkErr::UnknownMethod,
5034                            header.tx_id,
5035                            header.ordinal,
5036                            header.dynamic_flags(),
5037                            (bytes, handles),
5038                        )?;
5039                        Ok(ConnectorRouterRequest::_UnknownMethod {
5040                            ordinal: header.ordinal,
5041                            control_handle: ConnectorRouterControlHandle {
5042                                inner: this.inner.clone(),
5043                            },
5044                            method_type: fidl::MethodType::TwoWay,
5045                        })
5046                    }
5047                    _ => Err(fidl::Error::UnknownOrdinal {
5048                        ordinal: header.ordinal,
5049                        protocol_name:
5050                            <ConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5051                    }),
5052                }))
5053            },
5054        )
5055    }
5056}
5057
5058#[derive(Debug)]
5059pub enum ConnectorRouterRequest {
5060    Route {
5061        payload: RouteRequest,
5062        responder: ConnectorRouterRouteResponder,
5063    },
5064    /// An interaction was received which does not match any known method.
5065    #[non_exhaustive]
5066    _UnknownMethod {
5067        /// Ordinal of the method that was called.
5068        ordinal: u64,
5069        control_handle: ConnectorRouterControlHandle,
5070        method_type: fidl::MethodType,
5071    },
5072}
5073
5074impl ConnectorRouterRequest {
5075    #[allow(irrefutable_let_patterns)]
5076    pub fn into_route(self) -> Option<(RouteRequest, ConnectorRouterRouteResponder)> {
5077        if let ConnectorRouterRequest::Route { payload, responder } = self {
5078            Some((payload, responder))
5079        } else {
5080            None
5081        }
5082    }
5083
5084    /// Name of the method defined in FIDL
5085    pub fn method_name(&self) -> &'static str {
5086        match *self {
5087            ConnectorRouterRequest::Route { .. } => "route",
5088            ConnectorRouterRequest::_UnknownMethod {
5089                method_type: fidl::MethodType::OneWay,
5090                ..
5091            } => "unknown one-way method",
5092            ConnectorRouterRequest::_UnknownMethod {
5093                method_type: fidl::MethodType::TwoWay,
5094                ..
5095            } => "unknown two-way method",
5096        }
5097    }
5098}
5099
5100#[derive(Debug, Clone)]
5101pub struct ConnectorRouterControlHandle {
5102    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5103}
5104
5105impl ConnectorRouterControlHandle {
5106    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
5107        self.inner.shutdown_with_epitaph(status.into())
5108    }
5109}
5110
5111impl fidl::endpoints::ControlHandle for ConnectorRouterControlHandle {
5112    fn shutdown(&self) {
5113        self.inner.shutdown()
5114    }
5115
5116    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
5117        self.inner.shutdown_with_epitaph(status)
5118    }
5119
5120    fn is_closed(&self) -> bool {
5121        self.inner.channel().is_closed()
5122    }
5123    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
5124        self.inner.channel().on_closed()
5125    }
5126
5127    #[cfg(target_os = "fuchsia")]
5128    fn signal_peer(
5129        &self,
5130        clear_mask: zx::Signals,
5131        set_mask: zx::Signals,
5132    ) -> Result<(), zx_status::Status> {
5133        use fidl::Peered;
5134        self.inner.channel().signal_peer(clear_mask, set_mask)
5135    }
5136}
5137
5138impl ConnectorRouterControlHandle {}
5139
5140#[must_use = "FIDL methods require a response to be sent"]
5141#[derive(Debug)]
5142pub struct ConnectorRouterRouteResponder {
5143    control_handle: std::mem::ManuallyDrop<ConnectorRouterControlHandle>,
5144    tx_id: u32,
5145}
5146
5147/// Set the the channel to be shutdown (see [`ConnectorRouterControlHandle::shutdown`])
5148/// if the responder is dropped without sending a response, so that the client
5149/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5150impl std::ops::Drop for ConnectorRouterRouteResponder {
5151    fn drop(&mut self) {
5152        self.control_handle.shutdown();
5153        // Safety: drops once, never accessed again
5154        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5155    }
5156}
5157
5158impl fidl::endpoints::Responder for ConnectorRouterRouteResponder {
5159    type ControlHandle = ConnectorRouterControlHandle;
5160
5161    fn control_handle(&self) -> &ConnectorRouterControlHandle {
5162        &self.control_handle
5163    }
5164
5165    fn drop_without_shutdown(mut self) {
5166        // Safety: drops once, never accessed again due to mem::forget
5167        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5168        // Prevent Drop from running (which would shut down the channel)
5169        std::mem::forget(self);
5170    }
5171}
5172
5173impl ConnectorRouterRouteResponder {
5174    /// Sends a response to the FIDL transaction.
5175    ///
5176    /// Sets the channel to shutdown if an error occurs.
5177    pub fn send(
5178        self,
5179        mut result: Result<ConnectorRouterRouteResponse, RouterError>,
5180    ) -> Result<(), fidl::Error> {
5181        let _result = self.send_raw(result);
5182        if _result.is_err() {
5183            self.control_handle.shutdown();
5184        }
5185        self.drop_without_shutdown();
5186        _result
5187    }
5188
5189    /// Similar to "send" but does not shutdown the channel if an error occurs.
5190    pub fn send_no_shutdown_on_err(
5191        self,
5192        mut result: Result<ConnectorRouterRouteResponse, RouterError>,
5193    ) -> Result<(), fidl::Error> {
5194        let _result = self.send_raw(result);
5195        self.drop_without_shutdown();
5196        _result
5197    }
5198
5199    fn send_raw(
5200        &self,
5201        mut result: Result<ConnectorRouterRouteResponse, RouterError>,
5202    ) -> Result<(), fidl::Error> {
5203        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
5204            ConnectorRouterRouteResponse,
5205            RouterError,
5206        >>(
5207            fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
5208            self.tx_id,
5209            0x74dbb8bc13730766,
5210            fidl::encoding::DynamicFlags::FLEXIBLE,
5211        )
5212    }
5213}
5214
5215#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5216pub struct DataRouterMarker;
5217
5218impl fidl::endpoints::ProtocolMarker for DataRouterMarker {
5219    type Proxy = DataRouterProxy;
5220    type RequestStream = DataRouterRequestStream;
5221    #[cfg(target_os = "fuchsia")]
5222    type SynchronousProxy = DataRouterSynchronousProxy;
5223
5224    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.DataRouter";
5225}
5226impl fidl::endpoints::DiscoverableProtocolMarker for DataRouterMarker {}
5227pub type DataRouterRouteResult = Result<DataRouterRouteResponse, RouterError>;
5228
5229pub trait DataRouterProxyInterface: Send + Sync {
5230    type RouteResponseFut: std::future::Future<Output = Result<DataRouterRouteResult, fidl::Error>>
5231        + Send;
5232    fn r#route(&self, payload: RouteRequest) -> Self::RouteResponseFut;
5233}
5234#[derive(Debug)]
5235#[cfg(target_os = "fuchsia")]
5236pub struct DataRouterSynchronousProxy {
5237    client: fidl::client::sync::Client,
5238}
5239
5240#[cfg(target_os = "fuchsia")]
5241impl fidl::endpoints::SynchronousProxy for DataRouterSynchronousProxy {
5242    type Proxy = DataRouterProxy;
5243    type Protocol = DataRouterMarker;
5244
5245    fn from_channel(inner: fidl::Channel) -> Self {
5246        Self::new(inner)
5247    }
5248
5249    fn into_channel(self) -> fidl::Channel {
5250        self.client.into_channel()
5251    }
5252
5253    fn as_channel(&self) -> &fidl::Channel {
5254        self.client.as_channel()
5255    }
5256}
5257
5258#[cfg(target_os = "fuchsia")]
5259impl DataRouterSynchronousProxy {
5260    pub fn new(channel: fidl::Channel) -> Self {
5261        Self { client: fidl::client::sync::Client::new(channel) }
5262    }
5263
5264    pub fn into_channel(self) -> fidl::Channel {
5265        self.client.into_channel()
5266    }
5267
5268    /// Waits until an event arrives and returns it. It is safe for other
5269    /// threads to make concurrent requests while waiting for an event.
5270    pub fn wait_for_event(
5271        &self,
5272        deadline: zx::MonotonicInstant,
5273    ) -> Result<DataRouterEvent, fidl::Error> {
5274        DataRouterEvent::decode(self.client.wait_for_event::<DataRouterMarker>(deadline)?)
5275    }
5276
5277    pub fn r#route(
5278        &self,
5279        mut payload: RouteRequest,
5280        ___deadline: zx::MonotonicInstant,
5281    ) -> Result<DataRouterRouteResult, fidl::Error> {
5282        let _response = self.client.send_query::<
5283            RouteRequest,
5284            fidl::encoding::FlexibleResultType<DataRouterRouteResponse, RouterError>,
5285            DataRouterMarker,
5286        >(
5287            &mut payload,
5288            0x2e87dc44dfc53804,
5289            fidl::encoding::DynamicFlags::FLEXIBLE,
5290            ___deadline,
5291        )?
5292        .into_result::<DataRouterMarker>("route")?;
5293        Ok(_response.map(|x| x))
5294    }
5295}
5296
5297#[cfg(target_os = "fuchsia")]
5298impl From<DataRouterSynchronousProxy> for zx::NullableHandle {
5299    fn from(value: DataRouterSynchronousProxy) -> Self {
5300        value.into_channel().into()
5301    }
5302}
5303
5304#[cfg(target_os = "fuchsia")]
5305impl From<fidl::Channel> for DataRouterSynchronousProxy {
5306    fn from(value: fidl::Channel) -> Self {
5307        Self::new(value)
5308    }
5309}
5310
5311#[cfg(target_os = "fuchsia")]
5312impl fidl::endpoints::FromClient for DataRouterSynchronousProxy {
5313    type Protocol = DataRouterMarker;
5314
5315    fn from_client(value: fidl::endpoints::ClientEnd<DataRouterMarker>) -> Self {
5316        Self::new(value.into_channel())
5317    }
5318}
5319
5320#[derive(Debug, Clone)]
5321pub struct DataRouterProxy {
5322    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
5323}
5324
5325impl fidl::endpoints::Proxy for DataRouterProxy {
5326    type Protocol = DataRouterMarker;
5327
5328    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
5329        Self::new(inner)
5330    }
5331
5332    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
5333        self.client.into_channel().map_err(|client| Self { client })
5334    }
5335
5336    fn as_channel(&self) -> &::fidl::AsyncChannel {
5337        self.client.as_channel()
5338    }
5339}
5340
5341impl DataRouterProxy {
5342    /// Create a new Proxy for fuchsia.component.sandbox/DataRouter.
5343    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5344        let protocol_name = <DataRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5345        Self { client: fidl::client::Client::new(channel, protocol_name) }
5346    }
5347
5348    /// Get a Stream of events from the remote end of the protocol.
5349    ///
5350    /// # Panics
5351    ///
5352    /// Panics if the event stream was already taken.
5353    pub fn take_event_stream(&self) -> DataRouterEventStream {
5354        DataRouterEventStream { event_receiver: self.client.take_event_receiver() }
5355    }
5356
5357    pub fn r#route(
5358        &self,
5359        mut payload: RouteRequest,
5360    ) -> fidl::client::QueryResponseFut<
5361        DataRouterRouteResult,
5362        fidl::encoding::DefaultFuchsiaResourceDialect,
5363    > {
5364        DataRouterProxyInterface::r#route(self, payload)
5365    }
5366}
5367
5368impl DataRouterProxyInterface for DataRouterProxy {
5369    type RouteResponseFut = fidl::client::QueryResponseFut<
5370        DataRouterRouteResult,
5371        fidl::encoding::DefaultFuchsiaResourceDialect,
5372    >;
5373    fn r#route(&self, mut payload: RouteRequest) -> Self::RouteResponseFut {
5374        fn _decode(
5375            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5376        ) -> Result<DataRouterRouteResult, fidl::Error> {
5377            let _response = fidl::client::decode_transaction_body::<
5378                fidl::encoding::FlexibleResultType<DataRouterRouteResponse, RouterError>,
5379                fidl::encoding::DefaultFuchsiaResourceDialect,
5380                0x2e87dc44dfc53804,
5381            >(_buf?)?
5382            .into_result::<DataRouterMarker>("route")?;
5383            Ok(_response.map(|x| x))
5384        }
5385        self.client.send_query_and_decode::<RouteRequest, DataRouterRouteResult>(
5386            &mut payload,
5387            0x2e87dc44dfc53804,
5388            fidl::encoding::DynamicFlags::FLEXIBLE,
5389            _decode,
5390        )
5391    }
5392}
5393
5394pub struct DataRouterEventStream {
5395    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
5396}
5397
5398impl std::marker::Unpin for DataRouterEventStream {}
5399
5400impl futures::stream::FusedStream for DataRouterEventStream {
5401    fn is_terminated(&self) -> bool {
5402        self.event_receiver.is_terminated()
5403    }
5404}
5405
5406impl futures::Stream for DataRouterEventStream {
5407    type Item = Result<DataRouterEvent, fidl::Error>;
5408
5409    fn poll_next(
5410        mut self: std::pin::Pin<&mut Self>,
5411        cx: &mut std::task::Context<'_>,
5412    ) -> std::task::Poll<Option<Self::Item>> {
5413        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5414            &mut self.event_receiver,
5415            cx
5416        )?) {
5417            Some(buf) => std::task::Poll::Ready(Some(DataRouterEvent::decode(buf))),
5418            None => std::task::Poll::Ready(None),
5419        }
5420    }
5421}
5422
5423#[derive(Debug)]
5424pub enum DataRouterEvent {
5425    #[non_exhaustive]
5426    _UnknownEvent {
5427        /// Ordinal of the event that was sent.
5428        ordinal: u64,
5429    },
5430}
5431
5432impl DataRouterEvent {
5433    /// Decodes a message buffer as a [`DataRouterEvent`].
5434    fn decode(
5435        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5436    ) -> Result<DataRouterEvent, fidl::Error> {
5437        let (bytes, _handles) = buf.split_mut();
5438        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5439        debug_assert_eq!(tx_header.tx_id, 0);
5440        match tx_header.ordinal {
5441            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
5442                Ok(DataRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
5443            }
5444            _ => Err(fidl::Error::UnknownOrdinal {
5445                ordinal: tx_header.ordinal,
5446                protocol_name: <DataRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5447            }),
5448        }
5449    }
5450}
5451
5452/// A Stream of incoming requests for fuchsia.component.sandbox/DataRouter.
5453pub struct DataRouterRequestStream {
5454    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5455    is_terminated: bool,
5456}
5457
5458impl std::marker::Unpin for DataRouterRequestStream {}
5459
5460impl futures::stream::FusedStream for DataRouterRequestStream {
5461    fn is_terminated(&self) -> bool {
5462        self.is_terminated
5463    }
5464}
5465
5466impl fidl::endpoints::RequestStream for DataRouterRequestStream {
5467    type Protocol = DataRouterMarker;
5468    type ControlHandle = DataRouterControlHandle;
5469
5470    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5471        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5472    }
5473
5474    fn control_handle(&self) -> Self::ControlHandle {
5475        DataRouterControlHandle { inner: self.inner.clone() }
5476    }
5477
5478    fn into_inner(
5479        self,
5480    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5481    {
5482        (self.inner, self.is_terminated)
5483    }
5484
5485    fn from_inner(
5486        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5487        is_terminated: bool,
5488    ) -> Self {
5489        Self { inner, is_terminated }
5490    }
5491}
5492
5493impl futures::Stream for DataRouterRequestStream {
5494    type Item = Result<DataRouterRequest, fidl::Error>;
5495
5496    fn poll_next(
5497        mut self: std::pin::Pin<&mut Self>,
5498        cx: &mut std::task::Context<'_>,
5499    ) -> std::task::Poll<Option<Self::Item>> {
5500        let this = &mut *self;
5501        if this.inner.check_shutdown(cx) {
5502            this.is_terminated = true;
5503            return std::task::Poll::Ready(None);
5504        }
5505        if this.is_terminated {
5506            panic!("polled DataRouterRequestStream after completion");
5507        }
5508        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
5509            |bytes, handles| {
5510                match this.inner.channel().read_etc(cx, bytes, handles) {
5511                    std::task::Poll::Ready(Ok(())) => {}
5512                    std::task::Poll::Pending => return std::task::Poll::Pending,
5513                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
5514                        this.is_terminated = true;
5515                        return std::task::Poll::Ready(None);
5516                    }
5517                    std::task::Poll::Ready(Err(e)) => {
5518                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5519                            e.into(),
5520                        ))));
5521                    }
5522                }
5523
5524                // A message has been received from the channel
5525                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5526
5527                std::task::Poll::Ready(Some(match header.ordinal {
5528                    0x2e87dc44dfc53804 => {
5529                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5530                        let mut req = fidl::new_empty!(
5531                            RouteRequest,
5532                            fidl::encoding::DefaultFuchsiaResourceDialect
5533                        );
5534                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RouteRequest>(&header, _body_bytes, handles, &mut req)?;
5535                        let control_handle = DataRouterControlHandle { inner: this.inner.clone() };
5536                        Ok(DataRouterRequest::Route {
5537                            payload: req,
5538                            responder: DataRouterRouteResponder {
5539                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5540                                tx_id: header.tx_id,
5541                            },
5542                        })
5543                    }
5544                    _ if header.tx_id == 0
5545                        && header
5546                            .dynamic_flags()
5547                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5548                    {
5549                        Ok(DataRouterRequest::_UnknownMethod {
5550                            ordinal: header.ordinal,
5551                            control_handle: DataRouterControlHandle { inner: this.inner.clone() },
5552                            method_type: fidl::MethodType::OneWay,
5553                        })
5554                    }
5555                    _ if header
5556                        .dynamic_flags()
5557                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5558                    {
5559                        this.inner.send_framework_err(
5560                            fidl::encoding::FrameworkErr::UnknownMethod,
5561                            header.tx_id,
5562                            header.ordinal,
5563                            header.dynamic_flags(),
5564                            (bytes, handles),
5565                        )?;
5566                        Ok(DataRouterRequest::_UnknownMethod {
5567                            ordinal: header.ordinal,
5568                            control_handle: DataRouterControlHandle { inner: this.inner.clone() },
5569                            method_type: fidl::MethodType::TwoWay,
5570                        })
5571                    }
5572                    _ => Err(fidl::Error::UnknownOrdinal {
5573                        ordinal: header.ordinal,
5574                        protocol_name:
5575                            <DataRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5576                    }),
5577                }))
5578            },
5579        )
5580    }
5581}
5582
5583#[derive(Debug)]
5584pub enum DataRouterRequest {
5585    Route {
5586        payload: RouteRequest,
5587        responder: DataRouterRouteResponder,
5588    },
5589    /// An interaction was received which does not match any known method.
5590    #[non_exhaustive]
5591    _UnknownMethod {
5592        /// Ordinal of the method that was called.
5593        ordinal: u64,
5594        control_handle: DataRouterControlHandle,
5595        method_type: fidl::MethodType,
5596    },
5597}
5598
5599impl DataRouterRequest {
5600    #[allow(irrefutable_let_patterns)]
5601    pub fn into_route(self) -> Option<(RouteRequest, DataRouterRouteResponder)> {
5602        if let DataRouterRequest::Route { payload, responder } = self {
5603            Some((payload, responder))
5604        } else {
5605            None
5606        }
5607    }
5608
5609    /// Name of the method defined in FIDL
5610    pub fn method_name(&self) -> &'static str {
5611        match *self {
5612            DataRouterRequest::Route { .. } => "route",
5613            DataRouterRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
5614                "unknown one-way method"
5615            }
5616            DataRouterRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
5617                "unknown two-way method"
5618            }
5619        }
5620    }
5621}
5622
5623#[derive(Debug, Clone)]
5624pub struct DataRouterControlHandle {
5625    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5626}
5627
5628impl DataRouterControlHandle {
5629    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
5630        self.inner.shutdown_with_epitaph(status.into())
5631    }
5632}
5633
5634impl fidl::endpoints::ControlHandle for DataRouterControlHandle {
5635    fn shutdown(&self) {
5636        self.inner.shutdown()
5637    }
5638
5639    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
5640        self.inner.shutdown_with_epitaph(status)
5641    }
5642
5643    fn is_closed(&self) -> bool {
5644        self.inner.channel().is_closed()
5645    }
5646    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
5647        self.inner.channel().on_closed()
5648    }
5649
5650    #[cfg(target_os = "fuchsia")]
5651    fn signal_peer(
5652        &self,
5653        clear_mask: zx::Signals,
5654        set_mask: zx::Signals,
5655    ) -> Result<(), zx_status::Status> {
5656        use fidl::Peered;
5657        self.inner.channel().signal_peer(clear_mask, set_mask)
5658    }
5659}
5660
5661impl DataRouterControlHandle {}
5662
5663#[must_use = "FIDL methods require a response to be sent"]
5664#[derive(Debug)]
5665pub struct DataRouterRouteResponder {
5666    control_handle: std::mem::ManuallyDrop<DataRouterControlHandle>,
5667    tx_id: u32,
5668}
5669
5670/// Set the the channel to be shutdown (see [`DataRouterControlHandle::shutdown`])
5671/// if the responder is dropped without sending a response, so that the client
5672/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5673impl std::ops::Drop for DataRouterRouteResponder {
5674    fn drop(&mut self) {
5675        self.control_handle.shutdown();
5676        // Safety: drops once, never accessed again
5677        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5678    }
5679}
5680
5681impl fidl::endpoints::Responder for DataRouterRouteResponder {
5682    type ControlHandle = DataRouterControlHandle;
5683
5684    fn control_handle(&self) -> &DataRouterControlHandle {
5685        &self.control_handle
5686    }
5687
5688    fn drop_without_shutdown(mut self) {
5689        // Safety: drops once, never accessed again due to mem::forget
5690        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5691        // Prevent Drop from running (which would shut down the channel)
5692        std::mem::forget(self);
5693    }
5694}
5695
5696impl DataRouterRouteResponder {
5697    /// Sends a response to the FIDL transaction.
5698    ///
5699    /// Sets the channel to shutdown if an error occurs.
5700    pub fn send(
5701        self,
5702        mut result: Result<DataRouterRouteResponse, RouterError>,
5703    ) -> Result<(), fidl::Error> {
5704        let _result = self.send_raw(result);
5705        if _result.is_err() {
5706            self.control_handle.shutdown();
5707        }
5708        self.drop_without_shutdown();
5709        _result
5710    }
5711
5712    /// Similar to "send" but does not shutdown the channel if an error occurs.
5713    pub fn send_no_shutdown_on_err(
5714        self,
5715        mut result: Result<DataRouterRouteResponse, RouterError>,
5716    ) -> Result<(), fidl::Error> {
5717        let _result = self.send_raw(result);
5718        self.drop_without_shutdown();
5719        _result
5720    }
5721
5722    fn send_raw(
5723        &self,
5724        mut result: Result<DataRouterRouteResponse, RouterError>,
5725    ) -> Result<(), fidl::Error> {
5726        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
5727            DataRouterRouteResponse,
5728            RouterError,
5729        >>(
5730            fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
5731            self.tx_id,
5732            0x2e87dc44dfc53804,
5733            fidl::encoding::DynamicFlags::FLEXIBLE,
5734        )
5735    }
5736}
5737
5738#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5739pub struct DictionaryMarker;
5740
5741impl fidl::endpoints::ProtocolMarker for DictionaryMarker {
5742    type Proxy = DictionaryProxy;
5743    type RequestStream = DictionaryRequestStream;
5744    #[cfg(target_os = "fuchsia")]
5745    type SynchronousProxy = DictionarySynchronousProxy;
5746
5747    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.Dictionary";
5748}
5749impl fidl::endpoints::DiscoverableProtocolMarker for DictionaryMarker {}
5750
5751pub trait DictionaryProxyInterface: Send + Sync {}
5752#[derive(Debug)]
5753#[cfg(target_os = "fuchsia")]
5754pub struct DictionarySynchronousProxy {
5755    client: fidl::client::sync::Client,
5756}
5757
5758#[cfg(target_os = "fuchsia")]
5759impl fidl::endpoints::SynchronousProxy for DictionarySynchronousProxy {
5760    type Proxy = DictionaryProxy;
5761    type Protocol = DictionaryMarker;
5762
5763    fn from_channel(inner: fidl::Channel) -> Self {
5764        Self::new(inner)
5765    }
5766
5767    fn into_channel(self) -> fidl::Channel {
5768        self.client.into_channel()
5769    }
5770
5771    fn as_channel(&self) -> &fidl::Channel {
5772        self.client.as_channel()
5773    }
5774}
5775
5776#[cfg(target_os = "fuchsia")]
5777impl DictionarySynchronousProxy {
5778    pub fn new(channel: fidl::Channel) -> Self {
5779        Self { client: fidl::client::sync::Client::new(channel) }
5780    }
5781
5782    pub fn into_channel(self) -> fidl::Channel {
5783        self.client.into_channel()
5784    }
5785
5786    /// Waits until an event arrives and returns it. It is safe for other
5787    /// threads to make concurrent requests while waiting for an event.
5788    pub fn wait_for_event(
5789        &self,
5790        deadline: zx::MonotonicInstant,
5791    ) -> Result<DictionaryEvent, fidl::Error> {
5792        DictionaryEvent::decode(self.client.wait_for_event::<DictionaryMarker>(deadline)?)
5793    }
5794}
5795
5796#[cfg(target_os = "fuchsia")]
5797impl From<DictionarySynchronousProxy> for zx::NullableHandle {
5798    fn from(value: DictionarySynchronousProxy) -> Self {
5799        value.into_channel().into()
5800    }
5801}
5802
5803#[cfg(target_os = "fuchsia")]
5804impl From<fidl::Channel> for DictionarySynchronousProxy {
5805    fn from(value: fidl::Channel) -> Self {
5806        Self::new(value)
5807    }
5808}
5809
5810#[cfg(target_os = "fuchsia")]
5811impl fidl::endpoints::FromClient for DictionarySynchronousProxy {
5812    type Protocol = DictionaryMarker;
5813
5814    fn from_client(value: fidl::endpoints::ClientEnd<DictionaryMarker>) -> Self {
5815        Self::new(value.into_channel())
5816    }
5817}
5818
5819#[derive(Debug, Clone)]
5820pub struct DictionaryProxy {
5821    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
5822}
5823
5824impl fidl::endpoints::Proxy for DictionaryProxy {
5825    type Protocol = DictionaryMarker;
5826
5827    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
5828        Self::new(inner)
5829    }
5830
5831    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
5832        self.client.into_channel().map_err(|client| Self { client })
5833    }
5834
5835    fn as_channel(&self) -> &::fidl::AsyncChannel {
5836        self.client.as_channel()
5837    }
5838}
5839
5840impl DictionaryProxy {
5841    /// Create a new Proxy for fuchsia.component.sandbox/Dictionary.
5842    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5843        let protocol_name = <DictionaryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5844        Self { client: fidl::client::Client::new(channel, protocol_name) }
5845    }
5846
5847    /// Get a Stream of events from the remote end of the protocol.
5848    ///
5849    /// # Panics
5850    ///
5851    /// Panics if the event stream was already taken.
5852    pub fn take_event_stream(&self) -> DictionaryEventStream {
5853        DictionaryEventStream { event_receiver: self.client.take_event_receiver() }
5854    }
5855}
5856
5857impl DictionaryProxyInterface for DictionaryProxy {}
5858
5859pub struct DictionaryEventStream {
5860    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
5861}
5862
5863impl std::marker::Unpin for DictionaryEventStream {}
5864
5865impl futures::stream::FusedStream for DictionaryEventStream {
5866    fn is_terminated(&self) -> bool {
5867        self.event_receiver.is_terminated()
5868    }
5869}
5870
5871impl futures::Stream for DictionaryEventStream {
5872    type Item = Result<DictionaryEvent, fidl::Error>;
5873
5874    fn poll_next(
5875        mut self: std::pin::Pin<&mut Self>,
5876        cx: &mut std::task::Context<'_>,
5877    ) -> std::task::Poll<Option<Self::Item>> {
5878        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5879            &mut self.event_receiver,
5880            cx
5881        )?) {
5882            Some(buf) => std::task::Poll::Ready(Some(DictionaryEvent::decode(buf))),
5883            None => std::task::Poll::Ready(None),
5884        }
5885    }
5886}
5887
5888#[derive(Debug)]
5889pub enum DictionaryEvent {
5890    #[non_exhaustive]
5891    _UnknownEvent {
5892        /// Ordinal of the event that was sent.
5893        ordinal: u64,
5894    },
5895}
5896
5897impl DictionaryEvent {
5898    /// Decodes a message buffer as a [`DictionaryEvent`].
5899    fn decode(
5900        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5901    ) -> Result<DictionaryEvent, fidl::Error> {
5902        let (bytes, _handles) = buf.split_mut();
5903        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5904        debug_assert_eq!(tx_header.tx_id, 0);
5905        match tx_header.ordinal {
5906            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
5907                Ok(DictionaryEvent::_UnknownEvent { ordinal: tx_header.ordinal })
5908            }
5909            _ => Err(fidl::Error::UnknownOrdinal {
5910                ordinal: tx_header.ordinal,
5911                protocol_name: <DictionaryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5912            }),
5913        }
5914    }
5915}
5916
5917/// A Stream of incoming requests for fuchsia.component.sandbox/Dictionary.
5918pub struct DictionaryRequestStream {
5919    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5920    is_terminated: bool,
5921}
5922
5923impl std::marker::Unpin for DictionaryRequestStream {}
5924
5925impl futures::stream::FusedStream for DictionaryRequestStream {
5926    fn is_terminated(&self) -> bool {
5927        self.is_terminated
5928    }
5929}
5930
5931impl fidl::endpoints::RequestStream for DictionaryRequestStream {
5932    type Protocol = DictionaryMarker;
5933    type ControlHandle = DictionaryControlHandle;
5934
5935    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5936        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5937    }
5938
5939    fn control_handle(&self) -> Self::ControlHandle {
5940        DictionaryControlHandle { inner: self.inner.clone() }
5941    }
5942
5943    fn into_inner(
5944        self,
5945    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5946    {
5947        (self.inner, self.is_terminated)
5948    }
5949
5950    fn from_inner(
5951        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5952        is_terminated: bool,
5953    ) -> Self {
5954        Self { inner, is_terminated }
5955    }
5956}
5957
5958impl futures::Stream for DictionaryRequestStream {
5959    type Item = Result<DictionaryRequest, fidl::Error>;
5960
5961    fn poll_next(
5962        mut self: std::pin::Pin<&mut Self>,
5963        cx: &mut std::task::Context<'_>,
5964    ) -> std::task::Poll<Option<Self::Item>> {
5965        let this = &mut *self;
5966        if this.inner.check_shutdown(cx) {
5967            this.is_terminated = true;
5968            return std::task::Poll::Ready(None);
5969        }
5970        if this.is_terminated {
5971            panic!("polled DictionaryRequestStream after completion");
5972        }
5973        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
5974            |bytes, handles| {
5975                match this.inner.channel().read_etc(cx, bytes, handles) {
5976                    std::task::Poll::Ready(Ok(())) => {}
5977                    std::task::Poll::Pending => return std::task::Poll::Pending,
5978                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
5979                        this.is_terminated = true;
5980                        return std::task::Poll::Ready(None);
5981                    }
5982                    std::task::Poll::Ready(Err(e)) => {
5983                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5984                            e.into(),
5985                        ))));
5986                    }
5987                }
5988
5989                // A message has been received from the channel
5990                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5991
5992                std::task::Poll::Ready(Some(match header.ordinal {
5993                    _ if header.tx_id == 0
5994                        && header
5995                            .dynamic_flags()
5996                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5997                    {
5998                        Ok(DictionaryRequest::_UnknownMethod {
5999                            ordinal: header.ordinal,
6000                            control_handle: DictionaryControlHandle { inner: this.inner.clone() },
6001                            method_type: fidl::MethodType::OneWay,
6002                        })
6003                    }
6004                    _ if header
6005                        .dynamic_flags()
6006                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
6007                    {
6008                        this.inner.send_framework_err(
6009                            fidl::encoding::FrameworkErr::UnknownMethod,
6010                            header.tx_id,
6011                            header.ordinal,
6012                            header.dynamic_flags(),
6013                            (bytes, handles),
6014                        )?;
6015                        Ok(DictionaryRequest::_UnknownMethod {
6016                            ordinal: header.ordinal,
6017                            control_handle: DictionaryControlHandle { inner: this.inner.clone() },
6018                            method_type: fidl::MethodType::TwoWay,
6019                        })
6020                    }
6021                    _ => Err(fidl::Error::UnknownOrdinal {
6022                        ordinal: header.ordinal,
6023                        protocol_name:
6024                            <DictionaryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6025                    }),
6026                }))
6027            },
6028        )
6029    }
6030}
6031
6032#[derive(Debug)]
6033pub enum DictionaryRequest {
6034    /// An interaction was received which does not match any known method.
6035    #[non_exhaustive]
6036    _UnknownMethod {
6037        /// Ordinal of the method that was called.
6038        ordinal: u64,
6039        control_handle: DictionaryControlHandle,
6040        method_type: fidl::MethodType,
6041    },
6042}
6043
6044impl DictionaryRequest {
6045    /// Name of the method defined in FIDL
6046    pub fn method_name(&self) -> &'static str {
6047        match *self {
6048            DictionaryRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
6049                "unknown one-way method"
6050            }
6051            DictionaryRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
6052                "unknown two-way method"
6053            }
6054        }
6055    }
6056}
6057
6058#[derive(Debug, Clone)]
6059pub struct DictionaryControlHandle {
6060    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6061}
6062
6063impl DictionaryControlHandle {
6064    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
6065        self.inner.shutdown_with_epitaph(status.into())
6066    }
6067}
6068
6069impl fidl::endpoints::ControlHandle for DictionaryControlHandle {
6070    fn shutdown(&self) {
6071        self.inner.shutdown()
6072    }
6073
6074    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
6075        self.inner.shutdown_with_epitaph(status)
6076    }
6077
6078    fn is_closed(&self) -> bool {
6079        self.inner.channel().is_closed()
6080    }
6081    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6082        self.inner.channel().on_closed()
6083    }
6084
6085    #[cfg(target_os = "fuchsia")]
6086    fn signal_peer(
6087        &self,
6088        clear_mask: zx::Signals,
6089        set_mask: zx::Signals,
6090    ) -> Result<(), zx_status::Status> {
6091        use fidl::Peered;
6092        self.inner.channel().signal_peer(clear_mask, set_mask)
6093    }
6094}
6095
6096impl DictionaryControlHandle {}
6097
6098#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6099pub struct DictionaryDrainIteratorMarker;
6100
6101impl fidl::endpoints::ProtocolMarker for DictionaryDrainIteratorMarker {
6102    type Proxy = DictionaryDrainIteratorProxy;
6103    type RequestStream = DictionaryDrainIteratorRequestStream;
6104    #[cfg(target_os = "fuchsia")]
6105    type SynchronousProxy = DictionaryDrainIteratorSynchronousProxy;
6106
6107    const DEBUG_NAME: &'static str = "(anonymous) DictionaryDrainIterator";
6108}
6109pub type DictionaryDrainIteratorGetNextResult =
6110    Result<(Vec<DictionaryItem>, u64), CapabilityStoreError>;
6111
6112pub trait DictionaryDrainIteratorProxyInterface: Send + Sync {
6113    type GetNextResponseFut: std::future::Future<Output = Result<DictionaryDrainIteratorGetNextResult, fidl::Error>>
6114        + Send;
6115    fn r#get_next(&self, start_id: u64, limit: u32) -> Self::GetNextResponseFut;
6116}
6117#[derive(Debug)]
6118#[cfg(target_os = "fuchsia")]
6119pub struct DictionaryDrainIteratorSynchronousProxy {
6120    client: fidl::client::sync::Client,
6121}
6122
6123#[cfg(target_os = "fuchsia")]
6124impl fidl::endpoints::SynchronousProxy for DictionaryDrainIteratorSynchronousProxy {
6125    type Proxy = DictionaryDrainIteratorProxy;
6126    type Protocol = DictionaryDrainIteratorMarker;
6127
6128    fn from_channel(inner: fidl::Channel) -> Self {
6129        Self::new(inner)
6130    }
6131
6132    fn into_channel(self) -> fidl::Channel {
6133        self.client.into_channel()
6134    }
6135
6136    fn as_channel(&self) -> &fidl::Channel {
6137        self.client.as_channel()
6138    }
6139}
6140
6141#[cfg(target_os = "fuchsia")]
6142impl DictionaryDrainIteratorSynchronousProxy {
6143    pub fn new(channel: fidl::Channel) -> Self {
6144        Self { client: fidl::client::sync::Client::new(channel) }
6145    }
6146
6147    pub fn into_channel(self) -> fidl::Channel {
6148        self.client.into_channel()
6149    }
6150
6151    /// Waits until an event arrives and returns it. It is safe for other
6152    /// threads to make concurrent requests while waiting for an event.
6153    pub fn wait_for_event(
6154        &self,
6155        deadline: zx::MonotonicInstant,
6156    ) -> Result<DictionaryDrainIteratorEvent, fidl::Error> {
6157        DictionaryDrainIteratorEvent::decode(
6158            self.client.wait_for_event::<DictionaryDrainIteratorMarker>(deadline)?,
6159        )
6160    }
6161
6162    /// Returns the next batch of results for a [Dictionary.Drain] call, returning up to
6163    /// `limit` results. `limit` can be at most [MAX_DICTIONARY_ITERATOR_CHUNK].
6164    ///
6165    /// Each returned capability will be assigned a monotonically increasing [CapabilityId] starting
6166    /// from `start_id`.
6167    ///
6168    /// In addition to the `items`, returns `end_id`, which is one more than the highest id reserved
6169    /// by [GetNext]. `end_id` can be used as the `start_id` for the next call to [GetNext].
6170    ///
6171    /// If [GetNext] returns an error, the server will also close the channel.
6172    ///
6173    /// Errors:
6174    ///
6175    /// - `ID_ALREADY_EXISTS` if some id in the range `[start_id, limit)` already exists in this
6176    ///   store.
6177    /// - `INVALID_ARGS` if `limit` was `0` or greater than `MAX_DICTIONARY_ITERATOR_CHUNK`.
6178    pub fn r#get_next(
6179        &self,
6180        mut start_id: u64,
6181        mut limit: u32,
6182        ___deadline: zx::MonotonicInstant,
6183    ) -> Result<DictionaryDrainIteratorGetNextResult, fidl::Error> {
6184        let _response = self
6185            .client
6186            .send_query::<DictionaryDrainIteratorGetNextRequest, fidl::encoding::FlexibleResultType<
6187                DictionaryDrainIteratorGetNextResponse,
6188                CapabilityStoreError,
6189            >, DictionaryDrainIteratorMarker>(
6190                (start_id, limit),
6191                0x4f8082ca1ee26061,
6192                fidl::encoding::DynamicFlags::FLEXIBLE,
6193                ___deadline,
6194            )?
6195            .into_result::<DictionaryDrainIteratorMarker>("get_next")?;
6196        Ok(_response.map(|x| (x.items, x.end_id)))
6197    }
6198}
6199
6200#[cfg(target_os = "fuchsia")]
6201impl From<DictionaryDrainIteratorSynchronousProxy> for zx::NullableHandle {
6202    fn from(value: DictionaryDrainIteratorSynchronousProxy) -> Self {
6203        value.into_channel().into()
6204    }
6205}
6206
6207#[cfg(target_os = "fuchsia")]
6208impl From<fidl::Channel> for DictionaryDrainIteratorSynchronousProxy {
6209    fn from(value: fidl::Channel) -> Self {
6210        Self::new(value)
6211    }
6212}
6213
6214#[cfg(target_os = "fuchsia")]
6215impl fidl::endpoints::FromClient for DictionaryDrainIteratorSynchronousProxy {
6216    type Protocol = DictionaryDrainIteratorMarker;
6217
6218    fn from_client(value: fidl::endpoints::ClientEnd<DictionaryDrainIteratorMarker>) -> Self {
6219        Self::new(value.into_channel())
6220    }
6221}
6222
6223#[derive(Debug, Clone)]
6224pub struct DictionaryDrainIteratorProxy {
6225    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6226}
6227
6228impl fidl::endpoints::Proxy for DictionaryDrainIteratorProxy {
6229    type Protocol = DictionaryDrainIteratorMarker;
6230
6231    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6232        Self::new(inner)
6233    }
6234
6235    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6236        self.client.into_channel().map_err(|client| Self { client })
6237    }
6238
6239    fn as_channel(&self) -> &::fidl::AsyncChannel {
6240        self.client.as_channel()
6241    }
6242}
6243
6244impl DictionaryDrainIteratorProxy {
6245    /// Create a new Proxy for fuchsia.component.sandbox/DictionaryDrainIterator.
6246    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6247        let protocol_name =
6248            <DictionaryDrainIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6249        Self { client: fidl::client::Client::new(channel, protocol_name) }
6250    }
6251
6252    /// Get a Stream of events from the remote end of the protocol.
6253    ///
6254    /// # Panics
6255    ///
6256    /// Panics if the event stream was already taken.
6257    pub fn take_event_stream(&self) -> DictionaryDrainIteratorEventStream {
6258        DictionaryDrainIteratorEventStream { event_receiver: self.client.take_event_receiver() }
6259    }
6260
6261    /// Returns the next batch of results for a [Dictionary.Drain] call, returning up to
6262    /// `limit` results. `limit` can be at most [MAX_DICTIONARY_ITERATOR_CHUNK].
6263    ///
6264    /// Each returned capability will be assigned a monotonically increasing [CapabilityId] starting
6265    /// from `start_id`.
6266    ///
6267    /// In addition to the `items`, returns `end_id`, which is one more than the highest id reserved
6268    /// by [GetNext]. `end_id` can be used as the `start_id` for the next call to [GetNext].
6269    ///
6270    /// If [GetNext] returns an error, the server will also close the channel.
6271    ///
6272    /// Errors:
6273    ///
6274    /// - `ID_ALREADY_EXISTS` if some id in the range `[start_id, limit)` already exists in this
6275    ///   store.
6276    /// - `INVALID_ARGS` if `limit` was `0` or greater than `MAX_DICTIONARY_ITERATOR_CHUNK`.
6277    pub fn r#get_next(
6278        &self,
6279        mut start_id: u64,
6280        mut limit: u32,
6281    ) -> fidl::client::QueryResponseFut<
6282        DictionaryDrainIteratorGetNextResult,
6283        fidl::encoding::DefaultFuchsiaResourceDialect,
6284    > {
6285        DictionaryDrainIteratorProxyInterface::r#get_next(self, start_id, limit)
6286    }
6287}
6288
6289impl DictionaryDrainIteratorProxyInterface for DictionaryDrainIteratorProxy {
6290    type GetNextResponseFut = fidl::client::QueryResponseFut<
6291        DictionaryDrainIteratorGetNextResult,
6292        fidl::encoding::DefaultFuchsiaResourceDialect,
6293    >;
6294    fn r#get_next(&self, mut start_id: u64, mut limit: u32) -> Self::GetNextResponseFut {
6295        fn _decode(
6296            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6297        ) -> Result<DictionaryDrainIteratorGetNextResult, fidl::Error> {
6298            let _response = fidl::client::decode_transaction_body::<
6299                fidl::encoding::FlexibleResultType<
6300                    DictionaryDrainIteratorGetNextResponse,
6301                    CapabilityStoreError,
6302                >,
6303                fidl::encoding::DefaultFuchsiaResourceDialect,
6304                0x4f8082ca1ee26061,
6305            >(_buf?)?
6306            .into_result::<DictionaryDrainIteratorMarker>("get_next")?;
6307            Ok(_response.map(|x| (x.items, x.end_id)))
6308        }
6309        self.client.send_query_and_decode::<
6310            DictionaryDrainIteratorGetNextRequest,
6311            DictionaryDrainIteratorGetNextResult,
6312        >(
6313            (start_id, limit,),
6314            0x4f8082ca1ee26061,
6315            fidl::encoding::DynamicFlags::FLEXIBLE,
6316            _decode,
6317        )
6318    }
6319}
6320
6321pub struct DictionaryDrainIteratorEventStream {
6322    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6323}
6324
6325impl std::marker::Unpin for DictionaryDrainIteratorEventStream {}
6326
6327impl futures::stream::FusedStream for DictionaryDrainIteratorEventStream {
6328    fn is_terminated(&self) -> bool {
6329        self.event_receiver.is_terminated()
6330    }
6331}
6332
6333impl futures::Stream for DictionaryDrainIteratorEventStream {
6334    type Item = Result<DictionaryDrainIteratorEvent, fidl::Error>;
6335
6336    fn poll_next(
6337        mut self: std::pin::Pin<&mut Self>,
6338        cx: &mut std::task::Context<'_>,
6339    ) -> std::task::Poll<Option<Self::Item>> {
6340        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6341            &mut self.event_receiver,
6342            cx
6343        )?) {
6344            Some(buf) => std::task::Poll::Ready(Some(DictionaryDrainIteratorEvent::decode(buf))),
6345            None => std::task::Poll::Ready(None),
6346        }
6347    }
6348}
6349
6350#[derive(Debug)]
6351pub enum DictionaryDrainIteratorEvent {
6352    #[non_exhaustive]
6353    _UnknownEvent {
6354        /// Ordinal of the event that was sent.
6355        ordinal: u64,
6356    },
6357}
6358
6359impl DictionaryDrainIteratorEvent {
6360    /// Decodes a message buffer as a [`DictionaryDrainIteratorEvent`].
6361    fn decode(
6362        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6363    ) -> Result<DictionaryDrainIteratorEvent, fidl::Error> {
6364        let (bytes, _handles) = buf.split_mut();
6365        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6366        debug_assert_eq!(tx_header.tx_id, 0);
6367        match tx_header.ordinal {
6368            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6369                Ok(DictionaryDrainIteratorEvent::_UnknownEvent { ordinal: tx_header.ordinal })
6370            }
6371            _ => Err(fidl::Error::UnknownOrdinal {
6372                ordinal: tx_header.ordinal,
6373                protocol_name:
6374                    <DictionaryDrainIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6375            }),
6376        }
6377    }
6378}
6379
6380/// A Stream of incoming requests for fuchsia.component.sandbox/DictionaryDrainIterator.
6381pub struct DictionaryDrainIteratorRequestStream {
6382    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6383    is_terminated: bool,
6384}
6385
6386impl std::marker::Unpin for DictionaryDrainIteratorRequestStream {}
6387
6388impl futures::stream::FusedStream for DictionaryDrainIteratorRequestStream {
6389    fn is_terminated(&self) -> bool {
6390        self.is_terminated
6391    }
6392}
6393
6394impl fidl::endpoints::RequestStream for DictionaryDrainIteratorRequestStream {
6395    type Protocol = DictionaryDrainIteratorMarker;
6396    type ControlHandle = DictionaryDrainIteratorControlHandle;
6397
6398    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6399        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6400    }
6401
6402    fn control_handle(&self) -> Self::ControlHandle {
6403        DictionaryDrainIteratorControlHandle { inner: self.inner.clone() }
6404    }
6405
6406    fn into_inner(
6407        self,
6408    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6409    {
6410        (self.inner, self.is_terminated)
6411    }
6412
6413    fn from_inner(
6414        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6415        is_terminated: bool,
6416    ) -> Self {
6417        Self { inner, is_terminated }
6418    }
6419}
6420
6421impl futures::Stream for DictionaryDrainIteratorRequestStream {
6422    type Item = Result<DictionaryDrainIteratorRequest, fidl::Error>;
6423
6424    fn poll_next(
6425        mut self: std::pin::Pin<&mut Self>,
6426        cx: &mut std::task::Context<'_>,
6427    ) -> std::task::Poll<Option<Self::Item>> {
6428        let this = &mut *self;
6429        if this.inner.check_shutdown(cx) {
6430            this.is_terminated = true;
6431            return std::task::Poll::Ready(None);
6432        }
6433        if this.is_terminated {
6434            panic!("polled DictionaryDrainIteratorRequestStream after completion");
6435        }
6436        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
6437            |bytes, handles| {
6438                match this.inner.channel().read_etc(cx, bytes, handles) {
6439                    std::task::Poll::Ready(Ok(())) => {}
6440                    std::task::Poll::Pending => return std::task::Poll::Pending,
6441                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
6442                        this.is_terminated = true;
6443                        return std::task::Poll::Ready(None);
6444                    }
6445                    std::task::Poll::Ready(Err(e)) => {
6446                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6447                            e.into(),
6448                        ))));
6449                    }
6450                }
6451
6452                // A message has been received from the channel
6453                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6454
6455                std::task::Poll::Ready(Some(match header.ordinal {
6456                0x4f8082ca1ee26061 => {
6457                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6458                    let mut req = fidl::new_empty!(DictionaryDrainIteratorGetNextRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
6459                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DictionaryDrainIteratorGetNextRequest>(&header, _body_bytes, handles, &mut req)?;
6460                    let control_handle = DictionaryDrainIteratorControlHandle {
6461                        inner: this.inner.clone(),
6462                    };
6463                    Ok(DictionaryDrainIteratorRequest::GetNext {start_id: req.start_id,
6464limit: req.limit,
6465
6466                        responder: DictionaryDrainIteratorGetNextResponder {
6467                            control_handle: std::mem::ManuallyDrop::new(control_handle),
6468                            tx_id: header.tx_id,
6469                        },
6470                    })
6471                }
6472                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6473                    Ok(DictionaryDrainIteratorRequest::_UnknownMethod {
6474                        ordinal: header.ordinal,
6475                        control_handle: DictionaryDrainIteratorControlHandle { inner: this.inner.clone() },
6476                        method_type: fidl::MethodType::OneWay,
6477                    })
6478                }
6479                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6480                    this.inner.send_framework_err(
6481                        fidl::encoding::FrameworkErr::UnknownMethod,
6482                        header.tx_id,
6483                        header.ordinal,
6484                        header.dynamic_flags(),
6485                        (bytes, handles),
6486                    )?;
6487                    Ok(DictionaryDrainIteratorRequest::_UnknownMethod {
6488                        ordinal: header.ordinal,
6489                        control_handle: DictionaryDrainIteratorControlHandle { inner: this.inner.clone() },
6490                        method_type: fidl::MethodType::TwoWay,
6491                    })
6492                }
6493                _ => Err(fidl::Error::UnknownOrdinal {
6494                    ordinal: header.ordinal,
6495                    protocol_name: <DictionaryDrainIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6496                }),
6497            }))
6498            },
6499        )
6500    }
6501}
6502
6503#[derive(Debug)]
6504pub enum DictionaryDrainIteratorRequest {
6505    /// Returns the next batch of results for a [Dictionary.Drain] call, returning up to
6506    /// `limit` results. `limit` can be at most [MAX_DICTIONARY_ITERATOR_CHUNK].
6507    ///
6508    /// Each returned capability will be assigned a monotonically increasing [CapabilityId] starting
6509    /// from `start_id`.
6510    ///
6511    /// In addition to the `items`, returns `end_id`, which is one more than the highest id reserved
6512    /// by [GetNext]. `end_id` can be used as the `start_id` for the next call to [GetNext].
6513    ///
6514    /// If [GetNext] returns an error, the server will also close the channel.
6515    ///
6516    /// Errors:
6517    ///
6518    /// - `ID_ALREADY_EXISTS` if some id in the range `[start_id, limit)` already exists in this
6519    ///   store.
6520    /// - `INVALID_ARGS` if `limit` was `0` or greater than `MAX_DICTIONARY_ITERATOR_CHUNK`.
6521    GetNext { start_id: u64, limit: u32, responder: DictionaryDrainIteratorGetNextResponder },
6522    /// An interaction was received which does not match any known method.
6523    #[non_exhaustive]
6524    _UnknownMethod {
6525        /// Ordinal of the method that was called.
6526        ordinal: u64,
6527        control_handle: DictionaryDrainIteratorControlHandle,
6528        method_type: fidl::MethodType,
6529    },
6530}
6531
6532impl DictionaryDrainIteratorRequest {
6533    #[allow(irrefutable_let_patterns)]
6534    pub fn into_get_next(self) -> Option<(u64, u32, DictionaryDrainIteratorGetNextResponder)> {
6535        if let DictionaryDrainIteratorRequest::GetNext { start_id, limit, responder } = self {
6536            Some((start_id, limit, responder))
6537        } else {
6538            None
6539        }
6540    }
6541
6542    /// Name of the method defined in FIDL
6543    pub fn method_name(&self) -> &'static str {
6544        match *self {
6545            DictionaryDrainIteratorRequest::GetNext { .. } => "get_next",
6546            DictionaryDrainIteratorRequest::_UnknownMethod {
6547                method_type: fidl::MethodType::OneWay,
6548                ..
6549            } => "unknown one-way method",
6550            DictionaryDrainIteratorRequest::_UnknownMethod {
6551                method_type: fidl::MethodType::TwoWay,
6552                ..
6553            } => "unknown two-way method",
6554        }
6555    }
6556}
6557
6558#[derive(Debug, Clone)]
6559pub struct DictionaryDrainIteratorControlHandle {
6560    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6561}
6562
6563impl DictionaryDrainIteratorControlHandle {
6564    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
6565        self.inner.shutdown_with_epitaph(status.into())
6566    }
6567}
6568
6569impl fidl::endpoints::ControlHandle for DictionaryDrainIteratorControlHandle {
6570    fn shutdown(&self) {
6571        self.inner.shutdown()
6572    }
6573
6574    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
6575        self.inner.shutdown_with_epitaph(status)
6576    }
6577
6578    fn is_closed(&self) -> bool {
6579        self.inner.channel().is_closed()
6580    }
6581    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6582        self.inner.channel().on_closed()
6583    }
6584
6585    #[cfg(target_os = "fuchsia")]
6586    fn signal_peer(
6587        &self,
6588        clear_mask: zx::Signals,
6589        set_mask: zx::Signals,
6590    ) -> Result<(), zx_status::Status> {
6591        use fidl::Peered;
6592        self.inner.channel().signal_peer(clear_mask, set_mask)
6593    }
6594}
6595
6596impl DictionaryDrainIteratorControlHandle {}
6597
6598#[must_use = "FIDL methods require a response to be sent"]
6599#[derive(Debug)]
6600pub struct DictionaryDrainIteratorGetNextResponder {
6601    control_handle: std::mem::ManuallyDrop<DictionaryDrainIteratorControlHandle>,
6602    tx_id: u32,
6603}
6604
6605/// Set the the channel to be shutdown (see [`DictionaryDrainIteratorControlHandle::shutdown`])
6606/// if the responder is dropped without sending a response, so that the client
6607/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6608impl std::ops::Drop for DictionaryDrainIteratorGetNextResponder {
6609    fn drop(&mut self) {
6610        self.control_handle.shutdown();
6611        // Safety: drops once, never accessed again
6612        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6613    }
6614}
6615
6616impl fidl::endpoints::Responder for DictionaryDrainIteratorGetNextResponder {
6617    type ControlHandle = DictionaryDrainIteratorControlHandle;
6618
6619    fn control_handle(&self) -> &DictionaryDrainIteratorControlHandle {
6620        &self.control_handle
6621    }
6622
6623    fn drop_without_shutdown(mut self) {
6624        // Safety: drops once, never accessed again due to mem::forget
6625        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6626        // Prevent Drop from running (which would shut down the channel)
6627        std::mem::forget(self);
6628    }
6629}
6630
6631impl DictionaryDrainIteratorGetNextResponder {
6632    /// Sends a response to the FIDL transaction.
6633    ///
6634    /// Sets the channel to shutdown if an error occurs.
6635    pub fn send(
6636        self,
6637        mut result: Result<(&[DictionaryItem], u64), CapabilityStoreError>,
6638    ) -> Result<(), fidl::Error> {
6639        let _result = self.send_raw(result);
6640        if _result.is_err() {
6641            self.control_handle.shutdown();
6642        }
6643        self.drop_without_shutdown();
6644        _result
6645    }
6646
6647    /// Similar to "send" but does not shutdown the channel if an error occurs.
6648    pub fn send_no_shutdown_on_err(
6649        self,
6650        mut result: Result<(&[DictionaryItem], u64), CapabilityStoreError>,
6651    ) -> Result<(), fidl::Error> {
6652        let _result = self.send_raw(result);
6653        self.drop_without_shutdown();
6654        _result
6655    }
6656
6657    fn send_raw(
6658        &self,
6659        mut result: Result<(&[DictionaryItem], u64), CapabilityStoreError>,
6660    ) -> Result<(), fidl::Error> {
6661        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
6662            DictionaryDrainIteratorGetNextResponse,
6663            CapabilityStoreError,
6664        >>(
6665            fidl::encoding::FlexibleResult::new(result),
6666            self.tx_id,
6667            0x4f8082ca1ee26061,
6668            fidl::encoding::DynamicFlags::FLEXIBLE,
6669        )
6670    }
6671}
6672
6673#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6674pub struct DictionaryEnumerateIteratorMarker;
6675
6676impl fidl::endpoints::ProtocolMarker for DictionaryEnumerateIteratorMarker {
6677    type Proxy = DictionaryEnumerateIteratorProxy;
6678    type RequestStream = DictionaryEnumerateIteratorRequestStream;
6679    #[cfg(target_os = "fuchsia")]
6680    type SynchronousProxy = DictionaryEnumerateIteratorSynchronousProxy;
6681
6682    const DEBUG_NAME: &'static str = "(anonymous) DictionaryEnumerateIterator";
6683}
6684pub type DictionaryEnumerateIteratorGetNextResult =
6685    Result<(Vec<DictionaryOptionalItem>, u64), CapabilityStoreError>;
6686
6687pub trait DictionaryEnumerateIteratorProxyInterface: Send + Sync {
6688    type GetNextResponseFut: std::future::Future<Output = Result<DictionaryEnumerateIteratorGetNextResult, fidl::Error>>
6689        + Send;
6690    fn r#get_next(&self, start_id: u64, limit: u32) -> Self::GetNextResponseFut;
6691}
6692#[derive(Debug)]
6693#[cfg(target_os = "fuchsia")]
6694pub struct DictionaryEnumerateIteratorSynchronousProxy {
6695    client: fidl::client::sync::Client,
6696}
6697
6698#[cfg(target_os = "fuchsia")]
6699impl fidl::endpoints::SynchronousProxy for DictionaryEnumerateIteratorSynchronousProxy {
6700    type Proxy = DictionaryEnumerateIteratorProxy;
6701    type Protocol = DictionaryEnumerateIteratorMarker;
6702
6703    fn from_channel(inner: fidl::Channel) -> Self {
6704        Self::new(inner)
6705    }
6706
6707    fn into_channel(self) -> fidl::Channel {
6708        self.client.into_channel()
6709    }
6710
6711    fn as_channel(&self) -> &fidl::Channel {
6712        self.client.as_channel()
6713    }
6714}
6715
6716#[cfg(target_os = "fuchsia")]
6717impl DictionaryEnumerateIteratorSynchronousProxy {
6718    pub fn new(channel: fidl::Channel) -> Self {
6719        Self { client: fidl::client::sync::Client::new(channel) }
6720    }
6721
6722    pub fn into_channel(self) -> fidl::Channel {
6723        self.client.into_channel()
6724    }
6725
6726    /// Waits until an event arrives and returns it. It is safe for other
6727    /// threads to make concurrent requests while waiting for an event.
6728    pub fn wait_for_event(
6729        &self,
6730        deadline: zx::MonotonicInstant,
6731    ) -> Result<DictionaryEnumerateIteratorEvent, fidl::Error> {
6732        DictionaryEnumerateIteratorEvent::decode(
6733            self.client.wait_for_event::<DictionaryEnumerateIteratorMarker>(deadline)?,
6734        )
6735    }
6736
6737    /// Returns the next batch of results for a [Dictionary.Enumerate] call, returning up to
6738    /// `limit` results. `limit` can be at most [MAX_DICTIONARY_ITERATOR_CHUNK].
6739    ///
6740    /// The value of each of `items` is a duplicate of the original capability
6741    /// ([CapabilityStore.Duplicate]), unless it could not be duplicated, it which case it will
6742    /// be null.
6743    ///
6744    /// Each returned capability will be assigned a monotonically increasing [CapabilityId] starting
6745    /// from `start_id`.
6746    ///
6747    /// In addition to the `items`, returns `end_id`, which is one more than the highest id reserved
6748    /// by [GetNext]. `end_id` can be used as the `start_id` for the next call to [GetNext].
6749    ///
6750    /// If [GetNext] returns an error, the server will also close the channel.
6751    ///
6752    /// Errors:
6753    ///
6754    /// - `ID_ALREADY_EXISTS` if some id in the range `[start_id, limit)` already exists in this
6755    ///   store.
6756    /// - `INVALID_ARGS` if `limit` was `0` or greater than `MAX_DICTIONARY_ITERATOR_CHUNK`.
6757    pub fn r#get_next(
6758        &self,
6759        mut start_id: u64,
6760        mut limit: u32,
6761        ___deadline: zx::MonotonicInstant,
6762    ) -> Result<DictionaryEnumerateIteratorGetNextResult, fidl::Error> {
6763        let _response = self.client.send_query::<
6764            DictionaryEnumerateIteratorGetNextRequest,
6765            fidl::encoding::FlexibleResultType<DictionaryEnumerateIteratorGetNextResponse, CapabilityStoreError>,
6766            DictionaryEnumerateIteratorMarker,
6767        >(
6768            (start_id, limit,),
6769            0x14f8bc286512f5cf,
6770            fidl::encoding::DynamicFlags::FLEXIBLE,
6771            ___deadline,
6772        )?
6773        .into_result::<DictionaryEnumerateIteratorMarker>("get_next")?;
6774        Ok(_response.map(|x| (x.items, x.end_id)))
6775    }
6776}
6777
6778#[cfg(target_os = "fuchsia")]
6779impl From<DictionaryEnumerateIteratorSynchronousProxy> for zx::NullableHandle {
6780    fn from(value: DictionaryEnumerateIteratorSynchronousProxy) -> Self {
6781        value.into_channel().into()
6782    }
6783}
6784
6785#[cfg(target_os = "fuchsia")]
6786impl From<fidl::Channel> for DictionaryEnumerateIteratorSynchronousProxy {
6787    fn from(value: fidl::Channel) -> Self {
6788        Self::new(value)
6789    }
6790}
6791
6792#[cfg(target_os = "fuchsia")]
6793impl fidl::endpoints::FromClient for DictionaryEnumerateIteratorSynchronousProxy {
6794    type Protocol = DictionaryEnumerateIteratorMarker;
6795
6796    fn from_client(value: fidl::endpoints::ClientEnd<DictionaryEnumerateIteratorMarker>) -> Self {
6797        Self::new(value.into_channel())
6798    }
6799}
6800
6801#[derive(Debug, Clone)]
6802pub struct DictionaryEnumerateIteratorProxy {
6803    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6804}
6805
6806impl fidl::endpoints::Proxy for DictionaryEnumerateIteratorProxy {
6807    type Protocol = DictionaryEnumerateIteratorMarker;
6808
6809    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6810        Self::new(inner)
6811    }
6812
6813    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6814        self.client.into_channel().map_err(|client| Self { client })
6815    }
6816
6817    fn as_channel(&self) -> &::fidl::AsyncChannel {
6818        self.client.as_channel()
6819    }
6820}
6821
6822impl DictionaryEnumerateIteratorProxy {
6823    /// Create a new Proxy for fuchsia.component.sandbox/DictionaryEnumerateIterator.
6824    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6825        let protocol_name =
6826            <DictionaryEnumerateIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6827        Self { client: fidl::client::Client::new(channel, protocol_name) }
6828    }
6829
6830    /// Get a Stream of events from the remote end of the protocol.
6831    ///
6832    /// # Panics
6833    ///
6834    /// Panics if the event stream was already taken.
6835    pub fn take_event_stream(&self) -> DictionaryEnumerateIteratorEventStream {
6836        DictionaryEnumerateIteratorEventStream { event_receiver: self.client.take_event_receiver() }
6837    }
6838
6839    /// Returns the next batch of results for a [Dictionary.Enumerate] call, returning up to
6840    /// `limit` results. `limit` can be at most [MAX_DICTIONARY_ITERATOR_CHUNK].
6841    ///
6842    /// The value of each of `items` is a duplicate of the original capability
6843    /// ([CapabilityStore.Duplicate]), unless it could not be duplicated, it which case it will
6844    /// be null.
6845    ///
6846    /// Each returned capability will be assigned a monotonically increasing [CapabilityId] starting
6847    /// from `start_id`.
6848    ///
6849    /// In addition to the `items`, returns `end_id`, which is one more than the highest id reserved
6850    /// by [GetNext]. `end_id` can be used as the `start_id` for the next call to [GetNext].
6851    ///
6852    /// If [GetNext] returns an error, the server will also close the channel.
6853    ///
6854    /// Errors:
6855    ///
6856    /// - `ID_ALREADY_EXISTS` if some id in the range `[start_id, limit)` already exists in this
6857    ///   store.
6858    /// - `INVALID_ARGS` if `limit` was `0` or greater than `MAX_DICTIONARY_ITERATOR_CHUNK`.
6859    pub fn r#get_next(
6860        &self,
6861        mut start_id: u64,
6862        mut limit: u32,
6863    ) -> fidl::client::QueryResponseFut<
6864        DictionaryEnumerateIteratorGetNextResult,
6865        fidl::encoding::DefaultFuchsiaResourceDialect,
6866    > {
6867        DictionaryEnumerateIteratorProxyInterface::r#get_next(self, start_id, limit)
6868    }
6869}
6870
6871impl DictionaryEnumerateIteratorProxyInterface for DictionaryEnumerateIteratorProxy {
6872    type GetNextResponseFut = fidl::client::QueryResponseFut<
6873        DictionaryEnumerateIteratorGetNextResult,
6874        fidl::encoding::DefaultFuchsiaResourceDialect,
6875    >;
6876    fn r#get_next(&self, mut start_id: u64, mut limit: u32) -> Self::GetNextResponseFut {
6877        fn _decode(
6878            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6879        ) -> Result<DictionaryEnumerateIteratorGetNextResult, fidl::Error> {
6880            let _response = fidl::client::decode_transaction_body::<
6881                fidl::encoding::FlexibleResultType<
6882                    DictionaryEnumerateIteratorGetNextResponse,
6883                    CapabilityStoreError,
6884                >,
6885                fidl::encoding::DefaultFuchsiaResourceDialect,
6886                0x14f8bc286512f5cf,
6887            >(_buf?)?
6888            .into_result::<DictionaryEnumerateIteratorMarker>("get_next")?;
6889            Ok(_response.map(|x| (x.items, x.end_id)))
6890        }
6891        self.client.send_query_and_decode::<
6892            DictionaryEnumerateIteratorGetNextRequest,
6893            DictionaryEnumerateIteratorGetNextResult,
6894        >(
6895            (start_id, limit,),
6896            0x14f8bc286512f5cf,
6897            fidl::encoding::DynamicFlags::FLEXIBLE,
6898            _decode,
6899        )
6900    }
6901}
6902
6903pub struct DictionaryEnumerateIteratorEventStream {
6904    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6905}
6906
6907impl std::marker::Unpin for DictionaryEnumerateIteratorEventStream {}
6908
6909impl futures::stream::FusedStream for DictionaryEnumerateIteratorEventStream {
6910    fn is_terminated(&self) -> bool {
6911        self.event_receiver.is_terminated()
6912    }
6913}
6914
6915impl futures::Stream for DictionaryEnumerateIteratorEventStream {
6916    type Item = Result<DictionaryEnumerateIteratorEvent, fidl::Error>;
6917
6918    fn poll_next(
6919        mut self: std::pin::Pin<&mut Self>,
6920        cx: &mut std::task::Context<'_>,
6921    ) -> std::task::Poll<Option<Self::Item>> {
6922        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6923            &mut self.event_receiver,
6924            cx
6925        )?) {
6926            Some(buf) => {
6927                std::task::Poll::Ready(Some(DictionaryEnumerateIteratorEvent::decode(buf)))
6928            }
6929            None => std::task::Poll::Ready(None),
6930        }
6931    }
6932}
6933
6934#[derive(Debug)]
6935pub enum DictionaryEnumerateIteratorEvent {
6936    #[non_exhaustive]
6937    _UnknownEvent {
6938        /// Ordinal of the event that was sent.
6939        ordinal: u64,
6940    },
6941}
6942
6943impl DictionaryEnumerateIteratorEvent {
6944    /// Decodes a message buffer as a [`DictionaryEnumerateIteratorEvent`].
6945    fn decode(
6946        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6947    ) -> Result<DictionaryEnumerateIteratorEvent, fidl::Error> {
6948        let (bytes, _handles) = buf.split_mut();
6949        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6950        debug_assert_eq!(tx_header.tx_id, 0);
6951        match tx_header.ordinal {
6952            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6953                Ok(DictionaryEnumerateIteratorEvent::_UnknownEvent {
6954                    ordinal: tx_header.ordinal,
6955                })
6956            }
6957            _ => Err(fidl::Error::UnknownOrdinal {
6958                ordinal: tx_header.ordinal,
6959                protocol_name: <DictionaryEnumerateIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6960            })
6961        }
6962    }
6963}
6964
6965/// A Stream of incoming requests for fuchsia.component.sandbox/DictionaryEnumerateIterator.
6966pub struct DictionaryEnumerateIteratorRequestStream {
6967    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6968    is_terminated: bool,
6969}
6970
6971impl std::marker::Unpin for DictionaryEnumerateIteratorRequestStream {}
6972
6973impl futures::stream::FusedStream for DictionaryEnumerateIteratorRequestStream {
6974    fn is_terminated(&self) -> bool {
6975        self.is_terminated
6976    }
6977}
6978
6979impl fidl::endpoints::RequestStream for DictionaryEnumerateIteratorRequestStream {
6980    type Protocol = DictionaryEnumerateIteratorMarker;
6981    type ControlHandle = DictionaryEnumerateIteratorControlHandle;
6982
6983    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6984        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6985    }
6986
6987    fn control_handle(&self) -> Self::ControlHandle {
6988        DictionaryEnumerateIteratorControlHandle { inner: self.inner.clone() }
6989    }
6990
6991    fn into_inner(
6992        self,
6993    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6994    {
6995        (self.inner, self.is_terminated)
6996    }
6997
6998    fn from_inner(
6999        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7000        is_terminated: bool,
7001    ) -> Self {
7002        Self { inner, is_terminated }
7003    }
7004}
7005
7006impl futures::Stream for DictionaryEnumerateIteratorRequestStream {
7007    type Item = Result<DictionaryEnumerateIteratorRequest, fidl::Error>;
7008
7009    fn poll_next(
7010        mut self: std::pin::Pin<&mut Self>,
7011        cx: &mut std::task::Context<'_>,
7012    ) -> std::task::Poll<Option<Self::Item>> {
7013        let this = &mut *self;
7014        if this.inner.check_shutdown(cx) {
7015            this.is_terminated = true;
7016            return std::task::Poll::Ready(None);
7017        }
7018        if this.is_terminated {
7019            panic!("polled DictionaryEnumerateIteratorRequestStream after completion");
7020        }
7021        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
7022            |bytes, handles| {
7023                match this.inner.channel().read_etc(cx, bytes, handles) {
7024                    std::task::Poll::Ready(Ok(())) => {}
7025                    std::task::Poll::Pending => return std::task::Poll::Pending,
7026                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
7027                        this.is_terminated = true;
7028                        return std::task::Poll::Ready(None);
7029                    }
7030                    std::task::Poll::Ready(Err(e)) => {
7031                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7032                            e.into(),
7033                        ))));
7034                    }
7035                }
7036
7037                // A message has been received from the channel
7038                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7039
7040                std::task::Poll::Ready(Some(match header.ordinal {
7041                0x14f8bc286512f5cf => {
7042                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7043                    let mut req = fidl::new_empty!(DictionaryEnumerateIteratorGetNextRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
7044                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DictionaryEnumerateIteratorGetNextRequest>(&header, _body_bytes, handles, &mut req)?;
7045                    let control_handle = DictionaryEnumerateIteratorControlHandle {
7046                        inner: this.inner.clone(),
7047                    };
7048                    Ok(DictionaryEnumerateIteratorRequest::GetNext {start_id: req.start_id,
7049limit: req.limit,
7050
7051                        responder: DictionaryEnumerateIteratorGetNextResponder {
7052                            control_handle: std::mem::ManuallyDrop::new(control_handle),
7053                            tx_id: header.tx_id,
7054                        },
7055                    })
7056                }
7057                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7058                    Ok(DictionaryEnumerateIteratorRequest::_UnknownMethod {
7059                        ordinal: header.ordinal,
7060                        control_handle: DictionaryEnumerateIteratorControlHandle { inner: this.inner.clone() },
7061                        method_type: fidl::MethodType::OneWay,
7062                    })
7063                }
7064                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7065                    this.inner.send_framework_err(
7066                        fidl::encoding::FrameworkErr::UnknownMethod,
7067                        header.tx_id,
7068                        header.ordinal,
7069                        header.dynamic_flags(),
7070                        (bytes, handles),
7071                    )?;
7072                    Ok(DictionaryEnumerateIteratorRequest::_UnknownMethod {
7073                        ordinal: header.ordinal,
7074                        control_handle: DictionaryEnumerateIteratorControlHandle { inner: this.inner.clone() },
7075                        method_type: fidl::MethodType::TwoWay,
7076                    })
7077                }
7078                _ => Err(fidl::Error::UnknownOrdinal {
7079                    ordinal: header.ordinal,
7080                    protocol_name: <DictionaryEnumerateIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7081                }),
7082            }))
7083            },
7084        )
7085    }
7086}
7087
7088#[derive(Debug)]
7089pub enum DictionaryEnumerateIteratorRequest {
7090    /// Returns the next batch of results for a [Dictionary.Enumerate] call, returning up to
7091    /// `limit` results. `limit` can be at most [MAX_DICTIONARY_ITERATOR_CHUNK].
7092    ///
7093    /// The value of each of `items` is a duplicate of the original capability
7094    /// ([CapabilityStore.Duplicate]), unless it could not be duplicated, it which case it will
7095    /// be null.
7096    ///
7097    /// Each returned capability will be assigned a monotonically increasing [CapabilityId] starting
7098    /// from `start_id`.
7099    ///
7100    /// In addition to the `items`, returns `end_id`, which is one more than the highest id reserved
7101    /// by [GetNext]. `end_id` can be used as the `start_id` for the next call to [GetNext].
7102    ///
7103    /// If [GetNext] returns an error, the server will also close the channel.
7104    ///
7105    /// Errors:
7106    ///
7107    /// - `ID_ALREADY_EXISTS` if some id in the range `[start_id, limit)` already exists in this
7108    ///   store.
7109    /// - `INVALID_ARGS` if `limit` was `0` or greater than `MAX_DICTIONARY_ITERATOR_CHUNK`.
7110    GetNext { start_id: u64, limit: u32, responder: DictionaryEnumerateIteratorGetNextResponder },
7111    /// An interaction was received which does not match any known method.
7112    #[non_exhaustive]
7113    _UnknownMethod {
7114        /// Ordinal of the method that was called.
7115        ordinal: u64,
7116        control_handle: DictionaryEnumerateIteratorControlHandle,
7117        method_type: fidl::MethodType,
7118    },
7119}
7120
7121impl DictionaryEnumerateIteratorRequest {
7122    #[allow(irrefutable_let_patterns)]
7123    pub fn into_get_next(self) -> Option<(u64, u32, DictionaryEnumerateIteratorGetNextResponder)> {
7124        if let DictionaryEnumerateIteratorRequest::GetNext { start_id, limit, responder } = self {
7125            Some((start_id, limit, responder))
7126        } else {
7127            None
7128        }
7129    }
7130
7131    /// Name of the method defined in FIDL
7132    pub fn method_name(&self) -> &'static str {
7133        match *self {
7134            DictionaryEnumerateIteratorRequest::GetNext { .. } => "get_next",
7135            DictionaryEnumerateIteratorRequest::_UnknownMethod {
7136                method_type: fidl::MethodType::OneWay,
7137                ..
7138            } => "unknown one-way method",
7139            DictionaryEnumerateIteratorRequest::_UnknownMethod {
7140                method_type: fidl::MethodType::TwoWay,
7141                ..
7142            } => "unknown two-way method",
7143        }
7144    }
7145}
7146
7147#[derive(Debug, Clone)]
7148pub struct DictionaryEnumerateIteratorControlHandle {
7149    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7150}
7151
7152impl DictionaryEnumerateIteratorControlHandle {
7153    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
7154        self.inner.shutdown_with_epitaph(status.into())
7155    }
7156}
7157
7158impl fidl::endpoints::ControlHandle for DictionaryEnumerateIteratorControlHandle {
7159    fn shutdown(&self) {
7160        self.inner.shutdown()
7161    }
7162
7163    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
7164        self.inner.shutdown_with_epitaph(status)
7165    }
7166
7167    fn is_closed(&self) -> bool {
7168        self.inner.channel().is_closed()
7169    }
7170    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
7171        self.inner.channel().on_closed()
7172    }
7173
7174    #[cfg(target_os = "fuchsia")]
7175    fn signal_peer(
7176        &self,
7177        clear_mask: zx::Signals,
7178        set_mask: zx::Signals,
7179    ) -> Result<(), zx_status::Status> {
7180        use fidl::Peered;
7181        self.inner.channel().signal_peer(clear_mask, set_mask)
7182    }
7183}
7184
7185impl DictionaryEnumerateIteratorControlHandle {}
7186
7187#[must_use = "FIDL methods require a response to be sent"]
7188#[derive(Debug)]
7189pub struct DictionaryEnumerateIteratorGetNextResponder {
7190    control_handle: std::mem::ManuallyDrop<DictionaryEnumerateIteratorControlHandle>,
7191    tx_id: u32,
7192}
7193
7194/// Set the the channel to be shutdown (see [`DictionaryEnumerateIteratorControlHandle::shutdown`])
7195/// if the responder is dropped without sending a response, so that the client
7196/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7197impl std::ops::Drop for DictionaryEnumerateIteratorGetNextResponder {
7198    fn drop(&mut self) {
7199        self.control_handle.shutdown();
7200        // Safety: drops once, never accessed again
7201        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7202    }
7203}
7204
7205impl fidl::endpoints::Responder for DictionaryEnumerateIteratorGetNextResponder {
7206    type ControlHandle = DictionaryEnumerateIteratorControlHandle;
7207
7208    fn control_handle(&self) -> &DictionaryEnumerateIteratorControlHandle {
7209        &self.control_handle
7210    }
7211
7212    fn drop_without_shutdown(mut self) {
7213        // Safety: drops once, never accessed again due to mem::forget
7214        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7215        // Prevent Drop from running (which would shut down the channel)
7216        std::mem::forget(self);
7217    }
7218}
7219
7220impl DictionaryEnumerateIteratorGetNextResponder {
7221    /// Sends a response to the FIDL transaction.
7222    ///
7223    /// Sets the channel to shutdown if an error occurs.
7224    pub fn send(
7225        self,
7226        mut result: Result<(Vec<DictionaryOptionalItem>, u64), CapabilityStoreError>,
7227    ) -> Result<(), fidl::Error> {
7228        let _result = self.send_raw(result);
7229        if _result.is_err() {
7230            self.control_handle.shutdown();
7231        }
7232        self.drop_without_shutdown();
7233        _result
7234    }
7235
7236    /// Similar to "send" but does not shutdown the channel if an error occurs.
7237    pub fn send_no_shutdown_on_err(
7238        self,
7239        mut result: Result<(Vec<DictionaryOptionalItem>, u64), CapabilityStoreError>,
7240    ) -> Result<(), fidl::Error> {
7241        let _result = self.send_raw(result);
7242        self.drop_without_shutdown();
7243        _result
7244    }
7245
7246    fn send_raw(
7247        &self,
7248        mut result: Result<(Vec<DictionaryOptionalItem>, u64), CapabilityStoreError>,
7249    ) -> Result<(), fidl::Error> {
7250        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
7251            DictionaryEnumerateIteratorGetNextResponse,
7252            CapabilityStoreError,
7253        >>(
7254            fidl::encoding::FlexibleResult::new(
7255                result
7256                    .as_mut()
7257                    .map_err(|e| *e)
7258                    .map(|(items, end_id)| (items.as_mut_slice(), *end_id)),
7259            ),
7260            self.tx_id,
7261            0x14f8bc286512f5cf,
7262            fidl::encoding::DynamicFlags::FLEXIBLE,
7263        )
7264    }
7265}
7266
7267#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
7268pub struct DictionaryKeysIteratorMarker;
7269
7270impl fidl::endpoints::ProtocolMarker for DictionaryKeysIteratorMarker {
7271    type Proxy = DictionaryKeysIteratorProxy;
7272    type RequestStream = DictionaryKeysIteratorRequestStream;
7273    #[cfg(target_os = "fuchsia")]
7274    type SynchronousProxy = DictionaryKeysIteratorSynchronousProxy;
7275
7276    const DEBUG_NAME: &'static str = "(anonymous) DictionaryKeysIterator";
7277}
7278
7279pub trait DictionaryKeysIteratorProxyInterface: Send + Sync {
7280    type GetNextResponseFut: std::future::Future<Output = Result<Vec<String>, fidl::Error>> + Send;
7281    fn r#get_next(&self) -> Self::GetNextResponseFut;
7282}
7283#[derive(Debug)]
7284#[cfg(target_os = "fuchsia")]
7285pub struct DictionaryKeysIteratorSynchronousProxy {
7286    client: fidl::client::sync::Client,
7287}
7288
7289#[cfg(target_os = "fuchsia")]
7290impl fidl::endpoints::SynchronousProxy for DictionaryKeysIteratorSynchronousProxy {
7291    type Proxy = DictionaryKeysIteratorProxy;
7292    type Protocol = DictionaryKeysIteratorMarker;
7293
7294    fn from_channel(inner: fidl::Channel) -> Self {
7295        Self::new(inner)
7296    }
7297
7298    fn into_channel(self) -> fidl::Channel {
7299        self.client.into_channel()
7300    }
7301
7302    fn as_channel(&self) -> &fidl::Channel {
7303        self.client.as_channel()
7304    }
7305}
7306
7307#[cfg(target_os = "fuchsia")]
7308impl DictionaryKeysIteratorSynchronousProxy {
7309    pub fn new(channel: fidl::Channel) -> Self {
7310        Self { client: fidl::client::sync::Client::new(channel) }
7311    }
7312
7313    pub fn into_channel(self) -> fidl::Channel {
7314        self.client.into_channel()
7315    }
7316
7317    /// Waits until an event arrives and returns it. It is safe for other
7318    /// threads to make concurrent requests while waiting for an event.
7319    pub fn wait_for_event(
7320        &self,
7321        deadline: zx::MonotonicInstant,
7322    ) -> Result<DictionaryKeysIteratorEvent, fidl::Error> {
7323        DictionaryKeysIteratorEvent::decode(
7324            self.client.wait_for_event::<DictionaryKeysIteratorMarker>(deadline)?,
7325        )
7326    }
7327
7328    pub fn r#get_next(
7329        &self,
7330        ___deadline: zx::MonotonicInstant,
7331    ) -> Result<Vec<String>, fidl::Error> {
7332        let _response = self.client.send_query::<
7333            fidl::encoding::EmptyPayload,
7334            fidl::encoding::FlexibleType<DictionaryKeysIteratorGetNextResponse>,
7335            DictionaryKeysIteratorMarker,
7336        >(
7337            (),
7338            0x453828cbacca7d53,
7339            fidl::encoding::DynamicFlags::FLEXIBLE,
7340            ___deadline,
7341        )?
7342        .into_result::<DictionaryKeysIteratorMarker>("get_next")?;
7343        Ok(_response.keys)
7344    }
7345}
7346
7347#[cfg(target_os = "fuchsia")]
7348impl From<DictionaryKeysIteratorSynchronousProxy> for zx::NullableHandle {
7349    fn from(value: DictionaryKeysIteratorSynchronousProxy) -> Self {
7350        value.into_channel().into()
7351    }
7352}
7353
7354#[cfg(target_os = "fuchsia")]
7355impl From<fidl::Channel> for DictionaryKeysIteratorSynchronousProxy {
7356    fn from(value: fidl::Channel) -> Self {
7357        Self::new(value)
7358    }
7359}
7360
7361#[cfg(target_os = "fuchsia")]
7362impl fidl::endpoints::FromClient for DictionaryKeysIteratorSynchronousProxy {
7363    type Protocol = DictionaryKeysIteratorMarker;
7364
7365    fn from_client(value: fidl::endpoints::ClientEnd<DictionaryKeysIteratorMarker>) -> Self {
7366        Self::new(value.into_channel())
7367    }
7368}
7369
7370#[derive(Debug, Clone)]
7371pub struct DictionaryKeysIteratorProxy {
7372    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
7373}
7374
7375impl fidl::endpoints::Proxy for DictionaryKeysIteratorProxy {
7376    type Protocol = DictionaryKeysIteratorMarker;
7377
7378    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
7379        Self::new(inner)
7380    }
7381
7382    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
7383        self.client.into_channel().map_err(|client| Self { client })
7384    }
7385
7386    fn as_channel(&self) -> &::fidl::AsyncChannel {
7387        self.client.as_channel()
7388    }
7389}
7390
7391impl DictionaryKeysIteratorProxy {
7392    /// Create a new Proxy for fuchsia.component.sandbox/DictionaryKeysIterator.
7393    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
7394        let protocol_name =
7395            <DictionaryKeysIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7396        Self { client: fidl::client::Client::new(channel, protocol_name) }
7397    }
7398
7399    /// Get a Stream of events from the remote end of the protocol.
7400    ///
7401    /// # Panics
7402    ///
7403    /// Panics if the event stream was already taken.
7404    pub fn take_event_stream(&self) -> DictionaryKeysIteratorEventStream {
7405        DictionaryKeysIteratorEventStream { event_receiver: self.client.take_event_receiver() }
7406    }
7407
7408    pub fn r#get_next(
7409        &self,
7410    ) -> fidl::client::QueryResponseFut<Vec<String>, fidl::encoding::DefaultFuchsiaResourceDialect>
7411    {
7412        DictionaryKeysIteratorProxyInterface::r#get_next(self)
7413    }
7414}
7415
7416impl DictionaryKeysIteratorProxyInterface for DictionaryKeysIteratorProxy {
7417    type GetNextResponseFut =
7418        fidl::client::QueryResponseFut<Vec<String>, fidl::encoding::DefaultFuchsiaResourceDialect>;
7419    fn r#get_next(&self) -> Self::GetNextResponseFut {
7420        fn _decode(
7421            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7422        ) -> Result<Vec<String>, fidl::Error> {
7423            let _response = fidl::client::decode_transaction_body::<
7424                fidl::encoding::FlexibleType<DictionaryKeysIteratorGetNextResponse>,
7425                fidl::encoding::DefaultFuchsiaResourceDialect,
7426                0x453828cbacca7d53,
7427            >(_buf?)?
7428            .into_result::<DictionaryKeysIteratorMarker>("get_next")?;
7429            Ok(_response.keys)
7430        }
7431        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<String>>(
7432            (),
7433            0x453828cbacca7d53,
7434            fidl::encoding::DynamicFlags::FLEXIBLE,
7435            _decode,
7436        )
7437    }
7438}
7439
7440pub struct DictionaryKeysIteratorEventStream {
7441    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
7442}
7443
7444impl std::marker::Unpin for DictionaryKeysIteratorEventStream {}
7445
7446impl futures::stream::FusedStream for DictionaryKeysIteratorEventStream {
7447    fn is_terminated(&self) -> bool {
7448        self.event_receiver.is_terminated()
7449    }
7450}
7451
7452impl futures::Stream for DictionaryKeysIteratorEventStream {
7453    type Item = Result<DictionaryKeysIteratorEvent, fidl::Error>;
7454
7455    fn poll_next(
7456        mut self: std::pin::Pin<&mut Self>,
7457        cx: &mut std::task::Context<'_>,
7458    ) -> std::task::Poll<Option<Self::Item>> {
7459        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7460            &mut self.event_receiver,
7461            cx
7462        )?) {
7463            Some(buf) => std::task::Poll::Ready(Some(DictionaryKeysIteratorEvent::decode(buf))),
7464            None => std::task::Poll::Ready(None),
7465        }
7466    }
7467}
7468
7469#[derive(Debug)]
7470pub enum DictionaryKeysIteratorEvent {
7471    #[non_exhaustive]
7472    _UnknownEvent {
7473        /// Ordinal of the event that was sent.
7474        ordinal: u64,
7475    },
7476}
7477
7478impl DictionaryKeysIteratorEvent {
7479    /// Decodes a message buffer as a [`DictionaryKeysIteratorEvent`].
7480    fn decode(
7481        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7482    ) -> Result<DictionaryKeysIteratorEvent, fidl::Error> {
7483        let (bytes, _handles) = buf.split_mut();
7484        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7485        debug_assert_eq!(tx_header.tx_id, 0);
7486        match tx_header.ordinal {
7487            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7488                Ok(DictionaryKeysIteratorEvent::_UnknownEvent { ordinal: tx_header.ordinal })
7489            }
7490            _ => Err(fidl::Error::UnknownOrdinal {
7491                ordinal: tx_header.ordinal,
7492                protocol_name:
7493                    <DictionaryKeysIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7494            }),
7495        }
7496    }
7497}
7498
7499/// A Stream of incoming requests for fuchsia.component.sandbox/DictionaryKeysIterator.
7500pub struct DictionaryKeysIteratorRequestStream {
7501    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7502    is_terminated: bool,
7503}
7504
7505impl std::marker::Unpin for DictionaryKeysIteratorRequestStream {}
7506
7507impl futures::stream::FusedStream for DictionaryKeysIteratorRequestStream {
7508    fn is_terminated(&self) -> bool {
7509        self.is_terminated
7510    }
7511}
7512
7513impl fidl::endpoints::RequestStream for DictionaryKeysIteratorRequestStream {
7514    type Protocol = DictionaryKeysIteratorMarker;
7515    type ControlHandle = DictionaryKeysIteratorControlHandle;
7516
7517    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
7518        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7519    }
7520
7521    fn control_handle(&self) -> Self::ControlHandle {
7522        DictionaryKeysIteratorControlHandle { inner: self.inner.clone() }
7523    }
7524
7525    fn into_inner(
7526        self,
7527    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
7528    {
7529        (self.inner, self.is_terminated)
7530    }
7531
7532    fn from_inner(
7533        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7534        is_terminated: bool,
7535    ) -> Self {
7536        Self { inner, is_terminated }
7537    }
7538}
7539
7540impl futures::Stream for DictionaryKeysIteratorRequestStream {
7541    type Item = Result<DictionaryKeysIteratorRequest, fidl::Error>;
7542
7543    fn poll_next(
7544        mut self: std::pin::Pin<&mut Self>,
7545        cx: &mut std::task::Context<'_>,
7546    ) -> std::task::Poll<Option<Self::Item>> {
7547        let this = &mut *self;
7548        if this.inner.check_shutdown(cx) {
7549            this.is_terminated = true;
7550            return std::task::Poll::Ready(None);
7551        }
7552        if this.is_terminated {
7553            panic!("polled DictionaryKeysIteratorRequestStream after completion");
7554        }
7555        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
7556            |bytes, handles| {
7557                match this.inner.channel().read_etc(cx, bytes, handles) {
7558                    std::task::Poll::Ready(Ok(())) => {}
7559                    std::task::Poll::Pending => return std::task::Poll::Pending,
7560                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
7561                        this.is_terminated = true;
7562                        return std::task::Poll::Ready(None);
7563                    }
7564                    std::task::Poll::Ready(Err(e)) => {
7565                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7566                            e.into(),
7567                        ))));
7568                    }
7569                }
7570
7571                // A message has been received from the channel
7572                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7573
7574                std::task::Poll::Ready(Some(match header.ordinal {
7575                0x453828cbacca7d53 => {
7576                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7577                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
7578                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7579                    let control_handle = DictionaryKeysIteratorControlHandle {
7580                        inner: this.inner.clone(),
7581                    };
7582                    Ok(DictionaryKeysIteratorRequest::GetNext {
7583                        responder: DictionaryKeysIteratorGetNextResponder {
7584                            control_handle: std::mem::ManuallyDrop::new(control_handle),
7585                            tx_id: header.tx_id,
7586                        },
7587                    })
7588                }
7589                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7590                    Ok(DictionaryKeysIteratorRequest::_UnknownMethod {
7591                        ordinal: header.ordinal,
7592                        control_handle: DictionaryKeysIteratorControlHandle { inner: this.inner.clone() },
7593                        method_type: fidl::MethodType::OneWay,
7594                    })
7595                }
7596                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7597                    this.inner.send_framework_err(
7598                        fidl::encoding::FrameworkErr::UnknownMethod,
7599                        header.tx_id,
7600                        header.ordinal,
7601                        header.dynamic_flags(),
7602                        (bytes, handles),
7603                    )?;
7604                    Ok(DictionaryKeysIteratorRequest::_UnknownMethod {
7605                        ordinal: header.ordinal,
7606                        control_handle: DictionaryKeysIteratorControlHandle { inner: this.inner.clone() },
7607                        method_type: fidl::MethodType::TwoWay,
7608                    })
7609                }
7610                _ => Err(fidl::Error::UnknownOrdinal {
7611                    ordinal: header.ordinal,
7612                    protocol_name: <DictionaryKeysIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7613                }),
7614            }))
7615            },
7616        )
7617    }
7618}
7619
7620#[derive(Debug)]
7621pub enum DictionaryKeysIteratorRequest {
7622    GetNext {
7623        responder: DictionaryKeysIteratorGetNextResponder,
7624    },
7625    /// An interaction was received which does not match any known method.
7626    #[non_exhaustive]
7627    _UnknownMethod {
7628        /// Ordinal of the method that was called.
7629        ordinal: u64,
7630        control_handle: DictionaryKeysIteratorControlHandle,
7631        method_type: fidl::MethodType,
7632    },
7633}
7634
7635impl DictionaryKeysIteratorRequest {
7636    #[allow(irrefutable_let_patterns)]
7637    pub fn into_get_next(self) -> Option<(DictionaryKeysIteratorGetNextResponder)> {
7638        if let DictionaryKeysIteratorRequest::GetNext { responder } = self {
7639            Some((responder))
7640        } else {
7641            None
7642        }
7643    }
7644
7645    /// Name of the method defined in FIDL
7646    pub fn method_name(&self) -> &'static str {
7647        match *self {
7648            DictionaryKeysIteratorRequest::GetNext { .. } => "get_next",
7649            DictionaryKeysIteratorRequest::_UnknownMethod {
7650                method_type: fidl::MethodType::OneWay,
7651                ..
7652            } => "unknown one-way method",
7653            DictionaryKeysIteratorRequest::_UnknownMethod {
7654                method_type: fidl::MethodType::TwoWay,
7655                ..
7656            } => "unknown two-way method",
7657        }
7658    }
7659}
7660
7661#[derive(Debug, Clone)]
7662pub struct DictionaryKeysIteratorControlHandle {
7663    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7664}
7665
7666impl DictionaryKeysIteratorControlHandle {
7667    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
7668        self.inner.shutdown_with_epitaph(status.into())
7669    }
7670}
7671
7672impl fidl::endpoints::ControlHandle for DictionaryKeysIteratorControlHandle {
7673    fn shutdown(&self) {
7674        self.inner.shutdown()
7675    }
7676
7677    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
7678        self.inner.shutdown_with_epitaph(status)
7679    }
7680
7681    fn is_closed(&self) -> bool {
7682        self.inner.channel().is_closed()
7683    }
7684    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
7685        self.inner.channel().on_closed()
7686    }
7687
7688    #[cfg(target_os = "fuchsia")]
7689    fn signal_peer(
7690        &self,
7691        clear_mask: zx::Signals,
7692        set_mask: zx::Signals,
7693    ) -> Result<(), zx_status::Status> {
7694        use fidl::Peered;
7695        self.inner.channel().signal_peer(clear_mask, set_mask)
7696    }
7697}
7698
7699impl DictionaryKeysIteratorControlHandle {}
7700
7701#[must_use = "FIDL methods require a response to be sent"]
7702#[derive(Debug)]
7703pub struct DictionaryKeysIteratorGetNextResponder {
7704    control_handle: std::mem::ManuallyDrop<DictionaryKeysIteratorControlHandle>,
7705    tx_id: u32,
7706}
7707
7708/// Set the the channel to be shutdown (see [`DictionaryKeysIteratorControlHandle::shutdown`])
7709/// if the responder is dropped without sending a response, so that the client
7710/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7711impl std::ops::Drop for DictionaryKeysIteratorGetNextResponder {
7712    fn drop(&mut self) {
7713        self.control_handle.shutdown();
7714        // Safety: drops once, never accessed again
7715        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7716    }
7717}
7718
7719impl fidl::endpoints::Responder for DictionaryKeysIteratorGetNextResponder {
7720    type ControlHandle = DictionaryKeysIteratorControlHandle;
7721
7722    fn control_handle(&self) -> &DictionaryKeysIteratorControlHandle {
7723        &self.control_handle
7724    }
7725
7726    fn drop_without_shutdown(mut self) {
7727        // Safety: drops once, never accessed again due to mem::forget
7728        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7729        // Prevent Drop from running (which would shut down the channel)
7730        std::mem::forget(self);
7731    }
7732}
7733
7734impl DictionaryKeysIteratorGetNextResponder {
7735    /// Sends a response to the FIDL transaction.
7736    ///
7737    /// Sets the channel to shutdown if an error occurs.
7738    pub fn send(self, mut keys: &[String]) -> Result<(), fidl::Error> {
7739        let _result = self.send_raw(keys);
7740        if _result.is_err() {
7741            self.control_handle.shutdown();
7742        }
7743        self.drop_without_shutdown();
7744        _result
7745    }
7746
7747    /// Similar to "send" but does not shutdown the channel if an error occurs.
7748    pub fn send_no_shutdown_on_err(self, mut keys: &[String]) -> Result<(), fidl::Error> {
7749        let _result = self.send_raw(keys);
7750        self.drop_without_shutdown();
7751        _result
7752    }
7753
7754    fn send_raw(&self, mut keys: &[String]) -> Result<(), fidl::Error> {
7755        self.control_handle
7756            .inner
7757            .send::<fidl::encoding::FlexibleType<DictionaryKeysIteratorGetNextResponse>>(
7758                fidl::encoding::Flexible::new((keys,)),
7759                self.tx_id,
7760                0x453828cbacca7d53,
7761                fidl::encoding::DynamicFlags::FLEXIBLE,
7762            )
7763    }
7764}
7765
7766#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
7767pub struct DictionaryRouterMarker;
7768
7769impl fidl::endpoints::ProtocolMarker for DictionaryRouterMarker {
7770    type Proxy = DictionaryRouterProxy;
7771    type RequestStream = DictionaryRouterRequestStream;
7772    #[cfg(target_os = "fuchsia")]
7773    type SynchronousProxy = DictionaryRouterSynchronousProxy;
7774
7775    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.DictionaryRouter";
7776}
7777impl fidl::endpoints::DiscoverableProtocolMarker for DictionaryRouterMarker {}
7778pub type DictionaryRouterRouteResult = Result<DictionaryRouterRouteResponse, RouterError>;
7779
7780pub trait DictionaryRouterProxyInterface: Send + Sync {
7781    type RouteResponseFut: std::future::Future<Output = Result<DictionaryRouterRouteResult, fidl::Error>>
7782        + Send;
7783    fn r#route(&self, payload: RouteRequest) -> Self::RouteResponseFut;
7784}
7785#[derive(Debug)]
7786#[cfg(target_os = "fuchsia")]
7787pub struct DictionaryRouterSynchronousProxy {
7788    client: fidl::client::sync::Client,
7789}
7790
7791#[cfg(target_os = "fuchsia")]
7792impl fidl::endpoints::SynchronousProxy for DictionaryRouterSynchronousProxy {
7793    type Proxy = DictionaryRouterProxy;
7794    type Protocol = DictionaryRouterMarker;
7795
7796    fn from_channel(inner: fidl::Channel) -> Self {
7797        Self::new(inner)
7798    }
7799
7800    fn into_channel(self) -> fidl::Channel {
7801        self.client.into_channel()
7802    }
7803
7804    fn as_channel(&self) -> &fidl::Channel {
7805        self.client.as_channel()
7806    }
7807}
7808
7809#[cfg(target_os = "fuchsia")]
7810impl DictionaryRouterSynchronousProxy {
7811    pub fn new(channel: fidl::Channel) -> Self {
7812        Self { client: fidl::client::sync::Client::new(channel) }
7813    }
7814
7815    pub fn into_channel(self) -> fidl::Channel {
7816        self.client.into_channel()
7817    }
7818
7819    /// Waits until an event arrives and returns it. It is safe for other
7820    /// threads to make concurrent requests while waiting for an event.
7821    pub fn wait_for_event(
7822        &self,
7823        deadline: zx::MonotonicInstant,
7824    ) -> Result<DictionaryRouterEvent, fidl::Error> {
7825        DictionaryRouterEvent::decode(
7826            self.client.wait_for_event::<DictionaryRouterMarker>(deadline)?,
7827        )
7828    }
7829
7830    pub fn r#route(
7831        &self,
7832        mut payload: RouteRequest,
7833        ___deadline: zx::MonotonicInstant,
7834    ) -> Result<DictionaryRouterRouteResult, fidl::Error> {
7835        let _response = self.client.send_query::<
7836            RouteRequest,
7837            fidl::encoding::FlexibleResultType<DictionaryRouterRouteResponse, RouterError>,
7838            DictionaryRouterMarker,
7839        >(
7840            &mut payload,
7841            0x714c65bfe54bd79f,
7842            fidl::encoding::DynamicFlags::FLEXIBLE,
7843            ___deadline,
7844        )?
7845        .into_result::<DictionaryRouterMarker>("route")?;
7846        Ok(_response.map(|x| x))
7847    }
7848}
7849
7850#[cfg(target_os = "fuchsia")]
7851impl From<DictionaryRouterSynchronousProxy> for zx::NullableHandle {
7852    fn from(value: DictionaryRouterSynchronousProxy) -> Self {
7853        value.into_channel().into()
7854    }
7855}
7856
7857#[cfg(target_os = "fuchsia")]
7858impl From<fidl::Channel> for DictionaryRouterSynchronousProxy {
7859    fn from(value: fidl::Channel) -> Self {
7860        Self::new(value)
7861    }
7862}
7863
7864#[cfg(target_os = "fuchsia")]
7865impl fidl::endpoints::FromClient for DictionaryRouterSynchronousProxy {
7866    type Protocol = DictionaryRouterMarker;
7867
7868    fn from_client(value: fidl::endpoints::ClientEnd<DictionaryRouterMarker>) -> Self {
7869        Self::new(value.into_channel())
7870    }
7871}
7872
7873#[derive(Debug, Clone)]
7874pub struct DictionaryRouterProxy {
7875    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
7876}
7877
7878impl fidl::endpoints::Proxy for DictionaryRouterProxy {
7879    type Protocol = DictionaryRouterMarker;
7880
7881    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
7882        Self::new(inner)
7883    }
7884
7885    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
7886        self.client.into_channel().map_err(|client| Self { client })
7887    }
7888
7889    fn as_channel(&self) -> &::fidl::AsyncChannel {
7890        self.client.as_channel()
7891    }
7892}
7893
7894impl DictionaryRouterProxy {
7895    /// Create a new Proxy for fuchsia.component.sandbox/DictionaryRouter.
7896    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
7897        let protocol_name = <DictionaryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7898        Self { client: fidl::client::Client::new(channel, protocol_name) }
7899    }
7900
7901    /// Get a Stream of events from the remote end of the protocol.
7902    ///
7903    /// # Panics
7904    ///
7905    /// Panics if the event stream was already taken.
7906    pub fn take_event_stream(&self) -> DictionaryRouterEventStream {
7907        DictionaryRouterEventStream { event_receiver: self.client.take_event_receiver() }
7908    }
7909
7910    pub fn r#route(
7911        &self,
7912        mut payload: RouteRequest,
7913    ) -> fidl::client::QueryResponseFut<
7914        DictionaryRouterRouteResult,
7915        fidl::encoding::DefaultFuchsiaResourceDialect,
7916    > {
7917        DictionaryRouterProxyInterface::r#route(self, payload)
7918    }
7919}
7920
7921impl DictionaryRouterProxyInterface for DictionaryRouterProxy {
7922    type RouteResponseFut = fidl::client::QueryResponseFut<
7923        DictionaryRouterRouteResult,
7924        fidl::encoding::DefaultFuchsiaResourceDialect,
7925    >;
7926    fn r#route(&self, mut payload: RouteRequest) -> Self::RouteResponseFut {
7927        fn _decode(
7928            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7929        ) -> Result<DictionaryRouterRouteResult, fidl::Error> {
7930            let _response = fidl::client::decode_transaction_body::<
7931                fidl::encoding::FlexibleResultType<DictionaryRouterRouteResponse, RouterError>,
7932                fidl::encoding::DefaultFuchsiaResourceDialect,
7933                0x714c65bfe54bd79f,
7934            >(_buf?)?
7935            .into_result::<DictionaryRouterMarker>("route")?;
7936            Ok(_response.map(|x| x))
7937        }
7938        self.client.send_query_and_decode::<RouteRequest, DictionaryRouterRouteResult>(
7939            &mut payload,
7940            0x714c65bfe54bd79f,
7941            fidl::encoding::DynamicFlags::FLEXIBLE,
7942            _decode,
7943        )
7944    }
7945}
7946
7947pub struct DictionaryRouterEventStream {
7948    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
7949}
7950
7951impl std::marker::Unpin for DictionaryRouterEventStream {}
7952
7953impl futures::stream::FusedStream for DictionaryRouterEventStream {
7954    fn is_terminated(&self) -> bool {
7955        self.event_receiver.is_terminated()
7956    }
7957}
7958
7959impl futures::Stream for DictionaryRouterEventStream {
7960    type Item = Result<DictionaryRouterEvent, fidl::Error>;
7961
7962    fn poll_next(
7963        mut self: std::pin::Pin<&mut Self>,
7964        cx: &mut std::task::Context<'_>,
7965    ) -> std::task::Poll<Option<Self::Item>> {
7966        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7967            &mut self.event_receiver,
7968            cx
7969        )?) {
7970            Some(buf) => std::task::Poll::Ready(Some(DictionaryRouterEvent::decode(buf))),
7971            None => std::task::Poll::Ready(None),
7972        }
7973    }
7974}
7975
7976#[derive(Debug)]
7977pub enum DictionaryRouterEvent {
7978    #[non_exhaustive]
7979    _UnknownEvent {
7980        /// Ordinal of the event that was sent.
7981        ordinal: u64,
7982    },
7983}
7984
7985impl DictionaryRouterEvent {
7986    /// Decodes a message buffer as a [`DictionaryRouterEvent`].
7987    fn decode(
7988        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7989    ) -> Result<DictionaryRouterEvent, fidl::Error> {
7990        let (bytes, _handles) = buf.split_mut();
7991        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7992        debug_assert_eq!(tx_header.tx_id, 0);
7993        match tx_header.ordinal {
7994            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7995                Ok(DictionaryRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
7996            }
7997            _ => Err(fidl::Error::UnknownOrdinal {
7998                ordinal: tx_header.ordinal,
7999                protocol_name:
8000                    <DictionaryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8001            }),
8002        }
8003    }
8004}
8005
8006/// A Stream of incoming requests for fuchsia.component.sandbox/DictionaryRouter.
8007pub struct DictionaryRouterRequestStream {
8008    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8009    is_terminated: bool,
8010}
8011
8012impl std::marker::Unpin for DictionaryRouterRequestStream {}
8013
8014impl futures::stream::FusedStream for DictionaryRouterRequestStream {
8015    fn is_terminated(&self) -> bool {
8016        self.is_terminated
8017    }
8018}
8019
8020impl fidl::endpoints::RequestStream for DictionaryRouterRequestStream {
8021    type Protocol = DictionaryRouterMarker;
8022    type ControlHandle = DictionaryRouterControlHandle;
8023
8024    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
8025        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
8026    }
8027
8028    fn control_handle(&self) -> Self::ControlHandle {
8029        DictionaryRouterControlHandle { inner: self.inner.clone() }
8030    }
8031
8032    fn into_inner(
8033        self,
8034    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
8035    {
8036        (self.inner, self.is_terminated)
8037    }
8038
8039    fn from_inner(
8040        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8041        is_terminated: bool,
8042    ) -> Self {
8043        Self { inner, is_terminated }
8044    }
8045}
8046
8047impl futures::Stream for DictionaryRouterRequestStream {
8048    type Item = Result<DictionaryRouterRequest, fidl::Error>;
8049
8050    fn poll_next(
8051        mut self: std::pin::Pin<&mut Self>,
8052        cx: &mut std::task::Context<'_>,
8053    ) -> std::task::Poll<Option<Self::Item>> {
8054        let this = &mut *self;
8055        if this.inner.check_shutdown(cx) {
8056            this.is_terminated = true;
8057            return std::task::Poll::Ready(None);
8058        }
8059        if this.is_terminated {
8060            panic!("polled DictionaryRouterRequestStream after completion");
8061        }
8062        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
8063            |bytes, handles| {
8064                match this.inner.channel().read_etc(cx, bytes, handles) {
8065                    std::task::Poll::Ready(Ok(())) => {}
8066                    std::task::Poll::Pending => return std::task::Poll::Pending,
8067                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
8068                        this.is_terminated = true;
8069                        return std::task::Poll::Ready(None);
8070                    }
8071                    std::task::Poll::Ready(Err(e)) => {
8072                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
8073                            e.into(),
8074                        ))));
8075                    }
8076                }
8077
8078                // A message has been received from the channel
8079                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8080
8081                std::task::Poll::Ready(Some(match header.ordinal {
8082                    0x714c65bfe54bd79f => {
8083                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
8084                        let mut req = fidl::new_empty!(
8085                            RouteRequest,
8086                            fidl::encoding::DefaultFuchsiaResourceDialect
8087                        );
8088                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RouteRequest>(&header, _body_bytes, handles, &mut req)?;
8089                        let control_handle =
8090                            DictionaryRouterControlHandle { inner: this.inner.clone() };
8091                        Ok(DictionaryRouterRequest::Route {
8092                            payload: req,
8093                            responder: DictionaryRouterRouteResponder {
8094                                control_handle: std::mem::ManuallyDrop::new(control_handle),
8095                                tx_id: header.tx_id,
8096                            },
8097                        })
8098                    }
8099                    _ if header.tx_id == 0
8100                        && header
8101                            .dynamic_flags()
8102                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
8103                    {
8104                        Ok(DictionaryRouterRequest::_UnknownMethod {
8105                            ordinal: header.ordinal,
8106                            control_handle: DictionaryRouterControlHandle {
8107                                inner: this.inner.clone(),
8108                            },
8109                            method_type: fidl::MethodType::OneWay,
8110                        })
8111                    }
8112                    _ if header
8113                        .dynamic_flags()
8114                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
8115                    {
8116                        this.inner.send_framework_err(
8117                            fidl::encoding::FrameworkErr::UnknownMethod,
8118                            header.tx_id,
8119                            header.ordinal,
8120                            header.dynamic_flags(),
8121                            (bytes, handles),
8122                        )?;
8123                        Ok(DictionaryRouterRequest::_UnknownMethod {
8124                            ordinal: header.ordinal,
8125                            control_handle: DictionaryRouterControlHandle {
8126                                inner: this.inner.clone(),
8127                            },
8128                            method_type: fidl::MethodType::TwoWay,
8129                        })
8130                    }
8131                    _ => Err(fidl::Error::UnknownOrdinal {
8132                        ordinal: header.ordinal,
8133                        protocol_name:
8134                            <DictionaryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8135                    }),
8136                }))
8137            },
8138        )
8139    }
8140}
8141
8142#[derive(Debug)]
8143pub enum DictionaryRouterRequest {
8144    Route {
8145        payload: RouteRequest,
8146        responder: DictionaryRouterRouteResponder,
8147    },
8148    /// An interaction was received which does not match any known method.
8149    #[non_exhaustive]
8150    _UnknownMethod {
8151        /// Ordinal of the method that was called.
8152        ordinal: u64,
8153        control_handle: DictionaryRouterControlHandle,
8154        method_type: fidl::MethodType,
8155    },
8156}
8157
8158impl DictionaryRouterRequest {
8159    #[allow(irrefutable_let_patterns)]
8160    pub fn into_route(self) -> Option<(RouteRequest, DictionaryRouterRouteResponder)> {
8161        if let DictionaryRouterRequest::Route { payload, responder } = self {
8162            Some((payload, responder))
8163        } else {
8164            None
8165        }
8166    }
8167
8168    /// Name of the method defined in FIDL
8169    pub fn method_name(&self) -> &'static str {
8170        match *self {
8171            DictionaryRouterRequest::Route { .. } => "route",
8172            DictionaryRouterRequest::_UnknownMethod {
8173                method_type: fidl::MethodType::OneWay,
8174                ..
8175            } => "unknown one-way method",
8176            DictionaryRouterRequest::_UnknownMethod {
8177                method_type: fidl::MethodType::TwoWay,
8178                ..
8179            } => "unknown two-way method",
8180        }
8181    }
8182}
8183
8184#[derive(Debug, Clone)]
8185pub struct DictionaryRouterControlHandle {
8186    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8187}
8188
8189impl DictionaryRouterControlHandle {
8190    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
8191        self.inner.shutdown_with_epitaph(status.into())
8192    }
8193}
8194
8195impl fidl::endpoints::ControlHandle for DictionaryRouterControlHandle {
8196    fn shutdown(&self) {
8197        self.inner.shutdown()
8198    }
8199
8200    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
8201        self.inner.shutdown_with_epitaph(status)
8202    }
8203
8204    fn is_closed(&self) -> bool {
8205        self.inner.channel().is_closed()
8206    }
8207    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
8208        self.inner.channel().on_closed()
8209    }
8210
8211    #[cfg(target_os = "fuchsia")]
8212    fn signal_peer(
8213        &self,
8214        clear_mask: zx::Signals,
8215        set_mask: zx::Signals,
8216    ) -> Result<(), zx_status::Status> {
8217        use fidl::Peered;
8218        self.inner.channel().signal_peer(clear_mask, set_mask)
8219    }
8220}
8221
8222impl DictionaryRouterControlHandle {}
8223
8224#[must_use = "FIDL methods require a response to be sent"]
8225#[derive(Debug)]
8226pub struct DictionaryRouterRouteResponder {
8227    control_handle: std::mem::ManuallyDrop<DictionaryRouterControlHandle>,
8228    tx_id: u32,
8229}
8230
8231/// Set the the channel to be shutdown (see [`DictionaryRouterControlHandle::shutdown`])
8232/// if the responder is dropped without sending a response, so that the client
8233/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8234impl std::ops::Drop for DictionaryRouterRouteResponder {
8235    fn drop(&mut self) {
8236        self.control_handle.shutdown();
8237        // Safety: drops once, never accessed again
8238        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8239    }
8240}
8241
8242impl fidl::endpoints::Responder for DictionaryRouterRouteResponder {
8243    type ControlHandle = DictionaryRouterControlHandle;
8244
8245    fn control_handle(&self) -> &DictionaryRouterControlHandle {
8246        &self.control_handle
8247    }
8248
8249    fn drop_without_shutdown(mut self) {
8250        // Safety: drops once, never accessed again due to mem::forget
8251        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8252        // Prevent Drop from running (which would shut down the channel)
8253        std::mem::forget(self);
8254    }
8255}
8256
8257impl DictionaryRouterRouteResponder {
8258    /// Sends a response to the FIDL transaction.
8259    ///
8260    /// Sets the channel to shutdown if an error occurs.
8261    pub fn send(
8262        self,
8263        mut result: Result<DictionaryRouterRouteResponse, RouterError>,
8264    ) -> Result<(), fidl::Error> {
8265        let _result = self.send_raw(result);
8266        if _result.is_err() {
8267            self.control_handle.shutdown();
8268        }
8269        self.drop_without_shutdown();
8270        _result
8271    }
8272
8273    /// Similar to "send" but does not shutdown the channel if an error occurs.
8274    pub fn send_no_shutdown_on_err(
8275        self,
8276        mut result: Result<DictionaryRouterRouteResponse, RouterError>,
8277    ) -> Result<(), fidl::Error> {
8278        let _result = self.send_raw(result);
8279        self.drop_without_shutdown();
8280        _result
8281    }
8282
8283    fn send_raw(
8284        &self,
8285        mut result: Result<DictionaryRouterRouteResponse, RouterError>,
8286    ) -> Result<(), fidl::Error> {
8287        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
8288            DictionaryRouterRouteResponse,
8289            RouterError,
8290        >>(
8291            fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
8292            self.tx_id,
8293            0x714c65bfe54bd79f,
8294            fidl::encoding::DynamicFlags::FLEXIBLE,
8295        )
8296    }
8297}
8298
8299#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
8300pub struct DirConnectorRouterMarker;
8301
8302impl fidl::endpoints::ProtocolMarker for DirConnectorRouterMarker {
8303    type Proxy = DirConnectorRouterProxy;
8304    type RequestStream = DirConnectorRouterRequestStream;
8305    #[cfg(target_os = "fuchsia")]
8306    type SynchronousProxy = DirConnectorRouterSynchronousProxy;
8307
8308    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.DirConnectorRouter";
8309}
8310impl fidl::endpoints::DiscoverableProtocolMarker for DirConnectorRouterMarker {}
8311pub type DirConnectorRouterRouteResult = Result<DirConnectorRouterRouteResponse, RouterError>;
8312
8313pub trait DirConnectorRouterProxyInterface: Send + Sync {
8314    type RouteResponseFut: std::future::Future<Output = Result<DirConnectorRouterRouteResult, fidl::Error>>
8315        + Send;
8316    fn r#route(&self, payload: RouteRequest) -> Self::RouteResponseFut;
8317}
8318#[derive(Debug)]
8319#[cfg(target_os = "fuchsia")]
8320pub struct DirConnectorRouterSynchronousProxy {
8321    client: fidl::client::sync::Client,
8322}
8323
8324#[cfg(target_os = "fuchsia")]
8325impl fidl::endpoints::SynchronousProxy for DirConnectorRouterSynchronousProxy {
8326    type Proxy = DirConnectorRouterProxy;
8327    type Protocol = DirConnectorRouterMarker;
8328
8329    fn from_channel(inner: fidl::Channel) -> Self {
8330        Self::new(inner)
8331    }
8332
8333    fn into_channel(self) -> fidl::Channel {
8334        self.client.into_channel()
8335    }
8336
8337    fn as_channel(&self) -> &fidl::Channel {
8338        self.client.as_channel()
8339    }
8340}
8341
8342#[cfg(target_os = "fuchsia")]
8343impl DirConnectorRouterSynchronousProxy {
8344    pub fn new(channel: fidl::Channel) -> Self {
8345        Self { client: fidl::client::sync::Client::new(channel) }
8346    }
8347
8348    pub fn into_channel(self) -> fidl::Channel {
8349        self.client.into_channel()
8350    }
8351
8352    /// Waits until an event arrives and returns it. It is safe for other
8353    /// threads to make concurrent requests while waiting for an event.
8354    pub fn wait_for_event(
8355        &self,
8356        deadline: zx::MonotonicInstant,
8357    ) -> Result<DirConnectorRouterEvent, fidl::Error> {
8358        DirConnectorRouterEvent::decode(
8359            self.client.wait_for_event::<DirConnectorRouterMarker>(deadline)?,
8360        )
8361    }
8362
8363    pub fn r#route(
8364        &self,
8365        mut payload: RouteRequest,
8366        ___deadline: zx::MonotonicInstant,
8367    ) -> Result<DirConnectorRouterRouteResult, fidl::Error> {
8368        let _response = self.client.send_query::<
8369            RouteRequest,
8370            fidl::encoding::FlexibleResultType<DirConnectorRouterRouteResponse, RouterError>,
8371            DirConnectorRouterMarker,
8372        >(
8373            &mut payload,
8374            0xd7e0f01da2c8e40,
8375            fidl::encoding::DynamicFlags::FLEXIBLE,
8376            ___deadline,
8377        )?
8378        .into_result::<DirConnectorRouterMarker>("route")?;
8379        Ok(_response.map(|x| x))
8380    }
8381}
8382
8383#[cfg(target_os = "fuchsia")]
8384impl From<DirConnectorRouterSynchronousProxy> for zx::NullableHandle {
8385    fn from(value: DirConnectorRouterSynchronousProxy) -> Self {
8386        value.into_channel().into()
8387    }
8388}
8389
8390#[cfg(target_os = "fuchsia")]
8391impl From<fidl::Channel> for DirConnectorRouterSynchronousProxy {
8392    fn from(value: fidl::Channel) -> Self {
8393        Self::new(value)
8394    }
8395}
8396
8397#[cfg(target_os = "fuchsia")]
8398impl fidl::endpoints::FromClient for DirConnectorRouterSynchronousProxy {
8399    type Protocol = DirConnectorRouterMarker;
8400
8401    fn from_client(value: fidl::endpoints::ClientEnd<DirConnectorRouterMarker>) -> Self {
8402        Self::new(value.into_channel())
8403    }
8404}
8405
8406#[derive(Debug, Clone)]
8407pub struct DirConnectorRouterProxy {
8408    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
8409}
8410
8411impl fidl::endpoints::Proxy for DirConnectorRouterProxy {
8412    type Protocol = DirConnectorRouterMarker;
8413
8414    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
8415        Self::new(inner)
8416    }
8417
8418    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
8419        self.client.into_channel().map_err(|client| Self { client })
8420    }
8421
8422    fn as_channel(&self) -> &::fidl::AsyncChannel {
8423        self.client.as_channel()
8424    }
8425}
8426
8427impl DirConnectorRouterProxy {
8428    /// Create a new Proxy for fuchsia.component.sandbox/DirConnectorRouter.
8429    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
8430        let protocol_name =
8431            <DirConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8432        Self { client: fidl::client::Client::new(channel, protocol_name) }
8433    }
8434
8435    /// Get a Stream of events from the remote end of the protocol.
8436    ///
8437    /// # Panics
8438    ///
8439    /// Panics if the event stream was already taken.
8440    pub fn take_event_stream(&self) -> DirConnectorRouterEventStream {
8441        DirConnectorRouterEventStream { event_receiver: self.client.take_event_receiver() }
8442    }
8443
8444    pub fn r#route(
8445        &self,
8446        mut payload: RouteRequest,
8447    ) -> fidl::client::QueryResponseFut<
8448        DirConnectorRouterRouteResult,
8449        fidl::encoding::DefaultFuchsiaResourceDialect,
8450    > {
8451        DirConnectorRouterProxyInterface::r#route(self, payload)
8452    }
8453}
8454
8455impl DirConnectorRouterProxyInterface for DirConnectorRouterProxy {
8456    type RouteResponseFut = fidl::client::QueryResponseFut<
8457        DirConnectorRouterRouteResult,
8458        fidl::encoding::DefaultFuchsiaResourceDialect,
8459    >;
8460    fn r#route(&self, mut payload: RouteRequest) -> Self::RouteResponseFut {
8461        fn _decode(
8462            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8463        ) -> Result<DirConnectorRouterRouteResult, fidl::Error> {
8464            let _response = fidl::client::decode_transaction_body::<
8465                fidl::encoding::FlexibleResultType<DirConnectorRouterRouteResponse, RouterError>,
8466                fidl::encoding::DefaultFuchsiaResourceDialect,
8467                0xd7e0f01da2c8e40,
8468            >(_buf?)?
8469            .into_result::<DirConnectorRouterMarker>("route")?;
8470            Ok(_response.map(|x| x))
8471        }
8472        self.client.send_query_and_decode::<RouteRequest, DirConnectorRouterRouteResult>(
8473            &mut payload,
8474            0xd7e0f01da2c8e40,
8475            fidl::encoding::DynamicFlags::FLEXIBLE,
8476            _decode,
8477        )
8478    }
8479}
8480
8481pub struct DirConnectorRouterEventStream {
8482    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
8483}
8484
8485impl std::marker::Unpin for DirConnectorRouterEventStream {}
8486
8487impl futures::stream::FusedStream for DirConnectorRouterEventStream {
8488    fn is_terminated(&self) -> bool {
8489        self.event_receiver.is_terminated()
8490    }
8491}
8492
8493impl futures::Stream for DirConnectorRouterEventStream {
8494    type Item = Result<DirConnectorRouterEvent, fidl::Error>;
8495
8496    fn poll_next(
8497        mut self: std::pin::Pin<&mut Self>,
8498        cx: &mut std::task::Context<'_>,
8499    ) -> std::task::Poll<Option<Self::Item>> {
8500        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
8501            &mut self.event_receiver,
8502            cx
8503        )?) {
8504            Some(buf) => std::task::Poll::Ready(Some(DirConnectorRouterEvent::decode(buf))),
8505            None => std::task::Poll::Ready(None),
8506        }
8507    }
8508}
8509
8510#[derive(Debug)]
8511pub enum DirConnectorRouterEvent {
8512    #[non_exhaustive]
8513    _UnknownEvent {
8514        /// Ordinal of the event that was sent.
8515        ordinal: u64,
8516    },
8517}
8518
8519impl DirConnectorRouterEvent {
8520    /// Decodes a message buffer as a [`DirConnectorRouterEvent`].
8521    fn decode(
8522        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
8523    ) -> Result<DirConnectorRouterEvent, fidl::Error> {
8524        let (bytes, _handles) = buf.split_mut();
8525        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8526        debug_assert_eq!(tx_header.tx_id, 0);
8527        match tx_header.ordinal {
8528            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
8529                Ok(DirConnectorRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
8530            }
8531            _ => Err(fidl::Error::UnknownOrdinal {
8532                ordinal: tx_header.ordinal,
8533                protocol_name:
8534                    <DirConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8535            }),
8536        }
8537    }
8538}
8539
8540/// A Stream of incoming requests for fuchsia.component.sandbox/DirConnectorRouter.
8541pub struct DirConnectorRouterRequestStream {
8542    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8543    is_terminated: bool,
8544}
8545
8546impl std::marker::Unpin for DirConnectorRouterRequestStream {}
8547
8548impl futures::stream::FusedStream for DirConnectorRouterRequestStream {
8549    fn is_terminated(&self) -> bool {
8550        self.is_terminated
8551    }
8552}
8553
8554impl fidl::endpoints::RequestStream for DirConnectorRouterRequestStream {
8555    type Protocol = DirConnectorRouterMarker;
8556    type ControlHandle = DirConnectorRouterControlHandle;
8557
8558    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
8559        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
8560    }
8561
8562    fn control_handle(&self) -> Self::ControlHandle {
8563        DirConnectorRouterControlHandle { inner: self.inner.clone() }
8564    }
8565
8566    fn into_inner(
8567        self,
8568    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
8569    {
8570        (self.inner, self.is_terminated)
8571    }
8572
8573    fn from_inner(
8574        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8575        is_terminated: bool,
8576    ) -> Self {
8577        Self { inner, is_terminated }
8578    }
8579}
8580
8581impl futures::Stream for DirConnectorRouterRequestStream {
8582    type Item = Result<DirConnectorRouterRequest, fidl::Error>;
8583
8584    fn poll_next(
8585        mut self: std::pin::Pin<&mut Self>,
8586        cx: &mut std::task::Context<'_>,
8587    ) -> std::task::Poll<Option<Self::Item>> {
8588        let this = &mut *self;
8589        if this.inner.check_shutdown(cx) {
8590            this.is_terminated = true;
8591            return std::task::Poll::Ready(None);
8592        }
8593        if this.is_terminated {
8594            panic!("polled DirConnectorRouterRequestStream after completion");
8595        }
8596        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
8597            |bytes, handles| {
8598                match this.inner.channel().read_etc(cx, bytes, handles) {
8599                    std::task::Poll::Ready(Ok(())) => {}
8600                    std::task::Poll::Pending => return std::task::Poll::Pending,
8601                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
8602                        this.is_terminated = true;
8603                        return std::task::Poll::Ready(None);
8604                    }
8605                    std::task::Poll::Ready(Err(e)) => {
8606                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
8607                            e.into(),
8608                        ))));
8609                    }
8610                }
8611
8612                // A message has been received from the channel
8613                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8614
8615                std::task::Poll::Ready(Some(match header.ordinal {
8616                0xd7e0f01da2c8e40 => {
8617                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
8618                    let mut req = fidl::new_empty!(RouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
8619                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RouteRequest>(&header, _body_bytes, handles, &mut req)?;
8620                    let control_handle = DirConnectorRouterControlHandle {
8621                        inner: this.inner.clone(),
8622                    };
8623                    Ok(DirConnectorRouterRequest::Route {payload: req,
8624                        responder: DirConnectorRouterRouteResponder {
8625                            control_handle: std::mem::ManuallyDrop::new(control_handle),
8626                            tx_id: header.tx_id,
8627                        },
8628                    })
8629                }
8630                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
8631                    Ok(DirConnectorRouterRequest::_UnknownMethod {
8632                        ordinal: header.ordinal,
8633                        control_handle: DirConnectorRouterControlHandle { inner: this.inner.clone() },
8634                        method_type: fidl::MethodType::OneWay,
8635                    })
8636                }
8637                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
8638                    this.inner.send_framework_err(
8639                        fidl::encoding::FrameworkErr::UnknownMethod,
8640                        header.tx_id,
8641                        header.ordinal,
8642                        header.dynamic_flags(),
8643                        (bytes, handles),
8644                    )?;
8645                    Ok(DirConnectorRouterRequest::_UnknownMethod {
8646                        ordinal: header.ordinal,
8647                        control_handle: DirConnectorRouterControlHandle { inner: this.inner.clone() },
8648                        method_type: fidl::MethodType::TwoWay,
8649                    })
8650                }
8651                _ => Err(fidl::Error::UnknownOrdinal {
8652                    ordinal: header.ordinal,
8653                    protocol_name: <DirConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8654                }),
8655            }))
8656            },
8657        )
8658    }
8659}
8660
8661#[derive(Debug)]
8662pub enum DirConnectorRouterRequest {
8663    Route {
8664        payload: RouteRequest,
8665        responder: DirConnectorRouterRouteResponder,
8666    },
8667    /// An interaction was received which does not match any known method.
8668    #[non_exhaustive]
8669    _UnknownMethod {
8670        /// Ordinal of the method that was called.
8671        ordinal: u64,
8672        control_handle: DirConnectorRouterControlHandle,
8673        method_type: fidl::MethodType,
8674    },
8675}
8676
8677impl DirConnectorRouterRequest {
8678    #[allow(irrefutable_let_patterns)]
8679    pub fn into_route(self) -> Option<(RouteRequest, DirConnectorRouterRouteResponder)> {
8680        if let DirConnectorRouterRequest::Route { payload, responder } = self {
8681            Some((payload, responder))
8682        } else {
8683            None
8684        }
8685    }
8686
8687    /// Name of the method defined in FIDL
8688    pub fn method_name(&self) -> &'static str {
8689        match *self {
8690            DirConnectorRouterRequest::Route { .. } => "route",
8691            DirConnectorRouterRequest::_UnknownMethod {
8692                method_type: fidl::MethodType::OneWay,
8693                ..
8694            } => "unknown one-way method",
8695            DirConnectorRouterRequest::_UnknownMethod {
8696                method_type: fidl::MethodType::TwoWay,
8697                ..
8698            } => "unknown two-way method",
8699        }
8700    }
8701}
8702
8703#[derive(Debug, Clone)]
8704pub struct DirConnectorRouterControlHandle {
8705    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8706}
8707
8708impl DirConnectorRouterControlHandle {
8709    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
8710        self.inner.shutdown_with_epitaph(status.into())
8711    }
8712}
8713
8714impl fidl::endpoints::ControlHandle for DirConnectorRouterControlHandle {
8715    fn shutdown(&self) {
8716        self.inner.shutdown()
8717    }
8718
8719    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
8720        self.inner.shutdown_with_epitaph(status)
8721    }
8722
8723    fn is_closed(&self) -> bool {
8724        self.inner.channel().is_closed()
8725    }
8726    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
8727        self.inner.channel().on_closed()
8728    }
8729
8730    #[cfg(target_os = "fuchsia")]
8731    fn signal_peer(
8732        &self,
8733        clear_mask: zx::Signals,
8734        set_mask: zx::Signals,
8735    ) -> Result<(), zx_status::Status> {
8736        use fidl::Peered;
8737        self.inner.channel().signal_peer(clear_mask, set_mask)
8738    }
8739}
8740
8741impl DirConnectorRouterControlHandle {}
8742
8743#[must_use = "FIDL methods require a response to be sent"]
8744#[derive(Debug)]
8745pub struct DirConnectorRouterRouteResponder {
8746    control_handle: std::mem::ManuallyDrop<DirConnectorRouterControlHandle>,
8747    tx_id: u32,
8748}
8749
8750/// Set the the channel to be shutdown (see [`DirConnectorRouterControlHandle::shutdown`])
8751/// if the responder is dropped without sending a response, so that the client
8752/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8753impl std::ops::Drop for DirConnectorRouterRouteResponder {
8754    fn drop(&mut self) {
8755        self.control_handle.shutdown();
8756        // Safety: drops once, never accessed again
8757        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8758    }
8759}
8760
8761impl fidl::endpoints::Responder for DirConnectorRouterRouteResponder {
8762    type ControlHandle = DirConnectorRouterControlHandle;
8763
8764    fn control_handle(&self) -> &DirConnectorRouterControlHandle {
8765        &self.control_handle
8766    }
8767
8768    fn drop_without_shutdown(mut self) {
8769        // Safety: drops once, never accessed again due to mem::forget
8770        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8771        // Prevent Drop from running (which would shut down the channel)
8772        std::mem::forget(self);
8773    }
8774}
8775
8776impl DirConnectorRouterRouteResponder {
8777    /// Sends a response to the FIDL transaction.
8778    ///
8779    /// Sets the channel to shutdown if an error occurs.
8780    pub fn send(
8781        self,
8782        mut result: Result<DirConnectorRouterRouteResponse, RouterError>,
8783    ) -> Result<(), fidl::Error> {
8784        let _result = self.send_raw(result);
8785        if _result.is_err() {
8786            self.control_handle.shutdown();
8787        }
8788        self.drop_without_shutdown();
8789        _result
8790    }
8791
8792    /// Similar to "send" but does not shutdown the channel if an error occurs.
8793    pub fn send_no_shutdown_on_err(
8794        self,
8795        mut result: Result<DirConnectorRouterRouteResponse, RouterError>,
8796    ) -> Result<(), fidl::Error> {
8797        let _result = self.send_raw(result);
8798        self.drop_without_shutdown();
8799        _result
8800    }
8801
8802    fn send_raw(
8803        &self,
8804        mut result: Result<DirConnectorRouterRouteResponse, RouterError>,
8805    ) -> Result<(), fidl::Error> {
8806        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
8807            DirConnectorRouterRouteResponse,
8808            RouterError,
8809        >>(
8810            fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
8811            self.tx_id,
8812            0xd7e0f01da2c8e40,
8813            fidl::encoding::DynamicFlags::FLEXIBLE,
8814        )
8815    }
8816}
8817
8818#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
8819pub struct DirEntryRouterMarker;
8820
8821impl fidl::endpoints::ProtocolMarker for DirEntryRouterMarker {
8822    type Proxy = DirEntryRouterProxy;
8823    type RequestStream = DirEntryRouterRequestStream;
8824    #[cfg(target_os = "fuchsia")]
8825    type SynchronousProxy = DirEntryRouterSynchronousProxy;
8826
8827    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.DirEntryRouter";
8828}
8829impl fidl::endpoints::DiscoverableProtocolMarker for DirEntryRouterMarker {}
8830pub type DirEntryRouterRouteResult = Result<DirEntryRouterRouteResponse, RouterError>;
8831
8832pub trait DirEntryRouterProxyInterface: Send + Sync {
8833    type RouteResponseFut: std::future::Future<Output = Result<DirEntryRouterRouteResult, fidl::Error>>
8834        + Send;
8835    fn r#route(&self, payload: RouteRequest) -> Self::RouteResponseFut;
8836}
8837#[derive(Debug)]
8838#[cfg(target_os = "fuchsia")]
8839pub struct DirEntryRouterSynchronousProxy {
8840    client: fidl::client::sync::Client,
8841}
8842
8843#[cfg(target_os = "fuchsia")]
8844impl fidl::endpoints::SynchronousProxy for DirEntryRouterSynchronousProxy {
8845    type Proxy = DirEntryRouterProxy;
8846    type Protocol = DirEntryRouterMarker;
8847
8848    fn from_channel(inner: fidl::Channel) -> Self {
8849        Self::new(inner)
8850    }
8851
8852    fn into_channel(self) -> fidl::Channel {
8853        self.client.into_channel()
8854    }
8855
8856    fn as_channel(&self) -> &fidl::Channel {
8857        self.client.as_channel()
8858    }
8859}
8860
8861#[cfg(target_os = "fuchsia")]
8862impl DirEntryRouterSynchronousProxy {
8863    pub fn new(channel: fidl::Channel) -> Self {
8864        Self { client: fidl::client::sync::Client::new(channel) }
8865    }
8866
8867    pub fn into_channel(self) -> fidl::Channel {
8868        self.client.into_channel()
8869    }
8870
8871    /// Waits until an event arrives and returns it. It is safe for other
8872    /// threads to make concurrent requests while waiting for an event.
8873    pub fn wait_for_event(
8874        &self,
8875        deadline: zx::MonotonicInstant,
8876    ) -> Result<DirEntryRouterEvent, fidl::Error> {
8877        DirEntryRouterEvent::decode(self.client.wait_for_event::<DirEntryRouterMarker>(deadline)?)
8878    }
8879
8880    pub fn r#route(
8881        &self,
8882        mut payload: RouteRequest,
8883        ___deadline: zx::MonotonicInstant,
8884    ) -> Result<DirEntryRouterRouteResult, fidl::Error> {
8885        let _response = self.client.send_query::<
8886            RouteRequest,
8887            fidl::encoding::FlexibleResultType<DirEntryRouterRouteResponse, RouterError>,
8888            DirEntryRouterMarker,
8889        >(
8890            &mut payload,
8891            0x1ac694001c208bd2,
8892            fidl::encoding::DynamicFlags::FLEXIBLE,
8893            ___deadline,
8894        )?
8895        .into_result::<DirEntryRouterMarker>("route")?;
8896        Ok(_response.map(|x| x))
8897    }
8898}
8899
8900#[cfg(target_os = "fuchsia")]
8901impl From<DirEntryRouterSynchronousProxy> for zx::NullableHandle {
8902    fn from(value: DirEntryRouterSynchronousProxy) -> Self {
8903        value.into_channel().into()
8904    }
8905}
8906
8907#[cfg(target_os = "fuchsia")]
8908impl From<fidl::Channel> for DirEntryRouterSynchronousProxy {
8909    fn from(value: fidl::Channel) -> Self {
8910        Self::new(value)
8911    }
8912}
8913
8914#[cfg(target_os = "fuchsia")]
8915impl fidl::endpoints::FromClient for DirEntryRouterSynchronousProxy {
8916    type Protocol = DirEntryRouterMarker;
8917
8918    fn from_client(value: fidl::endpoints::ClientEnd<DirEntryRouterMarker>) -> Self {
8919        Self::new(value.into_channel())
8920    }
8921}
8922
8923#[derive(Debug, Clone)]
8924pub struct DirEntryRouterProxy {
8925    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
8926}
8927
8928impl fidl::endpoints::Proxy for DirEntryRouterProxy {
8929    type Protocol = DirEntryRouterMarker;
8930
8931    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
8932        Self::new(inner)
8933    }
8934
8935    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
8936        self.client.into_channel().map_err(|client| Self { client })
8937    }
8938
8939    fn as_channel(&self) -> &::fidl::AsyncChannel {
8940        self.client.as_channel()
8941    }
8942}
8943
8944impl DirEntryRouterProxy {
8945    /// Create a new Proxy for fuchsia.component.sandbox/DirEntryRouter.
8946    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
8947        let protocol_name = <DirEntryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8948        Self { client: fidl::client::Client::new(channel, protocol_name) }
8949    }
8950
8951    /// Get a Stream of events from the remote end of the protocol.
8952    ///
8953    /// # Panics
8954    ///
8955    /// Panics if the event stream was already taken.
8956    pub fn take_event_stream(&self) -> DirEntryRouterEventStream {
8957        DirEntryRouterEventStream { event_receiver: self.client.take_event_receiver() }
8958    }
8959
8960    pub fn r#route(
8961        &self,
8962        mut payload: RouteRequest,
8963    ) -> fidl::client::QueryResponseFut<
8964        DirEntryRouterRouteResult,
8965        fidl::encoding::DefaultFuchsiaResourceDialect,
8966    > {
8967        DirEntryRouterProxyInterface::r#route(self, payload)
8968    }
8969}
8970
8971impl DirEntryRouterProxyInterface for DirEntryRouterProxy {
8972    type RouteResponseFut = fidl::client::QueryResponseFut<
8973        DirEntryRouterRouteResult,
8974        fidl::encoding::DefaultFuchsiaResourceDialect,
8975    >;
8976    fn r#route(&self, mut payload: RouteRequest) -> Self::RouteResponseFut {
8977        fn _decode(
8978            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8979        ) -> Result<DirEntryRouterRouteResult, fidl::Error> {
8980            let _response = fidl::client::decode_transaction_body::<
8981                fidl::encoding::FlexibleResultType<DirEntryRouterRouteResponse, RouterError>,
8982                fidl::encoding::DefaultFuchsiaResourceDialect,
8983                0x1ac694001c208bd2,
8984            >(_buf?)?
8985            .into_result::<DirEntryRouterMarker>("route")?;
8986            Ok(_response.map(|x| x))
8987        }
8988        self.client.send_query_and_decode::<RouteRequest, DirEntryRouterRouteResult>(
8989            &mut payload,
8990            0x1ac694001c208bd2,
8991            fidl::encoding::DynamicFlags::FLEXIBLE,
8992            _decode,
8993        )
8994    }
8995}
8996
8997pub struct DirEntryRouterEventStream {
8998    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
8999}
9000
9001impl std::marker::Unpin for DirEntryRouterEventStream {}
9002
9003impl futures::stream::FusedStream for DirEntryRouterEventStream {
9004    fn is_terminated(&self) -> bool {
9005        self.event_receiver.is_terminated()
9006    }
9007}
9008
9009impl futures::Stream for DirEntryRouterEventStream {
9010    type Item = Result<DirEntryRouterEvent, fidl::Error>;
9011
9012    fn poll_next(
9013        mut self: std::pin::Pin<&mut Self>,
9014        cx: &mut std::task::Context<'_>,
9015    ) -> std::task::Poll<Option<Self::Item>> {
9016        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
9017            &mut self.event_receiver,
9018            cx
9019        )?) {
9020            Some(buf) => std::task::Poll::Ready(Some(DirEntryRouterEvent::decode(buf))),
9021            None => std::task::Poll::Ready(None),
9022        }
9023    }
9024}
9025
9026#[derive(Debug)]
9027pub enum DirEntryRouterEvent {
9028    #[non_exhaustive]
9029    _UnknownEvent {
9030        /// Ordinal of the event that was sent.
9031        ordinal: u64,
9032    },
9033}
9034
9035impl DirEntryRouterEvent {
9036    /// Decodes a message buffer as a [`DirEntryRouterEvent`].
9037    fn decode(
9038        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
9039    ) -> Result<DirEntryRouterEvent, fidl::Error> {
9040        let (bytes, _handles) = buf.split_mut();
9041        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9042        debug_assert_eq!(tx_header.tx_id, 0);
9043        match tx_header.ordinal {
9044            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
9045                Ok(DirEntryRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
9046            }
9047            _ => Err(fidl::Error::UnknownOrdinal {
9048                ordinal: tx_header.ordinal,
9049                protocol_name:
9050                    <DirEntryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9051            }),
9052        }
9053    }
9054}
9055
9056/// A Stream of incoming requests for fuchsia.component.sandbox/DirEntryRouter.
9057pub struct DirEntryRouterRequestStream {
9058    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9059    is_terminated: bool,
9060}
9061
9062impl std::marker::Unpin for DirEntryRouterRequestStream {}
9063
9064impl futures::stream::FusedStream for DirEntryRouterRequestStream {
9065    fn is_terminated(&self) -> bool {
9066        self.is_terminated
9067    }
9068}
9069
9070impl fidl::endpoints::RequestStream for DirEntryRouterRequestStream {
9071    type Protocol = DirEntryRouterMarker;
9072    type ControlHandle = DirEntryRouterControlHandle;
9073
9074    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
9075        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
9076    }
9077
9078    fn control_handle(&self) -> Self::ControlHandle {
9079        DirEntryRouterControlHandle { inner: self.inner.clone() }
9080    }
9081
9082    fn into_inner(
9083        self,
9084    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
9085    {
9086        (self.inner, self.is_terminated)
9087    }
9088
9089    fn from_inner(
9090        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9091        is_terminated: bool,
9092    ) -> Self {
9093        Self { inner, is_terminated }
9094    }
9095}
9096
9097impl futures::Stream for DirEntryRouterRequestStream {
9098    type Item = Result<DirEntryRouterRequest, fidl::Error>;
9099
9100    fn poll_next(
9101        mut self: std::pin::Pin<&mut Self>,
9102        cx: &mut std::task::Context<'_>,
9103    ) -> std::task::Poll<Option<Self::Item>> {
9104        let this = &mut *self;
9105        if this.inner.check_shutdown(cx) {
9106            this.is_terminated = true;
9107            return std::task::Poll::Ready(None);
9108        }
9109        if this.is_terminated {
9110            panic!("polled DirEntryRouterRequestStream after completion");
9111        }
9112        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
9113            |bytes, handles| {
9114                match this.inner.channel().read_etc(cx, bytes, handles) {
9115                    std::task::Poll::Ready(Ok(())) => {}
9116                    std::task::Poll::Pending => return std::task::Poll::Pending,
9117                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
9118                        this.is_terminated = true;
9119                        return std::task::Poll::Ready(None);
9120                    }
9121                    std::task::Poll::Ready(Err(e)) => {
9122                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
9123                            e.into(),
9124                        ))));
9125                    }
9126                }
9127
9128                // A message has been received from the channel
9129                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9130
9131                std::task::Poll::Ready(Some(match header.ordinal {
9132                    0x1ac694001c208bd2 => {
9133                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9134                        let mut req = fidl::new_empty!(
9135                            RouteRequest,
9136                            fidl::encoding::DefaultFuchsiaResourceDialect
9137                        );
9138                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RouteRequest>(&header, _body_bytes, handles, &mut req)?;
9139                        let control_handle =
9140                            DirEntryRouterControlHandle { inner: this.inner.clone() };
9141                        Ok(DirEntryRouterRequest::Route {
9142                            payload: req,
9143                            responder: DirEntryRouterRouteResponder {
9144                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9145                                tx_id: header.tx_id,
9146                            },
9147                        })
9148                    }
9149                    _ if header.tx_id == 0
9150                        && header
9151                            .dynamic_flags()
9152                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
9153                    {
9154                        Ok(DirEntryRouterRequest::_UnknownMethod {
9155                            ordinal: header.ordinal,
9156                            control_handle: DirEntryRouterControlHandle {
9157                                inner: this.inner.clone(),
9158                            },
9159                            method_type: fidl::MethodType::OneWay,
9160                        })
9161                    }
9162                    _ if header
9163                        .dynamic_flags()
9164                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
9165                    {
9166                        this.inner.send_framework_err(
9167                            fidl::encoding::FrameworkErr::UnknownMethod,
9168                            header.tx_id,
9169                            header.ordinal,
9170                            header.dynamic_flags(),
9171                            (bytes, handles),
9172                        )?;
9173                        Ok(DirEntryRouterRequest::_UnknownMethod {
9174                            ordinal: header.ordinal,
9175                            control_handle: DirEntryRouterControlHandle {
9176                                inner: this.inner.clone(),
9177                            },
9178                            method_type: fidl::MethodType::TwoWay,
9179                        })
9180                    }
9181                    _ => Err(fidl::Error::UnknownOrdinal {
9182                        ordinal: header.ordinal,
9183                        protocol_name:
9184                            <DirEntryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9185                    }),
9186                }))
9187            },
9188        )
9189    }
9190}
9191
9192#[derive(Debug)]
9193pub enum DirEntryRouterRequest {
9194    Route {
9195        payload: RouteRequest,
9196        responder: DirEntryRouterRouteResponder,
9197    },
9198    /// An interaction was received which does not match any known method.
9199    #[non_exhaustive]
9200    _UnknownMethod {
9201        /// Ordinal of the method that was called.
9202        ordinal: u64,
9203        control_handle: DirEntryRouterControlHandle,
9204        method_type: fidl::MethodType,
9205    },
9206}
9207
9208impl DirEntryRouterRequest {
9209    #[allow(irrefutable_let_patterns)]
9210    pub fn into_route(self) -> Option<(RouteRequest, DirEntryRouterRouteResponder)> {
9211        if let DirEntryRouterRequest::Route { payload, responder } = self {
9212            Some((payload, responder))
9213        } else {
9214            None
9215        }
9216    }
9217
9218    /// Name of the method defined in FIDL
9219    pub fn method_name(&self) -> &'static str {
9220        match *self {
9221            DirEntryRouterRequest::Route { .. } => "route",
9222            DirEntryRouterRequest::_UnknownMethod {
9223                method_type: fidl::MethodType::OneWay, ..
9224            } => "unknown one-way method",
9225            DirEntryRouterRequest::_UnknownMethod {
9226                method_type: fidl::MethodType::TwoWay, ..
9227            } => "unknown two-way method",
9228        }
9229    }
9230}
9231
9232#[derive(Debug, Clone)]
9233pub struct DirEntryRouterControlHandle {
9234    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9235}
9236
9237impl DirEntryRouterControlHandle {
9238    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
9239        self.inner.shutdown_with_epitaph(status.into())
9240    }
9241}
9242
9243impl fidl::endpoints::ControlHandle for DirEntryRouterControlHandle {
9244    fn shutdown(&self) {
9245        self.inner.shutdown()
9246    }
9247
9248    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
9249        self.inner.shutdown_with_epitaph(status)
9250    }
9251
9252    fn is_closed(&self) -> bool {
9253        self.inner.channel().is_closed()
9254    }
9255    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
9256        self.inner.channel().on_closed()
9257    }
9258
9259    #[cfg(target_os = "fuchsia")]
9260    fn signal_peer(
9261        &self,
9262        clear_mask: zx::Signals,
9263        set_mask: zx::Signals,
9264    ) -> Result<(), zx_status::Status> {
9265        use fidl::Peered;
9266        self.inner.channel().signal_peer(clear_mask, set_mask)
9267    }
9268}
9269
9270impl DirEntryRouterControlHandle {}
9271
9272#[must_use = "FIDL methods require a response to be sent"]
9273#[derive(Debug)]
9274pub struct DirEntryRouterRouteResponder {
9275    control_handle: std::mem::ManuallyDrop<DirEntryRouterControlHandle>,
9276    tx_id: u32,
9277}
9278
9279/// Set the the channel to be shutdown (see [`DirEntryRouterControlHandle::shutdown`])
9280/// if the responder is dropped without sending a response, so that the client
9281/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9282impl std::ops::Drop for DirEntryRouterRouteResponder {
9283    fn drop(&mut self) {
9284        self.control_handle.shutdown();
9285        // Safety: drops once, never accessed again
9286        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9287    }
9288}
9289
9290impl fidl::endpoints::Responder for DirEntryRouterRouteResponder {
9291    type ControlHandle = DirEntryRouterControlHandle;
9292
9293    fn control_handle(&self) -> &DirEntryRouterControlHandle {
9294        &self.control_handle
9295    }
9296
9297    fn drop_without_shutdown(mut self) {
9298        // Safety: drops once, never accessed again due to mem::forget
9299        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9300        // Prevent Drop from running (which would shut down the channel)
9301        std::mem::forget(self);
9302    }
9303}
9304
9305impl DirEntryRouterRouteResponder {
9306    /// Sends a response to the FIDL transaction.
9307    ///
9308    /// Sets the channel to shutdown if an error occurs.
9309    pub fn send(
9310        self,
9311        mut result: Result<DirEntryRouterRouteResponse, RouterError>,
9312    ) -> Result<(), fidl::Error> {
9313        let _result = self.send_raw(result);
9314        if _result.is_err() {
9315            self.control_handle.shutdown();
9316        }
9317        self.drop_without_shutdown();
9318        _result
9319    }
9320
9321    /// Similar to "send" but does not shutdown the channel if an error occurs.
9322    pub fn send_no_shutdown_on_err(
9323        self,
9324        mut result: Result<DirEntryRouterRouteResponse, RouterError>,
9325    ) -> Result<(), fidl::Error> {
9326        let _result = self.send_raw(result);
9327        self.drop_without_shutdown();
9328        _result
9329    }
9330
9331    fn send_raw(
9332        &self,
9333        mut result: Result<DirEntryRouterRouteResponse, RouterError>,
9334    ) -> Result<(), fidl::Error> {
9335        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
9336            DirEntryRouterRouteResponse,
9337            RouterError,
9338        >>(
9339            fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
9340            self.tx_id,
9341            0x1ac694001c208bd2,
9342            fidl::encoding::DynamicFlags::FLEXIBLE,
9343        )
9344    }
9345}
9346
9347#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
9348pub struct DirReceiverMarker;
9349
9350impl fidl::endpoints::ProtocolMarker for DirReceiverMarker {
9351    type Proxy = DirReceiverProxy;
9352    type RequestStream = DirReceiverRequestStream;
9353    #[cfg(target_os = "fuchsia")]
9354    type SynchronousProxy = DirReceiverSynchronousProxy;
9355
9356    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.DirReceiver";
9357}
9358impl fidl::endpoints::DiscoverableProtocolMarker for DirReceiverMarker {}
9359
9360pub trait DirReceiverProxyInterface: Send + Sync {
9361    fn r#receive(&self, payload: DirReceiverReceiveRequest) -> Result<(), fidl::Error>;
9362}
9363#[derive(Debug)]
9364#[cfg(target_os = "fuchsia")]
9365pub struct DirReceiverSynchronousProxy {
9366    client: fidl::client::sync::Client,
9367}
9368
9369#[cfg(target_os = "fuchsia")]
9370impl fidl::endpoints::SynchronousProxy for DirReceiverSynchronousProxy {
9371    type Proxy = DirReceiverProxy;
9372    type Protocol = DirReceiverMarker;
9373
9374    fn from_channel(inner: fidl::Channel) -> Self {
9375        Self::new(inner)
9376    }
9377
9378    fn into_channel(self) -> fidl::Channel {
9379        self.client.into_channel()
9380    }
9381
9382    fn as_channel(&self) -> &fidl::Channel {
9383        self.client.as_channel()
9384    }
9385}
9386
9387#[cfg(target_os = "fuchsia")]
9388impl DirReceiverSynchronousProxy {
9389    pub fn new(channel: fidl::Channel) -> Self {
9390        Self { client: fidl::client::sync::Client::new(channel) }
9391    }
9392
9393    pub fn into_channel(self) -> fidl::Channel {
9394        self.client.into_channel()
9395    }
9396
9397    /// Waits until an event arrives and returns it. It is safe for other
9398    /// threads to make concurrent requests while waiting for an event.
9399    pub fn wait_for_event(
9400        &self,
9401        deadline: zx::MonotonicInstant,
9402    ) -> Result<DirReceiverEvent, fidl::Error> {
9403        DirReceiverEvent::decode(self.client.wait_for_event::<DirReceiverMarker>(deadline)?)
9404    }
9405
9406    /// Sends a directory channel to this receiver.
9407    ///
9408    /// The server should implement this method by forwarding `channel` to a vfs instance
9409    /// of the language appropriate `vfs` library.
9410    pub fn r#receive(&self, mut payload: DirReceiverReceiveRequest) -> Result<(), fidl::Error> {
9411        self.client.send::<DirReceiverReceiveRequest>(
9412            &mut payload,
9413            0xcdc3e9b89fe7bb4,
9414            fidl::encoding::DynamicFlags::FLEXIBLE,
9415        )
9416    }
9417}
9418
9419#[cfg(target_os = "fuchsia")]
9420impl From<DirReceiverSynchronousProxy> for zx::NullableHandle {
9421    fn from(value: DirReceiverSynchronousProxy) -> Self {
9422        value.into_channel().into()
9423    }
9424}
9425
9426#[cfg(target_os = "fuchsia")]
9427impl From<fidl::Channel> for DirReceiverSynchronousProxy {
9428    fn from(value: fidl::Channel) -> Self {
9429        Self::new(value)
9430    }
9431}
9432
9433#[cfg(target_os = "fuchsia")]
9434impl fidl::endpoints::FromClient for DirReceiverSynchronousProxy {
9435    type Protocol = DirReceiverMarker;
9436
9437    fn from_client(value: fidl::endpoints::ClientEnd<DirReceiverMarker>) -> Self {
9438        Self::new(value.into_channel())
9439    }
9440}
9441
9442#[derive(Debug, Clone)]
9443pub struct DirReceiverProxy {
9444    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
9445}
9446
9447impl fidl::endpoints::Proxy for DirReceiverProxy {
9448    type Protocol = DirReceiverMarker;
9449
9450    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
9451        Self::new(inner)
9452    }
9453
9454    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
9455        self.client.into_channel().map_err(|client| Self { client })
9456    }
9457
9458    fn as_channel(&self) -> &::fidl::AsyncChannel {
9459        self.client.as_channel()
9460    }
9461}
9462
9463impl DirReceiverProxy {
9464    /// Create a new Proxy for fuchsia.component.sandbox/DirReceiver.
9465    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
9466        let protocol_name = <DirReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
9467        Self { client: fidl::client::Client::new(channel, protocol_name) }
9468    }
9469
9470    /// Get a Stream of events from the remote end of the protocol.
9471    ///
9472    /// # Panics
9473    ///
9474    /// Panics if the event stream was already taken.
9475    pub fn take_event_stream(&self) -> DirReceiverEventStream {
9476        DirReceiverEventStream { event_receiver: self.client.take_event_receiver() }
9477    }
9478
9479    /// Sends a directory channel to this receiver.
9480    ///
9481    /// The server should implement this method by forwarding `channel` to a vfs instance
9482    /// of the language appropriate `vfs` library.
9483    pub fn r#receive(&self, mut payload: DirReceiverReceiveRequest) -> Result<(), fidl::Error> {
9484        DirReceiverProxyInterface::r#receive(self, payload)
9485    }
9486}
9487
9488impl DirReceiverProxyInterface for DirReceiverProxy {
9489    fn r#receive(&self, mut payload: DirReceiverReceiveRequest) -> Result<(), fidl::Error> {
9490        self.client.send::<DirReceiverReceiveRequest>(
9491            &mut payload,
9492            0xcdc3e9b89fe7bb4,
9493            fidl::encoding::DynamicFlags::FLEXIBLE,
9494        )
9495    }
9496}
9497
9498pub struct DirReceiverEventStream {
9499    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
9500}
9501
9502impl std::marker::Unpin for DirReceiverEventStream {}
9503
9504impl futures::stream::FusedStream for DirReceiverEventStream {
9505    fn is_terminated(&self) -> bool {
9506        self.event_receiver.is_terminated()
9507    }
9508}
9509
9510impl futures::Stream for DirReceiverEventStream {
9511    type Item = Result<DirReceiverEvent, fidl::Error>;
9512
9513    fn poll_next(
9514        mut self: std::pin::Pin<&mut Self>,
9515        cx: &mut std::task::Context<'_>,
9516    ) -> std::task::Poll<Option<Self::Item>> {
9517        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
9518            &mut self.event_receiver,
9519            cx
9520        )?) {
9521            Some(buf) => std::task::Poll::Ready(Some(DirReceiverEvent::decode(buf))),
9522            None => std::task::Poll::Ready(None),
9523        }
9524    }
9525}
9526
9527#[derive(Debug)]
9528pub enum DirReceiverEvent {
9529    #[non_exhaustive]
9530    _UnknownEvent {
9531        /// Ordinal of the event that was sent.
9532        ordinal: u64,
9533    },
9534}
9535
9536impl DirReceiverEvent {
9537    /// Decodes a message buffer as a [`DirReceiverEvent`].
9538    fn decode(
9539        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
9540    ) -> Result<DirReceiverEvent, fidl::Error> {
9541        let (bytes, _handles) = buf.split_mut();
9542        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9543        debug_assert_eq!(tx_header.tx_id, 0);
9544        match tx_header.ordinal {
9545            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
9546                Ok(DirReceiverEvent::_UnknownEvent { ordinal: tx_header.ordinal })
9547            }
9548            _ => Err(fidl::Error::UnknownOrdinal {
9549                ordinal: tx_header.ordinal,
9550                protocol_name: <DirReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9551            }),
9552        }
9553    }
9554}
9555
9556/// A Stream of incoming requests for fuchsia.component.sandbox/DirReceiver.
9557pub struct DirReceiverRequestStream {
9558    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9559    is_terminated: bool,
9560}
9561
9562impl std::marker::Unpin for DirReceiverRequestStream {}
9563
9564impl futures::stream::FusedStream for DirReceiverRequestStream {
9565    fn is_terminated(&self) -> bool {
9566        self.is_terminated
9567    }
9568}
9569
9570impl fidl::endpoints::RequestStream for DirReceiverRequestStream {
9571    type Protocol = DirReceiverMarker;
9572    type ControlHandle = DirReceiverControlHandle;
9573
9574    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
9575        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
9576    }
9577
9578    fn control_handle(&self) -> Self::ControlHandle {
9579        DirReceiverControlHandle { inner: self.inner.clone() }
9580    }
9581
9582    fn into_inner(
9583        self,
9584    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
9585    {
9586        (self.inner, self.is_terminated)
9587    }
9588
9589    fn from_inner(
9590        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9591        is_terminated: bool,
9592    ) -> Self {
9593        Self { inner, is_terminated }
9594    }
9595}
9596
9597impl futures::Stream for DirReceiverRequestStream {
9598    type Item = Result<DirReceiverRequest, fidl::Error>;
9599
9600    fn poll_next(
9601        mut self: std::pin::Pin<&mut Self>,
9602        cx: &mut std::task::Context<'_>,
9603    ) -> std::task::Poll<Option<Self::Item>> {
9604        let this = &mut *self;
9605        if this.inner.check_shutdown(cx) {
9606            this.is_terminated = true;
9607            return std::task::Poll::Ready(None);
9608        }
9609        if this.is_terminated {
9610            panic!("polled DirReceiverRequestStream after completion");
9611        }
9612        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
9613            |bytes, handles| {
9614                match this.inner.channel().read_etc(cx, bytes, handles) {
9615                    std::task::Poll::Ready(Ok(())) => {}
9616                    std::task::Poll::Pending => return std::task::Poll::Pending,
9617                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
9618                        this.is_terminated = true;
9619                        return std::task::Poll::Ready(None);
9620                    }
9621                    std::task::Poll::Ready(Err(e)) => {
9622                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
9623                            e.into(),
9624                        ))));
9625                    }
9626                }
9627
9628                // A message has been received from the channel
9629                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9630
9631                std::task::Poll::Ready(Some(match header.ordinal {
9632                    0xcdc3e9b89fe7bb4 => {
9633                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
9634                        let mut req = fidl::new_empty!(
9635                            DirReceiverReceiveRequest,
9636                            fidl::encoding::DefaultFuchsiaResourceDialect
9637                        );
9638                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirReceiverReceiveRequest>(&header, _body_bytes, handles, &mut req)?;
9639                        let control_handle = DirReceiverControlHandle { inner: this.inner.clone() };
9640                        Ok(DirReceiverRequest::Receive { payload: req, control_handle })
9641                    }
9642                    _ if header.tx_id == 0
9643                        && header
9644                            .dynamic_flags()
9645                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
9646                    {
9647                        Ok(DirReceiverRequest::_UnknownMethod {
9648                            ordinal: header.ordinal,
9649                            control_handle: DirReceiverControlHandle { inner: this.inner.clone() },
9650                            method_type: fidl::MethodType::OneWay,
9651                        })
9652                    }
9653                    _ if header
9654                        .dynamic_flags()
9655                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
9656                    {
9657                        this.inner.send_framework_err(
9658                            fidl::encoding::FrameworkErr::UnknownMethod,
9659                            header.tx_id,
9660                            header.ordinal,
9661                            header.dynamic_flags(),
9662                            (bytes, handles),
9663                        )?;
9664                        Ok(DirReceiverRequest::_UnknownMethod {
9665                            ordinal: header.ordinal,
9666                            control_handle: DirReceiverControlHandle { inner: this.inner.clone() },
9667                            method_type: fidl::MethodType::TwoWay,
9668                        })
9669                    }
9670                    _ => Err(fidl::Error::UnknownOrdinal {
9671                        ordinal: header.ordinal,
9672                        protocol_name:
9673                            <DirReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9674                    }),
9675                }))
9676            },
9677        )
9678    }
9679}
9680
9681/// A receiver is served by components and allows them to receive directory channels
9682/// framework.
9683#[derive(Debug)]
9684pub enum DirReceiverRequest {
9685    /// Sends a directory channel to this receiver.
9686    ///
9687    /// The server should implement this method by forwarding `channel` to a vfs instance
9688    /// of the language appropriate `vfs` library.
9689    Receive { payload: DirReceiverReceiveRequest, control_handle: DirReceiverControlHandle },
9690    /// An interaction was received which does not match any known method.
9691    #[non_exhaustive]
9692    _UnknownMethod {
9693        /// Ordinal of the method that was called.
9694        ordinal: u64,
9695        control_handle: DirReceiverControlHandle,
9696        method_type: fidl::MethodType,
9697    },
9698}
9699
9700impl DirReceiverRequest {
9701    #[allow(irrefutable_let_patterns)]
9702    pub fn into_receive(self) -> Option<(DirReceiverReceiveRequest, DirReceiverControlHandle)> {
9703        if let DirReceiverRequest::Receive { payload, control_handle } = self {
9704            Some((payload, control_handle))
9705        } else {
9706            None
9707        }
9708    }
9709
9710    /// Name of the method defined in FIDL
9711    pub fn method_name(&self) -> &'static str {
9712        match *self {
9713            DirReceiverRequest::Receive { .. } => "receive",
9714            DirReceiverRequest::_UnknownMethod {
9715                method_type: fidl::MethodType::OneWay, ..
9716            } => "unknown one-way method",
9717            DirReceiverRequest::_UnknownMethod {
9718                method_type: fidl::MethodType::TwoWay, ..
9719            } => "unknown two-way method",
9720        }
9721    }
9722}
9723
9724#[derive(Debug, Clone)]
9725pub struct DirReceiverControlHandle {
9726    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9727}
9728
9729impl DirReceiverControlHandle {
9730    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
9731        self.inner.shutdown_with_epitaph(status.into())
9732    }
9733}
9734
9735impl fidl::endpoints::ControlHandle for DirReceiverControlHandle {
9736    fn shutdown(&self) {
9737        self.inner.shutdown()
9738    }
9739
9740    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
9741        self.inner.shutdown_with_epitaph(status)
9742    }
9743
9744    fn is_closed(&self) -> bool {
9745        self.inner.channel().is_closed()
9746    }
9747    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
9748        self.inner.channel().on_closed()
9749    }
9750
9751    #[cfg(target_os = "fuchsia")]
9752    fn signal_peer(
9753        &self,
9754        clear_mask: zx::Signals,
9755        set_mask: zx::Signals,
9756    ) -> Result<(), zx_status::Status> {
9757        use fidl::Peered;
9758        self.inner.channel().signal_peer(clear_mask, set_mask)
9759    }
9760}
9761
9762impl DirReceiverControlHandle {}
9763
9764#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
9765pub struct DirectoryRouterMarker;
9766
9767impl fidl::endpoints::ProtocolMarker for DirectoryRouterMarker {
9768    type Proxy = DirectoryRouterProxy;
9769    type RequestStream = DirectoryRouterRequestStream;
9770    #[cfg(target_os = "fuchsia")]
9771    type SynchronousProxy = DirectoryRouterSynchronousProxy;
9772
9773    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.DirectoryRouter";
9774}
9775impl fidl::endpoints::DiscoverableProtocolMarker for DirectoryRouterMarker {}
9776pub type DirectoryRouterRouteResult = Result<DirectoryRouterRouteResponse, RouterError>;
9777
9778pub trait DirectoryRouterProxyInterface: Send + Sync {
9779    type RouteResponseFut: std::future::Future<Output = Result<DirectoryRouterRouteResult, fidl::Error>>
9780        + Send;
9781    fn r#route(&self, payload: RouteRequest) -> Self::RouteResponseFut;
9782}
9783#[derive(Debug)]
9784#[cfg(target_os = "fuchsia")]
9785pub struct DirectoryRouterSynchronousProxy {
9786    client: fidl::client::sync::Client,
9787}
9788
9789#[cfg(target_os = "fuchsia")]
9790impl fidl::endpoints::SynchronousProxy for DirectoryRouterSynchronousProxy {
9791    type Proxy = DirectoryRouterProxy;
9792    type Protocol = DirectoryRouterMarker;
9793
9794    fn from_channel(inner: fidl::Channel) -> Self {
9795        Self::new(inner)
9796    }
9797
9798    fn into_channel(self) -> fidl::Channel {
9799        self.client.into_channel()
9800    }
9801
9802    fn as_channel(&self) -> &fidl::Channel {
9803        self.client.as_channel()
9804    }
9805}
9806
9807#[cfg(target_os = "fuchsia")]
9808impl DirectoryRouterSynchronousProxy {
9809    pub fn new(channel: fidl::Channel) -> Self {
9810        Self { client: fidl::client::sync::Client::new(channel) }
9811    }
9812
9813    pub fn into_channel(self) -> fidl::Channel {
9814        self.client.into_channel()
9815    }
9816
9817    /// Waits until an event arrives and returns it. It is safe for other
9818    /// threads to make concurrent requests while waiting for an event.
9819    pub fn wait_for_event(
9820        &self,
9821        deadline: zx::MonotonicInstant,
9822    ) -> Result<DirectoryRouterEvent, fidl::Error> {
9823        DirectoryRouterEvent::decode(self.client.wait_for_event::<DirectoryRouterMarker>(deadline)?)
9824    }
9825
9826    pub fn r#route(
9827        &self,
9828        mut payload: RouteRequest,
9829        ___deadline: zx::MonotonicInstant,
9830    ) -> Result<DirectoryRouterRouteResult, fidl::Error> {
9831        let _response = self.client.send_query::<
9832            RouteRequest,
9833            fidl::encoding::FlexibleResultType<DirectoryRouterRouteResponse, RouterError>,
9834            DirectoryRouterMarker,
9835        >(
9836            &mut payload,
9837            0x683b6c6be21b0f21,
9838            fidl::encoding::DynamicFlags::FLEXIBLE,
9839            ___deadline,
9840        )?
9841        .into_result::<DirectoryRouterMarker>("route")?;
9842        Ok(_response.map(|x| x))
9843    }
9844}
9845
9846#[cfg(target_os = "fuchsia")]
9847impl From<DirectoryRouterSynchronousProxy> for zx::NullableHandle {
9848    fn from(value: DirectoryRouterSynchronousProxy) -> Self {
9849        value.into_channel().into()
9850    }
9851}
9852
9853#[cfg(target_os = "fuchsia")]
9854impl From<fidl::Channel> for DirectoryRouterSynchronousProxy {
9855    fn from(value: fidl::Channel) -> Self {
9856        Self::new(value)
9857    }
9858}
9859
9860#[cfg(target_os = "fuchsia")]
9861impl fidl::endpoints::FromClient for DirectoryRouterSynchronousProxy {
9862    type Protocol = DirectoryRouterMarker;
9863
9864    fn from_client(value: fidl::endpoints::ClientEnd<DirectoryRouterMarker>) -> Self {
9865        Self::new(value.into_channel())
9866    }
9867}
9868
9869#[derive(Debug, Clone)]
9870pub struct DirectoryRouterProxy {
9871    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
9872}
9873
9874impl fidl::endpoints::Proxy for DirectoryRouterProxy {
9875    type Protocol = DirectoryRouterMarker;
9876
9877    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
9878        Self::new(inner)
9879    }
9880
9881    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
9882        self.client.into_channel().map_err(|client| Self { client })
9883    }
9884
9885    fn as_channel(&self) -> &::fidl::AsyncChannel {
9886        self.client.as_channel()
9887    }
9888}
9889
9890impl DirectoryRouterProxy {
9891    /// Create a new Proxy for fuchsia.component.sandbox/DirectoryRouter.
9892    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
9893        let protocol_name = <DirectoryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
9894        Self { client: fidl::client::Client::new(channel, protocol_name) }
9895    }
9896
9897    /// Get a Stream of events from the remote end of the protocol.
9898    ///
9899    /// # Panics
9900    ///
9901    /// Panics if the event stream was already taken.
9902    pub fn take_event_stream(&self) -> DirectoryRouterEventStream {
9903        DirectoryRouterEventStream { event_receiver: self.client.take_event_receiver() }
9904    }
9905
9906    pub fn r#route(
9907        &self,
9908        mut payload: RouteRequest,
9909    ) -> fidl::client::QueryResponseFut<
9910        DirectoryRouterRouteResult,
9911        fidl::encoding::DefaultFuchsiaResourceDialect,
9912    > {
9913        DirectoryRouterProxyInterface::r#route(self, payload)
9914    }
9915}
9916
9917impl DirectoryRouterProxyInterface for DirectoryRouterProxy {
9918    type RouteResponseFut = fidl::client::QueryResponseFut<
9919        DirectoryRouterRouteResult,
9920        fidl::encoding::DefaultFuchsiaResourceDialect,
9921    >;
9922    fn r#route(&self, mut payload: RouteRequest) -> Self::RouteResponseFut {
9923        fn _decode(
9924            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9925        ) -> Result<DirectoryRouterRouteResult, fidl::Error> {
9926            let _response = fidl::client::decode_transaction_body::<
9927                fidl::encoding::FlexibleResultType<DirectoryRouterRouteResponse, RouterError>,
9928                fidl::encoding::DefaultFuchsiaResourceDialect,
9929                0x683b6c6be21b0f21,
9930            >(_buf?)?
9931            .into_result::<DirectoryRouterMarker>("route")?;
9932            Ok(_response.map(|x| x))
9933        }
9934        self.client.send_query_and_decode::<RouteRequest, DirectoryRouterRouteResult>(
9935            &mut payload,
9936            0x683b6c6be21b0f21,
9937            fidl::encoding::DynamicFlags::FLEXIBLE,
9938            _decode,
9939        )
9940    }
9941}
9942
9943pub struct DirectoryRouterEventStream {
9944    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
9945}
9946
9947impl std::marker::Unpin for DirectoryRouterEventStream {}
9948
9949impl futures::stream::FusedStream for DirectoryRouterEventStream {
9950    fn is_terminated(&self) -> bool {
9951        self.event_receiver.is_terminated()
9952    }
9953}
9954
9955impl futures::Stream for DirectoryRouterEventStream {
9956    type Item = Result<DirectoryRouterEvent, fidl::Error>;
9957
9958    fn poll_next(
9959        mut self: std::pin::Pin<&mut Self>,
9960        cx: &mut std::task::Context<'_>,
9961    ) -> std::task::Poll<Option<Self::Item>> {
9962        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
9963            &mut self.event_receiver,
9964            cx
9965        )?) {
9966            Some(buf) => std::task::Poll::Ready(Some(DirectoryRouterEvent::decode(buf))),
9967            None => std::task::Poll::Ready(None),
9968        }
9969    }
9970}
9971
9972#[derive(Debug)]
9973pub enum DirectoryRouterEvent {
9974    #[non_exhaustive]
9975    _UnknownEvent {
9976        /// Ordinal of the event that was sent.
9977        ordinal: u64,
9978    },
9979}
9980
9981impl DirectoryRouterEvent {
9982    /// Decodes a message buffer as a [`DirectoryRouterEvent`].
9983    fn decode(
9984        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
9985    ) -> Result<DirectoryRouterEvent, fidl::Error> {
9986        let (bytes, _handles) = buf.split_mut();
9987        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9988        debug_assert_eq!(tx_header.tx_id, 0);
9989        match tx_header.ordinal {
9990            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
9991                Ok(DirectoryRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
9992            }
9993            _ => Err(fidl::Error::UnknownOrdinal {
9994                ordinal: tx_header.ordinal,
9995                protocol_name:
9996                    <DirectoryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9997            }),
9998        }
9999    }
10000}
10001
10002/// A Stream of incoming requests for fuchsia.component.sandbox/DirectoryRouter.
10003pub struct DirectoryRouterRequestStream {
10004    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10005    is_terminated: bool,
10006}
10007
10008impl std::marker::Unpin for DirectoryRouterRequestStream {}
10009
10010impl futures::stream::FusedStream for DirectoryRouterRequestStream {
10011    fn is_terminated(&self) -> bool {
10012        self.is_terminated
10013    }
10014}
10015
10016impl fidl::endpoints::RequestStream for DirectoryRouterRequestStream {
10017    type Protocol = DirectoryRouterMarker;
10018    type ControlHandle = DirectoryRouterControlHandle;
10019
10020    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
10021        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
10022    }
10023
10024    fn control_handle(&self) -> Self::ControlHandle {
10025        DirectoryRouterControlHandle { inner: self.inner.clone() }
10026    }
10027
10028    fn into_inner(
10029        self,
10030    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
10031    {
10032        (self.inner, self.is_terminated)
10033    }
10034
10035    fn from_inner(
10036        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10037        is_terminated: bool,
10038    ) -> Self {
10039        Self { inner, is_terminated }
10040    }
10041}
10042
10043impl futures::Stream for DirectoryRouterRequestStream {
10044    type Item = Result<DirectoryRouterRequest, fidl::Error>;
10045
10046    fn poll_next(
10047        mut self: std::pin::Pin<&mut Self>,
10048        cx: &mut std::task::Context<'_>,
10049    ) -> std::task::Poll<Option<Self::Item>> {
10050        let this = &mut *self;
10051        if this.inner.check_shutdown(cx) {
10052            this.is_terminated = true;
10053            return std::task::Poll::Ready(None);
10054        }
10055        if this.is_terminated {
10056            panic!("polled DirectoryRouterRequestStream after completion");
10057        }
10058        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
10059            |bytes, handles| {
10060                match this.inner.channel().read_etc(cx, bytes, handles) {
10061                    std::task::Poll::Ready(Ok(())) => {}
10062                    std::task::Poll::Pending => return std::task::Poll::Pending,
10063                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
10064                        this.is_terminated = true;
10065                        return std::task::Poll::Ready(None);
10066                    }
10067                    std::task::Poll::Ready(Err(e)) => {
10068                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
10069                            e.into(),
10070                        ))));
10071                    }
10072                }
10073
10074                // A message has been received from the channel
10075                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
10076
10077                std::task::Poll::Ready(Some(match header.ordinal {
10078                    0x683b6c6be21b0f21 => {
10079                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
10080                        let mut req = fidl::new_empty!(
10081                            RouteRequest,
10082                            fidl::encoding::DefaultFuchsiaResourceDialect
10083                        );
10084                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RouteRequest>(&header, _body_bytes, handles, &mut req)?;
10085                        let control_handle =
10086                            DirectoryRouterControlHandle { inner: this.inner.clone() };
10087                        Ok(DirectoryRouterRequest::Route {
10088                            payload: req,
10089                            responder: DirectoryRouterRouteResponder {
10090                                control_handle: std::mem::ManuallyDrop::new(control_handle),
10091                                tx_id: header.tx_id,
10092                            },
10093                        })
10094                    }
10095                    _ if header.tx_id == 0
10096                        && header
10097                            .dynamic_flags()
10098                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
10099                    {
10100                        Ok(DirectoryRouterRequest::_UnknownMethod {
10101                            ordinal: header.ordinal,
10102                            control_handle: DirectoryRouterControlHandle {
10103                                inner: this.inner.clone(),
10104                            },
10105                            method_type: fidl::MethodType::OneWay,
10106                        })
10107                    }
10108                    _ if header
10109                        .dynamic_flags()
10110                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
10111                    {
10112                        this.inner.send_framework_err(
10113                            fidl::encoding::FrameworkErr::UnknownMethod,
10114                            header.tx_id,
10115                            header.ordinal,
10116                            header.dynamic_flags(),
10117                            (bytes, handles),
10118                        )?;
10119                        Ok(DirectoryRouterRequest::_UnknownMethod {
10120                            ordinal: header.ordinal,
10121                            control_handle: DirectoryRouterControlHandle {
10122                                inner: this.inner.clone(),
10123                            },
10124                            method_type: fidl::MethodType::TwoWay,
10125                        })
10126                    }
10127                    _ => Err(fidl::Error::UnknownOrdinal {
10128                        ordinal: header.ordinal,
10129                        protocol_name:
10130                            <DirectoryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
10131                    }),
10132                }))
10133            },
10134        )
10135    }
10136}
10137
10138#[derive(Debug)]
10139pub enum DirectoryRouterRequest {
10140    Route {
10141        payload: RouteRequest,
10142        responder: DirectoryRouterRouteResponder,
10143    },
10144    /// An interaction was received which does not match any known method.
10145    #[non_exhaustive]
10146    _UnknownMethod {
10147        /// Ordinal of the method that was called.
10148        ordinal: u64,
10149        control_handle: DirectoryRouterControlHandle,
10150        method_type: fidl::MethodType,
10151    },
10152}
10153
10154impl DirectoryRouterRequest {
10155    #[allow(irrefutable_let_patterns)]
10156    pub fn into_route(self) -> Option<(RouteRequest, DirectoryRouterRouteResponder)> {
10157        if let DirectoryRouterRequest::Route { payload, responder } = self {
10158            Some((payload, responder))
10159        } else {
10160            None
10161        }
10162    }
10163
10164    /// Name of the method defined in FIDL
10165    pub fn method_name(&self) -> &'static str {
10166        match *self {
10167            DirectoryRouterRequest::Route { .. } => "route",
10168            DirectoryRouterRequest::_UnknownMethod {
10169                method_type: fidl::MethodType::OneWay,
10170                ..
10171            } => "unknown one-way method",
10172            DirectoryRouterRequest::_UnknownMethod {
10173                method_type: fidl::MethodType::TwoWay,
10174                ..
10175            } => "unknown two-way method",
10176        }
10177    }
10178}
10179
10180#[derive(Debug, Clone)]
10181pub struct DirectoryRouterControlHandle {
10182    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10183}
10184
10185impl DirectoryRouterControlHandle {
10186    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
10187        self.inner.shutdown_with_epitaph(status.into())
10188    }
10189}
10190
10191impl fidl::endpoints::ControlHandle for DirectoryRouterControlHandle {
10192    fn shutdown(&self) {
10193        self.inner.shutdown()
10194    }
10195
10196    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
10197        self.inner.shutdown_with_epitaph(status)
10198    }
10199
10200    fn is_closed(&self) -> bool {
10201        self.inner.channel().is_closed()
10202    }
10203    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
10204        self.inner.channel().on_closed()
10205    }
10206
10207    #[cfg(target_os = "fuchsia")]
10208    fn signal_peer(
10209        &self,
10210        clear_mask: zx::Signals,
10211        set_mask: zx::Signals,
10212    ) -> Result<(), zx_status::Status> {
10213        use fidl::Peered;
10214        self.inner.channel().signal_peer(clear_mask, set_mask)
10215    }
10216}
10217
10218impl DirectoryRouterControlHandle {}
10219
10220#[must_use = "FIDL methods require a response to be sent"]
10221#[derive(Debug)]
10222pub struct DirectoryRouterRouteResponder {
10223    control_handle: std::mem::ManuallyDrop<DirectoryRouterControlHandle>,
10224    tx_id: u32,
10225}
10226
10227/// Set the the channel to be shutdown (see [`DirectoryRouterControlHandle::shutdown`])
10228/// if the responder is dropped without sending a response, so that the client
10229/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10230impl std::ops::Drop for DirectoryRouterRouteResponder {
10231    fn drop(&mut self) {
10232        self.control_handle.shutdown();
10233        // Safety: drops once, never accessed again
10234        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10235    }
10236}
10237
10238impl fidl::endpoints::Responder for DirectoryRouterRouteResponder {
10239    type ControlHandle = DirectoryRouterControlHandle;
10240
10241    fn control_handle(&self) -> &DirectoryRouterControlHandle {
10242        &self.control_handle
10243    }
10244
10245    fn drop_without_shutdown(mut self) {
10246        // Safety: drops once, never accessed again due to mem::forget
10247        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10248        // Prevent Drop from running (which would shut down the channel)
10249        std::mem::forget(self);
10250    }
10251}
10252
10253impl DirectoryRouterRouteResponder {
10254    /// Sends a response to the FIDL transaction.
10255    ///
10256    /// Sets the channel to shutdown if an error occurs.
10257    pub fn send(
10258        self,
10259        mut result: Result<DirectoryRouterRouteResponse, RouterError>,
10260    ) -> Result<(), fidl::Error> {
10261        let _result = self.send_raw(result);
10262        if _result.is_err() {
10263            self.control_handle.shutdown();
10264        }
10265        self.drop_without_shutdown();
10266        _result
10267    }
10268
10269    /// Similar to "send" but does not shutdown the channel if an error occurs.
10270    pub fn send_no_shutdown_on_err(
10271        self,
10272        mut result: Result<DirectoryRouterRouteResponse, RouterError>,
10273    ) -> Result<(), fidl::Error> {
10274        let _result = self.send_raw(result);
10275        self.drop_without_shutdown();
10276        _result
10277    }
10278
10279    fn send_raw(
10280        &self,
10281        mut result: Result<DirectoryRouterRouteResponse, RouterError>,
10282    ) -> Result<(), fidl::Error> {
10283        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
10284            DirectoryRouterRouteResponse,
10285            RouterError,
10286        >>(
10287            fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
10288            self.tx_id,
10289            0x683b6c6be21b0f21,
10290            fidl::encoding::DynamicFlags::FLEXIBLE,
10291        )
10292    }
10293}
10294
10295#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
10296pub struct ReceiverMarker;
10297
10298impl fidl::endpoints::ProtocolMarker for ReceiverMarker {
10299    type Proxy = ReceiverProxy;
10300    type RequestStream = ReceiverRequestStream;
10301    #[cfg(target_os = "fuchsia")]
10302    type SynchronousProxy = ReceiverSynchronousProxy;
10303
10304    const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.Receiver";
10305}
10306impl fidl::endpoints::DiscoverableProtocolMarker for ReceiverMarker {}
10307
10308pub trait ReceiverProxyInterface: Send + Sync {
10309    fn r#receive(&self, channel: fidl::Channel) -> Result<(), fidl::Error>;
10310}
10311#[derive(Debug)]
10312#[cfg(target_os = "fuchsia")]
10313pub struct ReceiverSynchronousProxy {
10314    client: fidl::client::sync::Client,
10315}
10316
10317#[cfg(target_os = "fuchsia")]
10318impl fidl::endpoints::SynchronousProxy for ReceiverSynchronousProxy {
10319    type Proxy = ReceiverProxy;
10320    type Protocol = ReceiverMarker;
10321
10322    fn from_channel(inner: fidl::Channel) -> Self {
10323        Self::new(inner)
10324    }
10325
10326    fn into_channel(self) -> fidl::Channel {
10327        self.client.into_channel()
10328    }
10329
10330    fn as_channel(&self) -> &fidl::Channel {
10331        self.client.as_channel()
10332    }
10333}
10334
10335#[cfg(target_os = "fuchsia")]
10336impl ReceiverSynchronousProxy {
10337    pub fn new(channel: fidl::Channel) -> Self {
10338        Self { client: fidl::client::sync::Client::new(channel) }
10339    }
10340
10341    pub fn into_channel(self) -> fidl::Channel {
10342        self.client.into_channel()
10343    }
10344
10345    /// Waits until an event arrives and returns it. It is safe for other
10346    /// threads to make concurrent requests while waiting for an event.
10347    pub fn wait_for_event(
10348        &self,
10349        deadline: zx::MonotonicInstant,
10350    ) -> Result<ReceiverEvent, fidl::Error> {
10351        ReceiverEvent::decode(self.client.wait_for_event::<ReceiverMarker>(deadline)?)
10352    }
10353
10354    /// Sends a channel to this receiver.
10355    pub fn r#receive(&self, mut channel: fidl::Channel) -> Result<(), fidl::Error> {
10356        self.client.send::<ProtocolPayload>(
10357            (channel,),
10358            0x4bae18ab7aa1a94,
10359            fidl::encoding::DynamicFlags::FLEXIBLE,
10360        )
10361    }
10362}
10363
10364#[cfg(target_os = "fuchsia")]
10365impl From<ReceiverSynchronousProxy> for zx::NullableHandle {
10366    fn from(value: ReceiverSynchronousProxy) -> Self {
10367        value.into_channel().into()
10368    }
10369}
10370
10371#[cfg(target_os = "fuchsia")]
10372impl From<fidl::Channel> for ReceiverSynchronousProxy {
10373    fn from(value: fidl::Channel) -> Self {
10374        Self::new(value)
10375    }
10376}
10377
10378#[cfg(target_os = "fuchsia")]
10379impl fidl::endpoints::FromClient for ReceiverSynchronousProxy {
10380    type Protocol = ReceiverMarker;
10381
10382    fn from_client(value: fidl::endpoints::ClientEnd<ReceiverMarker>) -> Self {
10383        Self::new(value.into_channel())
10384    }
10385}
10386
10387#[derive(Debug, Clone)]
10388pub struct ReceiverProxy {
10389    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
10390}
10391
10392impl fidl::endpoints::Proxy for ReceiverProxy {
10393    type Protocol = ReceiverMarker;
10394
10395    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
10396        Self::new(inner)
10397    }
10398
10399    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
10400        self.client.into_channel().map_err(|client| Self { client })
10401    }
10402
10403    fn as_channel(&self) -> &::fidl::AsyncChannel {
10404        self.client.as_channel()
10405    }
10406}
10407
10408impl ReceiverProxy {
10409    /// Create a new Proxy for fuchsia.component.sandbox/Receiver.
10410    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
10411        let protocol_name = <ReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
10412        Self { client: fidl::client::Client::new(channel, protocol_name) }
10413    }
10414
10415    /// Get a Stream of events from the remote end of the protocol.
10416    ///
10417    /// # Panics
10418    ///
10419    /// Panics if the event stream was already taken.
10420    pub fn take_event_stream(&self) -> ReceiverEventStream {
10421        ReceiverEventStream { event_receiver: self.client.take_event_receiver() }
10422    }
10423
10424    /// Sends a channel to this receiver.
10425    pub fn r#receive(&self, mut channel: fidl::Channel) -> Result<(), fidl::Error> {
10426        ReceiverProxyInterface::r#receive(self, channel)
10427    }
10428}
10429
10430impl ReceiverProxyInterface for ReceiverProxy {
10431    fn r#receive(&self, mut channel: fidl::Channel) -> Result<(), fidl::Error> {
10432        self.client.send::<ProtocolPayload>(
10433            (channel,),
10434            0x4bae18ab7aa1a94,
10435            fidl::encoding::DynamicFlags::FLEXIBLE,
10436        )
10437    }
10438}
10439
10440pub struct ReceiverEventStream {
10441    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
10442}
10443
10444impl std::marker::Unpin for ReceiverEventStream {}
10445
10446impl futures::stream::FusedStream for ReceiverEventStream {
10447    fn is_terminated(&self) -> bool {
10448        self.event_receiver.is_terminated()
10449    }
10450}
10451
10452impl futures::Stream for ReceiverEventStream {
10453    type Item = Result<ReceiverEvent, fidl::Error>;
10454
10455    fn poll_next(
10456        mut self: std::pin::Pin<&mut Self>,
10457        cx: &mut std::task::Context<'_>,
10458    ) -> std::task::Poll<Option<Self::Item>> {
10459        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
10460            &mut self.event_receiver,
10461            cx
10462        )?) {
10463            Some(buf) => std::task::Poll::Ready(Some(ReceiverEvent::decode(buf))),
10464            None => std::task::Poll::Ready(None),
10465        }
10466    }
10467}
10468
10469#[derive(Debug)]
10470pub enum ReceiverEvent {
10471    #[non_exhaustive]
10472    _UnknownEvent {
10473        /// Ordinal of the event that was sent.
10474        ordinal: u64,
10475    },
10476}
10477
10478impl ReceiverEvent {
10479    /// Decodes a message buffer as a [`ReceiverEvent`].
10480    fn decode(
10481        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
10482    ) -> Result<ReceiverEvent, fidl::Error> {
10483        let (bytes, _handles) = buf.split_mut();
10484        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
10485        debug_assert_eq!(tx_header.tx_id, 0);
10486        match tx_header.ordinal {
10487            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
10488                Ok(ReceiverEvent::_UnknownEvent { ordinal: tx_header.ordinal })
10489            }
10490            _ => Err(fidl::Error::UnknownOrdinal {
10491                ordinal: tx_header.ordinal,
10492                protocol_name: <ReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
10493            }),
10494        }
10495    }
10496}
10497
10498/// A Stream of incoming requests for fuchsia.component.sandbox/Receiver.
10499pub struct ReceiverRequestStream {
10500    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10501    is_terminated: bool,
10502}
10503
10504impl std::marker::Unpin for ReceiverRequestStream {}
10505
10506impl futures::stream::FusedStream for ReceiverRequestStream {
10507    fn is_terminated(&self) -> bool {
10508        self.is_terminated
10509    }
10510}
10511
10512impl fidl::endpoints::RequestStream for ReceiverRequestStream {
10513    type Protocol = ReceiverMarker;
10514    type ControlHandle = ReceiverControlHandle;
10515
10516    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
10517        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
10518    }
10519
10520    fn control_handle(&self) -> Self::ControlHandle {
10521        ReceiverControlHandle { inner: self.inner.clone() }
10522    }
10523
10524    fn into_inner(
10525        self,
10526    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
10527    {
10528        (self.inner, self.is_terminated)
10529    }
10530
10531    fn from_inner(
10532        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10533        is_terminated: bool,
10534    ) -> Self {
10535        Self { inner, is_terminated }
10536    }
10537}
10538
10539impl futures::Stream for ReceiverRequestStream {
10540    type Item = Result<ReceiverRequest, fidl::Error>;
10541
10542    fn poll_next(
10543        mut self: std::pin::Pin<&mut Self>,
10544        cx: &mut std::task::Context<'_>,
10545    ) -> std::task::Poll<Option<Self::Item>> {
10546        let this = &mut *self;
10547        if this.inner.check_shutdown(cx) {
10548            this.is_terminated = true;
10549            return std::task::Poll::Ready(None);
10550        }
10551        if this.is_terminated {
10552            panic!("polled ReceiverRequestStream after completion");
10553        }
10554        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
10555            |bytes, handles| {
10556                match this.inner.channel().read_etc(cx, bytes, handles) {
10557                    std::task::Poll::Ready(Ok(())) => {}
10558                    std::task::Poll::Pending => return std::task::Poll::Pending,
10559                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
10560                        this.is_terminated = true;
10561                        return std::task::Poll::Ready(None);
10562                    }
10563                    std::task::Poll::Ready(Err(e)) => {
10564                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
10565                            e.into(),
10566                        ))));
10567                    }
10568                }
10569
10570                // A message has been received from the channel
10571                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
10572
10573                std::task::Poll::Ready(Some(match header.ordinal {
10574                    0x4bae18ab7aa1a94 => {
10575                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
10576                        let mut req = fidl::new_empty!(
10577                            ProtocolPayload,
10578                            fidl::encoding::DefaultFuchsiaResourceDialect
10579                        );
10580                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ProtocolPayload>(&header, _body_bytes, handles, &mut req)?;
10581                        let control_handle = ReceiverControlHandle { inner: this.inner.clone() };
10582                        Ok(ReceiverRequest::Receive { channel: req.channel, control_handle })
10583                    }
10584                    _ if header.tx_id == 0
10585                        && header
10586                            .dynamic_flags()
10587                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
10588                    {
10589                        Ok(ReceiverRequest::_UnknownMethod {
10590                            ordinal: header.ordinal,
10591                            control_handle: ReceiverControlHandle { inner: this.inner.clone() },
10592                            method_type: fidl::MethodType::OneWay,
10593                        })
10594                    }
10595                    _ if header
10596                        .dynamic_flags()
10597                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
10598                    {
10599                        this.inner.send_framework_err(
10600                            fidl::encoding::FrameworkErr::UnknownMethod,
10601                            header.tx_id,
10602                            header.ordinal,
10603                            header.dynamic_flags(),
10604                            (bytes, handles),
10605                        )?;
10606                        Ok(ReceiverRequest::_UnknownMethod {
10607                            ordinal: header.ordinal,
10608                            control_handle: ReceiverControlHandle { inner: this.inner.clone() },
10609                            method_type: fidl::MethodType::TwoWay,
10610                        })
10611                    }
10612                    _ => Err(fidl::Error::UnknownOrdinal {
10613                        ordinal: header.ordinal,
10614                        protocol_name:
10615                            <ReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
10616                    }),
10617                }))
10618            },
10619        )
10620    }
10621}
10622
10623/// A receiver is served by components and allows them to receive channels
10624/// from the framework.
10625#[derive(Debug)]
10626pub enum ReceiverRequest {
10627    /// Sends a channel to this receiver.
10628    Receive { channel: fidl::Channel, control_handle: ReceiverControlHandle },
10629    /// An interaction was received which does not match any known method.
10630    #[non_exhaustive]
10631    _UnknownMethod {
10632        /// Ordinal of the method that was called.
10633        ordinal: u64,
10634        control_handle: ReceiverControlHandle,
10635        method_type: fidl::MethodType,
10636    },
10637}
10638
10639impl ReceiverRequest {
10640    #[allow(irrefutable_let_patterns)]
10641    pub fn into_receive(self) -> Option<(fidl::Channel, ReceiverControlHandle)> {
10642        if let ReceiverRequest::Receive { channel, control_handle } = self {
10643            Some((channel, control_handle))
10644        } else {
10645            None
10646        }
10647    }
10648
10649    /// Name of the method defined in FIDL
10650    pub fn method_name(&self) -> &'static str {
10651        match *self {
10652            ReceiverRequest::Receive { .. } => "receive",
10653            ReceiverRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
10654                "unknown one-way method"
10655            }
10656            ReceiverRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
10657                "unknown two-way method"
10658            }
10659        }
10660    }
10661}
10662
10663#[derive(Debug, Clone)]
10664pub struct ReceiverControlHandle {
10665    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10666}
10667
10668impl ReceiverControlHandle {
10669    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
10670        self.inner.shutdown_with_epitaph(status.into())
10671    }
10672}
10673
10674impl fidl::endpoints::ControlHandle for ReceiverControlHandle {
10675    fn shutdown(&self) {
10676        self.inner.shutdown()
10677    }
10678
10679    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
10680        self.inner.shutdown_with_epitaph(status)
10681    }
10682
10683    fn is_closed(&self) -> bool {
10684        self.inner.channel().is_closed()
10685    }
10686    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
10687        self.inner.channel().on_closed()
10688    }
10689
10690    #[cfg(target_os = "fuchsia")]
10691    fn signal_peer(
10692        &self,
10693        clear_mask: zx::Signals,
10694        set_mask: zx::Signals,
10695    ) -> Result<(), zx_status::Status> {
10696        use fidl::Peered;
10697        self.inner.channel().signal_peer(clear_mask, set_mask)
10698    }
10699}
10700
10701impl ReceiverControlHandle {}
10702
10703mod internal {
10704    use super::*;
10705
10706    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreConnectorCreateRequest {
10707        type Borrowed<'a> = &'a mut Self;
10708        fn take_or_borrow<'a>(
10709            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10710        ) -> Self::Borrowed<'a> {
10711            value
10712        }
10713    }
10714
10715    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreConnectorCreateRequest {
10716        type Owned = Self;
10717
10718        #[inline(always)]
10719        fn inline_align(_context: fidl::encoding::Context) -> usize {
10720            8
10721        }
10722
10723        #[inline(always)]
10724        fn inline_size(_context: fidl::encoding::Context) -> usize {
10725            16
10726        }
10727    }
10728
10729    unsafe impl
10730        fidl::encoding::Encode<
10731            CapabilityStoreConnectorCreateRequest,
10732            fidl::encoding::DefaultFuchsiaResourceDialect,
10733        > for &mut CapabilityStoreConnectorCreateRequest
10734    {
10735        #[inline]
10736        unsafe fn encode(
10737            self,
10738            encoder: &mut fidl::encoding::Encoder<
10739                '_,
10740                fidl::encoding::DefaultFuchsiaResourceDialect,
10741            >,
10742            offset: usize,
10743            _depth: fidl::encoding::Depth,
10744        ) -> fidl::Result<()> {
10745            encoder.debug_check_bounds::<CapabilityStoreConnectorCreateRequest>(offset);
10746            // Delegate to tuple encoding.
10747            fidl::encoding::Encode::<CapabilityStoreConnectorCreateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10748                (
10749                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
10750                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ReceiverMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.receiver),
10751                ),
10752                encoder, offset, _depth
10753            )
10754        }
10755    }
10756    unsafe impl<
10757        T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
10758        T1: fidl::encoding::Encode<
10759                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ReceiverMarker>>,
10760                fidl::encoding::DefaultFuchsiaResourceDialect,
10761            >,
10762    >
10763        fidl::encoding::Encode<
10764            CapabilityStoreConnectorCreateRequest,
10765            fidl::encoding::DefaultFuchsiaResourceDialect,
10766        > for (T0, T1)
10767    {
10768        #[inline]
10769        unsafe fn encode(
10770            self,
10771            encoder: &mut fidl::encoding::Encoder<
10772                '_,
10773                fidl::encoding::DefaultFuchsiaResourceDialect,
10774            >,
10775            offset: usize,
10776            depth: fidl::encoding::Depth,
10777        ) -> fidl::Result<()> {
10778            encoder.debug_check_bounds::<CapabilityStoreConnectorCreateRequest>(offset);
10779            // Zero out padding regions. There's no need to apply masks
10780            // because the unmasked parts will be overwritten by fields.
10781            unsafe {
10782                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
10783                (ptr as *mut u64).write_unaligned(0);
10784            }
10785            // Write the fields.
10786            self.0.encode(encoder, offset + 0, depth)?;
10787            self.1.encode(encoder, offset + 8, depth)?;
10788            Ok(())
10789        }
10790    }
10791
10792    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10793        for CapabilityStoreConnectorCreateRequest
10794    {
10795        #[inline(always)]
10796        fn new_empty() -> Self {
10797            Self {
10798                id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
10799                receiver: fidl::new_empty!(
10800                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ReceiverMarker>>,
10801                    fidl::encoding::DefaultFuchsiaResourceDialect
10802                ),
10803            }
10804        }
10805
10806        #[inline]
10807        unsafe fn decode(
10808            &mut self,
10809            decoder: &mut fidl::encoding::Decoder<
10810                '_,
10811                fidl::encoding::DefaultFuchsiaResourceDialect,
10812            >,
10813            offset: usize,
10814            _depth: fidl::encoding::Depth,
10815        ) -> fidl::Result<()> {
10816            decoder.debug_check_bounds::<Self>(offset);
10817            // Verify that padding bytes are zero.
10818            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
10819            let padval = unsafe { (ptr as *const u64).read_unaligned() };
10820            let mask = 0xffffffff00000000u64;
10821            let maskedval = padval & mask;
10822            if maskedval != 0 {
10823                return Err(fidl::Error::NonZeroPadding {
10824                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
10825                });
10826            }
10827            fidl::decode!(
10828                u64,
10829                fidl::encoding::DefaultFuchsiaResourceDialect,
10830                &mut self.id,
10831                decoder,
10832                offset + 0,
10833                _depth
10834            )?;
10835            fidl::decode!(
10836                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ReceiverMarker>>,
10837                fidl::encoding::DefaultFuchsiaResourceDialect,
10838                &mut self.receiver,
10839                decoder,
10840                offset + 8,
10841                _depth
10842            )?;
10843            Ok(())
10844        }
10845    }
10846
10847    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreConnectorOpenRequest {
10848        type Borrowed<'a> = &'a mut Self;
10849        fn take_or_borrow<'a>(
10850            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10851        ) -> Self::Borrowed<'a> {
10852            value
10853        }
10854    }
10855
10856    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreConnectorOpenRequest {
10857        type Owned = Self;
10858
10859        #[inline(always)]
10860        fn inline_align(_context: fidl::encoding::Context) -> usize {
10861            8
10862        }
10863
10864        #[inline(always)]
10865        fn inline_size(_context: fidl::encoding::Context) -> usize {
10866            16
10867        }
10868    }
10869
10870    unsafe impl
10871        fidl::encoding::Encode<
10872            CapabilityStoreConnectorOpenRequest,
10873            fidl::encoding::DefaultFuchsiaResourceDialect,
10874        > for &mut CapabilityStoreConnectorOpenRequest
10875    {
10876        #[inline]
10877        unsafe fn encode(
10878            self,
10879            encoder: &mut fidl::encoding::Encoder<
10880                '_,
10881                fidl::encoding::DefaultFuchsiaResourceDialect,
10882            >,
10883            offset: usize,
10884            _depth: fidl::encoding::Depth,
10885        ) -> fidl::Result<()> {
10886            encoder.debug_check_bounds::<CapabilityStoreConnectorOpenRequest>(offset);
10887            // Delegate to tuple encoding.
10888            fidl::encoding::Encode::<
10889                CapabilityStoreConnectorOpenRequest,
10890                fidl::encoding::DefaultFuchsiaResourceDialect,
10891            >::encode(
10892                (
10893                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
10894                    <fidl::encoding::HandleType<
10895                        fidl::Channel,
10896                        { fidl::ObjectType::CHANNEL.into_raw() },
10897                        2147483648,
10898                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10899                        &mut self.server_end
10900                    ),
10901                ),
10902                encoder,
10903                offset,
10904                _depth,
10905            )
10906        }
10907    }
10908    unsafe impl<
10909        T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
10910        T1: fidl::encoding::Encode<
10911                fidl::encoding::HandleType<
10912                    fidl::Channel,
10913                    { fidl::ObjectType::CHANNEL.into_raw() },
10914                    2147483648,
10915                >,
10916                fidl::encoding::DefaultFuchsiaResourceDialect,
10917            >,
10918    >
10919        fidl::encoding::Encode<
10920            CapabilityStoreConnectorOpenRequest,
10921            fidl::encoding::DefaultFuchsiaResourceDialect,
10922        > for (T0, T1)
10923    {
10924        #[inline]
10925        unsafe fn encode(
10926            self,
10927            encoder: &mut fidl::encoding::Encoder<
10928                '_,
10929                fidl::encoding::DefaultFuchsiaResourceDialect,
10930            >,
10931            offset: usize,
10932            depth: fidl::encoding::Depth,
10933        ) -> fidl::Result<()> {
10934            encoder.debug_check_bounds::<CapabilityStoreConnectorOpenRequest>(offset);
10935            // Zero out padding regions. There's no need to apply masks
10936            // because the unmasked parts will be overwritten by fields.
10937            unsafe {
10938                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
10939                (ptr as *mut u64).write_unaligned(0);
10940            }
10941            // Write the fields.
10942            self.0.encode(encoder, offset + 0, depth)?;
10943            self.1.encode(encoder, offset + 8, depth)?;
10944            Ok(())
10945        }
10946    }
10947
10948    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10949        for CapabilityStoreConnectorOpenRequest
10950    {
10951        #[inline(always)]
10952        fn new_empty() -> Self {
10953            Self {
10954                id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
10955                server_end: fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
10956            }
10957        }
10958
10959        #[inline]
10960        unsafe fn decode(
10961            &mut self,
10962            decoder: &mut fidl::encoding::Decoder<
10963                '_,
10964                fidl::encoding::DefaultFuchsiaResourceDialect,
10965            >,
10966            offset: usize,
10967            _depth: fidl::encoding::Depth,
10968        ) -> fidl::Result<()> {
10969            decoder.debug_check_bounds::<Self>(offset);
10970            // Verify that padding bytes are zero.
10971            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
10972            let padval = unsafe { (ptr as *const u64).read_unaligned() };
10973            let mask = 0xffffffff00000000u64;
10974            let maskedval = padval & mask;
10975            if maskedval != 0 {
10976                return Err(fidl::Error::NonZeroPadding {
10977                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
10978                });
10979            }
10980            fidl::decode!(
10981                u64,
10982                fidl::encoding::DefaultFuchsiaResourceDialect,
10983                &mut self.id,
10984                decoder,
10985                offset + 0,
10986                _depth
10987            )?;
10988            fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.server_end, decoder, offset + 8, _depth)?;
10989            Ok(())
10990        }
10991    }
10992
10993    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreCreateServiceAggregateRequest {
10994        type Borrowed<'a> = &'a mut Self;
10995        fn take_or_borrow<'a>(
10996            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10997        ) -> Self::Borrowed<'a> {
10998            value
10999        }
11000    }
11001
11002    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreCreateServiceAggregateRequest {
11003        type Owned = Self;
11004
11005        #[inline(always)]
11006        fn inline_align(_context: fidl::encoding::Context) -> usize {
11007            8
11008        }
11009
11010        #[inline(always)]
11011        fn inline_size(_context: fidl::encoding::Context) -> usize {
11012            16
11013        }
11014    }
11015
11016    unsafe impl
11017        fidl::encoding::Encode<
11018            CapabilityStoreCreateServiceAggregateRequest,
11019            fidl::encoding::DefaultFuchsiaResourceDialect,
11020        > for &mut CapabilityStoreCreateServiceAggregateRequest
11021    {
11022        #[inline]
11023        unsafe fn encode(
11024            self,
11025            encoder: &mut fidl::encoding::Encoder<
11026                '_,
11027                fidl::encoding::DefaultFuchsiaResourceDialect,
11028            >,
11029            offset: usize,
11030            _depth: fidl::encoding::Depth,
11031        ) -> fidl::Result<()> {
11032            encoder.debug_check_bounds::<CapabilityStoreCreateServiceAggregateRequest>(offset);
11033            // Delegate to tuple encoding.
11034            fidl::encoding::Encode::<CapabilityStoreCreateServiceAggregateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
11035                (
11036                    <fidl::encoding::UnboundedVector<AggregateSource> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.sources),
11037                ),
11038                encoder, offset, _depth
11039            )
11040        }
11041    }
11042    unsafe impl<
11043        T0: fidl::encoding::Encode<
11044                fidl::encoding::UnboundedVector<AggregateSource>,
11045                fidl::encoding::DefaultFuchsiaResourceDialect,
11046            >,
11047    >
11048        fidl::encoding::Encode<
11049            CapabilityStoreCreateServiceAggregateRequest,
11050            fidl::encoding::DefaultFuchsiaResourceDialect,
11051        > for (T0,)
11052    {
11053        #[inline]
11054        unsafe fn encode(
11055            self,
11056            encoder: &mut fidl::encoding::Encoder<
11057                '_,
11058                fidl::encoding::DefaultFuchsiaResourceDialect,
11059            >,
11060            offset: usize,
11061            depth: fidl::encoding::Depth,
11062        ) -> fidl::Result<()> {
11063            encoder.debug_check_bounds::<CapabilityStoreCreateServiceAggregateRequest>(offset);
11064            // Zero out padding regions. There's no need to apply masks
11065            // because the unmasked parts will be overwritten by fields.
11066            // Write the fields.
11067            self.0.encode(encoder, offset + 0, depth)?;
11068            Ok(())
11069        }
11070    }
11071
11072    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11073        for CapabilityStoreCreateServiceAggregateRequest
11074    {
11075        #[inline(always)]
11076        fn new_empty() -> Self {
11077            Self {
11078                sources: fidl::new_empty!(
11079                    fidl::encoding::UnboundedVector<AggregateSource>,
11080                    fidl::encoding::DefaultFuchsiaResourceDialect
11081                ),
11082            }
11083        }
11084
11085        #[inline]
11086        unsafe fn decode(
11087            &mut self,
11088            decoder: &mut fidl::encoding::Decoder<
11089                '_,
11090                fidl::encoding::DefaultFuchsiaResourceDialect,
11091            >,
11092            offset: usize,
11093            _depth: fidl::encoding::Depth,
11094        ) -> fidl::Result<()> {
11095            decoder.debug_check_bounds::<Self>(offset);
11096            // Verify that padding bytes are zero.
11097            fidl::decode!(
11098                fidl::encoding::UnboundedVector<AggregateSource>,
11099                fidl::encoding::DefaultFuchsiaResourceDialect,
11100                &mut self.sources,
11101                decoder,
11102                offset + 0,
11103                _depth
11104            )?;
11105            Ok(())
11106        }
11107    }
11108
11109    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDictionaryDrainRequest {
11110        type Borrowed<'a> = &'a mut Self;
11111        fn take_or_borrow<'a>(
11112            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11113        ) -> Self::Borrowed<'a> {
11114            value
11115        }
11116    }
11117
11118    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDictionaryDrainRequest {
11119        type Owned = Self;
11120
11121        #[inline(always)]
11122        fn inline_align(_context: fidl::encoding::Context) -> usize {
11123            8
11124        }
11125
11126        #[inline(always)]
11127        fn inline_size(_context: fidl::encoding::Context) -> usize {
11128            16
11129        }
11130    }
11131
11132    unsafe impl
11133        fidl::encoding::Encode<
11134            CapabilityStoreDictionaryDrainRequest,
11135            fidl::encoding::DefaultFuchsiaResourceDialect,
11136        > for &mut CapabilityStoreDictionaryDrainRequest
11137    {
11138        #[inline]
11139        unsafe fn encode(
11140            self,
11141            encoder: &mut fidl::encoding::Encoder<
11142                '_,
11143                fidl::encoding::DefaultFuchsiaResourceDialect,
11144            >,
11145            offset: usize,
11146            _depth: fidl::encoding::Depth,
11147        ) -> fidl::Result<()> {
11148            encoder.debug_check_bounds::<CapabilityStoreDictionaryDrainRequest>(offset);
11149            // Delegate to tuple encoding.
11150            fidl::encoding::Encode::<
11151                CapabilityStoreDictionaryDrainRequest,
11152                fidl::encoding::DefaultFuchsiaResourceDialect,
11153            >::encode(
11154                (
11155                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
11156                    <fidl::encoding::Optional<
11157                        fidl::encoding::Endpoint<
11158                            fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>,
11159                        >,
11160                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11161                        &mut self.iterator
11162                    ),
11163                ),
11164                encoder,
11165                offset,
11166                _depth,
11167            )
11168        }
11169    }
11170    unsafe impl<
11171        T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
11172        T1: fidl::encoding::Encode<
11173                fidl::encoding::Optional<
11174                    fidl::encoding::Endpoint<
11175                        fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>,
11176                    >,
11177                >,
11178                fidl::encoding::DefaultFuchsiaResourceDialect,
11179            >,
11180    >
11181        fidl::encoding::Encode<
11182            CapabilityStoreDictionaryDrainRequest,
11183            fidl::encoding::DefaultFuchsiaResourceDialect,
11184        > for (T0, T1)
11185    {
11186        #[inline]
11187        unsafe fn encode(
11188            self,
11189            encoder: &mut fidl::encoding::Encoder<
11190                '_,
11191                fidl::encoding::DefaultFuchsiaResourceDialect,
11192            >,
11193            offset: usize,
11194            depth: fidl::encoding::Depth,
11195        ) -> fidl::Result<()> {
11196            encoder.debug_check_bounds::<CapabilityStoreDictionaryDrainRequest>(offset);
11197            // Zero out padding regions. There's no need to apply masks
11198            // because the unmasked parts will be overwritten by fields.
11199            unsafe {
11200                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
11201                (ptr as *mut u64).write_unaligned(0);
11202            }
11203            // Write the fields.
11204            self.0.encode(encoder, offset + 0, depth)?;
11205            self.1.encode(encoder, offset + 8, depth)?;
11206            Ok(())
11207        }
11208    }
11209
11210    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11211        for CapabilityStoreDictionaryDrainRequest
11212    {
11213        #[inline(always)]
11214        fn new_empty() -> Self {
11215            Self {
11216                id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
11217                iterator: fidl::new_empty!(
11218                    fidl::encoding::Optional<
11219                        fidl::encoding::Endpoint<
11220                            fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>,
11221                        >,
11222                    >,
11223                    fidl::encoding::DefaultFuchsiaResourceDialect
11224                ),
11225            }
11226        }
11227
11228        #[inline]
11229        unsafe fn decode(
11230            &mut self,
11231            decoder: &mut fidl::encoding::Decoder<
11232                '_,
11233                fidl::encoding::DefaultFuchsiaResourceDialect,
11234            >,
11235            offset: usize,
11236            _depth: fidl::encoding::Depth,
11237        ) -> fidl::Result<()> {
11238            decoder.debug_check_bounds::<Self>(offset);
11239            // Verify that padding bytes are zero.
11240            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
11241            let padval = unsafe { (ptr as *const u64).read_unaligned() };
11242            let mask = 0xffffffff00000000u64;
11243            let maskedval = padval & mask;
11244            if maskedval != 0 {
11245                return Err(fidl::Error::NonZeroPadding {
11246                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
11247                });
11248            }
11249            fidl::decode!(
11250                u64,
11251                fidl::encoding::DefaultFuchsiaResourceDialect,
11252                &mut self.id,
11253                decoder,
11254                offset + 0,
11255                _depth
11256            )?;
11257            fidl::decode!(
11258                fidl::encoding::Optional<
11259                    fidl::encoding::Endpoint<
11260                        fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>,
11261                    >,
11262                >,
11263                fidl::encoding::DefaultFuchsiaResourceDialect,
11264                &mut self.iterator,
11265                decoder,
11266                offset + 8,
11267                _depth
11268            )?;
11269            Ok(())
11270        }
11271    }
11272
11273    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDictionaryEnumerateRequest {
11274        type Borrowed<'a> = &'a mut Self;
11275        fn take_or_borrow<'a>(
11276            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11277        ) -> Self::Borrowed<'a> {
11278            value
11279        }
11280    }
11281
11282    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDictionaryEnumerateRequest {
11283        type Owned = Self;
11284
11285        #[inline(always)]
11286        fn inline_align(_context: fidl::encoding::Context) -> usize {
11287            8
11288        }
11289
11290        #[inline(always)]
11291        fn inline_size(_context: fidl::encoding::Context) -> usize {
11292            16
11293        }
11294    }
11295
11296    unsafe impl
11297        fidl::encoding::Encode<
11298            CapabilityStoreDictionaryEnumerateRequest,
11299            fidl::encoding::DefaultFuchsiaResourceDialect,
11300        > for &mut CapabilityStoreDictionaryEnumerateRequest
11301    {
11302        #[inline]
11303        unsafe fn encode(
11304            self,
11305            encoder: &mut fidl::encoding::Encoder<
11306                '_,
11307                fidl::encoding::DefaultFuchsiaResourceDialect,
11308            >,
11309            offset: usize,
11310            _depth: fidl::encoding::Depth,
11311        ) -> fidl::Result<()> {
11312            encoder.debug_check_bounds::<CapabilityStoreDictionaryEnumerateRequest>(offset);
11313            // Delegate to tuple encoding.
11314            fidl::encoding::Encode::<
11315                CapabilityStoreDictionaryEnumerateRequest,
11316                fidl::encoding::DefaultFuchsiaResourceDialect,
11317            >::encode(
11318                (
11319                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
11320                    <fidl::encoding::Endpoint<
11321                        fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
11322                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11323                        &mut self.iterator
11324                    ),
11325                ),
11326                encoder,
11327                offset,
11328                _depth,
11329            )
11330        }
11331    }
11332    unsafe impl<
11333        T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
11334        T1: fidl::encoding::Encode<
11335                fidl::encoding::Endpoint<
11336                    fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
11337                >,
11338                fidl::encoding::DefaultFuchsiaResourceDialect,
11339            >,
11340    >
11341        fidl::encoding::Encode<
11342            CapabilityStoreDictionaryEnumerateRequest,
11343            fidl::encoding::DefaultFuchsiaResourceDialect,
11344        > for (T0, T1)
11345    {
11346        #[inline]
11347        unsafe fn encode(
11348            self,
11349            encoder: &mut fidl::encoding::Encoder<
11350                '_,
11351                fidl::encoding::DefaultFuchsiaResourceDialect,
11352            >,
11353            offset: usize,
11354            depth: fidl::encoding::Depth,
11355        ) -> fidl::Result<()> {
11356            encoder.debug_check_bounds::<CapabilityStoreDictionaryEnumerateRequest>(offset);
11357            // Zero out padding regions. There's no need to apply masks
11358            // because the unmasked parts will be overwritten by fields.
11359            unsafe {
11360                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
11361                (ptr as *mut u64).write_unaligned(0);
11362            }
11363            // Write the fields.
11364            self.0.encode(encoder, offset + 0, depth)?;
11365            self.1.encode(encoder, offset + 8, depth)?;
11366            Ok(())
11367        }
11368    }
11369
11370    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11371        for CapabilityStoreDictionaryEnumerateRequest
11372    {
11373        #[inline(always)]
11374        fn new_empty() -> Self {
11375            Self {
11376                id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
11377                iterator: fidl::new_empty!(
11378                    fidl::encoding::Endpoint<
11379                        fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
11380                    >,
11381                    fidl::encoding::DefaultFuchsiaResourceDialect
11382                ),
11383            }
11384        }
11385
11386        #[inline]
11387        unsafe fn decode(
11388            &mut self,
11389            decoder: &mut fidl::encoding::Decoder<
11390                '_,
11391                fidl::encoding::DefaultFuchsiaResourceDialect,
11392            >,
11393            offset: usize,
11394            _depth: fidl::encoding::Depth,
11395        ) -> fidl::Result<()> {
11396            decoder.debug_check_bounds::<Self>(offset);
11397            // Verify that padding bytes are zero.
11398            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
11399            let padval = unsafe { (ptr as *const u64).read_unaligned() };
11400            let mask = 0xffffffff00000000u64;
11401            let maskedval = padval & mask;
11402            if maskedval != 0 {
11403                return Err(fidl::Error::NonZeroPadding {
11404                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
11405                });
11406            }
11407            fidl::decode!(
11408                u64,
11409                fidl::encoding::DefaultFuchsiaResourceDialect,
11410                &mut self.id,
11411                decoder,
11412                offset + 0,
11413                _depth
11414            )?;
11415            fidl::decode!(
11416                fidl::encoding::Endpoint<
11417                    fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
11418                >,
11419                fidl::encoding::DefaultFuchsiaResourceDialect,
11420                &mut self.iterator,
11421                decoder,
11422                offset + 8,
11423                _depth
11424            )?;
11425            Ok(())
11426        }
11427    }
11428
11429    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDictionaryKeysRequest {
11430        type Borrowed<'a> = &'a mut Self;
11431        fn take_or_borrow<'a>(
11432            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11433        ) -> Self::Borrowed<'a> {
11434            value
11435        }
11436    }
11437
11438    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDictionaryKeysRequest {
11439        type Owned = Self;
11440
11441        #[inline(always)]
11442        fn inline_align(_context: fidl::encoding::Context) -> usize {
11443            8
11444        }
11445
11446        #[inline(always)]
11447        fn inline_size(_context: fidl::encoding::Context) -> usize {
11448            16
11449        }
11450    }
11451
11452    unsafe impl
11453        fidl::encoding::Encode<
11454            CapabilityStoreDictionaryKeysRequest,
11455            fidl::encoding::DefaultFuchsiaResourceDialect,
11456        > for &mut CapabilityStoreDictionaryKeysRequest
11457    {
11458        #[inline]
11459        unsafe fn encode(
11460            self,
11461            encoder: &mut fidl::encoding::Encoder<
11462                '_,
11463                fidl::encoding::DefaultFuchsiaResourceDialect,
11464            >,
11465            offset: usize,
11466            _depth: fidl::encoding::Depth,
11467        ) -> fidl::Result<()> {
11468            encoder.debug_check_bounds::<CapabilityStoreDictionaryKeysRequest>(offset);
11469            // Delegate to tuple encoding.
11470            fidl::encoding::Encode::<
11471                CapabilityStoreDictionaryKeysRequest,
11472                fidl::encoding::DefaultFuchsiaResourceDialect,
11473            >::encode(
11474                (
11475                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
11476                    <fidl::encoding::Endpoint<
11477                        fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>,
11478                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11479                        &mut self.iterator
11480                    ),
11481                ),
11482                encoder,
11483                offset,
11484                _depth,
11485            )
11486        }
11487    }
11488    unsafe impl<
11489        T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
11490        T1: fidl::encoding::Encode<
11491                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>>,
11492                fidl::encoding::DefaultFuchsiaResourceDialect,
11493            >,
11494    >
11495        fidl::encoding::Encode<
11496            CapabilityStoreDictionaryKeysRequest,
11497            fidl::encoding::DefaultFuchsiaResourceDialect,
11498        > for (T0, T1)
11499    {
11500        #[inline]
11501        unsafe fn encode(
11502            self,
11503            encoder: &mut fidl::encoding::Encoder<
11504                '_,
11505                fidl::encoding::DefaultFuchsiaResourceDialect,
11506            >,
11507            offset: usize,
11508            depth: fidl::encoding::Depth,
11509        ) -> fidl::Result<()> {
11510            encoder.debug_check_bounds::<CapabilityStoreDictionaryKeysRequest>(offset);
11511            // Zero out padding regions. There's no need to apply masks
11512            // because the unmasked parts will be overwritten by fields.
11513            unsafe {
11514                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
11515                (ptr as *mut u64).write_unaligned(0);
11516            }
11517            // Write the fields.
11518            self.0.encode(encoder, offset + 0, depth)?;
11519            self.1.encode(encoder, offset + 8, depth)?;
11520            Ok(())
11521        }
11522    }
11523
11524    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11525        for CapabilityStoreDictionaryKeysRequest
11526    {
11527        #[inline(always)]
11528        fn new_empty() -> Self {
11529            Self {
11530                id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
11531                iterator: fidl::new_empty!(
11532                    fidl::encoding::Endpoint<
11533                        fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>,
11534                    >,
11535                    fidl::encoding::DefaultFuchsiaResourceDialect
11536                ),
11537            }
11538        }
11539
11540        #[inline]
11541        unsafe fn decode(
11542            &mut self,
11543            decoder: &mut fidl::encoding::Decoder<
11544                '_,
11545                fidl::encoding::DefaultFuchsiaResourceDialect,
11546            >,
11547            offset: usize,
11548            _depth: fidl::encoding::Depth,
11549        ) -> fidl::Result<()> {
11550            decoder.debug_check_bounds::<Self>(offset);
11551            // Verify that padding bytes are zero.
11552            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
11553            let padval = unsafe { (ptr as *const u64).read_unaligned() };
11554            let mask = 0xffffffff00000000u64;
11555            let maskedval = padval & mask;
11556            if maskedval != 0 {
11557                return Err(fidl::Error::NonZeroPadding {
11558                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
11559                });
11560            }
11561            fidl::decode!(
11562                u64,
11563                fidl::encoding::DefaultFuchsiaResourceDialect,
11564                &mut self.id,
11565                decoder,
11566                offset + 0,
11567                _depth
11568            )?;
11569            fidl::decode!(
11570                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>>,
11571                fidl::encoding::DefaultFuchsiaResourceDialect,
11572                &mut self.iterator,
11573                decoder,
11574                offset + 8,
11575                _depth
11576            )?;
11577            Ok(())
11578        }
11579    }
11580
11581    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDictionaryLegacyExportRequest {
11582        type Borrowed<'a> = &'a mut Self;
11583        fn take_or_borrow<'a>(
11584            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11585        ) -> Self::Borrowed<'a> {
11586            value
11587        }
11588    }
11589
11590    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDictionaryLegacyExportRequest {
11591        type Owned = Self;
11592
11593        #[inline(always)]
11594        fn inline_align(_context: fidl::encoding::Context) -> usize {
11595            8
11596        }
11597
11598        #[inline(always)]
11599        fn inline_size(_context: fidl::encoding::Context) -> usize {
11600            16
11601        }
11602    }
11603
11604    unsafe impl
11605        fidl::encoding::Encode<
11606            CapabilityStoreDictionaryLegacyExportRequest,
11607            fidl::encoding::DefaultFuchsiaResourceDialect,
11608        > for &mut CapabilityStoreDictionaryLegacyExportRequest
11609    {
11610        #[inline]
11611        unsafe fn encode(
11612            self,
11613            encoder: &mut fidl::encoding::Encoder<
11614                '_,
11615                fidl::encoding::DefaultFuchsiaResourceDialect,
11616            >,
11617            offset: usize,
11618            _depth: fidl::encoding::Depth,
11619        ) -> fidl::Result<()> {
11620            encoder.debug_check_bounds::<CapabilityStoreDictionaryLegacyExportRequest>(offset);
11621            // Delegate to tuple encoding.
11622            fidl::encoding::Encode::<
11623                CapabilityStoreDictionaryLegacyExportRequest,
11624                fidl::encoding::DefaultFuchsiaResourceDialect,
11625            >::encode(
11626                (
11627                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
11628                    <fidl::encoding::HandleType<
11629                        fidl::Channel,
11630                        { fidl::ObjectType::CHANNEL.into_raw() },
11631                        2147483648,
11632                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11633                        &mut self.server_end
11634                    ),
11635                ),
11636                encoder,
11637                offset,
11638                _depth,
11639            )
11640        }
11641    }
11642    unsafe impl<
11643        T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
11644        T1: fidl::encoding::Encode<
11645                fidl::encoding::HandleType<
11646                    fidl::Channel,
11647                    { fidl::ObjectType::CHANNEL.into_raw() },
11648                    2147483648,
11649                >,
11650                fidl::encoding::DefaultFuchsiaResourceDialect,
11651            >,
11652    >
11653        fidl::encoding::Encode<
11654            CapabilityStoreDictionaryLegacyExportRequest,
11655            fidl::encoding::DefaultFuchsiaResourceDialect,
11656        > for (T0, T1)
11657    {
11658        #[inline]
11659        unsafe fn encode(
11660            self,
11661            encoder: &mut fidl::encoding::Encoder<
11662                '_,
11663                fidl::encoding::DefaultFuchsiaResourceDialect,
11664            >,
11665            offset: usize,
11666            depth: fidl::encoding::Depth,
11667        ) -> fidl::Result<()> {
11668            encoder.debug_check_bounds::<CapabilityStoreDictionaryLegacyExportRequest>(offset);
11669            // Zero out padding regions. There's no need to apply masks
11670            // because the unmasked parts will be overwritten by fields.
11671            unsafe {
11672                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
11673                (ptr as *mut u64).write_unaligned(0);
11674            }
11675            // Write the fields.
11676            self.0.encode(encoder, offset + 0, depth)?;
11677            self.1.encode(encoder, offset + 8, depth)?;
11678            Ok(())
11679        }
11680    }
11681
11682    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11683        for CapabilityStoreDictionaryLegacyExportRequest
11684    {
11685        #[inline(always)]
11686        fn new_empty() -> Self {
11687            Self {
11688                id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
11689                server_end: fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11690            }
11691        }
11692
11693        #[inline]
11694        unsafe fn decode(
11695            &mut self,
11696            decoder: &mut fidl::encoding::Decoder<
11697                '_,
11698                fidl::encoding::DefaultFuchsiaResourceDialect,
11699            >,
11700            offset: usize,
11701            _depth: fidl::encoding::Depth,
11702        ) -> fidl::Result<()> {
11703            decoder.debug_check_bounds::<Self>(offset);
11704            // Verify that padding bytes are zero.
11705            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
11706            let padval = unsafe { (ptr as *const u64).read_unaligned() };
11707            let mask = 0xffffffff00000000u64;
11708            let maskedval = padval & mask;
11709            if maskedval != 0 {
11710                return Err(fidl::Error::NonZeroPadding {
11711                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
11712                });
11713            }
11714            fidl::decode!(
11715                u64,
11716                fidl::encoding::DefaultFuchsiaResourceDialect,
11717                &mut self.id,
11718                decoder,
11719                offset + 0,
11720                _depth
11721            )?;
11722            fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.server_end, decoder, offset + 8, _depth)?;
11723            Ok(())
11724        }
11725    }
11726
11727    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDictionaryLegacyImportRequest {
11728        type Borrowed<'a> = &'a mut Self;
11729        fn take_or_borrow<'a>(
11730            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11731        ) -> Self::Borrowed<'a> {
11732            value
11733        }
11734    }
11735
11736    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDictionaryLegacyImportRequest {
11737        type Owned = Self;
11738
11739        #[inline(always)]
11740        fn inline_align(_context: fidl::encoding::Context) -> usize {
11741            8
11742        }
11743
11744        #[inline(always)]
11745        fn inline_size(_context: fidl::encoding::Context) -> usize {
11746            16
11747        }
11748    }
11749
11750    unsafe impl
11751        fidl::encoding::Encode<
11752            CapabilityStoreDictionaryLegacyImportRequest,
11753            fidl::encoding::DefaultFuchsiaResourceDialect,
11754        > for &mut CapabilityStoreDictionaryLegacyImportRequest
11755    {
11756        #[inline]
11757        unsafe fn encode(
11758            self,
11759            encoder: &mut fidl::encoding::Encoder<
11760                '_,
11761                fidl::encoding::DefaultFuchsiaResourceDialect,
11762            >,
11763            offset: usize,
11764            _depth: fidl::encoding::Depth,
11765        ) -> fidl::Result<()> {
11766            encoder.debug_check_bounds::<CapabilityStoreDictionaryLegacyImportRequest>(offset);
11767            // Delegate to tuple encoding.
11768            fidl::encoding::Encode::<
11769                CapabilityStoreDictionaryLegacyImportRequest,
11770                fidl::encoding::DefaultFuchsiaResourceDialect,
11771            >::encode(
11772                (
11773                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
11774                    <fidl::encoding::HandleType<
11775                        fidl::Channel,
11776                        { fidl::ObjectType::CHANNEL.into_raw() },
11777                        2147483648,
11778                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11779                        &mut self.client_end
11780                    ),
11781                ),
11782                encoder,
11783                offset,
11784                _depth,
11785            )
11786        }
11787    }
11788    unsafe impl<
11789        T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
11790        T1: fidl::encoding::Encode<
11791                fidl::encoding::HandleType<
11792                    fidl::Channel,
11793                    { fidl::ObjectType::CHANNEL.into_raw() },
11794                    2147483648,
11795                >,
11796                fidl::encoding::DefaultFuchsiaResourceDialect,
11797            >,
11798    >
11799        fidl::encoding::Encode<
11800            CapabilityStoreDictionaryLegacyImportRequest,
11801            fidl::encoding::DefaultFuchsiaResourceDialect,
11802        > for (T0, T1)
11803    {
11804        #[inline]
11805        unsafe fn encode(
11806            self,
11807            encoder: &mut fidl::encoding::Encoder<
11808                '_,
11809                fidl::encoding::DefaultFuchsiaResourceDialect,
11810            >,
11811            offset: usize,
11812            depth: fidl::encoding::Depth,
11813        ) -> fidl::Result<()> {
11814            encoder.debug_check_bounds::<CapabilityStoreDictionaryLegacyImportRequest>(offset);
11815            // Zero out padding regions. There's no need to apply masks
11816            // because the unmasked parts will be overwritten by fields.
11817            unsafe {
11818                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
11819                (ptr as *mut u64).write_unaligned(0);
11820            }
11821            // Write the fields.
11822            self.0.encode(encoder, offset + 0, depth)?;
11823            self.1.encode(encoder, offset + 8, depth)?;
11824            Ok(())
11825        }
11826    }
11827
11828    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11829        for CapabilityStoreDictionaryLegacyImportRequest
11830    {
11831        #[inline(always)]
11832        fn new_empty() -> Self {
11833            Self {
11834                id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
11835                client_end: fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11836            }
11837        }
11838
11839        #[inline]
11840        unsafe fn decode(
11841            &mut self,
11842            decoder: &mut fidl::encoding::Decoder<
11843                '_,
11844                fidl::encoding::DefaultFuchsiaResourceDialect,
11845            >,
11846            offset: usize,
11847            _depth: fidl::encoding::Depth,
11848        ) -> fidl::Result<()> {
11849            decoder.debug_check_bounds::<Self>(offset);
11850            // Verify that padding bytes are zero.
11851            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
11852            let padval = unsafe { (ptr as *const u64).read_unaligned() };
11853            let mask = 0xffffffff00000000u64;
11854            let maskedval = padval & mask;
11855            if maskedval != 0 {
11856                return Err(fidl::Error::NonZeroPadding {
11857                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
11858                });
11859            }
11860            fidl::decode!(
11861                u64,
11862                fidl::encoding::DefaultFuchsiaResourceDialect,
11863                &mut self.id,
11864                decoder,
11865                offset + 0,
11866                _depth
11867            )?;
11868            fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.client_end, decoder, offset + 8, _depth)?;
11869            Ok(())
11870        }
11871    }
11872
11873    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDirConnectorCreateRequest {
11874        type Borrowed<'a> = &'a mut Self;
11875        fn take_or_borrow<'a>(
11876            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11877        ) -> Self::Borrowed<'a> {
11878            value
11879        }
11880    }
11881
11882    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDirConnectorCreateRequest {
11883        type Owned = Self;
11884
11885        #[inline(always)]
11886        fn inline_align(_context: fidl::encoding::Context) -> usize {
11887            8
11888        }
11889
11890        #[inline(always)]
11891        fn inline_size(_context: fidl::encoding::Context) -> usize {
11892            16
11893        }
11894    }
11895
11896    unsafe impl
11897        fidl::encoding::Encode<
11898            CapabilityStoreDirConnectorCreateRequest,
11899            fidl::encoding::DefaultFuchsiaResourceDialect,
11900        > for &mut CapabilityStoreDirConnectorCreateRequest
11901    {
11902        #[inline]
11903        unsafe fn encode(
11904            self,
11905            encoder: &mut fidl::encoding::Encoder<
11906                '_,
11907                fidl::encoding::DefaultFuchsiaResourceDialect,
11908            >,
11909            offset: usize,
11910            _depth: fidl::encoding::Depth,
11911        ) -> fidl::Result<()> {
11912            encoder.debug_check_bounds::<CapabilityStoreDirConnectorCreateRequest>(offset);
11913            // Delegate to tuple encoding.
11914            fidl::encoding::Encode::<CapabilityStoreDirConnectorCreateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
11915                (
11916                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
11917                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirReceiverMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.receiver),
11918                ),
11919                encoder, offset, _depth
11920            )
11921        }
11922    }
11923    unsafe impl<
11924        T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
11925        T1: fidl::encoding::Encode<
11926                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirReceiverMarker>>,
11927                fidl::encoding::DefaultFuchsiaResourceDialect,
11928            >,
11929    >
11930        fidl::encoding::Encode<
11931            CapabilityStoreDirConnectorCreateRequest,
11932            fidl::encoding::DefaultFuchsiaResourceDialect,
11933        > for (T0, T1)
11934    {
11935        #[inline]
11936        unsafe fn encode(
11937            self,
11938            encoder: &mut fidl::encoding::Encoder<
11939                '_,
11940                fidl::encoding::DefaultFuchsiaResourceDialect,
11941            >,
11942            offset: usize,
11943            depth: fidl::encoding::Depth,
11944        ) -> fidl::Result<()> {
11945            encoder.debug_check_bounds::<CapabilityStoreDirConnectorCreateRequest>(offset);
11946            // Zero out padding regions. There's no need to apply masks
11947            // because the unmasked parts will be overwritten by fields.
11948            unsafe {
11949                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
11950                (ptr as *mut u64).write_unaligned(0);
11951            }
11952            // Write the fields.
11953            self.0.encode(encoder, offset + 0, depth)?;
11954            self.1.encode(encoder, offset + 8, depth)?;
11955            Ok(())
11956        }
11957    }
11958
11959    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11960        for CapabilityStoreDirConnectorCreateRequest
11961    {
11962        #[inline(always)]
11963        fn new_empty() -> Self {
11964            Self {
11965                id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
11966                receiver: fidl::new_empty!(
11967                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirReceiverMarker>>,
11968                    fidl::encoding::DefaultFuchsiaResourceDialect
11969                ),
11970            }
11971        }
11972
11973        #[inline]
11974        unsafe fn decode(
11975            &mut self,
11976            decoder: &mut fidl::encoding::Decoder<
11977                '_,
11978                fidl::encoding::DefaultFuchsiaResourceDialect,
11979            >,
11980            offset: usize,
11981            _depth: fidl::encoding::Depth,
11982        ) -> fidl::Result<()> {
11983            decoder.debug_check_bounds::<Self>(offset);
11984            // Verify that padding bytes are zero.
11985            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
11986            let padval = unsafe { (ptr as *const u64).read_unaligned() };
11987            let mask = 0xffffffff00000000u64;
11988            let maskedval = padval & mask;
11989            if maskedval != 0 {
11990                return Err(fidl::Error::NonZeroPadding {
11991                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
11992                });
11993            }
11994            fidl::decode!(
11995                u64,
11996                fidl::encoding::DefaultFuchsiaResourceDialect,
11997                &mut self.id,
11998                decoder,
11999                offset + 0,
12000                _depth
12001            )?;
12002            fidl::decode!(
12003                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirReceiverMarker>>,
12004                fidl::encoding::DefaultFuchsiaResourceDialect,
12005                &mut self.receiver,
12006                decoder,
12007                offset + 8,
12008                _depth
12009            )?;
12010            Ok(())
12011        }
12012    }
12013
12014    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreImportRequest {
12015        type Borrowed<'a> = &'a mut Self;
12016        fn take_or_borrow<'a>(
12017            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12018        ) -> Self::Borrowed<'a> {
12019            value
12020        }
12021    }
12022
12023    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreImportRequest {
12024        type Owned = Self;
12025
12026        #[inline(always)]
12027        fn inline_align(_context: fidl::encoding::Context) -> usize {
12028            8
12029        }
12030
12031        #[inline(always)]
12032        fn inline_size(_context: fidl::encoding::Context) -> usize {
12033            24
12034        }
12035    }
12036
12037    unsafe impl
12038        fidl::encoding::Encode<
12039            CapabilityStoreImportRequest,
12040            fidl::encoding::DefaultFuchsiaResourceDialect,
12041        > for &mut CapabilityStoreImportRequest
12042    {
12043        #[inline]
12044        unsafe fn encode(
12045            self,
12046            encoder: &mut fidl::encoding::Encoder<
12047                '_,
12048                fidl::encoding::DefaultFuchsiaResourceDialect,
12049            >,
12050            offset: usize,
12051            _depth: fidl::encoding::Depth,
12052        ) -> fidl::Result<()> {
12053            encoder.debug_check_bounds::<CapabilityStoreImportRequest>(offset);
12054            // Delegate to tuple encoding.
12055            fidl::encoding::Encode::<
12056                CapabilityStoreImportRequest,
12057                fidl::encoding::DefaultFuchsiaResourceDialect,
12058            >::encode(
12059                (
12060                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
12061                    <Capability as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
12062                        &mut self.capability,
12063                    ),
12064                ),
12065                encoder,
12066                offset,
12067                _depth,
12068            )
12069        }
12070    }
12071    unsafe impl<
12072        T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
12073        T1: fidl::encoding::Encode<Capability, fidl::encoding::DefaultFuchsiaResourceDialect>,
12074    >
12075        fidl::encoding::Encode<
12076            CapabilityStoreImportRequest,
12077            fidl::encoding::DefaultFuchsiaResourceDialect,
12078        > for (T0, T1)
12079    {
12080        #[inline]
12081        unsafe fn encode(
12082            self,
12083            encoder: &mut fidl::encoding::Encoder<
12084                '_,
12085                fidl::encoding::DefaultFuchsiaResourceDialect,
12086            >,
12087            offset: usize,
12088            depth: fidl::encoding::Depth,
12089        ) -> fidl::Result<()> {
12090            encoder.debug_check_bounds::<CapabilityStoreImportRequest>(offset);
12091            // Zero out padding regions. There's no need to apply masks
12092            // because the unmasked parts will be overwritten by fields.
12093            // Write the fields.
12094            self.0.encode(encoder, offset + 0, depth)?;
12095            self.1.encode(encoder, offset + 8, depth)?;
12096            Ok(())
12097        }
12098    }
12099
12100    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12101        for CapabilityStoreImportRequest
12102    {
12103        #[inline(always)]
12104        fn new_empty() -> Self {
12105            Self {
12106                id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
12107                capability: fidl::new_empty!(
12108                    Capability,
12109                    fidl::encoding::DefaultFuchsiaResourceDialect
12110                ),
12111            }
12112        }
12113
12114        #[inline]
12115        unsafe fn decode(
12116            &mut self,
12117            decoder: &mut fidl::encoding::Decoder<
12118                '_,
12119                fidl::encoding::DefaultFuchsiaResourceDialect,
12120            >,
12121            offset: usize,
12122            _depth: fidl::encoding::Depth,
12123        ) -> fidl::Result<()> {
12124            decoder.debug_check_bounds::<Self>(offset);
12125            // Verify that padding bytes are zero.
12126            fidl::decode!(
12127                u64,
12128                fidl::encoding::DefaultFuchsiaResourceDialect,
12129                &mut self.id,
12130                decoder,
12131                offset + 0,
12132                _depth
12133            )?;
12134            fidl::decode!(
12135                Capability,
12136                fidl::encoding::DefaultFuchsiaResourceDialect,
12137                &mut self.capability,
12138                decoder,
12139                offset + 8,
12140                _depth
12141            )?;
12142            Ok(())
12143        }
12144    }
12145
12146    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreCreateServiceAggregateResponse {
12147        type Borrowed<'a> = &'a mut Self;
12148        fn take_or_borrow<'a>(
12149            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12150        ) -> Self::Borrowed<'a> {
12151            value
12152        }
12153    }
12154
12155    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreCreateServiceAggregateResponse {
12156        type Owned = Self;
12157
12158        #[inline(always)]
12159        fn inline_align(_context: fidl::encoding::Context) -> usize {
12160            4
12161        }
12162
12163        #[inline(always)]
12164        fn inline_size(_context: fidl::encoding::Context) -> usize {
12165            4
12166        }
12167    }
12168
12169    unsafe impl
12170        fidl::encoding::Encode<
12171            CapabilityStoreCreateServiceAggregateResponse,
12172            fidl::encoding::DefaultFuchsiaResourceDialect,
12173        > for &mut CapabilityStoreCreateServiceAggregateResponse
12174    {
12175        #[inline]
12176        unsafe fn encode(
12177            self,
12178            encoder: &mut fidl::encoding::Encoder<
12179                '_,
12180                fidl::encoding::DefaultFuchsiaResourceDialect,
12181            >,
12182            offset: usize,
12183            _depth: fidl::encoding::Depth,
12184        ) -> fidl::Result<()> {
12185            encoder.debug_check_bounds::<CapabilityStoreCreateServiceAggregateResponse>(offset);
12186            // Delegate to tuple encoding.
12187            fidl::encoding::Encode::<
12188                CapabilityStoreCreateServiceAggregateResponse,
12189                fidl::encoding::DefaultFuchsiaResourceDialect,
12190            >::encode(
12191                (<DirConnector as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
12192                    &mut self.aggregate_dir_connector,
12193                ),),
12194                encoder,
12195                offset,
12196                _depth,
12197            )
12198        }
12199    }
12200    unsafe impl<
12201        T0: fidl::encoding::Encode<DirConnector, fidl::encoding::DefaultFuchsiaResourceDialect>,
12202    >
12203        fidl::encoding::Encode<
12204            CapabilityStoreCreateServiceAggregateResponse,
12205            fidl::encoding::DefaultFuchsiaResourceDialect,
12206        > for (T0,)
12207    {
12208        #[inline]
12209        unsafe fn encode(
12210            self,
12211            encoder: &mut fidl::encoding::Encoder<
12212                '_,
12213                fidl::encoding::DefaultFuchsiaResourceDialect,
12214            >,
12215            offset: usize,
12216            depth: fidl::encoding::Depth,
12217        ) -> fidl::Result<()> {
12218            encoder.debug_check_bounds::<CapabilityStoreCreateServiceAggregateResponse>(offset);
12219            // Zero out padding regions. There's no need to apply masks
12220            // because the unmasked parts will be overwritten by fields.
12221            // Write the fields.
12222            self.0.encode(encoder, offset + 0, depth)?;
12223            Ok(())
12224        }
12225    }
12226
12227    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12228        for CapabilityStoreCreateServiceAggregateResponse
12229    {
12230        #[inline(always)]
12231        fn new_empty() -> Self {
12232            Self {
12233                aggregate_dir_connector: fidl::new_empty!(
12234                    DirConnector,
12235                    fidl::encoding::DefaultFuchsiaResourceDialect
12236                ),
12237            }
12238        }
12239
12240        #[inline]
12241        unsafe fn decode(
12242            &mut self,
12243            decoder: &mut fidl::encoding::Decoder<
12244                '_,
12245                fidl::encoding::DefaultFuchsiaResourceDialect,
12246            >,
12247            offset: usize,
12248            _depth: fidl::encoding::Depth,
12249        ) -> fidl::Result<()> {
12250            decoder.debug_check_bounds::<Self>(offset);
12251            // Verify that padding bytes are zero.
12252            fidl::decode!(
12253                DirConnector,
12254                fidl::encoding::DefaultFuchsiaResourceDialect,
12255                &mut self.aggregate_dir_connector,
12256                decoder,
12257                offset + 0,
12258                _depth
12259            )?;
12260            Ok(())
12261        }
12262    }
12263
12264    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreExportResponse {
12265        type Borrowed<'a> = &'a mut Self;
12266        fn take_or_borrow<'a>(
12267            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12268        ) -> Self::Borrowed<'a> {
12269            value
12270        }
12271    }
12272
12273    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreExportResponse {
12274        type Owned = Self;
12275
12276        #[inline(always)]
12277        fn inline_align(_context: fidl::encoding::Context) -> usize {
12278            8
12279        }
12280
12281        #[inline(always)]
12282        fn inline_size(_context: fidl::encoding::Context) -> usize {
12283            16
12284        }
12285    }
12286
12287    unsafe impl
12288        fidl::encoding::Encode<
12289            CapabilityStoreExportResponse,
12290            fidl::encoding::DefaultFuchsiaResourceDialect,
12291        > for &mut CapabilityStoreExportResponse
12292    {
12293        #[inline]
12294        unsafe fn encode(
12295            self,
12296            encoder: &mut fidl::encoding::Encoder<
12297                '_,
12298                fidl::encoding::DefaultFuchsiaResourceDialect,
12299            >,
12300            offset: usize,
12301            _depth: fidl::encoding::Depth,
12302        ) -> fidl::Result<()> {
12303            encoder.debug_check_bounds::<CapabilityStoreExportResponse>(offset);
12304            // Delegate to tuple encoding.
12305            fidl::encoding::Encode::<
12306                CapabilityStoreExportResponse,
12307                fidl::encoding::DefaultFuchsiaResourceDialect,
12308            >::encode(
12309                (<Capability as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
12310                    &mut self.capability,
12311                ),),
12312                encoder,
12313                offset,
12314                _depth,
12315            )
12316        }
12317    }
12318    unsafe impl<
12319        T0: fidl::encoding::Encode<Capability, fidl::encoding::DefaultFuchsiaResourceDialect>,
12320    >
12321        fidl::encoding::Encode<
12322            CapabilityStoreExportResponse,
12323            fidl::encoding::DefaultFuchsiaResourceDialect,
12324        > for (T0,)
12325    {
12326        #[inline]
12327        unsafe fn encode(
12328            self,
12329            encoder: &mut fidl::encoding::Encoder<
12330                '_,
12331                fidl::encoding::DefaultFuchsiaResourceDialect,
12332            >,
12333            offset: usize,
12334            depth: fidl::encoding::Depth,
12335        ) -> fidl::Result<()> {
12336            encoder.debug_check_bounds::<CapabilityStoreExportResponse>(offset);
12337            // Zero out padding regions. There's no need to apply masks
12338            // because the unmasked parts will be overwritten by fields.
12339            // Write the fields.
12340            self.0.encode(encoder, offset + 0, depth)?;
12341            Ok(())
12342        }
12343    }
12344
12345    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12346        for CapabilityStoreExportResponse
12347    {
12348        #[inline(always)]
12349        fn new_empty() -> Self {
12350            Self {
12351                capability: fidl::new_empty!(
12352                    Capability,
12353                    fidl::encoding::DefaultFuchsiaResourceDialect
12354                ),
12355            }
12356        }
12357
12358        #[inline]
12359        unsafe fn decode(
12360            &mut self,
12361            decoder: &mut fidl::encoding::Decoder<
12362                '_,
12363                fidl::encoding::DefaultFuchsiaResourceDialect,
12364            >,
12365            offset: usize,
12366            _depth: fidl::encoding::Depth,
12367        ) -> fidl::Result<()> {
12368            decoder.debug_check_bounds::<Self>(offset);
12369            // Verify that padding bytes are zero.
12370            fidl::decode!(
12371                Capability,
12372                fidl::encoding::DefaultFuchsiaResourceDialect,
12373                &mut self.capability,
12374                decoder,
12375                offset + 0,
12376                _depth
12377            )?;
12378            Ok(())
12379        }
12380    }
12381
12382    impl fidl::encoding::ResourceTypeMarker for Connector {
12383        type Borrowed<'a> = &'a mut Self;
12384        fn take_or_borrow<'a>(
12385            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12386        ) -> Self::Borrowed<'a> {
12387            value
12388        }
12389    }
12390
12391    unsafe impl fidl::encoding::TypeMarker for Connector {
12392        type Owned = Self;
12393
12394        #[inline(always)]
12395        fn inline_align(_context: fidl::encoding::Context) -> usize {
12396            4
12397        }
12398
12399        #[inline(always)]
12400        fn inline_size(_context: fidl::encoding::Context) -> usize {
12401            4
12402        }
12403    }
12404
12405    unsafe impl fidl::encoding::Encode<Connector, fidl::encoding::DefaultFuchsiaResourceDialect>
12406        for &mut Connector
12407    {
12408        #[inline]
12409        unsafe fn encode(
12410            self,
12411            encoder: &mut fidl::encoding::Encoder<
12412                '_,
12413                fidl::encoding::DefaultFuchsiaResourceDialect,
12414            >,
12415            offset: usize,
12416            _depth: fidl::encoding::Depth,
12417        ) -> fidl::Result<()> {
12418            encoder.debug_check_bounds::<Connector>(offset);
12419            // Delegate to tuple encoding.
12420            fidl::encoding::Encode::<Connector, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
12421                (
12422                    <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.token),
12423                ),
12424                encoder, offset, _depth
12425            )
12426        }
12427    }
12428    unsafe impl<
12429        T0: fidl::encoding::Encode<
12430                fidl::encoding::HandleType<
12431                    fidl::EventPair,
12432                    { fidl::ObjectType::EVENTPAIR.into_raw() },
12433                    2147483648,
12434                >,
12435                fidl::encoding::DefaultFuchsiaResourceDialect,
12436            >,
12437    > fidl::encoding::Encode<Connector, fidl::encoding::DefaultFuchsiaResourceDialect> for (T0,)
12438    {
12439        #[inline]
12440        unsafe fn encode(
12441            self,
12442            encoder: &mut fidl::encoding::Encoder<
12443                '_,
12444                fidl::encoding::DefaultFuchsiaResourceDialect,
12445            >,
12446            offset: usize,
12447            depth: fidl::encoding::Depth,
12448        ) -> fidl::Result<()> {
12449            encoder.debug_check_bounds::<Connector>(offset);
12450            // Zero out padding regions. There's no need to apply masks
12451            // because the unmasked parts will be overwritten by fields.
12452            // Write the fields.
12453            self.0.encode(encoder, offset + 0, depth)?;
12454            Ok(())
12455        }
12456    }
12457
12458    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Connector {
12459        #[inline(always)]
12460        fn new_empty() -> Self {
12461            Self {
12462                token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
12463            }
12464        }
12465
12466        #[inline]
12467        unsafe fn decode(
12468            &mut self,
12469            decoder: &mut fidl::encoding::Decoder<
12470                '_,
12471                fidl::encoding::DefaultFuchsiaResourceDialect,
12472            >,
12473            offset: usize,
12474            _depth: fidl::encoding::Depth,
12475        ) -> fidl::Result<()> {
12476            decoder.debug_check_bounds::<Self>(offset);
12477            // Verify that padding bytes are zero.
12478            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.token, decoder, offset + 0, _depth)?;
12479            Ok(())
12480        }
12481    }
12482
12483    impl fidl::encoding::ResourceTypeMarker for DictionaryDrainIteratorGetNextResponse {
12484        type Borrowed<'a> = &'a mut Self;
12485        fn take_or_borrow<'a>(
12486            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12487        ) -> Self::Borrowed<'a> {
12488            value
12489        }
12490    }
12491
12492    unsafe impl fidl::encoding::TypeMarker for DictionaryDrainIteratorGetNextResponse {
12493        type Owned = Self;
12494
12495        #[inline(always)]
12496        fn inline_align(_context: fidl::encoding::Context) -> usize {
12497            8
12498        }
12499
12500        #[inline(always)]
12501        fn inline_size(_context: fidl::encoding::Context) -> usize {
12502            24
12503        }
12504    }
12505
12506    unsafe impl
12507        fidl::encoding::Encode<
12508            DictionaryDrainIteratorGetNextResponse,
12509            fidl::encoding::DefaultFuchsiaResourceDialect,
12510        > for &mut DictionaryDrainIteratorGetNextResponse
12511    {
12512        #[inline]
12513        unsafe fn encode(
12514            self,
12515            encoder: &mut fidl::encoding::Encoder<
12516                '_,
12517                fidl::encoding::DefaultFuchsiaResourceDialect,
12518            >,
12519            offset: usize,
12520            _depth: fidl::encoding::Depth,
12521        ) -> fidl::Result<()> {
12522            encoder.debug_check_bounds::<DictionaryDrainIteratorGetNextResponse>(offset);
12523            // Delegate to tuple encoding.
12524            fidl::encoding::Encode::<DictionaryDrainIteratorGetNextResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
12525                (
12526                    <fidl::encoding::Vector<DictionaryItem, 128> as fidl::encoding::ValueTypeMarker>::borrow(&self.items),
12527                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.end_id),
12528                ),
12529                encoder, offset, _depth
12530            )
12531        }
12532    }
12533    unsafe impl<
12534        T0: fidl::encoding::Encode<
12535                fidl::encoding::Vector<DictionaryItem, 128>,
12536                fidl::encoding::DefaultFuchsiaResourceDialect,
12537            >,
12538        T1: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
12539    >
12540        fidl::encoding::Encode<
12541            DictionaryDrainIteratorGetNextResponse,
12542            fidl::encoding::DefaultFuchsiaResourceDialect,
12543        > for (T0, T1)
12544    {
12545        #[inline]
12546        unsafe fn encode(
12547            self,
12548            encoder: &mut fidl::encoding::Encoder<
12549                '_,
12550                fidl::encoding::DefaultFuchsiaResourceDialect,
12551            >,
12552            offset: usize,
12553            depth: fidl::encoding::Depth,
12554        ) -> fidl::Result<()> {
12555            encoder.debug_check_bounds::<DictionaryDrainIteratorGetNextResponse>(offset);
12556            // Zero out padding regions. There's no need to apply masks
12557            // because the unmasked parts will be overwritten by fields.
12558            // Write the fields.
12559            self.0.encode(encoder, offset + 0, depth)?;
12560            self.1.encode(encoder, offset + 16, depth)?;
12561            Ok(())
12562        }
12563    }
12564
12565    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12566        for DictionaryDrainIteratorGetNextResponse
12567    {
12568        #[inline(always)]
12569        fn new_empty() -> Self {
12570            Self {
12571                items: fidl::new_empty!(fidl::encoding::Vector<DictionaryItem, 128>, fidl::encoding::DefaultFuchsiaResourceDialect),
12572                end_id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
12573            }
12574        }
12575
12576        #[inline]
12577        unsafe fn decode(
12578            &mut self,
12579            decoder: &mut fidl::encoding::Decoder<
12580                '_,
12581                fidl::encoding::DefaultFuchsiaResourceDialect,
12582            >,
12583            offset: usize,
12584            _depth: fidl::encoding::Depth,
12585        ) -> fidl::Result<()> {
12586            decoder.debug_check_bounds::<Self>(offset);
12587            // Verify that padding bytes are zero.
12588            fidl::decode!(fidl::encoding::Vector<DictionaryItem, 128>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.items, decoder, offset + 0, _depth)?;
12589            fidl::decode!(
12590                u64,
12591                fidl::encoding::DefaultFuchsiaResourceDialect,
12592                &mut self.end_id,
12593                decoder,
12594                offset + 16,
12595                _depth
12596            )?;
12597            Ok(())
12598        }
12599    }
12600
12601    impl fidl::encoding::ResourceTypeMarker for DictionaryEnumerateIteratorGetNextResponse {
12602        type Borrowed<'a> = &'a mut Self;
12603        fn take_or_borrow<'a>(
12604            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12605        ) -> Self::Borrowed<'a> {
12606            value
12607        }
12608    }
12609
12610    unsafe impl fidl::encoding::TypeMarker for DictionaryEnumerateIteratorGetNextResponse {
12611        type Owned = Self;
12612
12613        #[inline(always)]
12614        fn inline_align(_context: fidl::encoding::Context) -> usize {
12615            8
12616        }
12617
12618        #[inline(always)]
12619        fn inline_size(_context: fidl::encoding::Context) -> usize {
12620            24
12621        }
12622    }
12623
12624    unsafe impl
12625        fidl::encoding::Encode<
12626            DictionaryEnumerateIteratorGetNextResponse,
12627            fidl::encoding::DefaultFuchsiaResourceDialect,
12628        > for &mut DictionaryEnumerateIteratorGetNextResponse
12629    {
12630        #[inline]
12631        unsafe fn encode(
12632            self,
12633            encoder: &mut fidl::encoding::Encoder<
12634                '_,
12635                fidl::encoding::DefaultFuchsiaResourceDialect,
12636            >,
12637            offset: usize,
12638            _depth: fidl::encoding::Depth,
12639        ) -> fidl::Result<()> {
12640            encoder.debug_check_bounds::<DictionaryEnumerateIteratorGetNextResponse>(offset);
12641            // Delegate to tuple encoding.
12642            fidl::encoding::Encode::<DictionaryEnumerateIteratorGetNextResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
12643                (
12644                    <fidl::encoding::Vector<DictionaryOptionalItem, 128> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.items),
12645                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.end_id),
12646                ),
12647                encoder, offset, _depth
12648            )
12649        }
12650    }
12651    unsafe impl<
12652        T0: fidl::encoding::Encode<
12653                fidl::encoding::Vector<DictionaryOptionalItem, 128>,
12654                fidl::encoding::DefaultFuchsiaResourceDialect,
12655            >,
12656        T1: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
12657    >
12658        fidl::encoding::Encode<
12659            DictionaryEnumerateIteratorGetNextResponse,
12660            fidl::encoding::DefaultFuchsiaResourceDialect,
12661        > for (T0, T1)
12662    {
12663        #[inline]
12664        unsafe fn encode(
12665            self,
12666            encoder: &mut fidl::encoding::Encoder<
12667                '_,
12668                fidl::encoding::DefaultFuchsiaResourceDialect,
12669            >,
12670            offset: usize,
12671            depth: fidl::encoding::Depth,
12672        ) -> fidl::Result<()> {
12673            encoder.debug_check_bounds::<DictionaryEnumerateIteratorGetNextResponse>(offset);
12674            // Zero out padding regions. There's no need to apply masks
12675            // because the unmasked parts will be overwritten by fields.
12676            // Write the fields.
12677            self.0.encode(encoder, offset + 0, depth)?;
12678            self.1.encode(encoder, offset + 16, depth)?;
12679            Ok(())
12680        }
12681    }
12682
12683    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12684        for DictionaryEnumerateIteratorGetNextResponse
12685    {
12686        #[inline(always)]
12687        fn new_empty() -> Self {
12688            Self {
12689                items: fidl::new_empty!(fidl::encoding::Vector<DictionaryOptionalItem, 128>, fidl::encoding::DefaultFuchsiaResourceDialect),
12690                end_id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
12691            }
12692        }
12693
12694        #[inline]
12695        unsafe fn decode(
12696            &mut self,
12697            decoder: &mut fidl::encoding::Decoder<
12698                '_,
12699                fidl::encoding::DefaultFuchsiaResourceDialect,
12700            >,
12701            offset: usize,
12702            _depth: fidl::encoding::Depth,
12703        ) -> fidl::Result<()> {
12704            decoder.debug_check_bounds::<Self>(offset);
12705            // Verify that padding bytes are zero.
12706            fidl::decode!(fidl::encoding::Vector<DictionaryOptionalItem, 128>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.items, decoder, offset + 0, _depth)?;
12707            fidl::decode!(
12708                u64,
12709                fidl::encoding::DefaultFuchsiaResourceDialect,
12710                &mut self.end_id,
12711                decoder,
12712                offset + 16,
12713                _depth
12714            )?;
12715            Ok(())
12716        }
12717    }
12718
12719    impl fidl::encoding::ResourceTypeMarker for DictionaryKeysIteratorGetNextResponse {
12720        type Borrowed<'a> = &'a mut Self;
12721        fn take_or_borrow<'a>(
12722            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12723        ) -> Self::Borrowed<'a> {
12724            value
12725        }
12726    }
12727
12728    unsafe impl fidl::encoding::TypeMarker for DictionaryKeysIteratorGetNextResponse {
12729        type Owned = Self;
12730
12731        #[inline(always)]
12732        fn inline_align(_context: fidl::encoding::Context) -> usize {
12733            8
12734        }
12735
12736        #[inline(always)]
12737        fn inline_size(_context: fidl::encoding::Context) -> usize {
12738            16
12739        }
12740    }
12741
12742    unsafe impl
12743        fidl::encoding::Encode<
12744            DictionaryKeysIteratorGetNextResponse,
12745            fidl::encoding::DefaultFuchsiaResourceDialect,
12746        > for &mut DictionaryKeysIteratorGetNextResponse
12747    {
12748        #[inline]
12749        unsafe fn encode(
12750            self,
12751            encoder: &mut fidl::encoding::Encoder<
12752                '_,
12753                fidl::encoding::DefaultFuchsiaResourceDialect,
12754            >,
12755            offset: usize,
12756            _depth: fidl::encoding::Depth,
12757        ) -> fidl::Result<()> {
12758            encoder.debug_check_bounds::<DictionaryKeysIteratorGetNextResponse>(offset);
12759            // Delegate to tuple encoding.
12760            fidl::encoding::Encode::<DictionaryKeysIteratorGetNextResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
12761                (
12762                    <fidl::encoding::Vector<fidl::encoding::BoundedString<255>, 128> as fidl::encoding::ValueTypeMarker>::borrow(&self.keys),
12763                ),
12764                encoder, offset, _depth
12765            )
12766        }
12767    }
12768    unsafe impl<
12769        T0: fidl::encoding::Encode<
12770                fidl::encoding::Vector<fidl::encoding::BoundedString<255>, 128>,
12771                fidl::encoding::DefaultFuchsiaResourceDialect,
12772            >,
12773    >
12774        fidl::encoding::Encode<
12775            DictionaryKeysIteratorGetNextResponse,
12776            fidl::encoding::DefaultFuchsiaResourceDialect,
12777        > for (T0,)
12778    {
12779        #[inline]
12780        unsafe fn encode(
12781            self,
12782            encoder: &mut fidl::encoding::Encoder<
12783                '_,
12784                fidl::encoding::DefaultFuchsiaResourceDialect,
12785            >,
12786            offset: usize,
12787            depth: fidl::encoding::Depth,
12788        ) -> fidl::Result<()> {
12789            encoder.debug_check_bounds::<DictionaryKeysIteratorGetNextResponse>(offset);
12790            // Zero out padding regions. There's no need to apply masks
12791            // because the unmasked parts will be overwritten by fields.
12792            // Write the fields.
12793            self.0.encode(encoder, offset + 0, depth)?;
12794            Ok(())
12795        }
12796    }
12797
12798    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12799        for DictionaryKeysIteratorGetNextResponse
12800    {
12801        #[inline(always)]
12802        fn new_empty() -> Self {
12803            Self {
12804                keys: fidl::new_empty!(
12805                    fidl::encoding::Vector<fidl::encoding::BoundedString<255>, 128>,
12806                    fidl::encoding::DefaultFuchsiaResourceDialect
12807                ),
12808            }
12809        }
12810
12811        #[inline]
12812        unsafe fn decode(
12813            &mut self,
12814            decoder: &mut fidl::encoding::Decoder<
12815                '_,
12816                fidl::encoding::DefaultFuchsiaResourceDialect,
12817            >,
12818            offset: usize,
12819            _depth: fidl::encoding::Depth,
12820        ) -> fidl::Result<()> {
12821            decoder.debug_check_bounds::<Self>(offset);
12822            // Verify that padding bytes are zero.
12823            fidl::decode!(
12824                fidl::encoding::Vector<fidl::encoding::BoundedString<255>, 128>,
12825                fidl::encoding::DefaultFuchsiaResourceDialect,
12826                &mut self.keys,
12827                decoder,
12828                offset + 0,
12829                _depth
12830            )?;
12831            Ok(())
12832        }
12833    }
12834
12835    impl fidl::encoding::ResourceTypeMarker for DictionaryOptionalItem {
12836        type Borrowed<'a> = &'a mut Self;
12837        fn take_or_borrow<'a>(
12838            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12839        ) -> Self::Borrowed<'a> {
12840            value
12841        }
12842    }
12843
12844    unsafe impl fidl::encoding::TypeMarker for DictionaryOptionalItem {
12845        type Owned = Self;
12846
12847        #[inline(always)]
12848        fn inline_align(_context: fidl::encoding::Context) -> usize {
12849            8
12850        }
12851
12852        #[inline(always)]
12853        fn inline_size(_context: fidl::encoding::Context) -> usize {
12854            24
12855        }
12856    }
12857
12858    unsafe impl
12859        fidl::encoding::Encode<
12860            DictionaryOptionalItem,
12861            fidl::encoding::DefaultFuchsiaResourceDialect,
12862        > for &mut DictionaryOptionalItem
12863    {
12864        #[inline]
12865        unsafe fn encode(
12866            self,
12867            encoder: &mut fidl::encoding::Encoder<
12868                '_,
12869                fidl::encoding::DefaultFuchsiaResourceDialect,
12870            >,
12871            offset: usize,
12872            _depth: fidl::encoding::Depth,
12873        ) -> fidl::Result<()> {
12874            encoder.debug_check_bounds::<DictionaryOptionalItem>(offset);
12875            // Delegate to tuple encoding.
12876            fidl::encoding::Encode::<DictionaryOptionalItem, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
12877                (
12878                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(&self.key),
12879                    <fidl::encoding::Boxed<WrappedCapabilityId> as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
12880                ),
12881                encoder, offset, _depth
12882            )
12883        }
12884    }
12885    unsafe impl<
12886        T0: fidl::encoding::Encode<
12887                fidl::encoding::BoundedString<255>,
12888                fidl::encoding::DefaultFuchsiaResourceDialect,
12889            >,
12890        T1: fidl::encoding::Encode<
12891                fidl::encoding::Boxed<WrappedCapabilityId>,
12892                fidl::encoding::DefaultFuchsiaResourceDialect,
12893            >,
12894    >
12895        fidl::encoding::Encode<
12896            DictionaryOptionalItem,
12897            fidl::encoding::DefaultFuchsiaResourceDialect,
12898        > for (T0, T1)
12899    {
12900        #[inline]
12901        unsafe fn encode(
12902            self,
12903            encoder: &mut fidl::encoding::Encoder<
12904                '_,
12905                fidl::encoding::DefaultFuchsiaResourceDialect,
12906            >,
12907            offset: usize,
12908            depth: fidl::encoding::Depth,
12909        ) -> fidl::Result<()> {
12910            encoder.debug_check_bounds::<DictionaryOptionalItem>(offset);
12911            // Zero out padding regions. There's no need to apply masks
12912            // because the unmasked parts will be overwritten by fields.
12913            // Write the fields.
12914            self.0.encode(encoder, offset + 0, depth)?;
12915            self.1.encode(encoder, offset + 16, depth)?;
12916            Ok(())
12917        }
12918    }
12919
12920    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12921        for DictionaryOptionalItem
12922    {
12923        #[inline(always)]
12924        fn new_empty() -> Self {
12925            Self {
12926                key: fidl::new_empty!(
12927                    fidl::encoding::BoundedString<255>,
12928                    fidl::encoding::DefaultFuchsiaResourceDialect
12929                ),
12930                value: fidl::new_empty!(
12931                    fidl::encoding::Boxed<WrappedCapabilityId>,
12932                    fidl::encoding::DefaultFuchsiaResourceDialect
12933                ),
12934            }
12935        }
12936
12937        #[inline]
12938        unsafe fn decode(
12939            &mut self,
12940            decoder: &mut fidl::encoding::Decoder<
12941                '_,
12942                fidl::encoding::DefaultFuchsiaResourceDialect,
12943            >,
12944            offset: usize,
12945            _depth: fidl::encoding::Depth,
12946        ) -> fidl::Result<()> {
12947            decoder.debug_check_bounds::<Self>(offset);
12948            // Verify that padding bytes are zero.
12949            fidl::decode!(
12950                fidl::encoding::BoundedString<255>,
12951                fidl::encoding::DefaultFuchsiaResourceDialect,
12952                &mut self.key,
12953                decoder,
12954                offset + 0,
12955                _depth
12956            )?;
12957            fidl::decode!(
12958                fidl::encoding::Boxed<WrappedCapabilityId>,
12959                fidl::encoding::DefaultFuchsiaResourceDialect,
12960                &mut self.value,
12961                decoder,
12962                offset + 16,
12963                _depth
12964            )?;
12965            Ok(())
12966        }
12967    }
12968
12969    impl fidl::encoding::ResourceTypeMarker for DictionaryRef {
12970        type Borrowed<'a> = &'a mut Self;
12971        fn take_or_borrow<'a>(
12972            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12973        ) -> Self::Borrowed<'a> {
12974            value
12975        }
12976    }
12977
12978    unsafe impl fidl::encoding::TypeMarker for DictionaryRef {
12979        type Owned = Self;
12980
12981        #[inline(always)]
12982        fn inline_align(_context: fidl::encoding::Context) -> usize {
12983            4
12984        }
12985
12986        #[inline(always)]
12987        fn inline_size(_context: fidl::encoding::Context) -> usize {
12988            4
12989        }
12990    }
12991
12992    unsafe impl fidl::encoding::Encode<DictionaryRef, fidl::encoding::DefaultFuchsiaResourceDialect>
12993        for &mut DictionaryRef
12994    {
12995        #[inline]
12996        unsafe fn encode(
12997            self,
12998            encoder: &mut fidl::encoding::Encoder<
12999                '_,
13000                fidl::encoding::DefaultFuchsiaResourceDialect,
13001            >,
13002            offset: usize,
13003            _depth: fidl::encoding::Depth,
13004        ) -> fidl::Result<()> {
13005            encoder.debug_check_bounds::<DictionaryRef>(offset);
13006            // Delegate to tuple encoding.
13007            fidl::encoding::Encode::<DictionaryRef, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
13008                (
13009                    <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.token),
13010                ),
13011                encoder, offset, _depth
13012            )
13013        }
13014    }
13015    unsafe impl<
13016        T0: fidl::encoding::Encode<
13017                fidl::encoding::HandleType<
13018                    fidl::EventPair,
13019                    { fidl::ObjectType::EVENTPAIR.into_raw() },
13020                    2147483648,
13021                >,
13022                fidl::encoding::DefaultFuchsiaResourceDialect,
13023            >,
13024    > fidl::encoding::Encode<DictionaryRef, fidl::encoding::DefaultFuchsiaResourceDialect>
13025        for (T0,)
13026    {
13027        #[inline]
13028        unsafe fn encode(
13029            self,
13030            encoder: &mut fidl::encoding::Encoder<
13031                '_,
13032                fidl::encoding::DefaultFuchsiaResourceDialect,
13033            >,
13034            offset: usize,
13035            depth: fidl::encoding::Depth,
13036        ) -> fidl::Result<()> {
13037            encoder.debug_check_bounds::<DictionaryRef>(offset);
13038            // Zero out padding regions. There's no need to apply masks
13039            // because the unmasked parts will be overwritten by fields.
13040            // Write the fields.
13041            self.0.encode(encoder, offset + 0, depth)?;
13042            Ok(())
13043        }
13044    }
13045
13046    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for DictionaryRef {
13047        #[inline(always)]
13048        fn new_empty() -> Self {
13049            Self {
13050                token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
13051            }
13052        }
13053
13054        #[inline]
13055        unsafe fn decode(
13056            &mut self,
13057            decoder: &mut fidl::encoding::Decoder<
13058                '_,
13059                fidl::encoding::DefaultFuchsiaResourceDialect,
13060            >,
13061            offset: usize,
13062            _depth: fidl::encoding::Depth,
13063        ) -> fidl::Result<()> {
13064            decoder.debug_check_bounds::<Self>(offset);
13065            // Verify that padding bytes are zero.
13066            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.token, decoder, offset + 0, _depth)?;
13067            Ok(())
13068        }
13069    }
13070
13071    impl fidl::encoding::ResourceTypeMarker for DirConnector {
13072        type Borrowed<'a> = &'a mut Self;
13073        fn take_or_borrow<'a>(
13074            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13075        ) -> Self::Borrowed<'a> {
13076            value
13077        }
13078    }
13079
13080    unsafe impl fidl::encoding::TypeMarker for DirConnector {
13081        type Owned = Self;
13082
13083        #[inline(always)]
13084        fn inline_align(_context: fidl::encoding::Context) -> usize {
13085            4
13086        }
13087
13088        #[inline(always)]
13089        fn inline_size(_context: fidl::encoding::Context) -> usize {
13090            4
13091        }
13092    }
13093
13094    unsafe impl fidl::encoding::Encode<DirConnector, fidl::encoding::DefaultFuchsiaResourceDialect>
13095        for &mut DirConnector
13096    {
13097        #[inline]
13098        unsafe fn encode(
13099            self,
13100            encoder: &mut fidl::encoding::Encoder<
13101                '_,
13102                fidl::encoding::DefaultFuchsiaResourceDialect,
13103            >,
13104            offset: usize,
13105            _depth: fidl::encoding::Depth,
13106        ) -> fidl::Result<()> {
13107            encoder.debug_check_bounds::<DirConnector>(offset);
13108            // Delegate to tuple encoding.
13109            fidl::encoding::Encode::<DirConnector, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
13110                (
13111                    <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.token),
13112                ),
13113                encoder, offset, _depth
13114            )
13115        }
13116    }
13117    unsafe impl<
13118        T0: fidl::encoding::Encode<
13119                fidl::encoding::HandleType<
13120                    fidl::EventPair,
13121                    { fidl::ObjectType::EVENTPAIR.into_raw() },
13122                    2147483648,
13123                >,
13124                fidl::encoding::DefaultFuchsiaResourceDialect,
13125            >,
13126    > fidl::encoding::Encode<DirConnector, fidl::encoding::DefaultFuchsiaResourceDialect> for (T0,)
13127    {
13128        #[inline]
13129        unsafe fn encode(
13130            self,
13131            encoder: &mut fidl::encoding::Encoder<
13132                '_,
13133                fidl::encoding::DefaultFuchsiaResourceDialect,
13134            >,
13135            offset: usize,
13136            depth: fidl::encoding::Depth,
13137        ) -> fidl::Result<()> {
13138            encoder.debug_check_bounds::<DirConnector>(offset);
13139            // Zero out padding regions. There's no need to apply masks
13140            // because the unmasked parts will be overwritten by fields.
13141            // Write the fields.
13142            self.0.encode(encoder, offset + 0, depth)?;
13143            Ok(())
13144        }
13145    }
13146
13147    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for DirConnector {
13148        #[inline(always)]
13149        fn new_empty() -> Self {
13150            Self {
13151                token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
13152            }
13153        }
13154
13155        #[inline]
13156        unsafe fn decode(
13157            &mut self,
13158            decoder: &mut fidl::encoding::Decoder<
13159                '_,
13160                fidl::encoding::DefaultFuchsiaResourceDialect,
13161            >,
13162            offset: usize,
13163            _depth: fidl::encoding::Depth,
13164        ) -> fidl::Result<()> {
13165            decoder.debug_check_bounds::<Self>(offset);
13166            // Verify that padding bytes are zero.
13167            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.token, decoder, offset + 0, _depth)?;
13168            Ok(())
13169        }
13170    }
13171
13172    impl fidl::encoding::ResourceTypeMarker for DirEntry {
13173        type Borrowed<'a> = &'a mut Self;
13174        fn take_or_borrow<'a>(
13175            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13176        ) -> Self::Borrowed<'a> {
13177            value
13178        }
13179    }
13180
13181    unsafe impl fidl::encoding::TypeMarker for DirEntry {
13182        type Owned = Self;
13183
13184        #[inline(always)]
13185        fn inline_align(_context: fidl::encoding::Context) -> usize {
13186            4
13187        }
13188
13189        #[inline(always)]
13190        fn inline_size(_context: fidl::encoding::Context) -> usize {
13191            4
13192        }
13193    }
13194
13195    unsafe impl fidl::encoding::Encode<DirEntry, fidl::encoding::DefaultFuchsiaResourceDialect>
13196        for &mut DirEntry
13197    {
13198        #[inline]
13199        unsafe fn encode(
13200            self,
13201            encoder: &mut fidl::encoding::Encoder<
13202                '_,
13203                fidl::encoding::DefaultFuchsiaResourceDialect,
13204            >,
13205            offset: usize,
13206            _depth: fidl::encoding::Depth,
13207        ) -> fidl::Result<()> {
13208            encoder.debug_check_bounds::<DirEntry>(offset);
13209            // Delegate to tuple encoding.
13210            fidl::encoding::Encode::<DirEntry, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
13211                (
13212                    <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.token),
13213                ),
13214                encoder, offset, _depth
13215            )
13216        }
13217    }
13218    unsafe impl<
13219        T0: fidl::encoding::Encode<
13220                fidl::encoding::HandleType<
13221                    fidl::EventPair,
13222                    { fidl::ObjectType::EVENTPAIR.into_raw() },
13223                    2147483648,
13224                >,
13225                fidl::encoding::DefaultFuchsiaResourceDialect,
13226            >,
13227    > fidl::encoding::Encode<DirEntry, fidl::encoding::DefaultFuchsiaResourceDialect> for (T0,)
13228    {
13229        #[inline]
13230        unsafe fn encode(
13231            self,
13232            encoder: &mut fidl::encoding::Encoder<
13233                '_,
13234                fidl::encoding::DefaultFuchsiaResourceDialect,
13235            >,
13236            offset: usize,
13237            depth: fidl::encoding::Depth,
13238        ) -> fidl::Result<()> {
13239            encoder.debug_check_bounds::<DirEntry>(offset);
13240            // Zero out padding regions. There's no need to apply masks
13241            // because the unmasked parts will be overwritten by fields.
13242            // Write the fields.
13243            self.0.encode(encoder, offset + 0, depth)?;
13244            Ok(())
13245        }
13246    }
13247
13248    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for DirEntry {
13249        #[inline(always)]
13250        fn new_empty() -> Self {
13251            Self {
13252                token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
13253            }
13254        }
13255
13256        #[inline]
13257        unsafe fn decode(
13258            &mut self,
13259            decoder: &mut fidl::encoding::Decoder<
13260                '_,
13261                fidl::encoding::DefaultFuchsiaResourceDialect,
13262            >,
13263            offset: usize,
13264            _depth: fidl::encoding::Depth,
13265        ) -> fidl::Result<()> {
13266            decoder.debug_check_bounds::<Self>(offset);
13267            // Verify that padding bytes are zero.
13268            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.token, decoder, offset + 0, _depth)?;
13269            Ok(())
13270        }
13271    }
13272
13273    impl fidl::encoding::ResourceTypeMarker for InstanceToken {
13274        type Borrowed<'a> = &'a mut Self;
13275        fn take_or_borrow<'a>(
13276            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13277        ) -> Self::Borrowed<'a> {
13278            value
13279        }
13280    }
13281
13282    unsafe impl fidl::encoding::TypeMarker for InstanceToken {
13283        type Owned = Self;
13284
13285        #[inline(always)]
13286        fn inline_align(_context: fidl::encoding::Context) -> usize {
13287            4
13288        }
13289
13290        #[inline(always)]
13291        fn inline_size(_context: fidl::encoding::Context) -> usize {
13292            4
13293        }
13294    }
13295
13296    unsafe impl fidl::encoding::Encode<InstanceToken, fidl::encoding::DefaultFuchsiaResourceDialect>
13297        for &mut InstanceToken
13298    {
13299        #[inline]
13300        unsafe fn encode(
13301            self,
13302            encoder: &mut fidl::encoding::Encoder<
13303                '_,
13304                fidl::encoding::DefaultFuchsiaResourceDialect,
13305            >,
13306            offset: usize,
13307            _depth: fidl::encoding::Depth,
13308        ) -> fidl::Result<()> {
13309            encoder.debug_check_bounds::<InstanceToken>(offset);
13310            // Delegate to tuple encoding.
13311            fidl::encoding::Encode::<InstanceToken, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
13312                (
13313                    <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.token),
13314                ),
13315                encoder, offset, _depth
13316            )
13317        }
13318    }
13319    unsafe impl<
13320        T0: fidl::encoding::Encode<
13321                fidl::encoding::HandleType<
13322                    fidl::EventPair,
13323                    { fidl::ObjectType::EVENTPAIR.into_raw() },
13324                    2147483648,
13325                >,
13326                fidl::encoding::DefaultFuchsiaResourceDialect,
13327            >,
13328    > fidl::encoding::Encode<InstanceToken, fidl::encoding::DefaultFuchsiaResourceDialect>
13329        for (T0,)
13330    {
13331        #[inline]
13332        unsafe fn encode(
13333            self,
13334            encoder: &mut fidl::encoding::Encoder<
13335                '_,
13336                fidl::encoding::DefaultFuchsiaResourceDialect,
13337            >,
13338            offset: usize,
13339            depth: fidl::encoding::Depth,
13340        ) -> fidl::Result<()> {
13341            encoder.debug_check_bounds::<InstanceToken>(offset);
13342            // Zero out padding regions. There's no need to apply masks
13343            // because the unmasked parts will be overwritten by fields.
13344            // Write the fields.
13345            self.0.encode(encoder, offset + 0, depth)?;
13346            Ok(())
13347        }
13348    }
13349
13350    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for InstanceToken {
13351        #[inline(always)]
13352        fn new_empty() -> Self {
13353            Self {
13354                token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
13355            }
13356        }
13357
13358        #[inline]
13359        unsafe fn decode(
13360            &mut self,
13361            decoder: &mut fidl::encoding::Decoder<
13362                '_,
13363                fidl::encoding::DefaultFuchsiaResourceDialect,
13364            >,
13365            offset: usize,
13366            _depth: fidl::encoding::Depth,
13367        ) -> fidl::Result<()> {
13368            decoder.debug_check_bounds::<Self>(offset);
13369            // Verify that padding bytes are zero.
13370            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.token, decoder, offset + 0, _depth)?;
13371            Ok(())
13372        }
13373    }
13374
13375    impl fidl::encoding::ResourceTypeMarker for ProtocolPayload {
13376        type Borrowed<'a> = &'a mut Self;
13377        fn take_or_borrow<'a>(
13378            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13379        ) -> Self::Borrowed<'a> {
13380            value
13381        }
13382    }
13383
13384    unsafe impl fidl::encoding::TypeMarker for ProtocolPayload {
13385        type Owned = Self;
13386
13387        #[inline(always)]
13388        fn inline_align(_context: fidl::encoding::Context) -> usize {
13389            4
13390        }
13391
13392        #[inline(always)]
13393        fn inline_size(_context: fidl::encoding::Context) -> usize {
13394            4
13395        }
13396    }
13397
13398    unsafe impl
13399        fidl::encoding::Encode<ProtocolPayload, fidl::encoding::DefaultFuchsiaResourceDialect>
13400        for &mut ProtocolPayload
13401    {
13402        #[inline]
13403        unsafe fn encode(
13404            self,
13405            encoder: &mut fidl::encoding::Encoder<
13406                '_,
13407                fidl::encoding::DefaultFuchsiaResourceDialect,
13408            >,
13409            offset: usize,
13410            _depth: fidl::encoding::Depth,
13411        ) -> fidl::Result<()> {
13412            encoder.debug_check_bounds::<ProtocolPayload>(offset);
13413            // Delegate to tuple encoding.
13414            fidl::encoding::Encode::<ProtocolPayload, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
13415                (
13416                    <fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.channel),
13417                ),
13418                encoder, offset, _depth
13419            )
13420        }
13421    }
13422    unsafe impl<
13423        T0: fidl::encoding::Encode<
13424                fidl::encoding::HandleType<
13425                    fidl::Channel,
13426                    { fidl::ObjectType::CHANNEL.into_raw() },
13427                    2147483648,
13428                >,
13429                fidl::encoding::DefaultFuchsiaResourceDialect,
13430            >,
13431    > fidl::encoding::Encode<ProtocolPayload, fidl::encoding::DefaultFuchsiaResourceDialect>
13432        for (T0,)
13433    {
13434        #[inline]
13435        unsafe fn encode(
13436            self,
13437            encoder: &mut fidl::encoding::Encoder<
13438                '_,
13439                fidl::encoding::DefaultFuchsiaResourceDialect,
13440            >,
13441            offset: usize,
13442            depth: fidl::encoding::Depth,
13443        ) -> fidl::Result<()> {
13444            encoder.debug_check_bounds::<ProtocolPayload>(offset);
13445            // Zero out padding regions. There's no need to apply masks
13446            // because the unmasked parts will be overwritten by fields.
13447            // Write the fields.
13448            self.0.encode(encoder, offset + 0, depth)?;
13449            Ok(())
13450        }
13451    }
13452
13453    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13454        for ProtocolPayload
13455    {
13456        #[inline(always)]
13457        fn new_empty() -> Self {
13458            Self {
13459                channel: fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
13460            }
13461        }
13462
13463        #[inline]
13464        unsafe fn decode(
13465            &mut self,
13466            decoder: &mut fidl::encoding::Decoder<
13467                '_,
13468                fidl::encoding::DefaultFuchsiaResourceDialect,
13469            >,
13470            offset: usize,
13471            _depth: fidl::encoding::Depth,
13472        ) -> fidl::Result<()> {
13473            decoder.debug_check_bounds::<Self>(offset);
13474            // Verify that padding bytes are zero.
13475            fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.channel, decoder, offset + 0, _depth)?;
13476            Ok(())
13477        }
13478    }
13479
13480    impl AggregateSource {
13481        #[inline(always)]
13482        fn max_ordinal_present(&self) -> u64 {
13483            if let Some(_) = self.renamed_instances {
13484                return 3;
13485            }
13486            if let Some(_) = self.source_instance_filter {
13487                return 2;
13488            }
13489            if let Some(_) = self.dir_connector {
13490                return 1;
13491            }
13492            0
13493        }
13494    }
13495
13496    impl fidl::encoding::ResourceTypeMarker for AggregateSource {
13497        type Borrowed<'a> = &'a mut Self;
13498        fn take_or_borrow<'a>(
13499            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13500        ) -> Self::Borrowed<'a> {
13501            value
13502        }
13503    }
13504
13505    unsafe impl fidl::encoding::TypeMarker for AggregateSource {
13506        type Owned = Self;
13507
13508        #[inline(always)]
13509        fn inline_align(_context: fidl::encoding::Context) -> usize {
13510            8
13511        }
13512
13513        #[inline(always)]
13514        fn inline_size(_context: fidl::encoding::Context) -> usize {
13515            16
13516        }
13517    }
13518
13519    unsafe impl
13520        fidl::encoding::Encode<AggregateSource, fidl::encoding::DefaultFuchsiaResourceDialect>
13521        for &mut AggregateSource
13522    {
13523        unsafe fn encode(
13524            self,
13525            encoder: &mut fidl::encoding::Encoder<
13526                '_,
13527                fidl::encoding::DefaultFuchsiaResourceDialect,
13528            >,
13529            offset: usize,
13530            mut depth: fidl::encoding::Depth,
13531        ) -> fidl::Result<()> {
13532            encoder.debug_check_bounds::<AggregateSource>(offset);
13533            // Vector header
13534            let max_ordinal: u64 = self.max_ordinal_present();
13535            encoder.write_num(max_ordinal, offset);
13536            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
13537            // Calling encoder.out_of_line_offset(0) is not allowed.
13538            if max_ordinal == 0 {
13539                return Ok(());
13540            }
13541            depth.increment()?;
13542            let envelope_size = 8;
13543            let bytes_len = max_ordinal as usize * envelope_size;
13544            #[allow(unused_variables)]
13545            let offset = encoder.out_of_line_offset(bytes_len);
13546            let mut _prev_end_offset: usize = 0;
13547            if 1 > max_ordinal {
13548                return Ok(());
13549            }
13550
13551            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13552            // are envelope_size bytes.
13553            let cur_offset: usize = (1 - 1) * envelope_size;
13554
13555            // Zero reserved fields.
13556            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13557
13558            // Safety:
13559            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13560            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13561            //   envelope_size bytes, there is always sufficient room.
13562            fidl::encoding::encode_in_envelope_optional::<
13563                DirConnector,
13564                fidl::encoding::DefaultFuchsiaResourceDialect,
13565            >(
13566                self.dir_connector
13567                    .as_mut()
13568                    .map(<DirConnector as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
13569                encoder,
13570                offset + cur_offset,
13571                depth,
13572            )?;
13573
13574            _prev_end_offset = cur_offset + envelope_size;
13575            if 2 > max_ordinal {
13576                return Ok(());
13577            }
13578
13579            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13580            // are envelope_size bytes.
13581            let cur_offset: usize = (2 - 1) * envelope_size;
13582
13583            // Zero reserved fields.
13584            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13585
13586            // Safety:
13587            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13588            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13589            //   envelope_size bytes, there is always sufficient room.
13590            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<255>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
13591            self.source_instance_filter.as_ref().map(<fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<255>> as fidl::encoding::ValueTypeMarker>::borrow),
13592            encoder, offset + cur_offset, depth
13593        )?;
13594
13595            _prev_end_offset = cur_offset + envelope_size;
13596            if 3 > max_ordinal {
13597                return Ok(());
13598            }
13599
13600            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13601            // are envelope_size bytes.
13602            let cur_offset: usize = (3 - 1) * envelope_size;
13603
13604            // Zero reserved fields.
13605            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13606
13607            // Safety:
13608            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13609            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13610            //   envelope_size bytes, there is always sufficient room.
13611            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<fidl_fuchsia_component_decl::NameMapping>, fidl::encoding::DefaultFuchsiaResourceDialect>(
13612            self.renamed_instances.as_ref().map(<fidl::encoding::UnboundedVector<fidl_fuchsia_component_decl::NameMapping> as fidl::encoding::ValueTypeMarker>::borrow),
13613            encoder, offset + cur_offset, depth
13614        )?;
13615
13616            _prev_end_offset = cur_offset + envelope_size;
13617
13618            Ok(())
13619        }
13620    }
13621
13622    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13623        for AggregateSource
13624    {
13625        #[inline(always)]
13626        fn new_empty() -> Self {
13627            Self::default()
13628        }
13629
13630        unsafe fn decode(
13631            &mut self,
13632            decoder: &mut fidl::encoding::Decoder<
13633                '_,
13634                fidl::encoding::DefaultFuchsiaResourceDialect,
13635            >,
13636            offset: usize,
13637            mut depth: fidl::encoding::Depth,
13638        ) -> fidl::Result<()> {
13639            decoder.debug_check_bounds::<Self>(offset);
13640            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13641                None => return Err(fidl::Error::NotNullable),
13642                Some(len) => len,
13643            };
13644            // Calling decoder.out_of_line_offset(0) is not allowed.
13645            if len == 0 {
13646                return Ok(());
13647            };
13648            depth.increment()?;
13649            let envelope_size = 8;
13650            let bytes_len = len * envelope_size;
13651            let offset = decoder.out_of_line_offset(bytes_len)?;
13652            // Decode the envelope for each type.
13653            let mut _next_ordinal_to_read = 0;
13654            let mut next_offset = offset;
13655            let end_offset = offset + bytes_len;
13656            _next_ordinal_to_read += 1;
13657            if next_offset >= end_offset {
13658                return Ok(());
13659            }
13660
13661            // Decode unknown envelopes for gaps in ordinals.
13662            while _next_ordinal_to_read < 1 {
13663                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13664                _next_ordinal_to_read += 1;
13665                next_offset += envelope_size;
13666            }
13667
13668            let next_out_of_line = decoder.next_out_of_line();
13669            let handles_before = decoder.remaining_handles();
13670            if let Some((inlined, num_bytes, num_handles)) =
13671                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13672            {
13673                let member_inline_size =
13674                    <DirConnector as fidl::encoding::TypeMarker>::inline_size(decoder.context);
13675                if inlined != (member_inline_size <= 4) {
13676                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13677                }
13678                let inner_offset;
13679                let mut inner_depth = depth.clone();
13680                if inlined {
13681                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13682                    inner_offset = next_offset;
13683                } else {
13684                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13685                    inner_depth.increment()?;
13686                }
13687                let val_ref = self.dir_connector.get_or_insert_with(|| {
13688                    fidl::new_empty!(DirConnector, fidl::encoding::DefaultFuchsiaResourceDialect)
13689                });
13690                fidl::decode!(
13691                    DirConnector,
13692                    fidl::encoding::DefaultFuchsiaResourceDialect,
13693                    val_ref,
13694                    decoder,
13695                    inner_offset,
13696                    inner_depth
13697                )?;
13698                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13699                {
13700                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13701                }
13702                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13703                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13704                }
13705            }
13706
13707            next_offset += envelope_size;
13708            _next_ordinal_to_read += 1;
13709            if next_offset >= end_offset {
13710                return Ok(());
13711            }
13712
13713            // Decode unknown envelopes for gaps in ordinals.
13714            while _next_ordinal_to_read < 2 {
13715                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13716                _next_ordinal_to_read += 1;
13717                next_offset += envelope_size;
13718            }
13719
13720            let next_out_of_line = decoder.next_out_of_line();
13721            let handles_before = decoder.remaining_handles();
13722            if let Some((inlined, num_bytes, num_handles)) =
13723                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13724            {
13725                let member_inline_size = <fidl::encoding::UnboundedVector<
13726                    fidl::encoding::BoundedString<255>,
13727                > as fidl::encoding::TypeMarker>::inline_size(
13728                    decoder.context
13729                );
13730                if inlined != (member_inline_size <= 4) {
13731                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13732                }
13733                let inner_offset;
13734                let mut inner_depth = depth.clone();
13735                if inlined {
13736                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13737                    inner_offset = next_offset;
13738                } else {
13739                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13740                    inner_depth.increment()?;
13741                }
13742                let val_ref = self.source_instance_filter.get_or_insert_with(|| {
13743                    fidl::new_empty!(
13744                        fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<255>>,
13745                        fidl::encoding::DefaultFuchsiaResourceDialect
13746                    )
13747                });
13748                fidl::decode!(
13749                    fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<255>>,
13750                    fidl::encoding::DefaultFuchsiaResourceDialect,
13751                    val_ref,
13752                    decoder,
13753                    inner_offset,
13754                    inner_depth
13755                )?;
13756                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13757                {
13758                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13759                }
13760                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13761                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13762                }
13763            }
13764
13765            next_offset += envelope_size;
13766            _next_ordinal_to_read += 1;
13767            if next_offset >= end_offset {
13768                return Ok(());
13769            }
13770
13771            // Decode unknown envelopes for gaps in ordinals.
13772            while _next_ordinal_to_read < 3 {
13773                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13774                _next_ordinal_to_read += 1;
13775                next_offset += envelope_size;
13776            }
13777
13778            let next_out_of_line = decoder.next_out_of_line();
13779            let handles_before = decoder.remaining_handles();
13780            if let Some((inlined, num_bytes, num_handles)) =
13781                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13782            {
13783                let member_inline_size = <fidl::encoding::UnboundedVector<
13784                    fidl_fuchsia_component_decl::NameMapping,
13785                > as fidl::encoding::TypeMarker>::inline_size(
13786                    decoder.context
13787                );
13788                if inlined != (member_inline_size <= 4) {
13789                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13790                }
13791                let inner_offset;
13792                let mut inner_depth = depth.clone();
13793                if inlined {
13794                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13795                    inner_offset = next_offset;
13796                } else {
13797                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13798                    inner_depth.increment()?;
13799                }
13800                let val_ref = self.renamed_instances.get_or_insert_with(|| {
13801                    fidl::new_empty!(
13802                        fidl::encoding::UnboundedVector<fidl_fuchsia_component_decl::NameMapping>,
13803                        fidl::encoding::DefaultFuchsiaResourceDialect
13804                    )
13805                });
13806                fidl::decode!(
13807                    fidl::encoding::UnboundedVector<fidl_fuchsia_component_decl::NameMapping>,
13808                    fidl::encoding::DefaultFuchsiaResourceDialect,
13809                    val_ref,
13810                    decoder,
13811                    inner_offset,
13812                    inner_depth
13813                )?;
13814                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13815                {
13816                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13817                }
13818                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13819                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13820                }
13821            }
13822
13823            next_offset += envelope_size;
13824
13825            // Decode the remaining unknown envelopes.
13826            while next_offset < end_offset {
13827                _next_ordinal_to_read += 1;
13828                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13829                next_offset += envelope_size;
13830            }
13831
13832            Ok(())
13833        }
13834    }
13835
13836    impl CapabilityStoreDirConnectorOpenRequest {
13837        #[inline(always)]
13838        fn max_ordinal_present(&self) -> u64 {
13839            if let Some(_) = self.path {
13840                return 4;
13841            }
13842            if let Some(_) = self.flags {
13843                return 3;
13844            }
13845            if let Some(_) = self.server_end {
13846                return 2;
13847            }
13848            if let Some(_) = self.id {
13849                return 1;
13850            }
13851            0
13852        }
13853    }
13854
13855    impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDirConnectorOpenRequest {
13856        type Borrowed<'a> = &'a mut Self;
13857        fn take_or_borrow<'a>(
13858            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13859        ) -> Self::Borrowed<'a> {
13860            value
13861        }
13862    }
13863
13864    unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDirConnectorOpenRequest {
13865        type Owned = Self;
13866
13867        #[inline(always)]
13868        fn inline_align(_context: fidl::encoding::Context) -> usize {
13869            8
13870        }
13871
13872        #[inline(always)]
13873        fn inline_size(_context: fidl::encoding::Context) -> usize {
13874            16
13875        }
13876    }
13877
13878    unsafe impl
13879        fidl::encoding::Encode<
13880            CapabilityStoreDirConnectorOpenRequest,
13881            fidl::encoding::DefaultFuchsiaResourceDialect,
13882        > for &mut CapabilityStoreDirConnectorOpenRequest
13883    {
13884        unsafe fn encode(
13885            self,
13886            encoder: &mut fidl::encoding::Encoder<
13887                '_,
13888                fidl::encoding::DefaultFuchsiaResourceDialect,
13889            >,
13890            offset: usize,
13891            mut depth: fidl::encoding::Depth,
13892        ) -> fidl::Result<()> {
13893            encoder.debug_check_bounds::<CapabilityStoreDirConnectorOpenRequest>(offset);
13894            // Vector header
13895            let max_ordinal: u64 = self.max_ordinal_present();
13896            encoder.write_num(max_ordinal, offset);
13897            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
13898            // Calling encoder.out_of_line_offset(0) is not allowed.
13899            if max_ordinal == 0 {
13900                return Ok(());
13901            }
13902            depth.increment()?;
13903            let envelope_size = 8;
13904            let bytes_len = max_ordinal as usize * envelope_size;
13905            #[allow(unused_variables)]
13906            let offset = encoder.out_of_line_offset(bytes_len);
13907            let mut _prev_end_offset: usize = 0;
13908            if 1 > max_ordinal {
13909                return Ok(());
13910            }
13911
13912            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13913            // are envelope_size bytes.
13914            let cur_offset: usize = (1 - 1) * envelope_size;
13915
13916            // Zero reserved fields.
13917            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13918
13919            // Safety:
13920            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13921            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13922            //   envelope_size bytes, there is always sufficient room.
13923            fidl::encoding::encode_in_envelope_optional::<
13924                u64,
13925                fidl::encoding::DefaultFuchsiaResourceDialect,
13926            >(
13927                self.id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
13928                encoder,
13929                offset + cur_offset,
13930                depth,
13931            )?;
13932
13933            _prev_end_offset = cur_offset + envelope_size;
13934            if 2 > max_ordinal {
13935                return Ok(());
13936            }
13937
13938            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13939            // are envelope_size bytes.
13940            let cur_offset: usize = (2 - 1) * envelope_size;
13941
13942            // Zero reserved fields.
13943            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13944
13945            // Safety:
13946            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13947            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13948            //   envelope_size bytes, there is always sufficient room.
13949            fidl::encoding::encode_in_envelope_optional::<
13950                fidl::encoding::Endpoint<
13951                    fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
13952                >,
13953                fidl::encoding::DefaultFuchsiaResourceDialect,
13954            >(
13955                self.server_end.as_mut().map(
13956                    <fidl::encoding::Endpoint<
13957                        fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
13958                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
13959                ),
13960                encoder,
13961                offset + cur_offset,
13962                depth,
13963            )?;
13964
13965            _prev_end_offset = cur_offset + envelope_size;
13966            if 3 > max_ordinal {
13967                return Ok(());
13968            }
13969
13970            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13971            // are envelope_size bytes.
13972            let cur_offset: usize = (3 - 1) * envelope_size;
13973
13974            // Zero reserved fields.
13975            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13976
13977            // Safety:
13978            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13979            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13980            //   envelope_size bytes, there is always sufficient room.
13981            fidl::encoding::encode_in_envelope_optional::<
13982                fidl_fuchsia_io::Flags,
13983                fidl::encoding::DefaultFuchsiaResourceDialect,
13984            >(
13985                self.flags
13986                    .as_ref()
13987                    .map(<fidl_fuchsia_io::Flags as fidl::encoding::ValueTypeMarker>::borrow),
13988                encoder,
13989                offset + cur_offset,
13990                depth,
13991            )?;
13992
13993            _prev_end_offset = cur_offset + envelope_size;
13994            if 4 > max_ordinal {
13995                return Ok(());
13996            }
13997
13998            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13999            // are envelope_size bytes.
14000            let cur_offset: usize = (4 - 1) * envelope_size;
14001
14002            // Zero reserved fields.
14003            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14004
14005            // Safety:
14006            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
14007            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
14008            //   envelope_size bytes, there is always sufficient room.
14009            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<4095>, fidl::encoding::DefaultFuchsiaResourceDialect>(
14010            self.path.as_ref().map(<fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow),
14011            encoder, offset + cur_offset, depth
14012        )?;
14013
14014            _prev_end_offset = cur_offset + envelope_size;
14015
14016            Ok(())
14017        }
14018    }
14019
14020    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14021        for CapabilityStoreDirConnectorOpenRequest
14022    {
14023        #[inline(always)]
14024        fn new_empty() -> Self {
14025            Self::default()
14026        }
14027
14028        unsafe fn decode(
14029            &mut self,
14030            decoder: &mut fidl::encoding::Decoder<
14031                '_,
14032                fidl::encoding::DefaultFuchsiaResourceDialect,
14033            >,
14034            offset: usize,
14035            mut depth: fidl::encoding::Depth,
14036        ) -> fidl::Result<()> {
14037            decoder.debug_check_bounds::<Self>(offset);
14038            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
14039                None => return Err(fidl::Error::NotNullable),
14040                Some(len) => len,
14041            };
14042            // Calling decoder.out_of_line_offset(0) is not allowed.
14043            if len == 0 {
14044                return Ok(());
14045            };
14046            depth.increment()?;
14047            let envelope_size = 8;
14048            let bytes_len = len * envelope_size;
14049            let offset = decoder.out_of_line_offset(bytes_len)?;
14050            // Decode the envelope for each type.
14051            let mut _next_ordinal_to_read = 0;
14052            let mut next_offset = offset;
14053            let end_offset = offset + bytes_len;
14054            _next_ordinal_to_read += 1;
14055            if next_offset >= end_offset {
14056                return Ok(());
14057            }
14058
14059            // Decode unknown envelopes for gaps in ordinals.
14060            while _next_ordinal_to_read < 1 {
14061                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14062                _next_ordinal_to_read += 1;
14063                next_offset += envelope_size;
14064            }
14065
14066            let next_out_of_line = decoder.next_out_of_line();
14067            let handles_before = decoder.remaining_handles();
14068            if let Some((inlined, num_bytes, num_handles)) =
14069                fidl::encoding::decode_envelope_header(decoder, next_offset)?
14070            {
14071                let member_inline_size =
14072                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
14073                if inlined != (member_inline_size <= 4) {
14074                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
14075                }
14076                let inner_offset;
14077                let mut inner_depth = depth.clone();
14078                if inlined {
14079                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14080                    inner_offset = next_offset;
14081                } else {
14082                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14083                    inner_depth.increment()?;
14084                }
14085                let val_ref = self.id.get_or_insert_with(|| {
14086                    fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect)
14087                });
14088                fidl::decode!(
14089                    u64,
14090                    fidl::encoding::DefaultFuchsiaResourceDialect,
14091                    val_ref,
14092                    decoder,
14093                    inner_offset,
14094                    inner_depth
14095                )?;
14096                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14097                {
14098                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
14099                }
14100                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14101                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14102                }
14103            }
14104
14105            next_offset += envelope_size;
14106            _next_ordinal_to_read += 1;
14107            if next_offset >= end_offset {
14108                return Ok(());
14109            }
14110
14111            // Decode unknown envelopes for gaps in ordinals.
14112            while _next_ordinal_to_read < 2 {
14113                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14114                _next_ordinal_to_read += 1;
14115                next_offset += envelope_size;
14116            }
14117
14118            let next_out_of_line = decoder.next_out_of_line();
14119            let handles_before = decoder.remaining_handles();
14120            if let Some((inlined, num_bytes, num_handles)) =
14121                fidl::encoding::decode_envelope_header(decoder, next_offset)?
14122            {
14123                let member_inline_size = <fidl::encoding::Endpoint<
14124                    fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
14125                > as fidl::encoding::TypeMarker>::inline_size(
14126                    decoder.context
14127                );
14128                if inlined != (member_inline_size <= 4) {
14129                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
14130                }
14131                let inner_offset;
14132                let mut inner_depth = depth.clone();
14133                if inlined {
14134                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14135                    inner_offset = next_offset;
14136                } else {
14137                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14138                    inner_depth.increment()?;
14139                }
14140                let val_ref = self.server_end.get_or_insert_with(|| {
14141                    fidl::new_empty!(
14142                        fidl::encoding::Endpoint<
14143                            fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
14144                        >,
14145                        fidl::encoding::DefaultFuchsiaResourceDialect
14146                    )
14147                });
14148                fidl::decode!(
14149                    fidl::encoding::Endpoint<
14150                        fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
14151                    >,
14152                    fidl::encoding::DefaultFuchsiaResourceDialect,
14153                    val_ref,
14154                    decoder,
14155                    inner_offset,
14156                    inner_depth
14157                )?;
14158                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14159                {
14160                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
14161                }
14162                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14163                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14164                }
14165            }
14166
14167            next_offset += envelope_size;
14168            _next_ordinal_to_read += 1;
14169            if next_offset >= end_offset {
14170                return Ok(());
14171            }
14172
14173            // Decode unknown envelopes for gaps in ordinals.
14174            while _next_ordinal_to_read < 3 {
14175                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14176                _next_ordinal_to_read += 1;
14177                next_offset += envelope_size;
14178            }
14179
14180            let next_out_of_line = decoder.next_out_of_line();
14181            let handles_before = decoder.remaining_handles();
14182            if let Some((inlined, num_bytes, num_handles)) =
14183                fidl::encoding::decode_envelope_header(decoder, next_offset)?
14184            {
14185                let member_inline_size =
14186                    <fidl_fuchsia_io::Flags as fidl::encoding::TypeMarker>::inline_size(
14187                        decoder.context,
14188                    );
14189                if inlined != (member_inline_size <= 4) {
14190                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
14191                }
14192                let inner_offset;
14193                let mut inner_depth = depth.clone();
14194                if inlined {
14195                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14196                    inner_offset = next_offset;
14197                } else {
14198                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14199                    inner_depth.increment()?;
14200                }
14201                let val_ref = self.flags.get_or_insert_with(|| {
14202                    fidl::new_empty!(
14203                        fidl_fuchsia_io::Flags,
14204                        fidl::encoding::DefaultFuchsiaResourceDialect
14205                    )
14206                });
14207                fidl::decode!(
14208                    fidl_fuchsia_io::Flags,
14209                    fidl::encoding::DefaultFuchsiaResourceDialect,
14210                    val_ref,
14211                    decoder,
14212                    inner_offset,
14213                    inner_depth
14214                )?;
14215                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14216                {
14217                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
14218                }
14219                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14220                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14221                }
14222            }
14223
14224            next_offset += envelope_size;
14225            _next_ordinal_to_read += 1;
14226            if next_offset >= end_offset {
14227                return Ok(());
14228            }
14229
14230            // Decode unknown envelopes for gaps in ordinals.
14231            while _next_ordinal_to_read < 4 {
14232                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14233                _next_ordinal_to_read += 1;
14234                next_offset += envelope_size;
14235            }
14236
14237            let next_out_of_line = decoder.next_out_of_line();
14238            let handles_before = decoder.remaining_handles();
14239            if let Some((inlined, num_bytes, num_handles)) =
14240                fidl::encoding::decode_envelope_header(decoder, next_offset)?
14241            {
14242                let member_inline_size = <fidl::encoding::BoundedString<4095> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
14243                if inlined != (member_inline_size <= 4) {
14244                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
14245                }
14246                let inner_offset;
14247                let mut inner_depth = depth.clone();
14248                if inlined {
14249                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14250                    inner_offset = next_offset;
14251                } else {
14252                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14253                    inner_depth.increment()?;
14254                }
14255                let val_ref = self.path.get_or_insert_with(|| {
14256                    fidl::new_empty!(
14257                        fidl::encoding::BoundedString<4095>,
14258                        fidl::encoding::DefaultFuchsiaResourceDialect
14259                    )
14260                });
14261                fidl::decode!(
14262                    fidl::encoding::BoundedString<4095>,
14263                    fidl::encoding::DefaultFuchsiaResourceDialect,
14264                    val_ref,
14265                    decoder,
14266                    inner_offset,
14267                    inner_depth
14268                )?;
14269                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14270                {
14271                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
14272                }
14273                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14274                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14275                }
14276            }
14277
14278            next_offset += envelope_size;
14279
14280            // Decode the remaining unknown envelopes.
14281            while next_offset < end_offset {
14282                _next_ordinal_to_read += 1;
14283                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14284                next_offset += envelope_size;
14285            }
14286
14287            Ok(())
14288        }
14289    }
14290
14291    impl DirReceiverReceiveRequest {
14292        #[inline(always)]
14293        fn max_ordinal_present(&self) -> u64 {
14294            if let Some(_) = self.subdir {
14295                return 3;
14296            }
14297            if let Some(_) = self.flags {
14298                return 2;
14299            }
14300            if let Some(_) = self.channel {
14301                return 1;
14302            }
14303            0
14304        }
14305    }
14306
14307    impl fidl::encoding::ResourceTypeMarker for DirReceiverReceiveRequest {
14308        type Borrowed<'a> = &'a mut Self;
14309        fn take_or_borrow<'a>(
14310            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14311        ) -> Self::Borrowed<'a> {
14312            value
14313        }
14314    }
14315
14316    unsafe impl fidl::encoding::TypeMarker for DirReceiverReceiveRequest {
14317        type Owned = Self;
14318
14319        #[inline(always)]
14320        fn inline_align(_context: fidl::encoding::Context) -> usize {
14321            8
14322        }
14323
14324        #[inline(always)]
14325        fn inline_size(_context: fidl::encoding::Context) -> usize {
14326            16
14327        }
14328    }
14329
14330    unsafe impl
14331        fidl::encoding::Encode<
14332            DirReceiverReceiveRequest,
14333            fidl::encoding::DefaultFuchsiaResourceDialect,
14334        > for &mut DirReceiverReceiveRequest
14335    {
14336        unsafe fn encode(
14337            self,
14338            encoder: &mut fidl::encoding::Encoder<
14339                '_,
14340                fidl::encoding::DefaultFuchsiaResourceDialect,
14341            >,
14342            offset: usize,
14343            mut depth: fidl::encoding::Depth,
14344        ) -> fidl::Result<()> {
14345            encoder.debug_check_bounds::<DirReceiverReceiveRequest>(offset);
14346            // Vector header
14347            let max_ordinal: u64 = self.max_ordinal_present();
14348            encoder.write_num(max_ordinal, offset);
14349            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
14350            // Calling encoder.out_of_line_offset(0) is not allowed.
14351            if max_ordinal == 0 {
14352                return Ok(());
14353            }
14354            depth.increment()?;
14355            let envelope_size = 8;
14356            let bytes_len = max_ordinal as usize * envelope_size;
14357            #[allow(unused_variables)]
14358            let offset = encoder.out_of_line_offset(bytes_len);
14359            let mut _prev_end_offset: usize = 0;
14360            if 1 > max_ordinal {
14361                return Ok(());
14362            }
14363
14364            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
14365            // are envelope_size bytes.
14366            let cur_offset: usize = (1 - 1) * envelope_size;
14367
14368            // Zero reserved fields.
14369            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14370
14371            // Safety:
14372            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
14373            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
14374            //   envelope_size bytes, there is always sufficient room.
14375            fidl::encoding::encode_in_envelope_optional::<
14376                fidl::encoding::HandleType<
14377                    fidl::Channel,
14378                    { fidl::ObjectType::CHANNEL.into_raw() },
14379                    2147483648,
14380                >,
14381                fidl::encoding::DefaultFuchsiaResourceDialect,
14382            >(
14383                self.channel.as_mut().map(
14384                    <fidl::encoding::HandleType<
14385                        fidl::Channel,
14386                        { fidl::ObjectType::CHANNEL.into_raw() },
14387                        2147483648,
14388                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
14389                ),
14390                encoder,
14391                offset + cur_offset,
14392                depth,
14393            )?;
14394
14395            _prev_end_offset = cur_offset + envelope_size;
14396            if 2 > max_ordinal {
14397                return Ok(());
14398            }
14399
14400            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
14401            // are envelope_size bytes.
14402            let cur_offset: usize = (2 - 1) * envelope_size;
14403
14404            // Zero reserved fields.
14405            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14406
14407            // Safety:
14408            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
14409            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
14410            //   envelope_size bytes, there is always sufficient room.
14411            fidl::encoding::encode_in_envelope_optional::<
14412                fidl_fuchsia_io::Flags,
14413                fidl::encoding::DefaultFuchsiaResourceDialect,
14414            >(
14415                self.flags
14416                    .as_ref()
14417                    .map(<fidl_fuchsia_io::Flags as fidl::encoding::ValueTypeMarker>::borrow),
14418                encoder,
14419                offset + cur_offset,
14420                depth,
14421            )?;
14422
14423            _prev_end_offset = cur_offset + envelope_size;
14424            if 3 > max_ordinal {
14425                return Ok(());
14426            }
14427
14428            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
14429            // are envelope_size bytes.
14430            let cur_offset: usize = (3 - 1) * envelope_size;
14431
14432            // Zero reserved fields.
14433            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14434
14435            // Safety:
14436            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
14437            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
14438            //   envelope_size bytes, there is always sufficient room.
14439            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<4095>, fidl::encoding::DefaultFuchsiaResourceDialect>(
14440            self.subdir.as_ref().map(<fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow),
14441            encoder, offset + cur_offset, depth
14442        )?;
14443
14444            _prev_end_offset = cur_offset + envelope_size;
14445
14446            Ok(())
14447        }
14448    }
14449
14450    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14451        for DirReceiverReceiveRequest
14452    {
14453        #[inline(always)]
14454        fn new_empty() -> Self {
14455            Self::default()
14456        }
14457
14458        unsafe fn decode(
14459            &mut self,
14460            decoder: &mut fidl::encoding::Decoder<
14461                '_,
14462                fidl::encoding::DefaultFuchsiaResourceDialect,
14463            >,
14464            offset: usize,
14465            mut depth: fidl::encoding::Depth,
14466        ) -> fidl::Result<()> {
14467            decoder.debug_check_bounds::<Self>(offset);
14468            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
14469                None => return Err(fidl::Error::NotNullable),
14470                Some(len) => len,
14471            };
14472            // Calling decoder.out_of_line_offset(0) is not allowed.
14473            if len == 0 {
14474                return Ok(());
14475            };
14476            depth.increment()?;
14477            let envelope_size = 8;
14478            let bytes_len = len * envelope_size;
14479            let offset = decoder.out_of_line_offset(bytes_len)?;
14480            // Decode the envelope for each type.
14481            let mut _next_ordinal_to_read = 0;
14482            let mut next_offset = offset;
14483            let end_offset = offset + bytes_len;
14484            _next_ordinal_to_read += 1;
14485            if next_offset >= end_offset {
14486                return Ok(());
14487            }
14488
14489            // Decode unknown envelopes for gaps in ordinals.
14490            while _next_ordinal_to_read < 1 {
14491                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14492                _next_ordinal_to_read += 1;
14493                next_offset += envelope_size;
14494            }
14495
14496            let next_out_of_line = decoder.next_out_of_line();
14497            let handles_before = decoder.remaining_handles();
14498            if let Some((inlined, num_bytes, num_handles)) =
14499                fidl::encoding::decode_envelope_header(decoder, next_offset)?
14500            {
14501                let member_inline_size = <fidl::encoding::HandleType<
14502                    fidl::Channel,
14503                    { fidl::ObjectType::CHANNEL.into_raw() },
14504                    2147483648,
14505                > as fidl::encoding::TypeMarker>::inline_size(
14506                    decoder.context
14507                );
14508                if inlined != (member_inline_size <= 4) {
14509                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
14510                }
14511                let inner_offset;
14512                let mut inner_depth = depth.clone();
14513                if inlined {
14514                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14515                    inner_offset = next_offset;
14516                } else {
14517                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14518                    inner_depth.increment()?;
14519                }
14520                let val_ref =
14521                self.channel.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
14522                fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
14523                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14524                {
14525                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
14526                }
14527                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14528                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14529                }
14530            }
14531
14532            next_offset += envelope_size;
14533            _next_ordinal_to_read += 1;
14534            if next_offset >= end_offset {
14535                return Ok(());
14536            }
14537
14538            // Decode unknown envelopes for gaps in ordinals.
14539            while _next_ordinal_to_read < 2 {
14540                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14541                _next_ordinal_to_read += 1;
14542                next_offset += envelope_size;
14543            }
14544
14545            let next_out_of_line = decoder.next_out_of_line();
14546            let handles_before = decoder.remaining_handles();
14547            if let Some((inlined, num_bytes, num_handles)) =
14548                fidl::encoding::decode_envelope_header(decoder, next_offset)?
14549            {
14550                let member_inline_size =
14551                    <fidl_fuchsia_io::Flags as fidl::encoding::TypeMarker>::inline_size(
14552                        decoder.context,
14553                    );
14554                if inlined != (member_inline_size <= 4) {
14555                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
14556                }
14557                let inner_offset;
14558                let mut inner_depth = depth.clone();
14559                if inlined {
14560                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14561                    inner_offset = next_offset;
14562                } else {
14563                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14564                    inner_depth.increment()?;
14565                }
14566                let val_ref = self.flags.get_or_insert_with(|| {
14567                    fidl::new_empty!(
14568                        fidl_fuchsia_io::Flags,
14569                        fidl::encoding::DefaultFuchsiaResourceDialect
14570                    )
14571                });
14572                fidl::decode!(
14573                    fidl_fuchsia_io::Flags,
14574                    fidl::encoding::DefaultFuchsiaResourceDialect,
14575                    val_ref,
14576                    decoder,
14577                    inner_offset,
14578                    inner_depth
14579                )?;
14580                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14581                {
14582                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
14583                }
14584                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14585                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14586                }
14587            }
14588
14589            next_offset += envelope_size;
14590            _next_ordinal_to_read += 1;
14591            if next_offset >= end_offset {
14592                return Ok(());
14593            }
14594
14595            // Decode unknown envelopes for gaps in ordinals.
14596            while _next_ordinal_to_read < 3 {
14597                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14598                _next_ordinal_to_read += 1;
14599                next_offset += envelope_size;
14600            }
14601
14602            let next_out_of_line = decoder.next_out_of_line();
14603            let handles_before = decoder.remaining_handles();
14604            if let Some((inlined, num_bytes, num_handles)) =
14605                fidl::encoding::decode_envelope_header(decoder, next_offset)?
14606            {
14607                let member_inline_size = <fidl::encoding::BoundedString<4095> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
14608                if inlined != (member_inline_size <= 4) {
14609                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
14610                }
14611                let inner_offset;
14612                let mut inner_depth = depth.clone();
14613                if inlined {
14614                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14615                    inner_offset = next_offset;
14616                } else {
14617                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14618                    inner_depth.increment()?;
14619                }
14620                let val_ref = self.subdir.get_or_insert_with(|| {
14621                    fidl::new_empty!(
14622                        fidl::encoding::BoundedString<4095>,
14623                        fidl::encoding::DefaultFuchsiaResourceDialect
14624                    )
14625                });
14626                fidl::decode!(
14627                    fidl::encoding::BoundedString<4095>,
14628                    fidl::encoding::DefaultFuchsiaResourceDialect,
14629                    val_ref,
14630                    decoder,
14631                    inner_offset,
14632                    inner_depth
14633                )?;
14634                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14635                {
14636                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
14637                }
14638                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14639                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14640                }
14641            }
14642
14643            next_offset += envelope_size;
14644
14645            // Decode the remaining unknown envelopes.
14646            while next_offset < end_offset {
14647                _next_ordinal_to_read += 1;
14648                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14649                next_offset += envelope_size;
14650            }
14651
14652            Ok(())
14653        }
14654    }
14655
14656    impl RouteRequest {
14657        #[inline(always)]
14658        fn max_ordinal_present(&self) -> u64 {
14659            if let Some(_) = self.requesting {
14660                return 1;
14661            }
14662            0
14663        }
14664    }
14665
14666    impl fidl::encoding::ResourceTypeMarker for RouteRequest {
14667        type Borrowed<'a> = &'a mut Self;
14668        fn take_or_borrow<'a>(
14669            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14670        ) -> Self::Borrowed<'a> {
14671            value
14672        }
14673    }
14674
14675    unsafe impl fidl::encoding::TypeMarker for RouteRequest {
14676        type Owned = Self;
14677
14678        #[inline(always)]
14679        fn inline_align(_context: fidl::encoding::Context) -> usize {
14680            8
14681        }
14682
14683        #[inline(always)]
14684        fn inline_size(_context: fidl::encoding::Context) -> usize {
14685            16
14686        }
14687    }
14688
14689    unsafe impl fidl::encoding::Encode<RouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
14690        for &mut RouteRequest
14691    {
14692        unsafe fn encode(
14693            self,
14694            encoder: &mut fidl::encoding::Encoder<
14695                '_,
14696                fidl::encoding::DefaultFuchsiaResourceDialect,
14697            >,
14698            offset: usize,
14699            mut depth: fidl::encoding::Depth,
14700        ) -> fidl::Result<()> {
14701            encoder.debug_check_bounds::<RouteRequest>(offset);
14702            // Vector header
14703            let max_ordinal: u64 = self.max_ordinal_present();
14704            encoder.write_num(max_ordinal, offset);
14705            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
14706            // Calling encoder.out_of_line_offset(0) is not allowed.
14707            if max_ordinal == 0 {
14708                return Ok(());
14709            }
14710            depth.increment()?;
14711            let envelope_size = 8;
14712            let bytes_len = max_ordinal as usize * envelope_size;
14713            #[allow(unused_variables)]
14714            let offset = encoder.out_of_line_offset(bytes_len);
14715            let mut _prev_end_offset: usize = 0;
14716            if 1 > max_ordinal {
14717                return Ok(());
14718            }
14719
14720            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
14721            // are envelope_size bytes.
14722            let cur_offset: usize = (1 - 1) * envelope_size;
14723
14724            // Zero reserved fields.
14725            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14726
14727            // Safety:
14728            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
14729            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
14730            //   envelope_size bytes, there is always sufficient room.
14731            fidl::encoding::encode_in_envelope_optional::<
14732                InstanceToken,
14733                fidl::encoding::DefaultFuchsiaResourceDialect,
14734            >(
14735                self.requesting
14736                    .as_mut()
14737                    .map(<InstanceToken as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
14738                encoder,
14739                offset + cur_offset,
14740                depth,
14741            )?;
14742
14743            _prev_end_offset = cur_offset + envelope_size;
14744
14745            Ok(())
14746        }
14747    }
14748
14749    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for RouteRequest {
14750        #[inline(always)]
14751        fn new_empty() -> Self {
14752            Self::default()
14753        }
14754
14755        unsafe fn decode(
14756            &mut self,
14757            decoder: &mut fidl::encoding::Decoder<
14758                '_,
14759                fidl::encoding::DefaultFuchsiaResourceDialect,
14760            >,
14761            offset: usize,
14762            mut depth: fidl::encoding::Depth,
14763        ) -> fidl::Result<()> {
14764            decoder.debug_check_bounds::<Self>(offset);
14765            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
14766                None => return Err(fidl::Error::NotNullable),
14767                Some(len) => len,
14768            };
14769            // Calling decoder.out_of_line_offset(0) is not allowed.
14770            if len == 0 {
14771                return Ok(());
14772            };
14773            depth.increment()?;
14774            let envelope_size = 8;
14775            let bytes_len = len * envelope_size;
14776            let offset = decoder.out_of_line_offset(bytes_len)?;
14777            // Decode the envelope for each type.
14778            let mut _next_ordinal_to_read = 0;
14779            let mut next_offset = offset;
14780            let end_offset = offset + bytes_len;
14781            _next_ordinal_to_read += 1;
14782            if next_offset >= end_offset {
14783                return Ok(());
14784            }
14785
14786            // Decode unknown envelopes for gaps in ordinals.
14787            while _next_ordinal_to_read < 1 {
14788                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14789                _next_ordinal_to_read += 1;
14790                next_offset += envelope_size;
14791            }
14792
14793            let next_out_of_line = decoder.next_out_of_line();
14794            let handles_before = decoder.remaining_handles();
14795            if let Some((inlined, num_bytes, num_handles)) =
14796                fidl::encoding::decode_envelope_header(decoder, next_offset)?
14797            {
14798                let member_inline_size =
14799                    <InstanceToken as fidl::encoding::TypeMarker>::inline_size(decoder.context);
14800                if inlined != (member_inline_size <= 4) {
14801                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
14802                }
14803                let inner_offset;
14804                let mut inner_depth = depth.clone();
14805                if inlined {
14806                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14807                    inner_offset = next_offset;
14808                } else {
14809                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14810                    inner_depth.increment()?;
14811                }
14812                let val_ref = self.requesting.get_or_insert_with(|| {
14813                    fidl::new_empty!(InstanceToken, fidl::encoding::DefaultFuchsiaResourceDialect)
14814                });
14815                fidl::decode!(
14816                    InstanceToken,
14817                    fidl::encoding::DefaultFuchsiaResourceDialect,
14818                    val_ref,
14819                    decoder,
14820                    inner_offset,
14821                    inner_depth
14822                )?;
14823                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14824                {
14825                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
14826                }
14827                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14828                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14829                }
14830            }
14831
14832            next_offset += envelope_size;
14833
14834            // Decode the remaining unknown envelopes.
14835            while next_offset < end_offset {
14836                _next_ordinal_to_read += 1;
14837                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14838                next_offset += envelope_size;
14839            }
14840
14841            Ok(())
14842        }
14843    }
14844
14845    impl fidl::encoding::ResourceTypeMarker for Capability {
14846        type Borrowed<'a> = &'a mut Self;
14847        fn take_or_borrow<'a>(
14848            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14849        ) -> Self::Borrowed<'a> {
14850            value
14851        }
14852    }
14853
14854    unsafe impl fidl::encoding::TypeMarker for Capability {
14855        type Owned = Self;
14856
14857        #[inline(always)]
14858        fn inline_align(_context: fidl::encoding::Context) -> usize {
14859            8
14860        }
14861
14862        #[inline(always)]
14863        fn inline_size(_context: fidl::encoding::Context) -> usize {
14864            16
14865        }
14866    }
14867
14868    unsafe impl fidl::encoding::Encode<Capability, fidl::encoding::DefaultFuchsiaResourceDialect>
14869        for &mut Capability
14870    {
14871        #[inline]
14872        unsafe fn encode(
14873            self,
14874            encoder: &mut fidl::encoding::Encoder<
14875                '_,
14876                fidl::encoding::DefaultFuchsiaResourceDialect,
14877            >,
14878            offset: usize,
14879            _depth: fidl::encoding::Depth,
14880        ) -> fidl::Result<()> {
14881            encoder.debug_check_bounds::<Capability>(offset);
14882            encoder.write_num::<u64>(self.ordinal(), offset);
14883            match self {
14884            Capability::Unit(ref val) => {
14885                fidl::encoding::encode_in_envelope::<Unit, fidl::encoding::DefaultFuchsiaResourceDialect>(
14886                    <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
14887                    encoder, offset + 8, _depth
14888                )
14889            }
14890            Capability::Handle(ref mut val) => {
14891                fidl::encoding::encode_in_envelope::<fidl::encoding::HandleType<fidl::NullableHandle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect>(
14892                    <fidl::encoding::HandleType<fidl::NullableHandle, { fidl::ObjectType::NONE.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
14893                    encoder, offset + 8, _depth
14894                )
14895            }
14896            Capability::Data(ref val) => {
14897                fidl::encoding::encode_in_envelope::<Data, fidl::encoding::DefaultFuchsiaResourceDialect>(
14898                    <Data as fidl::encoding::ValueTypeMarker>::borrow(val),
14899                    encoder, offset + 8, _depth
14900                )
14901            }
14902            Capability::Dictionary(ref mut val) => {
14903                fidl::encoding::encode_in_envelope::<DictionaryRef, fidl::encoding::DefaultFuchsiaResourceDialect>(
14904                    <DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
14905                    encoder, offset + 8, _depth
14906                )
14907            }
14908            Capability::Connector(ref mut val) => {
14909                fidl::encoding::encode_in_envelope::<Connector, fidl::encoding::DefaultFuchsiaResourceDialect>(
14910                    <Connector as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
14911                    encoder, offset + 8, _depth
14912                )
14913            }
14914            Capability::DirConnector(ref mut val) => {
14915                fidl::encoding::encode_in_envelope::<DirConnector, fidl::encoding::DefaultFuchsiaResourceDialect>(
14916                    <DirConnector as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
14917                    encoder, offset + 8, _depth
14918                )
14919            }
14920            Capability::Directory(ref mut val) => {
14921                fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
14922                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
14923                    encoder, offset + 8, _depth
14924                )
14925            }
14926            Capability::DirEntry(ref mut val) => {
14927                fidl::encoding::encode_in_envelope::<DirEntry, fidl::encoding::DefaultFuchsiaResourceDialect>(
14928                    <DirEntry as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
14929                    encoder, offset + 8, _depth
14930                )
14931            }
14932            Capability::ConnectorRouter(ref mut val) => {
14933                fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ConnectorRouterMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
14934                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ConnectorRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
14935                    encoder, offset + 8, _depth
14936                )
14937            }
14938            Capability::DictionaryRouter(ref mut val) => {
14939                fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DictionaryRouterMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
14940                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DictionaryRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
14941                    encoder, offset + 8, _depth
14942                )
14943            }
14944            Capability::DirEntryRouter(ref mut val) => {
14945                fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirEntryRouterMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
14946                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirEntryRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
14947                    encoder, offset + 8, _depth
14948                )
14949            }
14950            Capability::DataRouter(ref mut val) => {
14951                fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DataRouterMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
14952                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DataRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
14953                    encoder, offset + 8, _depth
14954                )
14955            }
14956            Capability::DirConnectorRouter(ref mut val) => {
14957                fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirConnectorRouterMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
14958                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirConnectorRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
14959                    encoder, offset + 8, _depth
14960                )
14961            }
14962            Capability::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
14963        }
14964        }
14965    }
14966
14967    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Capability {
14968        #[inline(always)]
14969        fn new_empty() -> Self {
14970            Self::__SourceBreaking { unknown_ordinal: 0 }
14971        }
14972
14973        #[inline]
14974        unsafe fn decode(
14975            &mut self,
14976            decoder: &mut fidl::encoding::Decoder<
14977                '_,
14978                fidl::encoding::DefaultFuchsiaResourceDialect,
14979            >,
14980            offset: usize,
14981            mut depth: fidl::encoding::Depth,
14982        ) -> fidl::Result<()> {
14983            decoder.debug_check_bounds::<Self>(offset);
14984            #[allow(unused_variables)]
14985            let next_out_of_line = decoder.next_out_of_line();
14986            let handles_before = decoder.remaining_handles();
14987            let (ordinal, inlined, num_bytes, num_handles) =
14988                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
14989
14990            let member_inline_size = match ordinal {
14991            1 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14992            2 => <fidl::encoding::HandleType<fidl::NullableHandle, { fidl::ObjectType::NONE.into_raw() }, 2147483648> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14993            3 => <Data as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14994            4 => <DictionaryRef as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14995            5 => <Connector as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14996            6 => <DirConnector as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14997            7 => <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14998            8 => <DirEntry as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14999            9 => <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ConnectorRouterMarker>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
15000            10 => <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DictionaryRouterMarker>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
15001            11 => <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirEntryRouterMarker>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
15002            12 => <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DataRouterMarker>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
15003            13 => <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirConnectorRouterMarker>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
15004            0 => return Err(fidl::Error::UnknownUnionTag),
15005            _ => num_bytes as usize,
15006        };
15007
15008            if inlined != (member_inline_size <= 4) {
15009                return Err(fidl::Error::InvalidInlineBitInEnvelope);
15010            }
15011            let _inner_offset;
15012            if inlined {
15013                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
15014                _inner_offset = offset + 8;
15015            } else {
15016                depth.increment()?;
15017                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15018            }
15019            match ordinal {
15020                1 => {
15021                    #[allow(irrefutable_let_patterns)]
15022                    if let Capability::Unit(_) = self {
15023                        // Do nothing, read the value into the object
15024                    } else {
15025                        // Initialize `self` to the right variant
15026                        *self = Capability::Unit(fidl::new_empty!(
15027                            Unit,
15028                            fidl::encoding::DefaultFuchsiaResourceDialect
15029                        ));
15030                    }
15031                    #[allow(irrefutable_let_patterns)]
15032                    if let Capability::Unit(ref mut val) = self {
15033                        fidl::decode!(
15034                            Unit,
15035                            fidl::encoding::DefaultFuchsiaResourceDialect,
15036                            val,
15037                            decoder,
15038                            _inner_offset,
15039                            depth
15040                        )?;
15041                    } else {
15042                        unreachable!()
15043                    }
15044                }
15045                2 => {
15046                    #[allow(irrefutable_let_patterns)]
15047                    if let Capability::Handle(_) = self {
15048                        // Do nothing, read the value into the object
15049                    } else {
15050                        // Initialize `self` to the right variant
15051                        *self = Capability::Handle(
15052                            fidl::new_empty!(fidl::encoding::HandleType<fidl::NullableHandle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
15053                        );
15054                    }
15055                    #[allow(irrefutable_let_patterns)]
15056                    if let Capability::Handle(ref mut val) = self {
15057                        fidl::decode!(fidl::encoding::HandleType<fidl::NullableHandle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val, decoder, _inner_offset, depth)?;
15058                    } else {
15059                        unreachable!()
15060                    }
15061                }
15062                3 => {
15063                    #[allow(irrefutable_let_patterns)]
15064                    if let Capability::Data(_) = self {
15065                        // Do nothing, read the value into the object
15066                    } else {
15067                        // Initialize `self` to the right variant
15068                        *self = Capability::Data(fidl::new_empty!(
15069                            Data,
15070                            fidl::encoding::DefaultFuchsiaResourceDialect
15071                        ));
15072                    }
15073                    #[allow(irrefutable_let_patterns)]
15074                    if let Capability::Data(ref mut val) = self {
15075                        fidl::decode!(
15076                            Data,
15077                            fidl::encoding::DefaultFuchsiaResourceDialect,
15078                            val,
15079                            decoder,
15080                            _inner_offset,
15081                            depth
15082                        )?;
15083                    } else {
15084                        unreachable!()
15085                    }
15086                }
15087                4 => {
15088                    #[allow(irrefutable_let_patterns)]
15089                    if let Capability::Dictionary(_) = self {
15090                        // Do nothing, read the value into the object
15091                    } else {
15092                        // Initialize `self` to the right variant
15093                        *self = Capability::Dictionary(fidl::new_empty!(
15094                            DictionaryRef,
15095                            fidl::encoding::DefaultFuchsiaResourceDialect
15096                        ));
15097                    }
15098                    #[allow(irrefutable_let_patterns)]
15099                    if let Capability::Dictionary(ref mut val) = self {
15100                        fidl::decode!(
15101                            DictionaryRef,
15102                            fidl::encoding::DefaultFuchsiaResourceDialect,
15103                            val,
15104                            decoder,
15105                            _inner_offset,
15106                            depth
15107                        )?;
15108                    } else {
15109                        unreachable!()
15110                    }
15111                }
15112                5 => {
15113                    #[allow(irrefutable_let_patterns)]
15114                    if let Capability::Connector(_) = self {
15115                        // Do nothing, read the value into the object
15116                    } else {
15117                        // Initialize `self` to the right variant
15118                        *self = Capability::Connector(fidl::new_empty!(
15119                            Connector,
15120                            fidl::encoding::DefaultFuchsiaResourceDialect
15121                        ));
15122                    }
15123                    #[allow(irrefutable_let_patterns)]
15124                    if let Capability::Connector(ref mut val) = self {
15125                        fidl::decode!(
15126                            Connector,
15127                            fidl::encoding::DefaultFuchsiaResourceDialect,
15128                            val,
15129                            decoder,
15130                            _inner_offset,
15131                            depth
15132                        )?;
15133                    } else {
15134                        unreachable!()
15135                    }
15136                }
15137                6 => {
15138                    #[allow(irrefutable_let_patterns)]
15139                    if let Capability::DirConnector(_) = self {
15140                        // Do nothing, read the value into the object
15141                    } else {
15142                        // Initialize `self` to the right variant
15143                        *self = Capability::DirConnector(fidl::new_empty!(
15144                            DirConnector,
15145                            fidl::encoding::DefaultFuchsiaResourceDialect
15146                        ));
15147                    }
15148                    #[allow(irrefutable_let_patterns)]
15149                    if let Capability::DirConnector(ref mut val) = self {
15150                        fidl::decode!(
15151                            DirConnector,
15152                            fidl::encoding::DefaultFuchsiaResourceDialect,
15153                            val,
15154                            decoder,
15155                            _inner_offset,
15156                            depth
15157                        )?;
15158                    } else {
15159                        unreachable!()
15160                    }
15161                }
15162                7 => {
15163                    #[allow(irrefutable_let_patterns)]
15164                    if let Capability::Directory(_) = self {
15165                        // Do nothing, read the value into the object
15166                    } else {
15167                        // Initialize `self` to the right variant
15168                        *self = Capability::Directory(fidl::new_empty!(
15169                            fidl::encoding::Endpoint<
15170                                fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
15171                            >,
15172                            fidl::encoding::DefaultFuchsiaResourceDialect
15173                        ));
15174                    }
15175                    #[allow(irrefutable_let_patterns)]
15176                    if let Capability::Directory(ref mut val) = self {
15177                        fidl::decode!(
15178                            fidl::encoding::Endpoint<
15179                                fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
15180                            >,
15181                            fidl::encoding::DefaultFuchsiaResourceDialect,
15182                            val,
15183                            decoder,
15184                            _inner_offset,
15185                            depth
15186                        )?;
15187                    } else {
15188                        unreachable!()
15189                    }
15190                }
15191                8 => {
15192                    #[allow(irrefutable_let_patterns)]
15193                    if let Capability::DirEntry(_) = self {
15194                        // Do nothing, read the value into the object
15195                    } else {
15196                        // Initialize `self` to the right variant
15197                        *self = Capability::DirEntry(fidl::new_empty!(
15198                            DirEntry,
15199                            fidl::encoding::DefaultFuchsiaResourceDialect
15200                        ));
15201                    }
15202                    #[allow(irrefutable_let_patterns)]
15203                    if let Capability::DirEntry(ref mut val) = self {
15204                        fidl::decode!(
15205                            DirEntry,
15206                            fidl::encoding::DefaultFuchsiaResourceDialect,
15207                            val,
15208                            decoder,
15209                            _inner_offset,
15210                            depth
15211                        )?;
15212                    } else {
15213                        unreachable!()
15214                    }
15215                }
15216                9 => {
15217                    #[allow(irrefutable_let_patterns)]
15218                    if let Capability::ConnectorRouter(_) = self {
15219                        // Do nothing, read the value into the object
15220                    } else {
15221                        // Initialize `self` to the right variant
15222                        *self = Capability::ConnectorRouter(fidl::new_empty!(
15223                            fidl::encoding::Endpoint<
15224                                fidl::endpoints::ClientEnd<ConnectorRouterMarker>,
15225                            >,
15226                            fidl::encoding::DefaultFuchsiaResourceDialect
15227                        ));
15228                    }
15229                    #[allow(irrefutable_let_patterns)]
15230                    if let Capability::ConnectorRouter(ref mut val) = self {
15231                        fidl::decode!(
15232                            fidl::encoding::Endpoint<
15233                                fidl::endpoints::ClientEnd<ConnectorRouterMarker>,
15234                            >,
15235                            fidl::encoding::DefaultFuchsiaResourceDialect,
15236                            val,
15237                            decoder,
15238                            _inner_offset,
15239                            depth
15240                        )?;
15241                    } else {
15242                        unreachable!()
15243                    }
15244                }
15245                10 => {
15246                    #[allow(irrefutable_let_patterns)]
15247                    if let Capability::DictionaryRouter(_) = self {
15248                        // Do nothing, read the value into the object
15249                    } else {
15250                        // Initialize `self` to the right variant
15251                        *self = Capability::DictionaryRouter(fidl::new_empty!(
15252                            fidl::encoding::Endpoint<
15253                                fidl::endpoints::ClientEnd<DictionaryRouterMarker>,
15254                            >,
15255                            fidl::encoding::DefaultFuchsiaResourceDialect
15256                        ));
15257                    }
15258                    #[allow(irrefutable_let_patterns)]
15259                    if let Capability::DictionaryRouter(ref mut val) = self {
15260                        fidl::decode!(
15261                            fidl::encoding::Endpoint<
15262                                fidl::endpoints::ClientEnd<DictionaryRouterMarker>,
15263                            >,
15264                            fidl::encoding::DefaultFuchsiaResourceDialect,
15265                            val,
15266                            decoder,
15267                            _inner_offset,
15268                            depth
15269                        )?;
15270                    } else {
15271                        unreachable!()
15272                    }
15273                }
15274                11 => {
15275                    #[allow(irrefutable_let_patterns)]
15276                    if let Capability::DirEntryRouter(_) = self {
15277                        // Do nothing, read the value into the object
15278                    } else {
15279                        // Initialize `self` to the right variant
15280                        *self = Capability::DirEntryRouter(fidl::new_empty!(
15281                            fidl::encoding::Endpoint<
15282                                fidl::endpoints::ClientEnd<DirEntryRouterMarker>,
15283                            >,
15284                            fidl::encoding::DefaultFuchsiaResourceDialect
15285                        ));
15286                    }
15287                    #[allow(irrefutable_let_patterns)]
15288                    if let Capability::DirEntryRouter(ref mut val) = self {
15289                        fidl::decode!(
15290                            fidl::encoding::Endpoint<
15291                                fidl::endpoints::ClientEnd<DirEntryRouterMarker>,
15292                            >,
15293                            fidl::encoding::DefaultFuchsiaResourceDialect,
15294                            val,
15295                            decoder,
15296                            _inner_offset,
15297                            depth
15298                        )?;
15299                    } else {
15300                        unreachable!()
15301                    }
15302                }
15303                12 => {
15304                    #[allow(irrefutable_let_patterns)]
15305                    if let Capability::DataRouter(_) = self {
15306                        // Do nothing, read the value into the object
15307                    } else {
15308                        // Initialize `self` to the right variant
15309                        *self = Capability::DataRouter(fidl::new_empty!(
15310                            fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DataRouterMarker>>,
15311                            fidl::encoding::DefaultFuchsiaResourceDialect
15312                        ));
15313                    }
15314                    #[allow(irrefutable_let_patterns)]
15315                    if let Capability::DataRouter(ref mut val) = self {
15316                        fidl::decode!(
15317                            fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DataRouterMarker>>,
15318                            fidl::encoding::DefaultFuchsiaResourceDialect,
15319                            val,
15320                            decoder,
15321                            _inner_offset,
15322                            depth
15323                        )?;
15324                    } else {
15325                        unreachable!()
15326                    }
15327                }
15328                13 => {
15329                    #[allow(irrefutable_let_patterns)]
15330                    if let Capability::DirConnectorRouter(_) = self {
15331                        // Do nothing, read the value into the object
15332                    } else {
15333                        // Initialize `self` to the right variant
15334                        *self = Capability::DirConnectorRouter(fidl::new_empty!(
15335                            fidl::encoding::Endpoint<
15336                                fidl::endpoints::ClientEnd<DirConnectorRouterMarker>,
15337                            >,
15338                            fidl::encoding::DefaultFuchsiaResourceDialect
15339                        ));
15340                    }
15341                    #[allow(irrefutable_let_patterns)]
15342                    if let Capability::DirConnectorRouter(ref mut val) = self {
15343                        fidl::decode!(
15344                            fidl::encoding::Endpoint<
15345                                fidl::endpoints::ClientEnd<DirConnectorRouterMarker>,
15346                            >,
15347                            fidl::encoding::DefaultFuchsiaResourceDialect,
15348                            val,
15349                            decoder,
15350                            _inner_offset,
15351                            depth
15352                        )?;
15353                    } else {
15354                        unreachable!()
15355                    }
15356                }
15357                #[allow(deprecated)]
15358                ordinal => {
15359                    for _ in 0..num_handles {
15360                        decoder.drop_next_handle()?;
15361                    }
15362                    *self = Capability::__SourceBreaking { unknown_ordinal: ordinal };
15363                }
15364            }
15365            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
15366                return Err(fidl::Error::InvalidNumBytesInEnvelope);
15367            }
15368            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15369                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15370            }
15371            Ok(())
15372        }
15373    }
15374
15375    impl fidl::encoding::ResourceTypeMarker for ConnectorRouterRouteResponse {
15376        type Borrowed<'a> = &'a mut Self;
15377        fn take_or_borrow<'a>(
15378            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
15379        ) -> Self::Borrowed<'a> {
15380            value
15381        }
15382    }
15383
15384    unsafe impl fidl::encoding::TypeMarker for ConnectorRouterRouteResponse {
15385        type Owned = Self;
15386
15387        #[inline(always)]
15388        fn inline_align(_context: fidl::encoding::Context) -> usize {
15389            8
15390        }
15391
15392        #[inline(always)]
15393        fn inline_size(_context: fidl::encoding::Context) -> usize {
15394            16
15395        }
15396    }
15397
15398    unsafe impl
15399        fidl::encoding::Encode<
15400            ConnectorRouterRouteResponse,
15401            fidl::encoding::DefaultFuchsiaResourceDialect,
15402        > for &mut ConnectorRouterRouteResponse
15403    {
15404        #[inline]
15405        unsafe fn encode(
15406            self,
15407            encoder: &mut fidl::encoding::Encoder<
15408                '_,
15409                fidl::encoding::DefaultFuchsiaResourceDialect,
15410            >,
15411            offset: usize,
15412            _depth: fidl::encoding::Depth,
15413        ) -> fidl::Result<()> {
15414            encoder.debug_check_bounds::<ConnectorRouterRouteResponse>(offset);
15415            encoder.write_num::<u64>(self.ordinal(), offset);
15416            match self {
15417                ConnectorRouterRouteResponse::Connector(ref mut val) => {
15418                    fidl::encoding::encode_in_envelope::<
15419                        Connector,
15420                        fidl::encoding::DefaultFuchsiaResourceDialect,
15421                    >(
15422                        <Connector as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
15423                        encoder,
15424                        offset + 8,
15425                        _depth,
15426                    )
15427                }
15428                ConnectorRouterRouteResponse::Unavailable(ref val) => {
15429                    fidl::encoding::encode_in_envelope::<
15430                        Unit,
15431                        fidl::encoding::DefaultFuchsiaResourceDialect,
15432                    >(
15433                        <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
15434                        encoder,
15435                        offset + 8,
15436                        _depth,
15437                    )
15438                }
15439            }
15440        }
15441    }
15442
15443    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
15444        for ConnectorRouterRouteResponse
15445    {
15446        #[inline(always)]
15447        fn new_empty() -> Self {
15448            Self::Connector(fidl::new_empty!(
15449                Connector,
15450                fidl::encoding::DefaultFuchsiaResourceDialect
15451            ))
15452        }
15453
15454        #[inline]
15455        unsafe fn decode(
15456            &mut self,
15457            decoder: &mut fidl::encoding::Decoder<
15458                '_,
15459                fidl::encoding::DefaultFuchsiaResourceDialect,
15460            >,
15461            offset: usize,
15462            mut depth: fidl::encoding::Depth,
15463        ) -> fidl::Result<()> {
15464            decoder.debug_check_bounds::<Self>(offset);
15465            #[allow(unused_variables)]
15466            let next_out_of_line = decoder.next_out_of_line();
15467            let handles_before = decoder.remaining_handles();
15468            let (ordinal, inlined, num_bytes, num_handles) =
15469                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
15470
15471            let member_inline_size = match ordinal {
15472                1 => <Connector as fidl::encoding::TypeMarker>::inline_size(decoder.context),
15473                2 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
15474                _ => return Err(fidl::Error::UnknownUnionTag),
15475            };
15476
15477            if inlined != (member_inline_size <= 4) {
15478                return Err(fidl::Error::InvalidInlineBitInEnvelope);
15479            }
15480            let _inner_offset;
15481            if inlined {
15482                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
15483                _inner_offset = offset + 8;
15484            } else {
15485                depth.increment()?;
15486                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15487            }
15488            match ordinal {
15489                1 => {
15490                    #[allow(irrefutable_let_patterns)]
15491                    if let ConnectorRouterRouteResponse::Connector(_) = self {
15492                        // Do nothing, read the value into the object
15493                    } else {
15494                        // Initialize `self` to the right variant
15495                        *self = ConnectorRouterRouteResponse::Connector(fidl::new_empty!(
15496                            Connector,
15497                            fidl::encoding::DefaultFuchsiaResourceDialect
15498                        ));
15499                    }
15500                    #[allow(irrefutable_let_patterns)]
15501                    if let ConnectorRouterRouteResponse::Connector(ref mut val) = self {
15502                        fidl::decode!(
15503                            Connector,
15504                            fidl::encoding::DefaultFuchsiaResourceDialect,
15505                            val,
15506                            decoder,
15507                            _inner_offset,
15508                            depth
15509                        )?;
15510                    } else {
15511                        unreachable!()
15512                    }
15513                }
15514                2 => {
15515                    #[allow(irrefutable_let_patterns)]
15516                    if let ConnectorRouterRouteResponse::Unavailable(_) = self {
15517                        // Do nothing, read the value into the object
15518                    } else {
15519                        // Initialize `self` to the right variant
15520                        *self = ConnectorRouterRouteResponse::Unavailable(fidl::new_empty!(
15521                            Unit,
15522                            fidl::encoding::DefaultFuchsiaResourceDialect
15523                        ));
15524                    }
15525                    #[allow(irrefutable_let_patterns)]
15526                    if let ConnectorRouterRouteResponse::Unavailable(ref mut val) = self {
15527                        fidl::decode!(
15528                            Unit,
15529                            fidl::encoding::DefaultFuchsiaResourceDialect,
15530                            val,
15531                            decoder,
15532                            _inner_offset,
15533                            depth
15534                        )?;
15535                    } else {
15536                        unreachable!()
15537                    }
15538                }
15539                ordinal => panic!("unexpected ordinal {:?}", ordinal),
15540            }
15541            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
15542                return Err(fidl::Error::InvalidNumBytesInEnvelope);
15543            }
15544            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15545                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15546            }
15547            Ok(())
15548        }
15549    }
15550
15551    impl fidl::encoding::ResourceTypeMarker for DataRouterRouteResponse {
15552        type Borrowed<'a> = &'a mut Self;
15553        fn take_or_borrow<'a>(
15554            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
15555        ) -> Self::Borrowed<'a> {
15556            value
15557        }
15558    }
15559
15560    unsafe impl fidl::encoding::TypeMarker for DataRouterRouteResponse {
15561        type Owned = Self;
15562
15563        #[inline(always)]
15564        fn inline_align(_context: fidl::encoding::Context) -> usize {
15565            8
15566        }
15567
15568        #[inline(always)]
15569        fn inline_size(_context: fidl::encoding::Context) -> usize {
15570            16
15571        }
15572    }
15573
15574    unsafe impl
15575        fidl::encoding::Encode<
15576            DataRouterRouteResponse,
15577            fidl::encoding::DefaultFuchsiaResourceDialect,
15578        > for &mut DataRouterRouteResponse
15579    {
15580        #[inline]
15581        unsafe fn encode(
15582            self,
15583            encoder: &mut fidl::encoding::Encoder<
15584                '_,
15585                fidl::encoding::DefaultFuchsiaResourceDialect,
15586            >,
15587            offset: usize,
15588            _depth: fidl::encoding::Depth,
15589        ) -> fidl::Result<()> {
15590            encoder.debug_check_bounds::<DataRouterRouteResponse>(offset);
15591            encoder.write_num::<u64>(self.ordinal(), offset);
15592            match self {
15593                DataRouterRouteResponse::Data(ref val) => fidl::encoding::encode_in_envelope::<
15594                    Data,
15595                    fidl::encoding::DefaultFuchsiaResourceDialect,
15596                >(
15597                    <Data as fidl::encoding::ValueTypeMarker>::borrow(val),
15598                    encoder,
15599                    offset + 8,
15600                    _depth,
15601                ),
15602                DataRouterRouteResponse::Unavailable(ref val) => {
15603                    fidl::encoding::encode_in_envelope::<
15604                        Unit,
15605                        fidl::encoding::DefaultFuchsiaResourceDialect,
15606                    >(
15607                        <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
15608                        encoder,
15609                        offset + 8,
15610                        _depth,
15611                    )
15612                }
15613            }
15614        }
15615    }
15616
15617    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
15618        for DataRouterRouteResponse
15619    {
15620        #[inline(always)]
15621        fn new_empty() -> Self {
15622            Self::Data(fidl::new_empty!(Data, fidl::encoding::DefaultFuchsiaResourceDialect))
15623        }
15624
15625        #[inline]
15626        unsafe fn decode(
15627            &mut self,
15628            decoder: &mut fidl::encoding::Decoder<
15629                '_,
15630                fidl::encoding::DefaultFuchsiaResourceDialect,
15631            >,
15632            offset: usize,
15633            mut depth: fidl::encoding::Depth,
15634        ) -> fidl::Result<()> {
15635            decoder.debug_check_bounds::<Self>(offset);
15636            #[allow(unused_variables)]
15637            let next_out_of_line = decoder.next_out_of_line();
15638            let handles_before = decoder.remaining_handles();
15639            let (ordinal, inlined, num_bytes, num_handles) =
15640                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
15641
15642            let member_inline_size = match ordinal {
15643                1 => <Data as fidl::encoding::TypeMarker>::inline_size(decoder.context),
15644                2 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
15645                _ => return Err(fidl::Error::UnknownUnionTag),
15646            };
15647
15648            if inlined != (member_inline_size <= 4) {
15649                return Err(fidl::Error::InvalidInlineBitInEnvelope);
15650            }
15651            let _inner_offset;
15652            if inlined {
15653                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
15654                _inner_offset = offset + 8;
15655            } else {
15656                depth.increment()?;
15657                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15658            }
15659            match ordinal {
15660                1 => {
15661                    #[allow(irrefutable_let_patterns)]
15662                    if let DataRouterRouteResponse::Data(_) = self {
15663                        // Do nothing, read the value into the object
15664                    } else {
15665                        // Initialize `self` to the right variant
15666                        *self = DataRouterRouteResponse::Data(fidl::new_empty!(
15667                            Data,
15668                            fidl::encoding::DefaultFuchsiaResourceDialect
15669                        ));
15670                    }
15671                    #[allow(irrefutable_let_patterns)]
15672                    if let DataRouterRouteResponse::Data(ref mut val) = self {
15673                        fidl::decode!(
15674                            Data,
15675                            fidl::encoding::DefaultFuchsiaResourceDialect,
15676                            val,
15677                            decoder,
15678                            _inner_offset,
15679                            depth
15680                        )?;
15681                    } else {
15682                        unreachable!()
15683                    }
15684                }
15685                2 => {
15686                    #[allow(irrefutable_let_patterns)]
15687                    if let DataRouterRouteResponse::Unavailable(_) = self {
15688                        // Do nothing, read the value into the object
15689                    } else {
15690                        // Initialize `self` to the right variant
15691                        *self = DataRouterRouteResponse::Unavailable(fidl::new_empty!(
15692                            Unit,
15693                            fidl::encoding::DefaultFuchsiaResourceDialect
15694                        ));
15695                    }
15696                    #[allow(irrefutable_let_patterns)]
15697                    if let DataRouterRouteResponse::Unavailable(ref mut val) = self {
15698                        fidl::decode!(
15699                            Unit,
15700                            fidl::encoding::DefaultFuchsiaResourceDialect,
15701                            val,
15702                            decoder,
15703                            _inner_offset,
15704                            depth
15705                        )?;
15706                    } else {
15707                        unreachable!()
15708                    }
15709                }
15710                ordinal => panic!("unexpected ordinal {:?}", ordinal),
15711            }
15712            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
15713                return Err(fidl::Error::InvalidNumBytesInEnvelope);
15714            }
15715            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15716                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15717            }
15718            Ok(())
15719        }
15720    }
15721
15722    impl fidl::encoding::ResourceTypeMarker for DictionaryRouterRouteResponse {
15723        type Borrowed<'a> = &'a mut Self;
15724        fn take_or_borrow<'a>(
15725            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
15726        ) -> Self::Borrowed<'a> {
15727            value
15728        }
15729    }
15730
15731    unsafe impl fidl::encoding::TypeMarker for DictionaryRouterRouteResponse {
15732        type Owned = Self;
15733
15734        #[inline(always)]
15735        fn inline_align(_context: fidl::encoding::Context) -> usize {
15736            8
15737        }
15738
15739        #[inline(always)]
15740        fn inline_size(_context: fidl::encoding::Context) -> usize {
15741            16
15742        }
15743    }
15744
15745    unsafe impl
15746        fidl::encoding::Encode<
15747            DictionaryRouterRouteResponse,
15748            fidl::encoding::DefaultFuchsiaResourceDialect,
15749        > for &mut DictionaryRouterRouteResponse
15750    {
15751        #[inline]
15752        unsafe fn encode(
15753            self,
15754            encoder: &mut fidl::encoding::Encoder<
15755                '_,
15756                fidl::encoding::DefaultFuchsiaResourceDialect,
15757            >,
15758            offset: usize,
15759            _depth: fidl::encoding::Depth,
15760        ) -> fidl::Result<()> {
15761            encoder.debug_check_bounds::<DictionaryRouterRouteResponse>(offset);
15762            encoder.write_num::<u64>(self.ordinal(), offset);
15763            match self {
15764                DictionaryRouterRouteResponse::Dictionary(ref mut val) => {
15765                    fidl::encoding::encode_in_envelope::<
15766                        DictionaryRef,
15767                        fidl::encoding::DefaultFuchsiaResourceDialect,
15768                    >(
15769                        <DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
15770                        encoder,
15771                        offset + 8,
15772                        _depth,
15773                    )
15774                }
15775                DictionaryRouterRouteResponse::Unavailable(ref val) => {
15776                    fidl::encoding::encode_in_envelope::<
15777                        Unit,
15778                        fidl::encoding::DefaultFuchsiaResourceDialect,
15779                    >(
15780                        <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
15781                        encoder,
15782                        offset + 8,
15783                        _depth,
15784                    )
15785                }
15786            }
15787        }
15788    }
15789
15790    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
15791        for DictionaryRouterRouteResponse
15792    {
15793        #[inline(always)]
15794        fn new_empty() -> Self {
15795            Self::Dictionary(fidl::new_empty!(
15796                DictionaryRef,
15797                fidl::encoding::DefaultFuchsiaResourceDialect
15798            ))
15799        }
15800
15801        #[inline]
15802        unsafe fn decode(
15803            &mut self,
15804            decoder: &mut fidl::encoding::Decoder<
15805                '_,
15806                fidl::encoding::DefaultFuchsiaResourceDialect,
15807            >,
15808            offset: usize,
15809            mut depth: fidl::encoding::Depth,
15810        ) -> fidl::Result<()> {
15811            decoder.debug_check_bounds::<Self>(offset);
15812            #[allow(unused_variables)]
15813            let next_out_of_line = decoder.next_out_of_line();
15814            let handles_before = decoder.remaining_handles();
15815            let (ordinal, inlined, num_bytes, num_handles) =
15816                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
15817
15818            let member_inline_size = match ordinal {
15819                1 => <DictionaryRef as fidl::encoding::TypeMarker>::inline_size(decoder.context),
15820                2 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
15821                _ => return Err(fidl::Error::UnknownUnionTag),
15822            };
15823
15824            if inlined != (member_inline_size <= 4) {
15825                return Err(fidl::Error::InvalidInlineBitInEnvelope);
15826            }
15827            let _inner_offset;
15828            if inlined {
15829                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
15830                _inner_offset = offset + 8;
15831            } else {
15832                depth.increment()?;
15833                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15834            }
15835            match ordinal {
15836                1 => {
15837                    #[allow(irrefutable_let_patterns)]
15838                    if let DictionaryRouterRouteResponse::Dictionary(_) = self {
15839                        // Do nothing, read the value into the object
15840                    } else {
15841                        // Initialize `self` to the right variant
15842                        *self = DictionaryRouterRouteResponse::Dictionary(fidl::new_empty!(
15843                            DictionaryRef,
15844                            fidl::encoding::DefaultFuchsiaResourceDialect
15845                        ));
15846                    }
15847                    #[allow(irrefutable_let_patterns)]
15848                    if let DictionaryRouterRouteResponse::Dictionary(ref mut val) = self {
15849                        fidl::decode!(
15850                            DictionaryRef,
15851                            fidl::encoding::DefaultFuchsiaResourceDialect,
15852                            val,
15853                            decoder,
15854                            _inner_offset,
15855                            depth
15856                        )?;
15857                    } else {
15858                        unreachable!()
15859                    }
15860                }
15861                2 => {
15862                    #[allow(irrefutable_let_patterns)]
15863                    if let DictionaryRouterRouteResponse::Unavailable(_) = self {
15864                        // Do nothing, read the value into the object
15865                    } else {
15866                        // Initialize `self` to the right variant
15867                        *self = DictionaryRouterRouteResponse::Unavailable(fidl::new_empty!(
15868                            Unit,
15869                            fidl::encoding::DefaultFuchsiaResourceDialect
15870                        ));
15871                    }
15872                    #[allow(irrefutable_let_patterns)]
15873                    if let DictionaryRouterRouteResponse::Unavailable(ref mut val) = self {
15874                        fidl::decode!(
15875                            Unit,
15876                            fidl::encoding::DefaultFuchsiaResourceDialect,
15877                            val,
15878                            decoder,
15879                            _inner_offset,
15880                            depth
15881                        )?;
15882                    } else {
15883                        unreachable!()
15884                    }
15885                }
15886                ordinal => panic!("unexpected ordinal {:?}", ordinal),
15887            }
15888            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
15889                return Err(fidl::Error::InvalidNumBytesInEnvelope);
15890            }
15891            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15892                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15893            }
15894            Ok(())
15895        }
15896    }
15897
15898    impl fidl::encoding::ResourceTypeMarker for DirConnectorRouterRouteResponse {
15899        type Borrowed<'a> = &'a mut Self;
15900        fn take_or_borrow<'a>(
15901            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
15902        ) -> Self::Borrowed<'a> {
15903            value
15904        }
15905    }
15906
15907    unsafe impl fidl::encoding::TypeMarker for DirConnectorRouterRouteResponse {
15908        type Owned = Self;
15909
15910        #[inline(always)]
15911        fn inline_align(_context: fidl::encoding::Context) -> usize {
15912            8
15913        }
15914
15915        #[inline(always)]
15916        fn inline_size(_context: fidl::encoding::Context) -> usize {
15917            16
15918        }
15919    }
15920
15921    unsafe impl
15922        fidl::encoding::Encode<
15923            DirConnectorRouterRouteResponse,
15924            fidl::encoding::DefaultFuchsiaResourceDialect,
15925        > for &mut DirConnectorRouterRouteResponse
15926    {
15927        #[inline]
15928        unsafe fn encode(
15929            self,
15930            encoder: &mut fidl::encoding::Encoder<
15931                '_,
15932                fidl::encoding::DefaultFuchsiaResourceDialect,
15933            >,
15934            offset: usize,
15935            _depth: fidl::encoding::Depth,
15936        ) -> fidl::Result<()> {
15937            encoder.debug_check_bounds::<DirConnectorRouterRouteResponse>(offset);
15938            encoder.write_num::<u64>(self.ordinal(), offset);
15939            match self {
15940                DirConnectorRouterRouteResponse::DirConnector(ref mut val) => {
15941                    fidl::encoding::encode_in_envelope::<
15942                        DirConnector,
15943                        fidl::encoding::DefaultFuchsiaResourceDialect,
15944                    >(
15945                        <DirConnector as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
15946                        encoder,
15947                        offset + 8,
15948                        _depth,
15949                    )
15950                }
15951                DirConnectorRouterRouteResponse::Unavailable(ref val) => {
15952                    fidl::encoding::encode_in_envelope::<
15953                        Unit,
15954                        fidl::encoding::DefaultFuchsiaResourceDialect,
15955                    >(
15956                        <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
15957                        encoder,
15958                        offset + 8,
15959                        _depth,
15960                    )
15961                }
15962            }
15963        }
15964    }
15965
15966    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
15967        for DirConnectorRouterRouteResponse
15968    {
15969        #[inline(always)]
15970        fn new_empty() -> Self {
15971            Self::DirConnector(fidl::new_empty!(
15972                DirConnector,
15973                fidl::encoding::DefaultFuchsiaResourceDialect
15974            ))
15975        }
15976
15977        #[inline]
15978        unsafe fn decode(
15979            &mut self,
15980            decoder: &mut fidl::encoding::Decoder<
15981                '_,
15982                fidl::encoding::DefaultFuchsiaResourceDialect,
15983            >,
15984            offset: usize,
15985            mut depth: fidl::encoding::Depth,
15986        ) -> fidl::Result<()> {
15987            decoder.debug_check_bounds::<Self>(offset);
15988            #[allow(unused_variables)]
15989            let next_out_of_line = decoder.next_out_of_line();
15990            let handles_before = decoder.remaining_handles();
15991            let (ordinal, inlined, num_bytes, num_handles) =
15992                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
15993
15994            let member_inline_size = match ordinal {
15995                1 => <DirConnector as fidl::encoding::TypeMarker>::inline_size(decoder.context),
15996                2 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
15997                _ => return Err(fidl::Error::UnknownUnionTag),
15998            };
15999
16000            if inlined != (member_inline_size <= 4) {
16001                return Err(fidl::Error::InvalidInlineBitInEnvelope);
16002            }
16003            let _inner_offset;
16004            if inlined {
16005                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
16006                _inner_offset = offset + 8;
16007            } else {
16008                depth.increment()?;
16009                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16010            }
16011            match ordinal {
16012                1 => {
16013                    #[allow(irrefutable_let_patterns)]
16014                    if let DirConnectorRouterRouteResponse::DirConnector(_) = self {
16015                        // Do nothing, read the value into the object
16016                    } else {
16017                        // Initialize `self` to the right variant
16018                        *self = DirConnectorRouterRouteResponse::DirConnector(fidl::new_empty!(
16019                            DirConnector,
16020                            fidl::encoding::DefaultFuchsiaResourceDialect
16021                        ));
16022                    }
16023                    #[allow(irrefutable_let_patterns)]
16024                    if let DirConnectorRouterRouteResponse::DirConnector(ref mut val) = self {
16025                        fidl::decode!(
16026                            DirConnector,
16027                            fidl::encoding::DefaultFuchsiaResourceDialect,
16028                            val,
16029                            decoder,
16030                            _inner_offset,
16031                            depth
16032                        )?;
16033                    } else {
16034                        unreachable!()
16035                    }
16036                }
16037                2 => {
16038                    #[allow(irrefutable_let_patterns)]
16039                    if let DirConnectorRouterRouteResponse::Unavailable(_) = self {
16040                        // Do nothing, read the value into the object
16041                    } else {
16042                        // Initialize `self` to the right variant
16043                        *self = DirConnectorRouterRouteResponse::Unavailable(fidl::new_empty!(
16044                            Unit,
16045                            fidl::encoding::DefaultFuchsiaResourceDialect
16046                        ));
16047                    }
16048                    #[allow(irrefutable_let_patterns)]
16049                    if let DirConnectorRouterRouteResponse::Unavailable(ref mut val) = self {
16050                        fidl::decode!(
16051                            Unit,
16052                            fidl::encoding::DefaultFuchsiaResourceDialect,
16053                            val,
16054                            decoder,
16055                            _inner_offset,
16056                            depth
16057                        )?;
16058                    } else {
16059                        unreachable!()
16060                    }
16061                }
16062                ordinal => panic!("unexpected ordinal {:?}", ordinal),
16063            }
16064            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
16065                return Err(fidl::Error::InvalidNumBytesInEnvelope);
16066            }
16067            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16068                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16069            }
16070            Ok(())
16071        }
16072    }
16073
16074    impl fidl::encoding::ResourceTypeMarker for DirEntryRouterRouteResponse {
16075        type Borrowed<'a> = &'a mut Self;
16076        fn take_or_borrow<'a>(
16077            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
16078        ) -> Self::Borrowed<'a> {
16079            value
16080        }
16081    }
16082
16083    unsafe impl fidl::encoding::TypeMarker for DirEntryRouterRouteResponse {
16084        type Owned = Self;
16085
16086        #[inline(always)]
16087        fn inline_align(_context: fidl::encoding::Context) -> usize {
16088            8
16089        }
16090
16091        #[inline(always)]
16092        fn inline_size(_context: fidl::encoding::Context) -> usize {
16093            16
16094        }
16095    }
16096
16097    unsafe impl
16098        fidl::encoding::Encode<
16099            DirEntryRouterRouteResponse,
16100            fidl::encoding::DefaultFuchsiaResourceDialect,
16101        > for &mut DirEntryRouterRouteResponse
16102    {
16103        #[inline]
16104        unsafe fn encode(
16105            self,
16106            encoder: &mut fidl::encoding::Encoder<
16107                '_,
16108                fidl::encoding::DefaultFuchsiaResourceDialect,
16109            >,
16110            offset: usize,
16111            _depth: fidl::encoding::Depth,
16112        ) -> fidl::Result<()> {
16113            encoder.debug_check_bounds::<DirEntryRouterRouteResponse>(offset);
16114            encoder.write_num::<u64>(self.ordinal(), offset);
16115            match self {
16116                DirEntryRouterRouteResponse::DirEntry(ref mut val) => {
16117                    fidl::encoding::encode_in_envelope::<
16118                        DirEntry,
16119                        fidl::encoding::DefaultFuchsiaResourceDialect,
16120                    >(
16121                        <DirEntry as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
16122                        encoder,
16123                        offset + 8,
16124                        _depth,
16125                    )
16126                }
16127                DirEntryRouterRouteResponse::Unavailable(ref val) => {
16128                    fidl::encoding::encode_in_envelope::<
16129                        Unit,
16130                        fidl::encoding::DefaultFuchsiaResourceDialect,
16131                    >(
16132                        <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
16133                        encoder,
16134                        offset + 8,
16135                        _depth,
16136                    )
16137                }
16138            }
16139        }
16140    }
16141
16142    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
16143        for DirEntryRouterRouteResponse
16144    {
16145        #[inline(always)]
16146        fn new_empty() -> Self {
16147            Self::DirEntry(fidl::new_empty!(
16148                DirEntry,
16149                fidl::encoding::DefaultFuchsiaResourceDialect
16150            ))
16151        }
16152
16153        #[inline]
16154        unsafe fn decode(
16155            &mut self,
16156            decoder: &mut fidl::encoding::Decoder<
16157                '_,
16158                fidl::encoding::DefaultFuchsiaResourceDialect,
16159            >,
16160            offset: usize,
16161            mut depth: fidl::encoding::Depth,
16162        ) -> fidl::Result<()> {
16163            decoder.debug_check_bounds::<Self>(offset);
16164            #[allow(unused_variables)]
16165            let next_out_of_line = decoder.next_out_of_line();
16166            let handles_before = decoder.remaining_handles();
16167            let (ordinal, inlined, num_bytes, num_handles) =
16168                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
16169
16170            let member_inline_size = match ordinal {
16171                1 => <DirEntry as fidl::encoding::TypeMarker>::inline_size(decoder.context),
16172                2 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
16173                _ => return Err(fidl::Error::UnknownUnionTag),
16174            };
16175
16176            if inlined != (member_inline_size <= 4) {
16177                return Err(fidl::Error::InvalidInlineBitInEnvelope);
16178            }
16179            let _inner_offset;
16180            if inlined {
16181                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
16182                _inner_offset = offset + 8;
16183            } else {
16184                depth.increment()?;
16185                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16186            }
16187            match ordinal {
16188                1 => {
16189                    #[allow(irrefutable_let_patterns)]
16190                    if let DirEntryRouterRouteResponse::DirEntry(_) = self {
16191                        // Do nothing, read the value into the object
16192                    } else {
16193                        // Initialize `self` to the right variant
16194                        *self = DirEntryRouterRouteResponse::DirEntry(fidl::new_empty!(
16195                            DirEntry,
16196                            fidl::encoding::DefaultFuchsiaResourceDialect
16197                        ));
16198                    }
16199                    #[allow(irrefutable_let_patterns)]
16200                    if let DirEntryRouterRouteResponse::DirEntry(ref mut val) = self {
16201                        fidl::decode!(
16202                            DirEntry,
16203                            fidl::encoding::DefaultFuchsiaResourceDialect,
16204                            val,
16205                            decoder,
16206                            _inner_offset,
16207                            depth
16208                        )?;
16209                    } else {
16210                        unreachable!()
16211                    }
16212                }
16213                2 => {
16214                    #[allow(irrefutable_let_patterns)]
16215                    if let DirEntryRouterRouteResponse::Unavailable(_) = self {
16216                        // Do nothing, read the value into the object
16217                    } else {
16218                        // Initialize `self` to the right variant
16219                        *self = DirEntryRouterRouteResponse::Unavailable(fidl::new_empty!(
16220                            Unit,
16221                            fidl::encoding::DefaultFuchsiaResourceDialect
16222                        ));
16223                    }
16224                    #[allow(irrefutable_let_patterns)]
16225                    if let DirEntryRouterRouteResponse::Unavailable(ref mut val) = self {
16226                        fidl::decode!(
16227                            Unit,
16228                            fidl::encoding::DefaultFuchsiaResourceDialect,
16229                            val,
16230                            decoder,
16231                            _inner_offset,
16232                            depth
16233                        )?;
16234                    } else {
16235                        unreachable!()
16236                    }
16237                }
16238                ordinal => panic!("unexpected ordinal {:?}", ordinal),
16239            }
16240            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
16241                return Err(fidl::Error::InvalidNumBytesInEnvelope);
16242            }
16243            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16244                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16245            }
16246            Ok(())
16247        }
16248    }
16249
16250    impl fidl::encoding::ResourceTypeMarker for DirectoryRouterRouteResponse {
16251        type Borrowed<'a> = &'a mut Self;
16252        fn take_or_borrow<'a>(
16253            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
16254        ) -> Self::Borrowed<'a> {
16255            value
16256        }
16257    }
16258
16259    unsafe impl fidl::encoding::TypeMarker for DirectoryRouterRouteResponse {
16260        type Owned = Self;
16261
16262        #[inline(always)]
16263        fn inline_align(_context: fidl::encoding::Context) -> usize {
16264            8
16265        }
16266
16267        #[inline(always)]
16268        fn inline_size(_context: fidl::encoding::Context) -> usize {
16269            16
16270        }
16271    }
16272
16273    unsafe impl
16274        fidl::encoding::Encode<
16275            DirectoryRouterRouteResponse,
16276            fidl::encoding::DefaultFuchsiaResourceDialect,
16277        > for &mut DirectoryRouterRouteResponse
16278    {
16279        #[inline]
16280        unsafe fn encode(
16281            self,
16282            encoder: &mut fidl::encoding::Encoder<
16283                '_,
16284                fidl::encoding::DefaultFuchsiaResourceDialect,
16285            >,
16286            offset: usize,
16287            _depth: fidl::encoding::Depth,
16288        ) -> fidl::Result<()> {
16289            encoder.debug_check_bounds::<DirectoryRouterRouteResponse>(offset);
16290            encoder.write_num::<u64>(self.ordinal(), offset);
16291            match self {
16292                DirectoryRouterRouteResponse::Directory(ref mut val) => {
16293                    fidl::encoding::encode_in_envelope::<
16294                        fidl::encoding::Endpoint<
16295                            fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
16296                        >,
16297                        fidl::encoding::DefaultFuchsiaResourceDialect,
16298                    >(
16299                        <fidl::encoding::Endpoint<
16300                            fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
16301                        > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
16302                            val
16303                        ),
16304                        encoder,
16305                        offset + 8,
16306                        _depth,
16307                    )
16308                }
16309                DirectoryRouterRouteResponse::Unavailable(ref val) => {
16310                    fidl::encoding::encode_in_envelope::<
16311                        Unit,
16312                        fidl::encoding::DefaultFuchsiaResourceDialect,
16313                    >(
16314                        <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
16315                        encoder,
16316                        offset + 8,
16317                        _depth,
16318                    )
16319                }
16320            }
16321        }
16322    }
16323
16324    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
16325        for DirectoryRouterRouteResponse
16326    {
16327        #[inline(always)]
16328        fn new_empty() -> Self {
16329            Self::Directory(fidl::new_empty!(
16330                fidl::encoding::Endpoint<
16331                    fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
16332                >,
16333                fidl::encoding::DefaultFuchsiaResourceDialect
16334            ))
16335        }
16336
16337        #[inline]
16338        unsafe fn decode(
16339            &mut self,
16340            decoder: &mut fidl::encoding::Decoder<
16341                '_,
16342                fidl::encoding::DefaultFuchsiaResourceDialect,
16343            >,
16344            offset: usize,
16345            mut depth: fidl::encoding::Depth,
16346        ) -> fidl::Result<()> {
16347            decoder.debug_check_bounds::<Self>(offset);
16348            #[allow(unused_variables)]
16349            let next_out_of_line = decoder.next_out_of_line();
16350            let handles_before = decoder.remaining_handles();
16351            let (ordinal, inlined, num_bytes, num_handles) =
16352                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
16353
16354            let member_inline_size = match ordinal {
16355                1 => <fidl::encoding::Endpoint<
16356                    fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
16357                > as fidl::encoding::TypeMarker>::inline_size(decoder.context),
16358                2 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
16359                _ => return Err(fidl::Error::UnknownUnionTag),
16360            };
16361
16362            if inlined != (member_inline_size <= 4) {
16363                return Err(fidl::Error::InvalidInlineBitInEnvelope);
16364            }
16365            let _inner_offset;
16366            if inlined {
16367                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
16368                _inner_offset = offset + 8;
16369            } else {
16370                depth.increment()?;
16371                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16372            }
16373            match ordinal {
16374                1 => {
16375                    #[allow(irrefutable_let_patterns)]
16376                    if let DirectoryRouterRouteResponse::Directory(_) = self {
16377                        // Do nothing, read the value into the object
16378                    } else {
16379                        // Initialize `self` to the right variant
16380                        *self = DirectoryRouterRouteResponse::Directory(fidl::new_empty!(
16381                            fidl::encoding::Endpoint<
16382                                fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
16383                            >,
16384                            fidl::encoding::DefaultFuchsiaResourceDialect
16385                        ));
16386                    }
16387                    #[allow(irrefutable_let_patterns)]
16388                    if let DirectoryRouterRouteResponse::Directory(ref mut val) = self {
16389                        fidl::decode!(
16390                            fidl::encoding::Endpoint<
16391                                fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
16392                            >,
16393                            fidl::encoding::DefaultFuchsiaResourceDialect,
16394                            val,
16395                            decoder,
16396                            _inner_offset,
16397                            depth
16398                        )?;
16399                    } else {
16400                        unreachable!()
16401                    }
16402                }
16403                2 => {
16404                    #[allow(irrefutable_let_patterns)]
16405                    if let DirectoryRouterRouteResponse::Unavailable(_) = self {
16406                        // Do nothing, read the value into the object
16407                    } else {
16408                        // Initialize `self` to the right variant
16409                        *self = DirectoryRouterRouteResponse::Unavailable(fidl::new_empty!(
16410                            Unit,
16411                            fidl::encoding::DefaultFuchsiaResourceDialect
16412                        ));
16413                    }
16414                    #[allow(irrefutable_let_patterns)]
16415                    if let DirectoryRouterRouteResponse::Unavailable(ref mut val) = self {
16416                        fidl::decode!(
16417                            Unit,
16418                            fidl::encoding::DefaultFuchsiaResourceDialect,
16419                            val,
16420                            decoder,
16421                            _inner_offset,
16422                            depth
16423                        )?;
16424                    } else {
16425                        unreachable!()
16426                    }
16427                }
16428                ordinal => panic!("unexpected ordinal {:?}", ordinal),
16429            }
16430            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
16431                return Err(fidl::Error::InvalidNumBytesInEnvelope);
16432            }
16433            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16434                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16435            }
16436            Ok(())
16437        }
16438    }
16439}